]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
maint: clean up update-b4-copyright code
[bison.git] / ChangeLog
... / ...
CommitLineData
12009-08-05 Joel E. Denny <jdenny@clemson.edu>
2
3 maint: clean up update-b4-copyright code
4 * build-aux/update-b4-copyright: Do not accept 2-digit
5 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
6 Don't accept a `[' in a b4_copyright argument.
7 Format code more consistently.
8 Don't assume b4*copyright never occurs.
9
102009-08-04 Joel E. Denny <jdenny@clemson.edu>
11
12 maint: automate b4_copyright updates.
13 * Makefile.am (update-b4-copyright): New target rule.
14 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
15 * build-aux/update-b4-copyright: New.
16 * data/yacc.c: Remove stray characters around b4_copyright
17 invocations.
18
192009-08-04 Joel E. Denny <jdenny@clemson.edu>
20
21 maint: automate annual package-wide copyright-year update.
22 * .x-update-copyright: New.
23 * Makefile.am (EXTRA_DIST): Remove maint.mk.
24 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
25 update-copyright. Remove gnumakefile, which is implied by
26 maintainer-makefile.
27 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
28 * gnulib: Update.
29 * maint.mk: Remove, now copied from gnulib.
30 * examples/extexi: Add missing "(C)" in copyright statement so
31 update-copyright can recognize it.
32 * src/LR0.h: Likewise.
33 * src/print.h: Likewise.
34 * src/print_graph.h: Likewise.
35 * src/gram.c: Add missing comma in copyright statement.
36 * src/gram.h: Likewise.
37
382009-08-04 Joel E. Denny <jdenny@clemson.edu>
39
40 Fix "make distcheck".
41 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
42 of just calc.stamp.
43
442009-08-01 Joel E. Denny <jdenny@clemson.edu>
45
46 Pacify "gcc -Wunused" for the input function from Flex.
47 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
48 and later.
49 * src/scan-code.l: Add "%option noinput", which I cannot find in
50 the Flex manual, but which Flex has supported since at least as
51 far back as 2.5.4. However, if any of our developers still use
52 Flex 2.5.4, they'll need to stop configuring with
53 --enable-gcc-warnings because "%option noinput" didn't work
54 correctly until Flex 2.5.6.
55 * src/scan-gram.l: Likewise.
56 * src/scan-skel.l: Likewise.
57
582009-07-31 Alex Rozenman <rozenman@gmail.com>
59
60 Fix --enable-gcc-warnings problems.
61 * src/reader.c: Adjust variable names.
62 * src/scan-code.l: Fix prototypes and adjust names.
63 * src/named-ref.c: Remove redundant "if".
64
652009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
66
67 Fix a --enable-gcc-warnings problem.
68 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
69 variable.
70
712009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
72
73 Warn about character literals not of length one.
74 * NEWS (2.5): Document.
75 * src/scan-gram.l (INITIAL): Remove comment that we don't check
76 the length.
77 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
78 * tests/input.at (Bad character literals): New test group.
79
802009-07-24 Alex Rozenman <rozenman@gmail.com>
81
82 Fix some memory leaks.
83 * src/named-ref.c: Add a pointer check (named_ref_free).
84 * src/scan-code.l: New function (variant_table_free). Called in
85 code_scanner_free.
86 * src/symlist.c: Call to named_ref_free (symbol_list_free).
87
882009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
89
90 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
91
922009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
93
94 Some M4 cleanup in the testsuite.
95 Suggested by Eric Blake at
96 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
97 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
98 complicate the code by distinguishing between a missing value
99 and an empty string value for an optional argument. This fix is
100 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
101 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
102 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
103 arguments are not needed because of the following changes.
104 Fix stale comments.
105 Bison developers should use GNU M4 and should not use
106 POSIXLY_CORRECT when building the test suite, so do not
107 complicate the code by avoiding $10 and above.
108 Do not quote an empty string value for an optional argument, and
109 do not distinguish between a missing value and an empty string
110 value.
111
1122009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
113
114 Revert unnecessary column realignment in --help output.
115 Reported by Akim Demaille at
116 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
117 * src/getargs.c (usage): Here.
118
1192009-07-04 Alex Rozenman <rozenman@gmail.com>
120
121 Alphabetical order in src/local.mk.
122 * src/local.mk: Adjust.
123
1242009-07-04 Alex Rozenman <rozenman@gmail.com>
125
126 Style changes and factoring.
127 * src/named-ref.h: Add comments.
128 * src/parse-gram.y: Readability and style changes.
129 * src/reader.c: Factoring: assign_named_ref function.
130 * src/scan-code.l: Factoring and style changes. Rename
131 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
132 Use "unsigned" type for variant index. Improve readablity.
133 * src/scan-gram.l: Change error messages and add comments.
134 * src/symlist.h: symbol_list_null: New function decl.
135 * src/symlist.c: symbol_list_null: Implement here.
136 * tests/named-refs.at: Adjust for new error messages.
137
1382009-06-29 Eric Blake <ebb9@byu.net>
139
140 scan-code: avoid compiler warnings
141 * src/scan-code.l (parse_named_ref): Use correct specifiers.
142
1432009-06-29 Akim Demaille <demaille@gostai.com>
144
145 build: avoid concurrent extraction of calc++.
146 * examples/calc++/Makefile.am (calc.stamp): New.
147 Depend on it to create the sources of calc++ so that concurrent
148 builds don't launch several "extexi" in parallel.
149 Not only this is inefficient, this also builds incorrect sources
150 with several extractions mixed together.
151
1522009-06-29 Akim Demaille <demaille@gostai.com>
153
154 parse.error: fix.
155 * data/bison.m4: Move code related to specific variables after the
156 definition of the variable-maintaining macros so that we don't
157 "invoke" b4_percent_define_check_values before it is defined.
158
1592009-06-29 Akim Demaille <demaille@gostai.com>
160
161 variables: parse.error
162
163 Implement, document, and test the replacement of %error-verbose
164 by %define parse.error "verbose".
165 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
166 values of the parse.error variable.
167 Make "simple" its default value.
168 Check the valid values.
169 * src/parse-gram.y: Use %define parse.error.
170 (PERCENT_ERROR_VERBOSE): New token.
171 Support it.
172 * src/scan-gram.l: Support %error-verbose.
173
174 * doc/bison.texinfo (Decl Summary): Replace the documentation of
175 %define error-verbose by that of %define parse.error.
176 * NEWS: Document it.
177
178 * tests/actions.at, tests/calc.at: Use parse.error instead of
179 %error-verbose.
180
1812009-06-27 Alex Rozenman <rozenman@gmail.com>
182
183 Implement support for named symbol references.
184 * src/parse-gram.y: Add new syntax (named_ref.opt).
185 * src/reader.c: Store named refs in symbol lists.
186 * src/reader.h: New argument for symbol_append and
187 action_append functions.
188 * src/scan-code.h: Add new field (named_ref) into
189 code_props data structure. Keeps named ref of midrule
190 actions.
191 * src/scan-code.l: Support for named refs in semantic
192 action code. New function 'parse_named_ref'.
193 * src/scan-gram.l: Support bracketed id.
194 * src/symlist.c: Store named refs in symbol lists.
195 * src/symlist.h: New field in symbol list: named_ref.
196 * src/named-ref.h: New file, a struct for named_ref.
197 * src/named-ref.cp: New file, named_ref_new function.
198 * src/local.mk: Add two new files.
199 * tests/testsuite.at: Include new test group:
200 * tests/named-refs.at: this new file.
201
2022009-06-25 Akim Demaille <demaille@gostai.com>
203
204 hash: check insertion for memory exhaustion.
205 * src/uniqstr.c (uniqstr_new): New.
206
2072009-06-24 Akim Demaille <demaille@gostai.com>
208
209 variables: rename namespace as api.namespace.
210 Discussed in
211 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
212
213 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
214 New.
215 (b4_percent_define_use): New.
216 Use it where applicable.
217 * data/c++.m4: Replace uses of the variable "namespace" by
218 "api.namespace".
219 Default the latter to the former.
220 * doc/bison.texinfo (Decl Summary): Document "namespace" as
221 obsolete.
222 Document api.namespace.
223 Use @samp to document %define uses, keep @code for identifiers.
224 * NEWS: Likewise.
225 * tests/c++.at, tests/input.at: Test api.namespace instead of
226 namespace. (The tests passed with namespace.)
227
2282009-06-11 Akim Demaille <demaille@gostai.com>
229
230 style changes.
231 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
232 * src/print-xml.c: Style changes.
233 * tests/conflicts.at: Comment changes.
234
2352009-06-11 Akim Demaille <demaille@gostai.com>
236
237 xml: beware of user strings used to give a %prec to rules.
238 * tests/conflicts.at (%prec with user strings): New.
239 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
240 XML output.
241
2422009-06-11 Akim Demaille <demaille@gostai.com>
243
244 hash: check insertion for memory exhaustion.
245 * src/muscle-tab.c (muscle_insert, muscle_grow)
246 * src/state.c (state_hash_insert): Check the return value of
247 hash_insert.
248
2492009-06-11 Akim Demaille <demaille@gostai.com>
250
251 tests: honor TESTSUITEFLAGS in every check target.
252 * tests/local.mk (RUN_TESTSUITE): New.
253 (check-local, installcheck-local, maintainer-check-g++)
254 (maintainer-check-posix, maintainer-check-valgrind): Use it.
255
2562009-06-10 Akim Demaille <demaille@gostai.com>
257
258 deterministic test suite.
259 Some consistency checks on symbols are performed after all the
260 symbols were read, by an iteration over the symbol table. This
261 traversal is nondeterministic, which can be a problem for test
262 cases.
263 Avoid this.
264 Addresses another form of nondeterminism reported by Joel E. Denny.
265 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
266
267 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
268 test in two.
269 Use different file names for the three tests to make the
270 maintenance easier.
271
2722009-06-10 Akim Demaille <demaille@gostai.com>
273
274 gnulib: update.
275 * gnulib: Update to latest.
276 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
277 * m4/.gitignore: Regen.
278 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
279 Call xalloc_die on hash_insert failures.
280 Requested by the new __warn_unused_result__ attribute of
281 hash_insert.
282
2832009-06-10 Akim Demaille <demaille@gostai.com>
284
285 deterministic user-token-number redeclaration errors.
286 Address nondeterminism reported by Joel E. Denny.
287 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
288
289 * src/uniqstr.h: Comment changes.
290 * src/location.h (boundary_cmp, location_cmp): New.
291 * src/symtab.c (user_token_number_redeclaration): New.
292 (symbol_translation): Use it.
293 * tests/input.at (Numbered tokens): Adjust the expected output.
294
2952009-05-25 Akim Demaille <demaille@gostai.com>
296
297 build: avoid ignored errors.
298 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
299 errors, they pollute the output.
300
3012009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
302
303 Convert multiple variable definition warnings to complaints.
304 * NEWS (2.5): Add a new entry for that change.
305 * doc/bison.texinfo (Decl Summary): Update %define entry.
306 (Bison Options): Update -D/--define/-F/--force-define entry.
307 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
308 * src/muscle-tab.h (muscle_percent_define_insert): Update
309 comments.
310 * tests/input.at (`%define errors'): Update.
311 (`%define, --define, --force-define'): Update.
312
3132009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
314
315 -F/--force-define and relative %define/-D/--define priorities.
316 * NEWS (2.5): Add documentation to -D/--define entry.
317 * build-aux/cross-options.pl: Hard-code association of
318 --force-define with %define.
319 * doc/bison.texinfo (Decl Summary): In %define entry,
320 cross-reference command-line options.
321 (Bison Options): Add documentation to -D/--define entry.
322 (Option Cross Key): Widen column for --force-define row.
323 * src/getargs.c (usage): Document -F/--force-define. Realign
324 options in output.
325 (short_options, long_options, getargs): Parse -F/--force-define,
326 and update muscle_percent_define_insert invocations.
327 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
328 (muscle_percent_define_insert): Add argument with that type.
329 * src/muscle-tab.c (muscle_percent_define_insert): Implement
330 -F/--force-define behavior and priorities.
331 (muscle_percent_define_ensure): Update
332 muscle_percent_define_insert invocation.
333 * src/parse-gram.y (prologue_declaration): Update
334 muscle_percent_define_insert invocations.
335 * tests/input.at (`%define, --define'): Rename to...
336 (`%define, --define, --force-define'): ... this and extend.
337
3382009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
339
340 Update some comments to make sense for -D.
341 * data/bison.m4 (b4_check_user_names): In header comments, say
342 "user occurrence" instead of "grammar occurrence".
343 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
344 (muscle_percent_code_grow): Likewise just for consistency.
345
3462009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
347
348 * data/c++.m4 (b4_namespace_close): Simplify slightly.
349
3502009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
351
352 Handle a trailing `:' in a user-supplied C++ namespace better.
353 * data/c++.m4 (b4_namespace_close): Don't let it be printed
354 among the closing braces here. This fix might make the
355 generated code easier to debug, but otherwise it should be
356 insignificant because a trailing `:' is a C++ error already.
357
3582009-05-19 Akim Demaille <demaille@gostai.com>
359
360 remove useless variable.
361 * src/getargs.c (skeleton_arg): Remove now useless variable.
362 Should help the compiler see that this printf-like call is sane.
363
3642009-05-15 Akim Demaille <demaille@gostai.com>
365
366 Rename token.prefix as api.tokens.prefix.
367 Discussed here.
368 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
369
370 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
371 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
372 (token.prefix): Rename as...
373 (api.tokens.prefix): this.
374
3752009-05-11 Akim Demaille <demaille@gostai.com>
376
377 doc: use C++ headers.
378 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
379 headers.
380
3812009-05-11 Akim Demaille <demaille@gostai.com>
382
383 doc: token.prefix
384 * doc/bison.simple (Decl Summary): Document token.prefix.
385 (Calc++ Parser): Various fixes.
386 Formatting changes.
387 Use token.prefix.
388 Introduce a macro TOKEN to shorten the code and make it more
389 readable.
390 (Calc++ Scanner): Adjust.
391 * NEWS (Variable token.prefix): New.
392
3932009-05-04 Akim Demaille <demaille@gostai.com>
394
395 bison: catch bad symbol names.
396 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
397 * tests/input.at: Adjust.
398
3992009-05-04 Akim Demaille <demaille@gostai.com>
400
401 identifiers: dashes are letters.
402 Dashes can now start identifiers (symbols and directives).
403
404 * src/scan-gram.l ({letter}): Add dash.
405 ({id}): Remove it.
406 * tests/input.at (Symbols): Adjust.
407 Remove stray comment.
408 * tests/regression.at (Invalid inputs): Adjust error message.
409 * doc/bison.texinfo (Symbols): Update.
410
4112009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
412
413 Declare %code to be a permanent feature.
414 * NEWS (2.4.2): Here.
415 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
416 experimental.
417 (Decl Summary): Likewise.
418
4192009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
420
421 Convert underscores to dashes in some %define variable names.
422 For now, just api.push-pull and lr.keep-unreachable-states.
423 Maintain old names for backward compatibility.
424 * NEWS (2.5): Document.
425 * data/c.m4 (b4_identification): Update comment.
426 * data/yacc.c: Update access.
427 * doc/bison.texinfo: Update.
428 * etc/bench.pl.in (bench_push_parser): Update use.
429 * src/files.c (tr): Move to...
430 * src/getargs.c, src/getargs.h (tr): ... here because I can't
431 think of a better place to expose it. My logic is that, for all
432 uses of tr so far, command-line arguments can be involved, and
433 getargs.h is already included.
434 * src/main.c (main): Update access.
435 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
436 variable names to new variable names before assigning value.
437 * src/reader.c (reader): Update setting default.
438 * tests/calc.at: Update uses.
439 * tests/conflicts.at (Unreachable States After Conflict
440 Resolution): Update use.
441 * tests/input.at (%define enum variables): Update use.
442 (%define backward compatibility): New test group.
443 * tests/push.at: Update uses.
444 * tests/reduce.at: Update uses.
445 * tests/torture.at: Update uses.
446
4472009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
448
449 Set all front-end %define defaults in one place.
450 * src/main.c (main): Move lr.keep_unreachable_states default...
451 * src/reader.c (reader): ... to here.
452
4532009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
454
455 Rename lr.default_reductions to lr.default-reductions.
456 * NEWS (2.5): Here.
457 * doc/bison.texinfo: Here.
458 * src/lalr.c (initialize_LA): Here.
459 * src/print.c (print_reductions): Here.
460 * src/reader.c (reader): Here.
461 * src/tables.c (action_row): Here.
462 * tests/input.at (%define enum variables): Here.
463 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
464
4652009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
466
467 Pacify ./configure --enable-gcc-warnings.
468 * tests/input.at (Symbols): Prototype yyerror and yylex.
469
4702009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
471
472 Document how `%define "var" "value"' is not M4-friendly.
473 * src/parse-gram.y (variable): In comments here.
474
4752009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
476
477 Clean up recent patches a little.
478 Reported by Akim Demaille.
479 * doc/bison.texinfo (Understanding): Fix typos.
480 * src/print.c (print_reductions): Don't use negated variable.
481
4822009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
483
484 List accepted values for a %define enum variable with an invalid value.
485 Suggested by Akim Demaille at
486 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
487 * data/bison.m4 (_b4_percent_define_check_values): Implement.
488 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
489 * tests/input.at (%define lr.default_reductions invalid values): Merge
490 into...
491 (%define enum variables): ... here, and update output.
492
4932009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
494
495 Rename "default rule" to "default reduction".
496 This includes changing variable names in code, changing
497 comments, and renaming %define lr.default_rules to %define
498 lr.default_reductions.
499 * NEWS (2.5): Update IELR documentation.
500 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
501 documentation.
502 * data/glr.c, data/lalr1.java: Sync copyright dates.
503 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
504 and lr.type documentation. Make some other wording
505 improvements.
506 (Glossary): Adjust cross-references and Default Reduction
507 definition.
508 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
509 Remove a confusing comment pointed out by Akim Demaille.
510 (initialize_LA): Adjust code.
511 * src/print-xml.c (print_reductions): Adjust code.
512 * src/print.c (print_reductions): Adjust code.
513 * src/reader.c (reader): Adjust code.
514 * src/tables.c (action_row): Adjust code.
515 (token_actions): Adjust code.
516 * src/tables.h: Adjust YYDEFACT documentation.
517 * tests/input.at (%define lr.default_rules invalid values):
518 Rename test group to...
519 (%define lr.default_reductions invalid values): ... this, and
520 update grammar file and expected output.
521 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
522 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
523
5242009-04-21 Akim Demaille <demaille@gostai.com>
525
526 tests: check the use of dashes and periods in symbols.
527 * tests/input.at (Symbol): New test group.
528
5292009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
530
531 Document %define lr.type and lr.default_rules.
532 * NEWS (2.5): Add an entry.
533 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
534 besides just LALR(1) and GLR(1).
535 * doc/bison.texinfo (Introduction): Likewise.
536 (Language and Grammar): Bison is no longer limited to LALR(1)
537 restrictions.
538 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
539 when trying to distinguish from GLR. Talk about LR(1) grammars
540 rather than LALR(1) grammars.
541 (Decl Summary): In %define api.push_pull entry, say it applies
542 to deterministic parsers in C rather than LALR(1) parsers in C.
543 Add lr.default_rules entry.
544 Add lr.type entry.
545 (Mystery Conflicts): Bison is no longer limited to LALR(1)
546 restrictions.
547 (Generalized LR Parsing): Same changes as for the previous GLR
548 section.
549 (Memory Management): Say deterministic rather than LALR(1).
550 (Understanding): Correct some bison output.
551 Index discussion of "accepting state".
552 Say deterministic rather than LALR(1).
553 (Bison Options): In --yacc entry, say deterministic rather than
554 LALR(1).
555 In --report, --graph, and --xml entries, just don't mention
556 LALR(1).
557 (C++ Parsers): Say deterministic rather than LALR(1).
558 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
559 (Glossary): Add Accepting State, Consistent State, Default Rule,
560 and IELR(1) definitions.
561 In Generalized LR (GLR) definition, make same changes as in
562 previous GLR sections.
563 In LALR(1) definition, say Bison uses LALR(1) by default rather
564 than implying Bison is limited to LALR(1).
565 (LocalWords): Add IELR.
566
5672009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
568
569 Finish implementing %define lr.type.
570 Its value can be "LALR", "IELR", or "canonical LR".
571 * lib/timevar.def (TV_IELR_PHASE1): New var.
572 (TV_IELR_PHASE2): New var.
573 (TV_IELR_PHASE3): New var.
574 (TV_IELR_PHASE4): New var.
575 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
576 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
577 Sbitset.h, ielr.h, and ielr.c.
578 * src/getargs.h, src/getargs.c (enum trace, trace_args,
579 trace_types): Add trace_ielr.
580 * src/lalr.h, src/lalr.c (ngotos): Export it.
581 (F): Rename to...
582 (goto_follows): ... this, update all uses, and export it.
583 (set_goto_map): Export it.
584 (map_goto): Export it.
585 (compute_lookahead_tokens): Don't free goto_follows yet. Now
586 handled in ielr.
587 (initialize_LA): Export it. Move lookback allocation to...
588 (lalr): ... here because, for canonical LR, initialize_LA must
589 be invoked but lookback and much of the rest of LALR isn't
590 needed.
591 * main.c (main): Instead of lalr, invoke ielr, which invokes
592 lalr.
593 * src/reader.c (reader): Default lr.type to "LALR".
594 Default lr.default_rules to "accepting" if lr.type is "canonical
595 LR". Leave the default as "all" otherwise.
596 Check for a valid lr.type value.
597 * src/state.h, src/state.c (struct state_list): Add state_list
598 member.
599 (state_new): Initialize state_list member to NULL.
600 (state_new_isocore): New function, exported.
601 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
602 exercises all values of lr.type.
603 (GNU AWK Grammar): Rename test group to...
604 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
605 AT_TEST_EXISTING_GRAMMAR.
606 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
607 (GNU pic Grammar): Rename test group to...
608 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
609 AT_TEST_EXISTING_GRAMMAR.
610 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
611 all values of lr.type.
612 (Single State Split): New test groups using AT_TEST_LR_TYPE.
613 (Lane Split): Likewise.
614 (Complex Lane Split): Likewise.
615 (Split During Added Lookahead Propagation): Likewise.
616
6172009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
618
619 Add new files for IELR and canonical LR implementation.
620 * src/AnnotationList.c: New.
621 * src/AnnotationList.h: New.
622 * src/InadequacyList.c: New.
623 * src/InadequacyList.h: New.
624 * src/Sbitset.c: New.
625 * src/Sbitset.h: New.
626 * src/ielr.c: New.
627 * src/ielr.h: New.
628
6292009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
630
631 Implement %define lr.default_rules.
632 Its value describes the states that are permitted to contain
633 default rules: "all", "consistent", or "accepting".
634 * src/reader.c (reader): Default lr.default_rules to "all".
635 Check for a valid lr.default_rules value.
636 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
637 is "accepting", then only mark the accepting state as
638 consistent.
639 (initialize_LA): Tell state_lookahead_tokens_count whether
640 lr.default_rules is "accepting".
641 * src/tables.c (action_row): If lr.default_rules is not "all",
642 then disable default rules in inconsistent states.
643 * src/print.c (print_reductions): Use this opportunity to
644 perform some assertions about whether lr.default_rules was
645 obeyed correctly.
646 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
647 helps with checking the parser tables for a grammar.
648 * tests/input.at (%define lr.default_rules invalid values): New
649 test group.
650 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
651 AT_TEST_TABLES_AND_PARSE.
652 (`no %define lr.default_rules'): New test group generated by
653 AT_TEST_LR_DEFAULT_RULES.
654 (`%define lr.default_rules "all"'): Likewise.
655 (`%define lr.default_rules "consistent"'): Likewise.
656 (`%define lr.default_rules "accepting"'): Likewise.
657
6582009-04-20 Akim Demaille <demaille@gostai.com>
659
660 Formatting change.
661
6622009-04-20 Akim Demaille <demaille@gostai.com>
663
664 bison: factoring.
665 * src/output.c (token_definitions_output): Use symbol_id_get
666 instead of duplicating its logic.
667 * TODO (YYERRCODE): Extend.
668
6692009-04-20 Akim Demaille <demaille@gostai.com>
670
671 variables: prefer error-verbose to error_verbose.
672 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
673 instead of error_verbose.
674 * src/scan-gram.l (%error-verbose): Map to the error-verbose
675 variable.
676 * doc/bison.texinfo: Promote %define error-verbose instead of
677 %error-verbose.
678 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
679
6802009-04-15 Akim Demaille <demaille@gostai.com>
681
682 variables: accept dashes.
683 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
684 underscores.
685 * src/scan-gram.l ({id}): Also accept dashes after the initial
686 letter.
687 ({directive}): Use {id}.
688 * src/parse-gram.y: Comment and formatting changes.
689 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
690 symbols.
691 * src/complain.h, src/complain.c (yacc_at): New.
692 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
693 symbol names.
694 * src/output.c (token_definitions_output): Do not #define token
695 names with dashes.
696
6972009-04-20 Akim Demaille <demaille@gostai.com>
698
699 Consistently refer to Yacc, not YACC.
700 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
701
7022009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
703
704 Pacify make maintainer-check-posix.
705 * tests/input.at (%define, --define): Move bison command-line
706 options before grammar file name.
707
7082009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
709
710 Document semicolon warnings.
711 * NEWS (2.5): Here.
712
7132009-04-14 Akim Demaille <demaille@gostai.com>
714
715 variables: use `parse.assert' instead of `assert'.
716 * TODO (assert): Remove.
717 * data/bison.m4 (b4_assert_if): Replace with...
718 (b4_parse_assert_if): this.
719 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
720 * doc/bison.texinfo (Decl Summary): Document parse.assert.
721
7222009-04-14 Akim Demaille <demaille@gostai.com>
723
724 variables: use `parse.trace' instead of `debug'.
725 * src/getargs.c (getargs): Map -t to %define trace.parse.
726 * src/scan-gram.l (%debug): Map to %define trace.parse.
727 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
728 names to `_' in macro names.
729 (b4_debug_if): Replace with...
730 (b4_parse_trace_if): this.
731 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
732 * data/yacc.c: Adjust.
733 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
734 Use @code to label the variable list.
735 Document the variable parse.trace.
736 (Tracing): Promote the parse.trace variable.
737 * TODO: %printer is not documented.
738
7392009-04-14 Akim Demaille <demaille@gostai.com>
740
741 doc: minor fixes.
742 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
743 (Table of Symbols): Remove duplicate entry for %debug.
744
7452009-04-10 Eric Blake <ebb9@byu.net>
746
747 submodules: update to latest
748 * submodules/autoconf: Use latest upstream Autoconf.
749
7502009-04-06 Eric Blake <ebb9@byu.net>
751
752 Work around autoconf 2.63b bug in testsuite.
753 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
754 autoconf bug related to # in test.
755
7562009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
757
758 * NEWS (2.5): New section. Describe new -D/--define feature.
759
7602009-04-06 Akim Demaille <demaille@gostai.com>
761
762 Regen.
763 * src/parse-gram.h, src/parse-gram.c: Regen.
764
7652009-04-06 Akim Demaille <demaille@gostai.com>
766
767 rename muscle_tab.* as muscle-tab.* for consistency.
768 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
769 * src/muscle-tab.h, src/muscle-tab.c: these.
770 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
771 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
772
7732009-04-06 Akim Demaille <demaille@gostai.com>
774
775 Makefile: introduce $(BISON).
776 * src/local.mk (BISON): New.
777 (YACC): Use it.
778
7792009-04-06 Akim Demaille <demaille@gostai.com>
780
781 parser: handle %locations as %define locations.
782 * src/getargs.h, src/getargs.c (locations_flag): Remove.
783 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
784 to set "locations" to true.
785 * src/output.c (prepare): Don't output "locations".
786 * src/scan-gram.l (%locations): Handle it as a %<flag>.
787 * src/parse-gram.y: It's no longer a token.
788 Don't handle it.
789 * data/bison.m4 (b4_locations_if): Define it with
790 b4_percent_define_if_define.
791 * data/c.m4, data/glr.cc: Adjust.
792
7932009-04-06 Akim Demaille <demaille@gostai.com>
794
795 Regen.
796 * src/parse-gram.c: Regen.
797
7982009-04-06 Akim Demaille <demaille@gostai.com>
799
800 muscle: factor the handling of obsolete of obsolete directives.
801 Suggested by Joel E. Denny.
802
803 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
804 New, extracted from...
805 * src/parse-gram.y (prologue_declaration: pure-parser): here.
806 Remove it.
807 (prologue_declaration: "%<flag>"): Use
808 muscle_percent_define_ensure.
809 (%error-verbose, %pure-parser): No longer tokens.
810 * src/scan-gram.l (pure-parser): Return as a %<flag>.
811
8122009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
813
814 Fix options documentation.
815 * build-aux/cross-options.pl: As in --help output, write optional
816 arguments as [=ARG] not =[ARG].
817 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
818
8192009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
820
821 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
822 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
823 requirements for a correct m4 are stricter.
824 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
825 * configure.ac: Update to use AC_PROG_GNU_M4.
826 Reported by Eric Blake.
827
8282009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
829
830 Help with updating web manual.
831 * HACKING: Incorporate instructions from gnulib/doc/README.
832 * bootstrap.conf (gnulib_modules): Add gendocs.
833
8342009-04-03 Akim Demaille <demaille@gostai.com>
835
836 Regen.
837 * src/parse-gram.h, src/parse-gram.c: Regen.
838
8392009-04-03 Akim Demaille <demaille@gostai.com>
840
841 Factor %FLAG at scan level.
842 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
843 definitions and associated rules, replaced by....
844 (PERCENT_FLAG): this new token type, and rule.
845 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
846 Use it for %debug and %error-verbose.
847
8482009-04-03 Akim Demaille <demaille@gostai.com>
849
850 Regen.
851 * src/parse-gram.h, src/parse-gram.c: Regen.
852
8532009-04-03 Akim Demaille <demaille@gostai.com>
854
855 Treat %debug as %define debug.
856 * data/bison.m4 (b4_debug_if): New.
857 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
858 * data/lalr1.java: Use it instead of b4_debug_flag.
859 * src/getargs.h, src/getargs.c (debug_flag): Remove.
860 * src/output.c (prepare): Don't output it.
861 * src/parse-gram.y: Treat %debug as %define debug.
862
8632009-04-03 Akim Demaille <demaille@gostai.com>
864
865 Treat %error-verbose as %define error_verbose.
866 This allows to pass -Derror_verbose on the command line. Better
867 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
868 ERROR_VERBOSE being defined as false or true.
869 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
870 on b4_percent_define_ifdef, for does not check the defined value,
871 but only whether the symbol is defined, rely on
872 b4_percent_define_flag_if, so that a value of "false" is processed
873 as a false.
874 If not defined, define the flag to "false".
875 (b4_error_verbose_if): New.
876 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
877 b4_error_verbose_flag.
878 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
879 * src/output.c (prepare): Don't output it.
880 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
881
8822009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
883
884 Fix strange %define locations for default values.
885 Reported by Akim Demaille at
886 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
887 and discussed again starting at
888 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
889 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
890 because location information is bogus.
891 Use angle brackets to delimit fake file name because square brackets
892 look like underexpanded m4. Choose a better fake file name.
893 Use negative line numbers.
894 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
895 * src/location.c (location_print): If line for a boundary is negative,
896 only print that boundary's file name.
897 * src/location.h: Document that.
898 * tests/skeletons.at (%define Boolean variables: invalid skeleton
899 defaults): Update output.
900
9012009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
902
903 Pacify ./configure --enable-gcc-warnings.
904 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
905 in lib won't compile with it.
906 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
907
9082009-03-31 Akim Demaille <demaille@gostai.com>
909
910 bootstrap: --help to stdout.
911 * bootstrap (usage): Don't send --help to stderr.
912 Use a here doc instead of a long string.
913
9142009-03-31 Akim Demaille <demaille@gostai.com>
915
916 bootstrap: README-hacking no longer exists
917 * bootstrap (checkout_only_file): Set to HACKING.
918
9192009-03-26 Akim Demaille <demaille@gostai.com>
920
921 doc: merge HACKING and README-hacking.
922 Two files is confusing.
923 Reported by Alexandre Duret-Lutz.
924
925 * README-hacking: Merge into...
926 * HACKING (Working from the repository): here.
927
9282009-03-26 Akim Demaille <demaille@gostai.com>
929
930 doc: update README-hacking.
931 * README-hacking: We now use git and git submodules.
932 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
933
9342009-03-26 Akim Demaille <demaille@gostai.com>
935
936 lalr1.cc: avoid GCC 4.3 warnings.
937 GCC 4.3 now warns about "a || b && c" and asks for explicit
938 parentheses.
939 Reported by Alexandre Duret-Lutz.
940 * data/location.cc: Update copyright years.
941 (Position::operator==): Use parens to make precedence explicit.
942 Compare lines and columns first, as they are more likely to be
943 different, and they are faster to compare.
944
9452009-03-26 Akim Demaille <demaille@gostai.com>
946
947 gnulib: update.
948 * gnulib: Update to latest.
949 * src/local.mk (AM_CFLAGS): Move to...
950 * Makefile.am: here.
951 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
952 AM_CFLAGS.
953
9542009-03-02 Akim Demaille <demaille@gostai.com>
955
956 Comment changes.
957
9582009-03-02 Akim Demaille <demaille@gostai.com>
959
960 Share b4_yytranslate_define.
961 * data/lalr1.cc (b4_yytranslate_define): Move to...
962 * data/c++.m4: here.
963
9642009-03-02 Akim Demaille <demaille@gostai.com>
965
966 Use locations in the variant example.
967 Yes, this obfuscates the point of this example, variants only.
968 But glr.cc cannot work (yet?) without locations. This change
969 makes it easier to use this example with glr.cc.
970
971 * examples/variant.yy (assert): %define it.
972 (locations): Request them.
973 (yylex): Bind the location to the stage.
974
9752009-03-02 Akim Demaille <demaille@gostai.com>
976
977 Dub make_TOKEN as a public type interface.
978 * data/c++.m4 (b4_symbol_constructor_declare)
979 (b4_symbol_constructor_define): New empty stubs.
980 (b4_public_types_declare, b4_public_types_define): Use them.
981 * data/lalr1.cc (b4_symbol_constructor_declare)
982 (b4_symbol_constructor_declare_)
983 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
984 Move to...
985 * data/variant.hh: here.
986 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
987 needed.
988 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
989 b4_symbol_constructor_declare, as it is now done by
990 b4_public_types_define and b4_public_types_declare.
991
9922009-03-02 Akim Demaille <demaille@gostai.com>
993
994 Coding style changes.
995 * data/lalr1.cc (b4_symbol_constructor_declaration_)
996 (b4_symbol_constructor_declarations)
997 (b4_symbol_constructor_definition_)
998 (b4_symbol_constructor_definitions)
999 (b4_yytranslate_definition): Rename as...
1000 (b4_symbol_constructor_declare_)
1001 (b4_symbol_constructor_declare)
1002 (b4_symbol_constructor_define_)
1003 (b4_symbol_constructor_define)
1004 (b4_yytranslate_define): these.
1005 * data/variant.hh (b4_variant_definition): Rename as...
1006 (b4_variant_define): this.
1007
10082009-03-02 Akim Demaille <demaille@gostai.com>
1009
1010 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
1011 * data/bison.m4 (b4_percent_define_if_define): New.
1012 * data/c++.m4 (b4_variant_if): Move to...
1013 * data/bison.m4: Here, using b4_percent_define_if_define.
1014 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
1015 * data/bison.m4: Here, using b4_percent_define_if_define.
1016
10172009-03-02 Akim Demaille <demaille@gostai.com>
1018
1019 Dub symbol_type_base as a public type.
1020 * data/c++.m4 (b4_public_types_declare): Now define
1021 symbol_type_base and symbol_type.
1022 (b4_public_types_define): New.
1023 In both cases, the definitions are taken verbatim from lalr1.cc.
1024 * data/lalr1.cc: Adjust.
1025
10262009-03-02 Akim Demaille <demaille@gostai.com>
1027
1028 b4_public_types_declare.
1029 * data/c++.m4 (b4_public_types_declare): New.
1030 * data/glr.cc, data/lalr1.cc: Use it.
1031
10322009-03-02 Akim Demaille <demaille@gostai.com>
1033
1034 b4_semantic_type_declare.
1035 * data/c++.m4 (b4_semantic_type_declare): New.
1036 Factors and generalizes what was in glr.cc and lalr1.cc.
1037 * data/variant.hh (b4_semantic_type_declare): Redefine it for
1038 variants.
1039 * data/lalr1.cc, data/glr.cc: Use it.
1040
10412009-02-26 Akim Demaille <demaille@gostai.com>
1042
1043 Upgrade gnulib.
1044 * gnulib: Upgrade from master.
1045 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
1046 Regen.
1047
10482009-02-25 Akim Demaille <demaille@gostai.com>
1049
1050 Remove useless arguments.
1051 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
1052 relevant.
1053
10542009-02-25 Akim Demaille <demaille@gostai.com>
1055
1056 Comment changes.
1057 * data/lalr1.cc: here.
1058
10592009-02-25 Akim Demaille <demaille@gostai.com>
1060
1061 Fix glr.cc's debug level handling.
1062 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
1063 glr.c which is used.
1064 (debug_level, set_debug_level): Adjust.
1065
10662009-02-25 Akim Demaille <demaille@gostai.com>
1067
1068 Copyright years.
1069 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1070
10712009-02-25 Akim Demaille <demaille@gostai.com>
1072
1073 Style changes.
1074 * etc/bench.pl.in (generate_grammar_list): Consitently use
1075 location_type, not yy::location.
1076
10772009-02-25 Akim Demaille <demaille@gostai.com>
1078
1079 Comment change.
1080 * data/lalr1.cc: here.
1081
10822009-02-19 Akim Demaille <demaille@gostai.com>
1083
1084 Make yyparser::error public.
1085 * data/lalr1.cc: here.
1086 There is no good reason to keep it private (and it is convenient
1087 to use it from the scanner for instance). It is already public in
1088 glr.cc.
1089
10902009-02-19 Akim Demaille <demaille@gostai.com>
1091
1092 Comment changes.
1093 * data/glr.cc: here.
1094
10952009-02-19 Akim Demaille <demaille@gostai.com>
1096
1097 Remove trailing blanks.
1098 The epilogue has its own ending \n, no need to add another.
1099
1100 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
1101 epilogue.
1102 * data/glr.cc: dnl when extending the epilogue.
1103 Remove stray "private:".
1104
11052009-02-19 Akim Demaille <demaille@gostai.com>
1106
1107 Use b4_c_modern.
1108 * data/c.m4 (b4_c_function_decl): Here.
1109
11102009-02-19 Akim Demaille <demaille@gostai.com>
1111
1112 Comment changes.
1113 * data/lalr1.cc: here.
1114
11152009-02-19 Akim Demaille <demaille@gostai.com>
1116
1117 Extract variant.hh
1118 * data/variant.hh: New, extracted from...
1119 * data/lalr1.cc: here.
1120 Adjust.
1121 * data/local.mk: Adjust.
1122
11232009-02-19 Akim Demaille <demaille@gostai.com>
1124
1125 Extract stack.hh from lalr1.cc.
1126 * data/stack.hh: New.
1127 * data/lalr1.cc: Extract from here.
1128 * data/local.mk: Adjust.
1129
11302009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1131
1132 Add reminder about uploading public key to keys.gnupg.net.
1133 * HACKING (Release Procedure): Here.
1134
11352009-01-28 Akim Demaille <demaille@gostai.com>
1136
1137 * NEWS: Update information about 2.4.1 and 2.4.2.
1138
11392008-11-04 Akim Demaille <demaille@gostai.com>
1140
1141 Reformat NEWS.
1142 * NEWS: Use more outline-mode markup.
1143 Suggested by Jim Meyering.
1144
11452009-01-08 Akim Demaille <demaille@gostai.com>
1146
1147 Fix grep portability issues.
1148 Grep on Solaris does not support -q.
1149 Reported by Summum Bonum.
1150
1151 * NEWS: Add a stub for 2.4.2.
1152 * THANKS: Add Summum Bonum.
1153 * tests/atlocal.in (EGREP): New.
1154 (CC, CXX, XSLTPROC): Make it possible to override them via
1155 envvars.
1156 * tests/java.at: Use $EGREP instead of egrep.
1157 Use AT_CHECK's ignore instead of grep's -q.
1158
11592008-12-11 Akim Demaille <demaille@gostai.com>
1160
1161 Pass the token type to yysyntax_error.
1162 * data/yacc.c (yysyntax_error): Take the transated token instead
1163 of the raw number.
1164 Adjust callers.
1165 * TODO: Update.
1166
11672008-12-11 Akim Demaille <demaille@gostai.com>
1168
1169 Formatting changes.
1170 * data/glr.c: Formatting changes.
1171
11722008-12-11 Akim Demaille <demaille@gostai.com>
1173
1174 Propagate i18n changes into glr.c.
1175 * TODO: Update.
1176 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
1177 building the error message format dynamically.
1178 * data/lalr1.java: Formatting changes.
1179
11802008-12-11 Akim Demaille <demaille@gostai.com>
1181
1182 Use testsuite -C.
1183 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
1184 Solves problems when top_srcdir is an absolute path.
1185 Suggested by Eric Blake.
1186 * configure.ac: Require Autoconf 2.62.
1187
11882008-12-11 Akim Demaille <demaille@gostai.com>
1189
1190 Simplify the i18n of the error messages.
1191 * data/lalr1.cc: Comment changes.
1192 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
1193 lalr1.cc instead of building dynamically the format string.
1194
11952008-12-08 Akim Demaille <demaille@gostai.com>
1196
1197 Fix portability issue in the test suite.
1198 * tests/local.at (AT_MATCHES_CHECK): New.
1199 Based on Perl instead of Sed. Sed has too many portability
1200 pitfalls, not ever Sed is GNU Sed.
1201 * tests/actions.at (Fix user actions without a trailing semicolon):
1202 Use it.
1203
12042008-12-08 Akim Demaille <demaille@gostai.com>
1205
1206 Update data/README.
1207 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1208
12092008-12-08 Akim Demaille <demaille@gostai.com>
1210
1211 Install autoconf as a submodule to get m4sugar.
1212 * .gitmodules: Add submodules/autoconf.
1213 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1214 submodules/autoconf.
1215
12162008-12-08 Akim Demaille <demaille@gostai.com>
1217
1218 Test token.prefix in all the skeletons.
1219 * data/java.m4 (b4_token_enum): Use the token.prefix.
1220 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
1221 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
1222 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
1223 * tests/java.at: Comment changes.
1224 (AT_CHECK_JAVA_MINIMAL): Define the END token.
1225 (Java parser class and package names): Add token.prefix check.
1226
12272008-12-08 Akim Demaille <demaille@gostai.com>
1228
1229 Fix regeneration of atconfig.
1230 * tests/local.mk (tests/atconfig): The rule was incorrect, but
1231 remove it: now that there is no tests/Makefile.am, the top-level
1232 Makefile properly updates atconfig when needed.
1233
12342008-12-07 Di-an Jan <dianj@freeshell.org>
1235
1236 Implement the FIXME that ends an user action with a semicolon
1237 if it seems necessary.
1238 * src/scan-code.l (flex rules section): Flag cpp directive from
1239 any `#' to the first unescaped end-of-line. Semicolon is not
1240 needed after `;', `{', '}', or cpp directives and is needed after
1241 any other token (whitespaces and comments have no effect).
1242 * tests/actions.at (Fix user actions without a trailing semicolon):
1243 New test.
1244 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1245 to make user actions complete statements.
1246 Adjust column numbers in error messages.
1247 * tests/regression.at (Fix user actions without a trailing semicolon):
1248 Remove. Covered by new test.
1249
12502008-12-07 Akim Demaille <demaille@gostai.com>
1251
1252 Update gnulib.
1253 * gnulib: Update from master.
1254
12552008-12-05 Eric Blake <ebb9@byu.net>
1256
1257 Avoid compiler warning.
1258 * src/output.c (muscle_insert_item_number_table): Delete unused
1259 function.
1260
12612008-12-02 Eric Blake <ebb9@byu.net>
1262
1263 Build testsuite with newer autoconf.
1264 * tests/output.at (m4_expand): Don't override in newer autoconf,
1265 where the underlying implementation changed.
1266 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1267 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1268 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1269 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1270 since some of them contain unbalanced ')'.
1271
12722008-12-01 Akim Demaille <demaille@gostai.com>
1273
1274 Use b4_symbol for printers and destructors everywhere.
1275 * data/bison.m4 (b4_symbol_action_location): New.
1276 * data/c.m4 (b4_symbol_actions): Remove.
1277 Adjust all callers to use by b4_symbol_foreach and the corresponding
1278 b4_symbol_printer/destructor macro.
1279 * data/glr.cc: Adjust.
1280 * data/lalr1.java: Adjust the %destructor sanity check.
1281 * src/output.c (symbol_code_props_output): Remove, we no longer
1282 need the b4_symbol_printers/destructors tables.
1283
12842008-12-01 Akim Demaille <demaille@gostai.com>
1285
1286 Use b4_symbol_case_.
1287 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
1288 b4_symbol_case_.
1289
12902008-12-01 Akim Demaille <demaille@gostai.com>
1291
1292 Move b4_symbol based macro to bison.m4.
1293 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
1294 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
1295 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
1296 (b4_type_foreach): Move to...
1297 * data/bison.m4: Here.
1298 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
1299 b4_symbol_value_template instead of b4_symbol_value.
1300
13012008-12-01 Akim Demaille <demaille@gostai.com>
1302
1303 b4_symbol/type_foreach.
1304 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
1305 Use them.
1306
13072008-12-01 Akim Demaille <demaille@gostai.com>
1308
1309 Use the symbol properties to output the printer/destructor for lalr1.cc.
1310 Instead of defining complex list of tuples to define various
1311 properties of the symbols, we now prefer to define symbols as
1312 "structs" in m4: using the symbol key (its number), and the
1313 property name, b4_symbol gives it value. Use this to handle
1314 destructors and printers.
1315
1316 * src/output.c (CODE_PROP): New.
1317 (prepare_symbol_definitions): Use it to define the printer and
1318 destructor related attributes of the symbols.
1319 * data/lalr1.cc (b4_symbol_actions): Rename as...
1320 (b4_symbol_action): this.
1321 Use b4_symbol instead of 6 arguments.
1322 (b4_symbol_printer, b4_symbol_destructor): New.
1323 Use them instead of b4_symbol_actions.
1324
13252008-12-01 Akim Demaille <demaille@gostai.com>
1326
1327 Avoid capturing variables too easily.
1328 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
1329 v__ and p__ instead of v and p.
1330
13312008-12-01 Akim Demaille <demaille@gostai.com>
1332
1333 Remove spurious empty line before syncline.
1334 * data/bison.m4 (b4_syncline): Don't output an empty line before
1335 the output.
1336
13372008-11-26 Akim Demaille <demaille@gostai.com>
1338
1339 Convert lib/Makefile.am into lib/local.mk.
1340 The real problem is rather gnulib.mk, which itself is extracted
1341 from a Makefile.am that gnulib expects to the "recursive". The
1342 tool prefix-gnulib-mk converts such a gnulib.mk to be
1343 non-recursive. Also, some AC_SUBST variables need to be adjusted.
1344
1345 * etc/prefix-gnulib-mk: New.
1346 * bootstrap (slurp): Use it to convert further gnulib.mk.
1347 No longer try to avoid re-creation of lib/gnulib.mk as the changes
1348 are deeper.
1349 * lib/Makefile.am: Rename as...
1350 * lib/local.mk: this.
1351 Adjust to be prefixed.
1352 * Makefile.am, configure.ac: Adjust.
1353 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
1354
13552008-11-26 Akim Demaille <demaille@gostai.com>
1356
1357 s/_FLAGS/FLAGS/.
1358 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
1359 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
1360 Reported by Eric Blake.
1361
13622008-11-26 Akim Demaille <demaille@gostai.com>
1363
1364 Use b4_parser_tables_define in glr.cc.
1365 * data/glr.c: Use b4_parser_tables_define instead of defining the
1366 (deterministic integral) tables by hand.
1367
13682008-11-26 Akim Demaille <demaille@gostai.com>
1369
1370 Use b4_parser_tables_define in Java.
1371 * data/java.m4 (b4_typed_parser_table): Rename as...
1372 (b4_typed_parser_table_define): this, for consistency.
1373 Accept a comment as $4.
1374 Move $2 into yy*_.
1375 (b4_integral_parser_table): Rename as...
1376 (b4_integral_parser_table_define): this.
1377 * data/lalr1.java: Adjust all uses.
1378 Use b4_parser_tables_define instead of generation by hand.
1379
13802008-11-26 Akim Demaille <demaille@gostai.com>
1381
1382 Prepare the convergence bw C style and Java table generation.
1383 * data/bison.m4 (b4_tables_map, b4_tables_declare)
1384 (b4_tables_define): Rename as...
1385 (b4_integral_parser_tables_map, b4_parser_tables_declare)
1386 (b4_parser_tables_define): these.
1387 * data/c.m4 (b4_table_define): Rename as...
1388 (b4_integral_parser_table_define): this.
1389 * data/lalr1.cc: Adjust.
1390 (b4_table_define, b4_table_declare): Rename as...
1391 (b4_integral_parser_table_define)
1392 (b4_integral_parser_table_declare): these.
1393 (yyrline_): Move the comment where it is actually used.
1394 * data/yacc.c: Adjust.
1395 (yyrline): Use b4_integral_parser_table_define.
1396
13972008-11-26 Akim Demaille <demaille@gostai.com>
1398
1399 Regen.
1400 * src/parse-gram.h, src/parse-gram.c: Regen.
1401
14022008-11-26 Akim Demaille <demaille@gostai.com>
1403
1404 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
1405 * data/lalr1.cc (b4_tables_map): Move to...
1406 * data/bison.m4: here.
1407 Update the comment for yytable during the flight.
1408 (b4_tables_declare, b4_tables_define): New.
1409 * data/lalr1.cc: Use them.
1410 * data/c.m4 (b4_table_define): New.
1411 * data/yacc.c: Use b4_tables_define instead of output the tables
1412 by hand.
1413 * tests/regression.at (Web2c Actions): Adjust the expected output,
1414 the order of the tables changed.
1415
14162008-11-26 Akim Demaille <demaille@gostai.com>
1417
1418 Get rid of (yy)rhs and (yy)prhs.
1419 These tables are no longer needed in the parsers, and they don't seem to
1420 be useful. They are not documented either.
1421
1422 * src/output.c (prepare_rules): Get rid of rhs and prhs.
1423 Adjust the computation of (yy)r2.
1424
14252008-11-26 Akim Demaille <demaille@gostai.com>
1426
1427 Rule length is unsigned.
1428 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
1429
14302008-11-26 Akim Demaille <demaille@gostai.com>
1431
1432 Get rid of lalr1-split.cc.
1433 It was no longer maintainer.
1434
1435 * data/lalr1-split.cc: Remove.
1436 * etc/bench.pl.in (bench_fusion_parser): Remove.
1437 Adjust.
1438
14392008-11-26 Akim Demaille <demaille@gostai.com>
1440
1441 Use yy* consistently.
1442 * data/glr.c: Now that yyrhs no longer exists as a global
1443 variable, rename local "rhs" variables into "yyrhs" for
1444 consistency.
1445
14462008-11-25 Akim Demaille <demaille@gostai.com>
1447
1448 Get rid of yyrhs and yyprhs in glr.c.
1449 * data/glr.c (yyrhs, yyprhs): Remove.
1450 Instead, use the state stack and yystos.
1451
14522008-11-25 Akim Demaille <demaille@gostai.com>
1453
1454 Flag glr tests.
1455 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
1456 as an Autotest keyword.
1457
14582008-11-25 Akim Demaille <demaille@gostai.com>
1459
1460 Prefer TESTSUITE_FLAGS.
1461 TESTSUITEFLAGS is barely readable.
1462
1463 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
1464 for backward compatibility.
1465 Use the former instead of the latter.
1466
14672008-11-25 Akim Demaille <demaille@gostai.com>
1468
1469 Get rid of yyrhs and yyprhs in larl1.java.
1470 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
1471 (yy_reduce_print): Rather, use yystos_ and the state stack.
1472
14732008-11-25 Akim Demaille <demaille@gostai.com>
1474
1475 Formatting changes.
1476
14772008-11-25 Akim Demaille <demaille@gostai.com>
1478
1479 Get rid of yyrhs and yyprhs in yacc.c.
1480 They were used to get the symbol types, given a rule number, when
1481 displaying the top of the stack before a reduction. But the
1482 symbol type is available from the state stack. This has two be
1483 benefits: two tables less in the parser (making it smaller), and a
1484 more consistent use of the three stacks which will help to fuse
1485 them.
1486
1487 * data/yacc.c (yyprhs, yyrhs): Remove.
1488 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
1489 (yy_reduce_print): Take yyssp as argument.
1490 Use it, together with yystos, to get the symbol type.
1491 * tests/regression.at (Web2c Report): Remove these tables from the
1492 expected output.
1493
14942008-11-25 Akim Demaille <demaille@gostai.com>
1495
1496 b4_tables_map.
1497 The point is to factor the generation of the tables across skeletons.
1498 This is language dependant.
1499
1500 * data/c.m4 (b4_comment_): New.
1501 Should be usable to define how to generate tables independently of
1502 the language.
1503 (b4_c_comment): New.
1504 (b4_comment): Bounce to b4_c_comment.
1505 Now support $2 = [PREFIX] for indentation.
1506 * data/lalr1.cc (b4_table_declare): Don't output a comment if
1507 there is no comment.
1508 Indent it properly when there is one.
1509 Output the ending semicolon.
1510 (b4_table_define): Space changes.
1511 Output the ending semicolon.
1512 (b4_tables_map): New.
1513 Use it twice instead of declaring and defining the (integral)
1514 tables by hand.
1515
15162008-11-25 Akim Demaille <demaille@gostai.com>
1517
1518 b4_table_declare.
1519 * data/lalr1.cc (b4_table_declare): New.
1520 Use it to declare the tables defined with b4_table_define.
1521 (b4_table_define): Declare a third arg to match b4_table_declare
1522 signature.
1523 Move all the comments around invocations of b4_table_define into
1524 the invocations itselves.
1525 Move things around to have the order for declarations and
1526 definitions.
1527
15282008-11-25 Akim Demaille <demaille@gostai.com>
1529
1530 Formatting changes.
1531 * data/lalr1.java: here.
1532
15332008-11-25 Akim Demaille <demaille@gostai.com>
1534
1535 b4_args is more general than only C++.
1536 * data/lalr1.cc (b4_args, _b4_args): Move to...
1537 * data/bison.m4: here.
1538
15392008-11-21 Di-an Jan <dianj@freeshell.org>
1540
1541 Implement no-XXX arguments for --warnings, --report, --trace.
1542 * src/getargs.c (flags_argmatch): Handles no-XXX.
1543 Fix typo in doxygen comment.
1544
15452008-11-21 Akim Demaille <demaille@gostai.com>
1546
1547 Display the changes in cross-options.texi.
1548 * build-aux/cross-options.pl ($sep): New, to separate items.
1549 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
1550 changes.
1551
15522008-11-20 Di-an Jan <dianj@freeshell.org>
1553
1554 Improves options in the manual.
1555 * doc/bison.texinfo (-g, -x): Add space before argument.
1556 (Option Cross Key): Implement FIXME: listing directives also.
1557 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1558 (Short Option): Special case -d. Put arguments inside @option.
1559 (Bison Directive): Add column, automatically extracted from
1560 src/scan-gram.l (actual name passed as the first argument)
1561 with special case for %define.
1562 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
1563 to build-aux/cross-options.pl.
1564 * src/getargs.c (usage): Document limitations of cross-options.pl.
1565 * src/scan-gram.l: Likewise.
1566
15672008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1568
1569 Fix unexpanded macros in GLR defines file.
1570 Reported by Csaba Raduly at
1571 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1572 * THANKS (Csaba Raduly): Add.
1573 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1574 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1575 lexer in a separate module that includes the defines file.
1576 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
1577 source.
1578 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1579 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1580 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1581 (AT_DATA_SOURCE_PROLOGUE): New.
1582 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1583 (AT_DATA_SOURCE): New.
1584 (AT_FULL_COMPILE): Extend to support an additional source file.
1585
15862008-11-18 Akim Demaille <demaille@gostai.com>
1587
1588 More TODO.
1589 * TODO: More short term issues.
1590
15912008-11-18 Akim Demaille <demaille@gostai.com>
1592
1593 Regen.
1594 * src/parse-gram.h, src/parse-gram.c: Regen.
1595
15962008-11-18 Akim Demaille <demaille@gostai.com>
1597
1598 Use b4_subtract where possible.
1599 * data/lalr1.cc (b4_subtract): Move to...
1600 * data/bison.m4: here.
1601 * data/glr.c (b4_rhs_data): Use it.
1602 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
1603
16042008-11-18 Akim Demaille <demaille@gostai.com>
1605
1606 Remove incorrect mode specification.
1607 * data/glr.cc: Don't pretend it's C code.
1608
16092008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1610
1611 Simplify last patch slightly.
1612 * src/getargs.c (getargs): Here.
1613
16142008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1615
1616 Fix last warning from --enable-gcc-warnings.
1617 * src/getargs.c (getargs): Don't assign const address to non-const
1618 pointer.
1619
16202008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1621
1622 Don't let maintainer-*-check targets force a version update.
1623 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1624 handled.
1625
16262008-11-17 Di-an Jan <dianj@freeshell.org>
1627
1628 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1629 Align menus. Adjust word wrapping. Use node names for menu names.
1630 (Examples): Don't abbreviate node names.
1631 (LocalWords): Remove abbreviations.
1632 (Copying): Make description a sentence.
1633 (Java Action Features): Remove period to match the rest of menu.
1634
16352008-11-17 Di-an Jan <dianj@freeshell.org>
1636
1637 Handles several --enable-gcc-warnings.
1638 * src/getargs.c (command_line_location): Set parameters to void.
1639 * src/output.c (symbol_type_name_cmp): Make static.
1640 (symbols_by_type_name): Set parameters to void.
1641 (symbol_definitions_output): Remove unused parameter. Rename as...
1642 (prepare_symbol_definitions): this.
1643 (muscles_output): Move symbol_definitions_output to...
1644 (output): here as prepare_symbol_definitions.
1645 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
1646 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
1647
16482008-11-17 Di-an Jan <dianj@freeshell.org>
1649
1650 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
1651 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
1652
16532008-11-16 Akim Demaille <demaille@gostai.com>
1654
1655 Add missing $(EXEEXT).
1656 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
1657 "src/bison$(EXEEXT)".
1658 Reported by Di-an Jan.
1659
16602008-11-15 Akim Demaille <demaille@gostai.com>
1661
1662 * TODO: Update.
1663
16642008-11-15 Akim Demaille <demaille@gostai.com>
1665
1666 Formatting changes.
1667 * tests/input.at: here.
1668
16692008-11-15 Akim Demaille <demaille@gostai.com>
1670
1671 Remove duplicate header inclusion.
1672 * src/LR0.c: here.
1673
16742008-11-15 Akim Demaille <demaille@gostai.com>
1675
1676 * src/parse-gram.h, src/parse-gram.c: Regen.
1677
16782008-11-15 Akim Demaille <demaille@gostai.com>
1679
1680 Support parametric types.
1681
1682 There are two issues to handle: first scanning nested angle
1683 bracket pairs to support types such as std::pair< std::string,
1684 std::list<std::string> > >.
1685
1686 Another issue is to address idiosyncracies of C++: do not glue two
1687 closing angle brackets together (otherwise it's operator>>), and
1688 avoid sticking blindly a TYPE to the opening <, as it can result
1689 in '<:' which is a digraph for '['.
1690
1691 * src/scan-gram.l (brace_level): Rename as...
1692 (nesting): this.
1693 (SC_TAG): New.
1694 Implement support for complex tags.
1695 (tag): Accept
1696 , but not <.
1697 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
1698 (b4_symbol_variant): Leave space around types as parameters.
1699 * examples/variant.yy: Use nested template types and leading ::.
1700 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
1701 Rename as...
1702 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
1703 * tests/c++.at: Test parametric types.
1704
17052008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1706
1707 Test token.prefix.
1708 This is not sufficient, but we test at least that the make_SYMBOL
1709 interface is not affected by token.prefix. A more general test
1710 will be implemented when the support of token.prefix is generalized
1711 to more skeletons.
1712
1713 * tests/c++.at: One more variant test, using token.prefix.
1714
17152008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1716
1717 Test the make_TOKEN interface.
1718 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
1719 Factor the common code in yylex.
1720 Use it to test "%define lex_symbol".
1721
17222008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1723
1724 Formatting change.
1725
17262008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1727
1728 Simplify code for variants bench marks.
1729 * etc/bench.pl.in (&generate_grammar_list): Define and use
1730 location_type.
1731 Factor the common code in yylex.
1732
17332008-11-15 Akim Demaille <demaille@gostai.com>
1734
1735 Better error message.
1736 * bootstrap (find_tool): Fix the error message.
1737
17382008-11-15 Akim Demaille <demaille@gostai.com>
1739
1740 Update variant.yy to newest interface.
1741 * examples/variant.yy: Define lex_symbol.
1742 Adjust.
1743
17442008-11-15 Akim Demaille <demaille@gostai.com>
1745
1746 Don't use locations in variant.yy.
1747 * examples/variant.yy: Adjust to not using locations.
1748
17492008-11-15 Akim Demaille <demaille@gostai.com>
1750
1751 Comment changes.
1752 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
1753 comments for the license.
1754
17552008-11-15 Akim Demaille <demaille@gostai.com>
1756
1757 Remove tests/Makefile.am.
1758 * tests/Makefile.am: Rename as...
1759 * tests/local.mk: this.
1760 * Makefile.am, configure.ac: Adjust.
1761 * Makefile.am (DISTCLEANFILES): Define.
1762 (maintainer-check, maintainer-xml-check, maintainer-push-check):
1763 Remove, we no longer need to bounce to the real targets.
1764
17652008-11-15 Akim Demaille <demaille@gostai.com>
1766
1767 Comment changes.
1768
17692008-11-15 Akim Demaille <demaille@gostai.com>
1770
1771 djgpp/local.mk.
1772 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
1773 * djgpp/local.mk: this new file.
1774
17752008-11-15 Akim Demaille <demaille@gostai.com>
1776
1777 Remove doc/Makefile.am.
1778 * doc/Makefile.am: Rename as...
1779 * doc/local.mk: this.
1780 Adjust paths
1781 * Makefile.am, configure.ac: Adjust.
1782 * Makefile.am (MOSTLYCLEANFILES): New.
1783 * src/local.mk: Adjust.
1784
17852008-11-15 Akim Demaille <demaille@gostai.com>
1786
1787 Move sc_tight_scope into maint.mk.
1788 It does not work, and I don't know how it was supposed to work: it
1789 seems to be looking for sources in the build tree. I just moved
1790 it at a better place, fixing it is still required.
1791
1792 * src/local.mk (echo): Remove.
1793 (sc_tight_scope): Move to...
1794 * maint.mk: here.
1795
17962008-11-15 Akim Demaille <demaille@gostai.com>
1797
1798 Regen.
1799 * src/parse-gram.h, src/parse-gram.h: Regen.
1800
18012008-11-15 Akim Demaille <demaille@gostai.com>
1802
1803 Remove src/Makefile.am.
1804 * src/Makefile.am: Rename as...
1805 * src/local.mk: this.
1806 Prefix all the paths with src/.
1807 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
1808 (AM_CPPFLAGS): Find find in builddir/src.
1809 (YACC): Move the flags into...
1810 (AM_YFLAGS): here.
1811 * maint.mk (sc_tight_scope): Disable.
1812 It used to bounce to the version in src/Makefile.am which is now
1813 part of this very Makefile.
1814 * Makefile.am, configure.ac: Adjust.
1815 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
1816 include "..." to find files "here": we are no longer in src/, so
1817 qualify the includes with src/.
1818 * doc/Makefile.am (PREPATH): No longer include the top_builddir
1819 prefix.
1820 (.x.1): Adjust to be able to create src/foo from the top level
1821 Makefile, instead of going bounce to src/Makefile the creation of
1822 foo.
1823
18242008-11-15 Akim Demaille <demaille@gostai.com>
1825
1826 Remove useless variable.
1827 * doc/Makefile.am (srcsrcdir): Remove.
1828
18292008-11-15 Akim Demaille <demaille@gostai.com>
1830
1831 Remove data/Makefile.am.
1832 * data/Makefile.am: Rename as...
1833 * data/local.mk: this.
1834 Adjust paths.
1835 * Makefile.am, configure.ac: Adjust.
1836
18372008-11-15 Akim Demaille <demaille@gostai.com>
1838
1839 Remove etc/Makefile.am.
1840 * etc/Makefile.am: Rename as...
1841 * etc/local.mk: this.
1842 Adjust.
1843 * Makefile.am, configure.ac: Adjust.
1844
18452008-11-15 Akim Demaille <demaille@gostai.com>
1846
1847 Remove examples/local.mk.
1848 examples/calc++/Makefile.am might be interesting to keep as is, since
1849 it is an example in itself.
1850
1851 * examples/Makefile.am: Rename as...
1852 * examples/local.mk: this.
1853 Adjust.
1854 * Makefile.am, configure.ac: Adjust.
1855
18562008-11-15 Akim Demaille <demaille@gostai.com>
1857
1858 Remove build-aux/Makefile.am.
1859 Recursive Makefiles are really way too slow, let's get rid of some of
1860 them.
1861
1862 * build-aux/Makefile.am: Rename as...
1863 * build-aux/local.mk: this.
1864 Adjust paths.
1865 * Makefile.am, configure.ac: Adjust.
1866
18672008-11-15 Akim Demaille <demaille@gostai.com>
1868
1869 Provide convenience constructors for locations and positions.
1870 * data/location.cc (position::position): Accept file, line and
1871 column as arguments with default values.
1872 Always qualify initial line and column literals as unsigned.
1873 (location::location): Provide convenience constructors.
1874
18752008-11-15 Akim Demaille <demaille@gostai.com>
1876
1877 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
1878 token type.
1879 Using template buys us nothing, and makes it uselessly complex to
1880 construct a symbol. Besides, it could not be generalized to other
1881 languages, while make_FOO would work in C/Java etc.
1882
1883 * data/lalr1.cc (b4_symbol_): New.
1884 (b4_symbol): Use it.
1885 (b4_symbol_constructor_declaration_)
1886 (b4_symbol_constructor_definition_): Instead of generating
1887 specializations of an overloaded template function, just generate
1888 several functions whose names are forged from the token names
1889 without the token.prefix.
1890 (b4_symbol_constructor_declarations): Generate them for all the
1891 symbols, not just by class of symbol type, now that instead of
1892 specializing a function template by the token, we generate a
1893 function named after the token.
1894 (b4_symbol_constructor_specialization_)
1895 (b4_symbol_constructor_specializations): Remove.
1896 * etc/bench.pl.in: Adjust to this new API.
1897
18982008-11-13 Akim Demaille <demaille@gostai.com>
1899
1900 %define token.prefix.
1901 Provide a means to add a prefix to the name of the tokens as
1902 output in the generated files. Because of name clashes, it is
1903 good to have such a prefix such as TOK_ that protects from names
1904 such as EOF, FILE etc. But it clutters the grammar itself.
1905
1906 * data/bison.m4 (token.prefix): Empty by default.
1907 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
1908 * data/lalr1.cc (b4_symbol): Ditto.
1909
19102008-11-13 Akim Demaille <demaille@gostai.com>
1911
1912 Compute at M4 time some of the subtractions.
1913 * data/lalr1.cc (b4_subtract): New.
1914 (b4_rhs_data): Use it.
1915
19162008-11-13 Akim Demaille <demaille@gostai.com>
1917
1918 symbol::token.
1919 This allows the user to get the type of a token returned by yylex.
1920
1921 * data/lalr1.cc (symbol::token): New.
1922 (yytoknum_): Define when %define lex_symbol, independently of
1923 %debug.
1924 (yytoken_number_): Move into...
1925 (symbol::token): here, since that's the only use.
1926 The other one is YYPRINT which was not officially supported
1927 by lalr1.cc, and anyway it did not work since YYPRINT uses this
1928 array under a different name (yytoknum).
1929
19302008-11-13 Akim Demaille <demaille@gostai.com>
1931
1932 YYERRCODE.
1933 * TODO (YYERRCODE): Mention the case of $undef.
1934
19352008-11-13 Akim Demaille <demaille@gostai.com>
1936
1937 TODO: YYPRINT.
1938 * TODO (YYPRINT): New.
1939
19402008-11-13 Akim Demaille <demaille@gostai.com>
1941
1942 Comment changes.
1943 * data/lalr1.cc, data/yacc.c: Fix the description of the
1944 yytranslate and yytoknum tables.
1945
19462008-11-13 Akim Demaille <demaille@gostai.com>
1947
1948 Define make_symbol in the header.
1949 To reach good performances these functions should be inlined (yet
1950 this is to measure precisely). To this end they must be available
1951 to the caller.
1952
1953 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
1954 location_type with the class name.
1955 Since will now be output in the header, declare "inline".
1956 No longer use b4_symbol_constructor_specializations, but
1957 b4_symbol_constructor_definitions in the header.
1958 Don't call it in the *.cc file.
1959
19602008-11-13 Akim Demaille <demaille@gostai.com>
1961
1962 Define yytranslate in the header for lex_symbol.
1963 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
1964 into the header file when using %define lex_symbol.
1965 (yytranslate_): Declare inline.
1966
19672008-11-13 Akim Demaille <demaille@gostai.com>
1968
1969 Define the constructors of symbol_type in
1970 b4_symbol_constructor_definitions.
1971 The constructors are called by the make_symbol functions, which a
1972 forthcoming patch will move elsewhere. Hence the interest of
1973 putting them together.
1974
1975 The stack_symbol_type does not need to be moved, it is used only
1976 by the parser.
1977
1978 * data/lalr1.cc: Move symbol_type and symbol_base_type
1979 constructors into...
1980 (b4_symbol_constructor_definitions): here.
1981 Adjust.
1982
19832008-11-13 Akim Demaille <demaille@gostai.com>
1984
1985 Make it easier to move the definition of yytranslate_.
1986 Forthcoming changes will make it possible to use yytranslate_
1987 from outside the parser implementation file.
1988
1989 * data/lalr1.cc (b4_yytranslate_definition): New.
1990 Use it.
1991
19922008-11-13 Akim Demaille <demaille@gostai.com>
1993
1994 Remove useless class specification.
1995 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1996 to refer to the class name to use a type defined by the class for
1997 arguments of member functions.
1998
19992008-11-13 Akim Demaille <demaille@gostai.com>
2000
2001 Finer input type for yytranslate.
2002 This patch is debatable: the tradition expects yylex to return an int
2003 which happens to correspond to token_number (which is an enum). This
2004 allows for instance to return characters (such as '*' etc.). But this
2005 goes against the stronger typing I am trying to have with the new
2006 lex interface which return a symbol_type. So in this case, feed
2007 yytranslate_ with a token_type.
2008
2009 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
2010 expect a token_type.
2011
20122008-11-13 Akim Demaille <demaille@gostai.com>
2013
2014 Honor lex-params in %define lex_symbol mode.
2015 * data/lalr1.cc: Use b4_lex_param.
2016
20172008-11-13 Akim Demaille <demaille@gostai.com>
2018
2019 Simplify names.
2020 * src/output.c (symbol_definitions_output): Rename symbol
2021 attributes type_name and has_type_name as type and has_type.
2022 * data/lalr1.cc: Adjust uses.
2023
20242008-11-13 Akim Demaille <demaille@gostai.com>
2025
2026 Use b4_type_names for the union type.
2027 The union used to compute the size of the variant used to iterate
2028 over the type of all the symbols, with a lot of redundancy. Now
2029 iterate over the lists of symbols having the same type-name.
2030
2031 * data/lalr1.cc (b4_char_sizeof_): New.
2032 (b4_char_sizeof): Use it.
2033 Adjust to be called with a list of numbers instead of a single
2034 number.
2035 Adjust its caller for new-line issues.
2036
20372008-11-13 Akim Demaille <demaille@gostai.com>
2038
2039 Define the "identifier" of a symbol.
2040 Symbols may have several string representations, for instance if
2041 they have an alias. What I call its "id" is a string that can be
2042 used as an identifier. May not exist.
2043
2044 Currently the symbols which have the "tag_is_id" flag set are
2045 those that don't have an alias. Look harder for the id.
2046
2047 * src/output.c (is_identifier): Move to...
2048 * src/symtab.c (is_identifier): here.
2049 * src/symtab.h, src/symtab.c (symbol_id_get): New.
2050 * src/output.c (symbol_definitions_output): Use it to define "id"
2051 and "has_id".
2052 Remove the definition of "tag_is_id".
2053 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
2054 "tag_is_id" were used to produce code.
2055 We still use "tag" for documentation.
2056
20572008-11-11 Akim Demaille <demaille@gostai.com>
2058
2059 Locations are no longer required by lalr1.cc.
2060 * data/lalr1.cc (_b4_args, b4_args): New.
2061 Adjust all uses of locations to make them optional.
2062 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
2063 (AT_CHECK_NAMESPACE): Check the use of locations.
2064 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
2065 without locations with lalr1.cc.
2066 Test these cases.
2067 * tests/output.at: Check lalr1.cc with and without location
2068 support.
2069 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
2070 Don't use locations.
2071
20722008-11-11 Akim Demaille <demaille@gostai.com>
2073
2074 AT_FULL_COMPILE.
2075 * tests/local.at (AT_FULL_COMPILE): New.
2076 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
2077
20782008-11-11 Akim Demaille <demaille@gostai.com>
2079
2080 Support parens in calc++.
2081 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
2082 * examples/calc++/test (run): Check the expected output.
2083 Adjust callers.
2084 Check parens too.
2085
20862008-11-11 Akim Demaille <demaille@gostai.com>
2087
2088 Simplify lalr1.cc since %defines is mandatory.
2089 * data/lalr1.cc: Remove useless calls to b4_defines_if.
2090
20912008-11-11 Akim Demaille <demaille@gostai.com>
2092
2093 TODO: yyfmt.
2094 * TODO (yysyntax_error): New item.
2095
20962008-11-11 Akim Demaille <demaille@gostai.com>
2097
2098 Prefer M4 to CPP.
2099 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
2100 YYERROR_VERBOSE.
2101
21022008-11-11 Akim Demaille <demaille@gostai.com>
2103
2104 Support i18n of the parse error messages.
2105 * TODO (lalr1.cc/I18n): Remove.
2106 * data/lalr1.cc (yysyntax_error_): Support the translation of the
2107 error messages, as done in yacc.c.
2108 Stay within the yy* pseudo namespace.
2109
21102008-11-11 Akim Demaille <demaille@gostai.com>
2111
2112 More TODO.
2113 * TODO (single stack, yysyntax_error): New.
2114
21152008-11-11 Akim Demaille <demaille@gostai.com>
2116
2117 Make it possible to return a symbol_type from yylex.
2118 * data/lalr1.cc (b4_lex_symbol_if): New.
2119 (parse): When lex_symbol is defined, expected yylex to return the
2120 complete lookahead.
2121 * etc/bench.pl.in (generate_grammar_list): Extend to support this
2122 yylex interface.
2123 (bench_variant_parser): Exercise it.
2124
21252008-11-11 Akim Demaille <demaille@gostai.com>
2126
2127 Remove useless bench case.
2128 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
2129 no longer used.
2130
21312008-11-11 Akim Demaille <demaille@gostai.com>
2132
2133 Improve display of directives.
2134 * etc/bench.pl.in (parse_term): Don't add useless eol.
2135
21362008-11-11 Akim Demaille <demaille@gostai.com>
2137
2138 Use string_cast in the bench.
2139 * etc/bench.pl.in (generate_grammar_list): Define and use
2140 string_cast.
2141
21422008-11-11 Akim Demaille <demaille@gostai.com>
2143
2144 Replace yychar with a Boolean.
2145 * data/lalr1.cc (parse::yychar): Replace by...
2146 (parse::yyempty): this.
2147
21482008-11-11 Akim Demaille <demaille@gostai.com>
2149
2150 Factor the tables.
2151 * TODO: New item.
2152
21532008-11-11 Akim Demaille <demaille@gostai.com>
2154
2155 Let yytranslate handle the eof case.
2156 * data/lalr1.cc (yytranslate_): Handle the EOF case.
2157 Adjust callers.
2158 No longer expect yychar to be equal to yyeof_, rather, test the
2159 lookahead's (translated) kind.
2160
21612008-11-11 Akim Demaille <demaille@gostai.com>
2162
2163 yychar cannot be empty in yyerrlab.
2164 * TODO (yychar == yyempty_): New.
2165 * data/lalr1.cc: Remove the handling of this case.
2166 This eases forthcoming changes related to yychar and yytranslate.
2167
21682008-11-11 Akim Demaille <demaille@gostai.com>
2169
2170 Bench: syntactic sugar for %define/#define.
2171 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
2172 (&bench_push_parser, bench_variant_parser): Use this feature.
2173 (&eat): New.
2174 Use it.
2175
21762008-11-11 Akim Demaille <demaille@gostai.com>
2177
2178 Less memory pressure on the "list" bench.
2179 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
2180 the values, to limit memory pressure.
2181
21822008-11-11 Akim Demaille <demaille@gostai.com>
2183
2184 Introduce make_symbol.
2185 make_symbol provides a means to construct a full symbol (kind,
2186 value, location) in a single shot. It is meant to be a Symbol
2187 constructor, parameterized by the symbol kind so that overloading
2188 would prevent incorrect kind/value pairs. Unfortunately
2189 parameterized constructors do not work well in C++ (unless the
2190 parameter also appears as an argument, which is not acceptable),
2191 hence the use of a function instead of a constructor.
2192
2193 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2194 (b4_symbol_constructor_declarations)
2195 (b4_symbol_constructor_specialization_)
2196 (b4_symbol_constructor_specializations)
2197 (b4_symbol_constructor_definition_)
2198 (b4_symbol_constructor_definitions): New.
2199 Use them where appropriate to generate declaration, declaration of
2200 the specializations, and implementations of the templated
2201 overloaded function "make_symbol".
2202 (variant::variant): Always define a default ctor.
2203 Also provide a copy ctor.
2204 (symbol_base_type, symbol_type): New ctor overloads for value-less
2205 symbols.
2206 (symbol_type): Now public, so that functions such as yylex can use
2207 it.
2208
22092008-11-11 Akim Demaille <demaille@gostai.com>
2210
2211 Inform m4 whether a tag is a valid id.
2212 * src/output.c (is_identifier): New.
2213 (symbol_definitions_output): Use it to define tag_is_id.
2214 But maybe this should be done at m4 level?
2215
22162008-11-11 Akim Demaille <demaille@gostai.com>
2217
2218 Test 214 was failing: it greps with a pattern containing [ ]*
2219 which obviously meant to catch spaces and tabs, but contained only
2220 spaces. Tabulations in sources are a nuisance, so to simplify the
2221 matter, get rid of all the tabulations in the Java sources. The
2222 other skeletons will be treated equally later.
2223
2224 * data/java.m4, data/lalr1.java: Untabify.
2225 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
2226 tabulations are no longer generated.
2227
22282008-11-11 Paolo Bonzini <bonzini@gnu.org>
2229
2230 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2231 * configure.ac: Adjust usage.
2232 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2233 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2234 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2235
22362008-11-10 Di-an Jan <dianj@freeshell.org>
2237
2238 Workaround Java's ``code too large'' problem for parser tables
2239 in most cases, by using one function per initialization.
2240 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
2241 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
2242 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
2243 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
2244 (yytname_): Use b4_typed_parser_table.
2245 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
2246 ``code too large'' error.
2247
22482008-11-10 Di-an Jan <dianj@freeshell.org>
2249
2250 * NEWS: Document them.
2251
2252 General Java skeleton improvements.
2253 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
2254 using gcj < 4.3 in the testsuite, according to comments in
2255 gnulib/m4/javacomp.m4.
2256 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
2257 location_type, position_type): Remove extraneous brackets from
2258 b4_percent_define_default.
2259 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
2260 m4_define and m4_define_default.
2261 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
2262 which marks the end of user code with appropriate syncline, like all
2263 the other skeletons.
2264 (b4_user_post_prologue): Add. Don't silently drop.
2265 (yylex): Remove.
2266 (parse): Inline yylex.
2267 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
2268 (%{...%}): Fix typo of %code imports.
2269 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
2270
2271 Support annotations on parser class with %define annotations.
2272 * data/lalr1.java (annotations): Add to parser class modifier.
2273 * doc/bison.texinfo (Java Parser Interface): Document
2274 %define annotations.
2275 (Java Declarations Summary): Document %define annotations.
2276 * tests/java.at (Java parser class modifiers): Test annotations.
2277
2278 Do not generate code for %error-verbose unless requested.
2279 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
2280 Make private. Make conditional on %error-verbose.
2281 (getErrorVerbose, setErrorVerbose): New.
2282 (yytnamerr_): Make conditional on %error-verbose.
2283 (yysyntax_error): Make some code conditional on %error-verbose.
2284 * doc/bison.texinfo (Java Bison Interface): Remove the parts
2285 about %error-verbose having no effect.
2286 (getErrorVerbose, setErrorVerbose): Document.
2287
2288 Move constants for token names to Lexer interface.
2289 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
2290 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
2291 (parse): Qualify EOF to Lexer.EOF.
2292 * doc/bison.texinfo (Java Parser Interface): Move documentation of
2293 EOF and token names to Java Lexer Interface.
2294 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
2295
2296 Make yyerror public.
2297 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
2298 (yyerror): Change to public. Add Javadoc comments. Use longer
2299 parameter names. Make the body rather than the declarator
2300 conditional on %locations.
2301 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
2302
2303 Allow user to add code to the constructor with %code init.
2304 * data/java.m4 (b4_init_throws): New, for %define init_throws.
2305 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
2306 Add %code init to the front of the constructor body.
2307 * doc/bison.texinfo (YYParser.YYParser): Document %code init
2308 and %define init_throws.
2309 (Java Declarations Summary): Document %code init and
2310 %define init_throws.
2311 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
2312 (Java constructor init and init_throws): Add tests.
2313
23142008-11-10 Akim Demaille <demaille@gostai.com>
2315
2316 Update TODO.
2317 * TODO (-D): is implemented.
2318 (associativity): Same precedence must have the same associativity.
2319 For instance, how can a * b / c be parsed if * is %left and / is
2320 %right?
2321 (YYERRORCODE, YYFAIL, YYBACKUP): New.
2322
23232008-11-10 Akim Demaille <demaille@gostai.com>
2324
2325 Formatting changes.
2326
23272008-11-10 Akim Demaille <demaille@gostai.com>
2328
2329 More information about the symbols.
2330 * src/output.c (type_names_output): Document all the symbols,
2331 including those that don't have a type-name.
2332 (symbol_definitions_output): Define "is_token" and
2333 "has_type_name".
2334 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
2335 type-name, now that they are defined too in b4_type_names.
2336
23372008-11-10 Akim Demaille <demaille@gostai.com>
2338
2339 Regen.
2340
23412008-11-10 Akim Demaille <demaille@gostai.com>
2342
2343 Make parser::yytranslate static.
2344 Small speedup (1%) on the list grammar. And makes yytranslate_
2345 available in non member functions.
2346
2347 * data/lalr1.cc (yytranslate_): Does not need to be a instance
2348 function.
2349
23502008-11-10 Akim Demaille <demaille@gostai.com>
2351
2352 Avoid trailing spaces.
2353 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
2354 * data/lalr1.cc: Don't indent before rule and symbol actions, as
2355 they can be empty, and anyway this incorrectly indents the first
2356 action.
2357
23582008-11-10 Akim Demaille <demaille@gostai.com>
2359
2360 Comment changes.
2361
23622008-11-10 Akim Demaille <demaille@gostai.com>
2363
2364 Use "enum" for integral constants.
2365 This is just nicer to read, I observed no speedup.
2366
2367 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
2368 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
2369 (yyuser_token_number_max_, yyundef_token_): Move into...
2370 (yytranslate_): here.
2371
23722008-11-10 Akim Demaille <demaille@gostai.com>
2373
2374 Shortcuts in bench directives.
2375 * etc/bench.pl.in (parse_dirs): New.
2376 Use it.
2377 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
2378 Create the benches in "benches/".
2379
23802008-11-10 Akim Demaille <demaille@gostai.com>
2381
2382 Formatting changes.
2383 * data/lalr1.cc: here.
2384
23852008-11-10 Akim Demaille <demaille@gostai.com>
2386
2387 Adjust verbose message to using emacs.
2388 * etc/bench.pl.in: Inform compilation-mode when we change the
2389 directory.
2390 (generate_grammar_list): Recognize %define "variant" in addition
2391 to %define variant.
2392
23932008-11-10 Akim Demaille <demaille@gostai.com>
2394
2395 Classify symbols by type-name.
2396 * src/uniqstr.h (UNIQSTR_CMP): New.
2397 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
2398 (type_names_output): New.
2399 (muscles_output): Use it.
2400 * data/lalr1.cc (b4_symbol_action_): Remove.
2401 (b4_symbol_case_, b4_type_action_): New.
2402 Adjust uses of b4_symbol_action_ to use b4_type_action_.
2403
24042008-11-10 Akim Demaille <demaille@gostai.com>
2405
2406 Change the handling of the symbols in the skeletons.
2407 Before we were using tables which lines were the symbols and which
2408 columns were things like number, tag, type-name etc. It is was
2409 difficult to extend: each time a column was added, all the numbers had
2410 to be updated (you asked for colon $2, not for "tag"). Also, it was
2411 hard to filter these tables when only a subset of the symbols (say the
2412 tokens, or the nterms, or the tokens that have and external number
2413 *and* a type-name) was of interest.
2414
2415 Now instead of monolithic tables, we define one macro per cell. For
2416 instance "b4_symbol(0, tag)" is a macro name which contents is
2417 self-decriptive. The macro "b4_symbol" provides easier access to
2418 these cells.
2419
2420 * src/output.c (type_names_output): Remove.
2421 (symbol_numbers_output, symbol_definitions_output): New.
2422 (muscles_output): Call them.
2423 (prepare_symbols): Define b4_symbols_number.
2424
24252008-11-10 Akim Demaille <demaille@gostai.com>
2426
2427 --trace=muscles
2428 * src/getargs.h, src/getargs.c (trace_muscle): New.
2429 (trace_types, trace_args): Support it.
2430 * src/output.c (output_skeleton): Use it.
2431
24322008-11-10 Akim Demaille <demaille@gostai.com>
2433
2434 muscles_output.
2435 * src/output.c (muscles_output): New, extracted from...
2436 (output_skeleton): here.
2437 Adjust.
2438
24392008-11-10 Akim Demaille <demaille@gostai.com>
2440
2441 Formatting changes.
2442
24432008-11-10 Akim Demaille <demaille@gostai.com>
2444
2445 Update the variant example.
2446 * examples/variant.yy: Formatting changes.
2447 One stage build.
2448
24492008-11-10 Akim Demaille <demaille@gostai.com>
2450
2451 Support constructor with an argument.
2452 This improves the "list" bench by 2%.
2453
2454 * data/lalr1.cc (variant::build): Add an overloaded version with
2455 an argument.
2456 * tests/c++.at (AT_CHECK_VARIANT): Check it.
2457
24582008-11-10 Akim Demaille <demaille@gostai.com>
2459
2460 Test variants.
2461 * tests/c++.at (AT_CHECK_VARIANTS): New.
2462 Use it with and without %define assert.
2463
24642008-11-10 Akim Demaille <demaille@gostai.com>
2465
2466 Add %precedence support.
2467 Unfortunately it is not possible to reuse the %prec directive. This
2468 is because to please POSIX, we do not require to end the rules with a
2469 semicolon. As a result,
2470
2471 foo: bar %prec baz
2472
2473 is ambiguous: either a rule which precedence is that of baz, or a rule,
2474 and then a declaration of the precedence of the token baz.
2475
2476 * doc/bison.texinfo: Document %precedence.
2477 (Precedence Only): New.
2478 * src/assoc.h, src/assoc.c (precedence_assoc): New.
2479 * src/conflicts.c (resolve_sr_conflict): Support it.
2480 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
2481 Parse it.
2482 * tests/calc.at: Use %precedence for NEG.
2483 * tests/conflicts.at (%precedence does not suffice)
2484 (%precedence suffices): New tests.
2485
24862008-11-09 Akim Demaille <demaille@gostai.com>
2487
2488 Make benches in a sub dirs.
2489 * etc/bench.pl.in ($dir): New.
2490 Use it.
2491 Check the use of constructors with an argument.
2492 (bench_variant_parser): Fix.
2493
24942008-11-09 Akim Demaille <demaille@gostai.com>
2495
2496 fix eof condition
2497
24982008-11-09 Akim Demaille <demaille@gostai.com>
2499
2500 Fix --help.
2501
25022008-11-09 Akim Demaille <demaille@gostai.com>
2503
2504 Require the generation of parse-gram.output.
2505 * src/Makefile.am (YACC): Pass --report=all.
2506
25072008-11-09 Akim Demaille <demaille@gostai.com>
2508
2509 Formatting changes.
2510
25112008-11-09 Akim Demaille <demaille@gostai.com>
2512
2513 Update TODO.
2514 * TODO: Remove obsolete items.
2515 Update others.
2516
25172008-11-09 Akim Demaille <demaille@gostai.com>
2518
2519 Enhance bench.pl.
2520 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
2521 (@token, $grammar, $bench): New.
2522 (generate_grammar_variant): Rename as...
2523 (generate_grammar_list): this.
2524 (generate_grammar): Adjust.
2525 (bench_grammar): Rename as...
2526 (bench): this.
2527 Use it in the various bench-marking routines.
2528 (-b, -g): New options.
2529
25302008-11-09 Akim Demaille <demaille@gostai.com>
2531
2532 Use a static hierarchy for symbols in the C++ parser.
2533 * data/lalr1.cc (symbol_base_type, symbol_type)
2534 (stack_symbol_type): Make it a static hierarchy.
2535 Adjust dependencies.
2536
25372008-11-09 Akim Demaille <demaille@gostai.com>
2538
2539 bench.pl -d, --directive.
2540 * etc/bench.pl.in (@directive): New.
2541 (&bench_grammar): Use it.
2542 (&bench_list_grammar): New, to provide access to the "variant"
2543 grammar.
2544 Use it.
2545 (getopts): Support -d, --directive.
2546
25472008-11-09 Akim Demaille <demaille@gostai.com>
2548
2549 Use inline for small operations.
2550 * data/lalr1.cc (symbol_base_type, symbol_type)
2551 (stack_symbol_type): Declare constructor and other operations as
2552 inline.
2553 (yy_destroy_): Inline.
2554
25552008-11-09 Akim Demaille <demaille@gostai.com>
2556
2557 Introduce a hierarchy for symbols.
2558 * data/lalr1.cc (symbol_base_type, symbol_type): New.
2559 (data_type): Rename as...
2560 (stack_symbol_type): this.
2561 Derive from symbol_base_type.
2562 (yy_symbol_value_print_): Merge into...
2563 (yy_symbol_print_): this.
2564 Rename as...
2565 (yy_print_): this.
2566 (yydestruct_): Rename as...
2567 (yy_destroy_): this.
2568 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
2569 (parser::parse): yyla is now of symbol_type.
2570 Use its type member instead of yytoken.
2571
25722008-11-09 Akim Demaille <demaille@gostai.com>
2573
2574 Rename data_type and stack_symbol_type.
2575 * data/lalr1.cc (data_type): Rename as...
2576 (stack_symbol_type): this.
2577
25782008-11-09 Akim Demaille <demaille@gostai.com>
2579
2580 Handle semantic value and location together.
2581 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
2582 yydata.value and yydata.location.
2583 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
2584 (YY_SYMBOL_PRINT): Now take semantic value and location as a
2585 single arg.
2586 Adjust all callers.
2587 (yydestruct_): New overload for a stack symbol.
2588
25892008-11-09 Akim Demaille <demaille@gostai.com>
2590
2591 Push a complete symbol, not connected parts.
2592 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
2593 state, value and location.
2594 Adjust callers.
2595
25962008-11-09 Akim Demaille <demaille@gostai.com>
2597
2598 Agregate yylval and yylloc.
2599 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
2600 (parser::yyla): this.
2601
26022008-11-09 Akim Demaille <demaille@gostai.com>
2603
2604 Rely on the state stack to display reduction traces.
2605 To display rhs symbols before a reduction, we used information
2606 about the rule reduced, which required the tables yyrhs and
2607 yyprhs. Now use rely only on the state stack to get the same
2608 information.
2609
2610 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
2611 Use them.
2612 (parser::yyrhs_, parser::yyprhs_): Remove.
2613 (parser::yy_reduce_print_): Use the state stack.
2614
26152008-11-09 Akim Demaille <demaille@gostai.com>
2616
2617 Fuse yyval and yyloc into yylhs.
2618 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
2619 yylhs.
2620 (parse): Replace yyval and yyloc with yylhs.value and
2621 yylhs.location.
2622 After a user action, compute yylhs.state earlier.
2623 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
2624 fresh error_token.
2625
26262008-11-09 Di-an Jan <dianj@freeshell.org>
2627
2628 Remove unused variable.
2629 * src/output.c (type_names_output): Remove unused variable sep.
2630
26312008-11-09 Paolo Bonzini <bonzini@gnu.org>
2632
2633 Change tests/output.at quoting.
2634 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
2635 expanding arguments.
2636
26372008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2638
2639 Don't add a semicolon to actions for %skeleton or %language.
2640 It breaks Java test cases as reported by Akim Demaille.
2641 * src/scan-code.l: Implement.
2642
26432008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2644
2645 Clean up %skeleton and %language priority implementation.
2646 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
2647 remove static qualifier because others will soon need to see it.
2648 (language_prio): Likewise.
2649 (getargs): Use command_line_prio rather than 0.
2650 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
2651 enum fields.
2652 (skeleton_prio): Extern it.
2653 (language_prio): Extern it.
2654 * src/parse-gram.y: Use grammar_prio rather than 1.
2655
26562008-11-07 Akim Demaille <demaille@gostai.com>
2657
2658 Moving push traces into yypush_.
2659 * data/lalr1.cc (yypush_): Now takes a optional trace message.
2660 Adjust all uses.
2661
26622008-11-07 Akim Demaille <demaille@gostai.com>
2663
2664 The single-stack C++ parser is now the standard one.
2665 * data/lalr1.cc: Rename as...
2666 * data/lalr1-split.cc: this.
2667 * data/lalr1-fusion.cc: Rename as...
2668 * data/lalr1.cc: this.
2669 * etc/bench.pl.in: Adjust.
2670
26712008-11-07 Akim Demaille <demaille@gostai.com>
2672
2673 Avoid empty-if warnings.
2674 Reported by Quentin Hocquet.
2675
2676 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
2677 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
2678
26792008-11-07 Akim Demaille <demaille@gostai.com>
2680
2681 Pass command line location to skeleton_arg and language_argmatch.
2682 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2683 The location argument is now mandatory.
2684 Adjust all dependencies.
2685 (getargs): Use command_line_location.
2686
26872008-11-07 Akim Demaille <demaille@gostai.com>
2688
2689 -D, --define.
2690 * src/getargs.c (usage): Document -D.
2691 Fix help string for --locations.
2692 (command_line_location): New.
2693 (short_options, long_options, getargs): Support -D, --define.
2694 (getargs): Move -d support at the right place.
2695 * doc/bison.texinfo (Bison Options): Update.
2696 * tests/input.at (%define, --define): New.
2697
26982008-11-07 Akim Demaille <demaille@gostai.com>
2699
2700 Initialize the muscle table before parsing the command line.
2701 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2702 (getargs): Define file_name.
2703 * src/main.c (main): Initialize muscle_tab before calling
2704 getargs.
2705 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2706 its value is not available yet.
2707
27082008-11-07 Akim Demaille <demaille@gostai.com>
2709
2710 Locations without columns for command line arguments.
2711 * src/location.c (location_print): Don't display negative columns.
2712 * src/location.h: Document this.
2713
27142008-11-07 Akim Demaille <demaille@gostai.com>
2715
2716 Fix --help.
2717 * src/getargs.c (usage): Fix help string for -W.
2718
27192008-11-07 Akim Demaille <demaille@gostai.com>
2720
2721 Handle more general types of option arguments.
2722 * build-aux/cross-options.pl: The argument ends at the first
2723 space, not the first non-symbol character.
2724 Use @var for each word appearing the argument description.
2725
27262008-11-07 Akim Demaille <demaille@gostai.com>
2727
2728 Destroy the variants that remain on the stack in case of error.
2729 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
2730 destructor.
2731 Display the value only if yymsg is nonnull.
2732 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
2733
27342008-11-07 Akim Demaille <demaille@gostai.com>
2735
2736 Add "%define assert" to variants.
2737 This is used to help the user catch cases where some value gets
2738 ovewritten by a new one. This should not happen, as this will
2739 probably leak.
2740
2741 Unfortunately this uncovered a bug in the C++ parser itself: the
2742 lookahead value was not destroyed between two calls to yylex. For
2743 instance if the previous lookahead was a std::string, and then an int,
2744 then the value of the std::string was correctly taken (i.e., the
2745 lookahead was now an empty string), but std::string structure itself
2746 was not reclaimed.
2747
2748 This is now done in variant::build(other&) (which is used to take the
2749 value of the lookahead): other is not only stolen from its value, it
2750 is also destroyed. This incurs a new performance penalty of a few
2751 percent, and union becomes faster again.
2752
2753 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
2754 (b4_variant_if): New.
2755 (variant::built): New.
2756 Use it whereever the status of the variant changes.
2757 * etc/bench.pl.in: Check the penalty of %define assert.
2758
27592008-11-07 Akim Demaille <demaille@gostai.com>
2760
2761 Use "%define variant" in bench.pl.
2762 * etc/bench.pl.in: No longer use the pseudo directive %variants,
2763 just use %define variants.
2764
27652008-11-07 Akim Demaille <demaille@gostai.com>
2766
2767 Regen.
2768 * src/parse-gram.h, src/parse-gram.c: Regen.
2769
27702008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2771
2772 Fix user actions without a trailing semicolon.
2773 Reported by Sergei Steshenko at
2774 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2775 * THANKS (Sergei Steshenko): Add.
2776 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2777 * tests/regression.at (Fix user actions without a trailing semicolon):
2778 New test case.
2779
27802008-11-04 Akim Demaille <demaille@gostai.com>
2781
2782 Use b4_copyright_years.
2783 * data/yacc.c (b4_copyright_years): New.
2784 Fix its value according to the comments in the file.
2785 Use it and undefine it.
2786
27872008-11-04 Akim Demaille <demaille@gostai.com>
2788
2789 Formatting changes.
2790 * data/lalr1-fusion.cc, src/parse-gram.y: here.
2791
27922008-11-04 Akim Demaille <demaille@gostai.com>
2793
2794 Formatting changes.
2795 * data/lalr1-fusion.cc: here.
2796
27972008-11-04 Akim Demaille <demaille@gostai.com>
2798
2799 Use strict on bench.pl.
2800 * etc/bench.pl.in (&run, &generate_grammar): New.
2801 Rename the grammar generating functions for consistency.
2802 Change the interface so that the list of benches to run is passed
2803 as (optionless) arguments.
2804 (&compile): Use &run.
2805
28062008-11-04 Akim Demaille <demaille@gostai.com>
2807
2808 Remove spurious initial empty lines.
2809 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2810 * data/yacc.c: End the @output lines with an @.
2811
28122008-11-04 Akim Demaille <demaille@gostai.com>
2813
2814 Improve the display of sizes.
2815 * etc/bench.p.in: Higher precision.
2816 Sort by decreasing size.
2817
28182008-11-04 Akim Demaille <demaille@gostai.com>
2819
2820 Don't memcpy C++ structures.
2821 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
2822 arguments.
2823 (variant::build): New overload for
2824 copy-construction-that-destroys.
2825 (variant::swap): New.
2826 (parser::yypush_): Use it in variant mode.
2827
28282008-11-04 Akim Demaille <demaille@gostai.com>
2829
2830 Better defaults for bench.pl.
2831 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
2832 default values.
2833 Adjust &verbose uses.
2834 (-q, --quiet): New.
2835
28362008-11-04 Akim Demaille <demaille@gostai.com>
2837
2838 Make variant.yy more complex.
2839 std::list cannot be copied via memcpy, they are more demanding than
2840 std::string. Use one std::list to strengthen the test.
2841
2842 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
2843 Adjust.
2844 Create a list of strings, instead of a single large string.
2845
28462008-11-04 Akim Demaille <demaille@gostai.com>
2847
2848 bench.pl --bench.
2849 * etc/bench.pl.in (--bench, $bench): New.
2850
28512008-11-04 Akim Demaille <demaille@gostai.com>
2852
2853 Sort methods.
2854 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
2855 Define it after as().
2856
28572008-11-04 Akim Demaille <demaille@gostai.com>
2858
2859 Useless parens.
2860 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
2861
28622008-11-04 Akim Demaille <demaille@gostai.com>
2863
2864 Issue missing synclines after user actions.
2865 * data/c.m4 (b4_case): Issue synclines on the output file.
2866
28672008-11-04 Akim Demaille <demaille@gostai.com>
2868
2869 Remove trailing empty line.
2870 * data/lalr1-fusion.cc: Don't add an empty line after the user's
2871 epilogue.
2872
28732008-11-04 Akim Demaille <demaille@gostai.com>
2874
2875 Fix output of copyright years.
2876 * data/bison.m4 (b4_copyright): Fix the indentation of the
2877 copyright year paragraph.
2878 Use b4_copyright_years when no years are given.
2879 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
2880 (b4_copyright_years): New.
2881 Use it.
2882
28832008-11-04 Akim Demaille <demaille@gostai.com>
2884
2885 Avoid the spurious initial empty line.
2886 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
2887 the end of @output request to suppress the empty line that
2888 results.
2889
28902008-11-04 Akim Demaille <demaille@gostai.com>
2891
2892 Remove parser::rhs_number_type.
2893 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
2894 (yyrhs_): Use b4_table_define.
2895
28962008-11-04 Akim Demaille <demaille@gostai.com>
2897
2898 Fix iteration type.
2899 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
2900
29012008-11-04 Akim Demaille <demaille@gostai.com>
2902
2903 Factor the declaration of the integer tables.
2904 * data/lalr1-fusion.cc (b4_table_define): New.
2905 Use it.
2906
29072008-11-03 Akim Demaille <demaille@gostai.com>
2908
2909 Fix indentation of tables in lalr1.cc
2910 * data/lalr1-fusion.cc: Fix the indentation.
2911
29122008-11-03 Akim Demaille <demaille@gostai.com>
2913
2914 Destroy the lhs symbols after reduction.
2915 * data/lalr1-fusion.cc (parse): After the user action, when in
2916 variant mode, destroy the lhs symbols.
2917
29182008-11-03 Akim Demaille <demaille@gostai.com>
2919
2920 Simplify yysyntax_error_ use.
2921 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
2922 type, but make it unnamed in the declaration when it is not used.
2923
29242008-11-03 Akim Demaille <demaille@gostai.com>
2925
2926 Let yy::variant::build return an lvalue.
2927 * data/lalr1-fusion.cc (variant::build): Return a reference to the
2928 object.
2929
29302008-11-03 Akim Demaille <demaille@gostai.com>
2931
2932 Define yy::variant only when needed.
2933 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
2934 used.
2935
29362008-11-03 Akim Demaille <demaille@gostai.com>
2937
2938 Bench the three-stack lalr1.cc.
2939 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
2940 one-stack one.
2941
29422008-11-03 Akim Demaille <demaille@gostai.com>
2943
2944 Fail on parse error in calc++.
2945 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
2946 status.
2947 * examples/calc++/test ($me, $number, $exit, run): New.
2948 Use them to propagate errors to the exit status.
2949
29502008-11-03 Akim Demaille <demaille@gostai.com>
2951
2952 Don't specify the skeleton twice in the example.
2953 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
2954 file does what is needed.
2955
29562008-11-03 Akim Demaille <demaille@gostai.com>
2957
2958 bench: Improve output.
2959 * etc/bench.pl.in (bench_grammar): Tune the printf format.
2960
29612008-11-03 Akim Demaille <demaille@gostai.com>
2962
2963 bench: check impact of %debug on variants.
2964 * etc/bench.pl.in (variant_grammar): Fix the computation of
2965 $variant.
2966 Generate a grammar file that can work with or without %debug.
2967 Do use the @directive.
2968 (bench_variant_parser): Check impact of %debug.
2969 (@directives): Rename all the occurrences to...
2970 (@directive): this, for consistency.
2971
29722008-11-03 Akim Demaille <demaille@gostai.com>
2973
2974 bench: report the size too.
2975 * etc/bench.pl.in ($iterations): Defaults to -3.
2976 (&bench_grammar): Require hireswallclock.
2977 Compute and display the size of the result.
2978 More comments.
2979
29802008-11-03 Akim Demaille <demaille@gostai.com>
2981
2982 bench: More use of the verbosity level.
2983 * etc/bench.pl.in ($verbose, &verbose): New.
2984 Use them.
2985 More POD documentation.
2986
29872008-11-03 Akim Demaille <demaille@gostai.com>
2988
2989 bench.pl: a command line interface
2990 * etc/bench.pl.in: More doc.
2991 Some fixes in the documentation.
2992 ($cflags, $iterations, &help, &getopt): New.
2993 Use them.
2994 (&variant_grammar): Let the number of stages be 10 times what is
2995 specified.
2996
29972008-11-03 Akim Demaille <demaille@gostai.com>
2998
2999 Bench the use of Boost.Variants.
3000 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
3001 New.
3002 (&compile): Be ready to compile C++ parsers.
3003 (&bench_push_parser): Move debug information to the outermost
3004 level.
3005 * THANKS: Add Michiel De Wilde.
3006
30072008-11-03 Akim Demaille <demaille@gostai.com>
3008
3009 bench.pl: Pass directives as a list instead of as a string.
3010 * etc/bench.pl.in (&directives): New.
3011 (&triangular_grammar, &calc_grammar): Use it to format the Bison
3012 directives.
3013 (&triangular_grammar): Do use the directives (were ignored).
3014 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
3015 directives.
3016
30172008-11-03 Akim Demaille <demaille@gostai.com>
3018
3019 Improve genericity of bench.pl.
3020 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
3021 argument.
3022 (&bench_push_parser): New.
3023 Call it.
3024
30252008-11-03 Akim Demaille <demaille@gostai.com>
3026
3027 Add documentation to bench.pl.
3028 * etc/bench.pl.in: Comment changes.
3029
30302008-11-03 Akim Demaille <demaille@gostai.com>
3031
3032 Fuse the three stacks into a single one.
3033
3034 In order to make it easy to perform benchmarks to ensure that
3035 there are no performance loss, lalr1.cc is forked into
3036 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
3037 lalr1.cc.
3038
3039 Meanwhile, to make sure that lalr1-fusion.cc is correctly
3040 exercized by the test suite, the user must install a symbolic link
3041 from lalr1.cc to it.
3042
3043 Instead of having three stacks (state, value, location), use a
3044 stack of triples. This considerably simplifies the code (and it
3045 will be easier not to require locations as currently does the C++
3046 parser), and also gives a 10% speedup according to
3047 etc/bench (probably mainly since memory allocation is done once
3048 instead of three times).
3049
3050 Another motivation is to make it easier to destruct properly
3051 semantic values: now that they are bound to their state (hence
3052 symbol type) it will be easier to call the appropriate destructor.
3053
3054 These changes should probably benefit the C parser too.
3055
3056 * data/lalr1.cc: Copy as...
3057 * data/lalr1-fusion.cc: this new file.
3058 (b4_rhs_value, b4_rhs_location): New definitions overriding those
3059 from c++.m4.
3060 (state_stack_type, semantic_stack_type, location_stack_type)
3061 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
3062 (data_type, stack_type, yystack_): New.
3063 (YYLLOC_DEFAULT, yypush_): Adjust.
3064 (yyerror_range): Now based on data_type, not location_type.
3065
30662008-11-03 Akim Demaille <demaille@gostai.com>
3067
3068 Push the state, value, and location at the same time.
3069 This is needed to prepare a forthcoming patch that fuses the three
3070 stacks into one.
3071
3072 * data/lalr1.cc (parser::yypush_): New.
3073 (parser::yynewstate): Change the semantics: instead of arriving to
3074 this label when value and location have been pushed, but yystate
3075 is to be pushed on the state stack, now the three of them must
3076 have been pushed before. yystate still must be the new state.
3077 This allows to use yypush_ everywhere instead of individual
3078 handling of the stacks.
3079
30802008-11-03 Akim Demaille <demaille@gostai.com>
3081
3082 Prefer references to pointers.
3083 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
3084 definition to use references instead of pointers.
3085 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
3086 Take the value and location as references.
3087 Adjust callers.
3088
30892008-11-03 Akim Demaille <demaille@gostai.com>
3090
3091 stack::size instead of stack::height.
3092 * data/lalr1.cc (stack::height): Rename as...
3093 (stack::size): this.
3094 Fix the output type.
3095 Comment changes.
3096
30972008-11-03 Akim Demaille <demaille@gostai.com>
3098
3099 Use variants to support objects as semantic values.
3100 This patch was inspired by work by Michiel De Wilde. But he used
3101 Boost variants which (i) requires Boost on the user side, (ii) is
3102 slow, and (iii) has useless overhead (the parser knows the type of
3103 the semantic value there is no reason to duplicate this
3104 information as Boost.Variants do).
3105
3106 This implementation reserves a buffer large enough to store the
3107 largest objects. yy::variant implements this buffer. It was
3108 implemented with Quentin Hocquet.
3109
3110 * src/output.c (type_names_output): New.
3111 (output_skeleton): Invoke it.
3112 * data/c++.m4 (b4_variant_if): New.
3113 (b4_symbol_value): If needed, provide a definition for variants.
3114 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
3115 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
3116 (b4_char_sizeof, yy::variant): New.
3117 (parser::parse): If variants are requested, define
3118 parser::union_type, parser::variant, change the definition of
3119 semantic_type, construct $$ before running the user action instead
3120 of performing a default $$ = $1.
3121 * examples/variant.yy: New.
3122 Based on an example by Michiel De Wilde.
3123
31242008-11-03 Akim Demaille <demaille@gostai.com>
3125
3126 Parameterize the extraction of semantic values.
3127 To make future changes easier, no longer rely on ".TYPE" being the
3128 way to get a semantic value.
3129
3130 * data/c.m4 (b4_symbol_value): New.
3131 Use it.
3132 * data/c++.m4, data/yacc.c: Use it.
3133 * data/glr.c: Use b4_symbol_value.
3134 (b4_rhs_data): New.
3135 Use it.
3136
31372008-11-03 Akim Demaille <demaille@gostai.com>
3138
3139 Prepare easier M4 changes.
3140 * data/lalr1.cc: Use escaped [] instead of literals to prepare
3141 future changes.
3142
31432008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3144
3145 Initiate further development.
3146 * NEWS: Create an empty section for new entries.
3147 * gnulib: Update submodule to HEAD.
3148
31492008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3150
3151 * NEWS: Version 2.4.
3152
31532008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3154
3155 Prepare for next release.
3156 * NEWS: Briefly mention changes since 2.3b.
3157 * README: Say GNU m4 1.4.6, which we've been requiring in release
3158 announcements already, not 1.4.3, which breaks the build.
3159
31602008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3161
3162 Say %language is experimental.
3163 We're thinking of extending it's effect on output file naming. See the
3164 thread at
3165 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
3166 * NEWS: Say it's experimental.
3167 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
3168 recommend it over %skeleton for now.
3169 (Bison Options): Likewise.
3170 (C++ Bison Interface): Use %skeleton not %language.
3171 (Calc++ Parser): Use %skeleton not %language.
3172 * src/getargs.c (usage): Say it's experimental.
3173
31742008-11-01 Di-an Jan <dianj@freeshell.org>
3175 Paolo Bonzini <bonzini@gnu.org>
3176
3177 Support all Java parser class modifiers.
3178 * data/java.m4 (b4_percent_define_get3): New.
3179 (b4_final_if, b4_strictfp_if): New.
3180 * data/lalr1.java (final, strictfp, extends, implements): Support.
3181 * doc/bison.texinfo (final, strictfp, extends, implements): Add
3182 documentation.
3183 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
3184 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
3185 (AT_CHECK_JAVA_GREP): New.
3186 (Java parser class modifiers): New test.
3187 (Java parser class extends and implements): New test.
3188
3189 Model exception propagation better with throws and lex_throws.
3190 * data/java.m4 (b4_list2): New.
3191 (throws): Change default.
3192 * data/lalr1.java (yyaction): Add throws.
3193 (parse): Add lex_throws in addition to throws.
3194 * doc/bison.texinfo (throws, lex_throws): Add documentation.
3195 * tests/java.at (Java throws specifications): New test.
3196
3197 Improve documentation for Java parsers.
3198 * doc/bison.texinfo (Java Parsers): Add subsections.
3199 Don't quote first argument of %define.
3200 (Java Bison Interface): Document output files. Move documentation
3201 of parser class and merge into Java Parser Interface. Document
3202 features that error out. Document directives with no effect.
3203 Move note about Javadoc higher.
3204 (Java Semantic Values): Explicitly mention stype.
3205 Document that generic types cannot be used.
3206 (Java Location Values): Use @deftypeivar. Document constructors.
3207 Correct return value for toString.
3208 (Java Parser Interface): List undocumented constants/fields.
3209 Move documentation of fields added by %parse-param closer to list
3210 of members. Document that token names are added as fields.
3211 Document constructors accurately. Remove error method.
3212 (Java Scanner Interface): Move note on %pure-parser to Java Bison
3213 Interface. Describe %code lexer and yylex accutately.
3214 Remove documentation that does not match the code.
3215 (Java Action Features): New.
3216 (Java Differences): Add reference. Add item on semantic values.
3217 Add note about @{ ... @}. Clarify %% epilogue placement.
3218 (Java Declarations Summary): New.
3219
3220 Fix Java skeleton.
3221 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
3222 (b4_remove_comma): Quote test argument.
3223 (b4_identification): Remove "bison" field.
3224 * tests/java.at (Java parser class and package names): New test.
3225 (Java %parse-param and %lex-param): New test.
3226 (Java stype, position_class and location_class): New test.
3227
32282008-10-31 Di-an Jan <dianj@freeshell.org>
3229
3230 * data/lalr1.jave: Update copyright years.
3231 (YYParser): Correct name of "generated from" file in Javadoc:
3232 use b4_file_name instead of @ofile@.
3233 (Location constructor): Correct Javadoc parameter name.
3234 (yylloc): Add missing opening m4 quote after b4_location_if.
3235 This removes a stray [ in the Javadoc of Lexer.getStartPos.
3236 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
3237 (YYParser constructor): Correct Javadoc parameter name.
3238
32392008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
3240
3241 Always put auxiliary code files in the same dir as other output files.
3242 * src/files.c (compute_file_name_parts): When the user specifies
3243 --output but not --file-prefix, extract the directory prefix from the
3244 file prefix not from the grammar file name. This affects the location
3245 of files like location.hh generated by the C++ skeleton. The includes
3246 in the other output files require this fix.
3247 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
3248 for expected output files.
3249 (Output files): Add a test for the above.
3250
32512008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
3252
3253 * gnulib: Update submodule to HEAD.
3254
32552008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3256
3257 Update copyright year.
3258 * src/files.c: Here.
3259
32602008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
3261
3262 Don't overwrite the input file.
3263 * src/files.c (output_file_name_check): Fatal error if using input file
3264 for output.
3265 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
3266 argument.
3267 (Conflicting output files): Add test.
3268
32692008-10-28 Akim Demaille <demaille@gostai.com>
3270
3271 Space changes.
3272 * data/lalr1.cc: Formatting changes.
3273
32742008-10-28 Akim Demaille <demaille@gostai.com>
3275
3276 Don't define debugging functions when !YYDEBUG.
3277 * data/lalr1.cc (debug_stream, set_debug_stream)
3278 (debug_level_type, debug_level, set_debug_level): Don't
3279 declare them when YYDEBUG is not defined.
3280 The implementation are already YYDEBUG-aware.
3281
32822008-10-28 Akim Demaille <demaille@gostai.com>
3283
3284 Prefer "continue" for empty loop bodies.
3285 * etc/bench.pl.in: Use "continue" instead of {}.
3286
32872008-10-28 Akim Demaille <demaille@gostai.com>
3288
3289 Space and comments changes.
3290 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3291 * data/c.m4, data/lalr1.cc: Space changes.
3292
32932008-10-28 Akim Demaille <demaille@gostai.com>
3294
3295 Make gnulib a submodule.
3296 * gnulib: New.
3297 * .gitmodules (gnulib): New.
3298
32992008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3300
3301 Fix yyerror_range for user-defined location type in C++. Reported by
3302 Georg Sauthoff at
3303 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3304 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3305 * THANKS (Georg Sauthoff): Add.
3306
33072008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3308
3309 Update several administrative files mainly to facilitate releasing.
3310 * HACKING (Administrivia): Make the git-merge-changelog notes more
3311 helpful.
3312 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3313 (Release Procedure): Update for git and add numerous details that were
3314 previously missing.
3315 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3316 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3317 that announcements don't claim we bootstrapped with whatever bison
3318 happened to be in PATH. Add flex as a bootstrap tool.
3319 * Makefile.maint: Remove, previously replaced by maint.mk.
3320 * Makefile.cfg: Remove, and migrate settings to...
3321 * cfg.mk: ... here for the sake of `make announcement'.
3322 * bootstrap.conf (gnulib_modules): Add announce-gen.
3323 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3324 Berry.
3325
33262008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3327
3328 Small but important bugfixes for the Java skeleton.
3329 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3330 (yy_symbol_print): Call toString on yyvaluep.
3331
33322008-08-29 Akim Demaille <demaille@gostai.com>
3333
3334 Clarify UPDATED use.
3335 * doc/bison.texinfo: It refers to the last edition of this file,
3336 not to the release date of Bison.
3337 Reported by Joel E. Denny.
3338
33392008-08-29 Akim Demaille <demaille@gostai.com>
3340
3341 * README: Update FAQ pointer.
3342 Reported by Joel E. Denny.
3343
33442008-08-27 Eric Blake <ebb9@byu.net>
3345
3346 Resync m4sugar from autoconf.
3347 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3348 (m4_init): Adjust to latest m4.git changes.
3349 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3350 effects.
3351 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3352 (_m4_list_cmp): Reduce side effects.
3353
33542008-08-27 Akim Demaille <demaille@gostai.com>
3355
3356 Check yyerrok in calc.at.
3357 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3358 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3359 expected.
3360
33612008-08-27 Akim Demaille <demaille@gostai.com>
3362
3363 Support yyerrok in lalr1.cc.
3364 YYBACKUP is still to import back into lalr1.cc.
3365 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
3366
33672008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3368
3369 For maintainer-check*, don't recompile for a $(VERSION) update.
3370 * cfg.mk: New file.
3371 (_is-dist-target): Override the one in GNUmakefile.
3372 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3373
33742008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3375
3376 Update for recent change to gnulib.
3377 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3378 string.h now.
3379
33802008-08-15 Eric Blake <ebb9@byu.net>
3381
3382 Remaining m4sugar merge from autoconf.
3383 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3384 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3385 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3386 * src/output.c (output_skeleton): Tell m4 how to find it.
3387
3388 Partial m4sugar merge from autoconf: m4_map.
3389 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3390 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3391 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3392 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3393 for empty list.
3394 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3395 Likewise.
3396 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3397 declares it.
3398
33992008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3400
3401 Keep .version and PACKAGE_VERSION in sync.
3402 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3403 dependency, and add comments justifying this in more detail. Discussed
3404 starting at
3405 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3406
34072008-08-06 Eric Blake <ebb9@byu.net>
3408
3409 Partial m4sugar merge from autoconf: m4_shiftn.
3410 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3411 (m4_shift2, m4_shift3): New macros.
3412 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3413 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3414 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3415 * data/java.m4 (b4_remove_comma): Likewise.
3416
3417 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3418 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3419 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3420 (m4_init): Consolidate wrapped text into single m4_wrap.
3421 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3422 in wrapped text.
3423
34242008-08-05 Eric Blake <ebb9@byu.net>
3425
3426 Partial m4sugar merge from autoconf: builtins, version.m4.
3427 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3428 (m4_prepend): Remove, as it is unused and inherently quadratic,
3429 whereas m4_append is linear in newer m4.
3430 (m4_mkstemp): New builtin.
3431 (m4_symbols): Make rename conditional.
3432 (m4_version_prereq): Ensure fatal error if used in bison, which
3433 intentionally lacks version.m4.
3434
3435 Fix comments in m4sugar.
3436 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3437
34382008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3439
3440 Update for recent .gitignore fix in Gnulib.
3441 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3442 anchored .gitignore entries.
3443
34442008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3445
3446 Set gnu or gnits strictness.
3447 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3448 development and gnits strictness for releases. Based on Eric Blake's
3449 suggestion at
3450 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3451
34522008-07-31 Paolo Bonzini <bonzini@gnu.org>
3453
3454 * NEWS: Clarify documentation of %language.
3455
34562008-07-31 Paolo Bonzini <bonzini@gnu.org>
3457
3458 Support usage of git-merge-changelog.
3459 * .gitattributes: New.
3460 * HACKING: Document usage of git-merge-changelog.
3461 * bootstrap: Install git-merge-changelog entries in .git/config
3462 if appropriate.
3463
34642008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3465
3466 Remove remaining dependence on CVS Id keyword.
3467 * ChangeLog: For the sake of people still using CVS, don't use dollars
3468 when mentioning Id.
3469 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3470 unusual anyway.
3471 * data/xslt/xml2dot.xsl: Likewise.
3472 * data/xslt/xml2text.xsl: Likewise.
3473 * data/xslt/xml2xhtml.xsl: Likewise.
3474 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3475 * doc/Makefile.am (neutralize): Remove, no longer needed.
3476 (.x.1): Don't use neutralize.
3477 (edit): Don't substitute for ID.
3478 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3479
34802008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3481
3482 Fix dependence on computed configure variables.
3483 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3484 $(top_srcdir)/configure.ac so that changes to computed variables, such
3485 as PACKAGE_VERSION, are seen.
3486 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3487
34882008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3489
3490 Update copyright dates for recent changes.
3491 * Makefile.am: Here.
3492 * src/Makefile.am: Here.
3493 * src/reduce.c: Here.
3494 * tests/reduce.at: Here.
3495
34962008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3497
3498 Use git-version-gen for version names between releases.
3499 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3500 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3501 * .prev-version: New.
3502 * .version.in: Remove.
3503 * ChangeLog: Remove the Id previously used for capturing the CVS
3504 revision.
3505 * GNUmakefile: Remove, now copied from Gnulib.
3506 * Makefile.am: Add code suggested by comments in
3507 build-aux/git-version-gen.
3508 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3509 .prev-version, and .version.
3510 * NEWS (2.3b+): Rename to...
3511 (?.?): ... this because we're dropping the "+" version naming scheme,
3512 but, in general, we still can't be sure of our next release name.
3513 * bootstrap: Add a quick hack to remove from .gitignore the
3514 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3515 entry. This should really be fixed in gnulib instead.
3516 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3517 * configure.ac (AC_INIT): Set version name by invoking
3518 build-aux/git-version-gen.
3519 (AC_CONFIG_FILES): Remove .version, now generated by
3520 build-aux/git-version-gen.
3521 * maint.mk: New, copied from coreutils.
3522 * doc/.cvsignore (bison.1): Add.
3523 * doc/.gitignore (/bison.1): Add.
3524 * doc/bison.1: Remove, generated.
3525 * src/.cvsignore (revision.c): Remove.
3526 * src/.gitignore (/revision.c): Remove.
3527 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3528 (BUILT_SOURCES): Remove revision.c.
3529 (revision.c): Remove.
3530 * src/getargs.c (version): Don't print revision after the VERSION.
3531 * src/revision.h: Remove.
3532
35332008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3534
3535 Fix untranslatable composition of sentences. Reported by Goran
3536 Uddeborg at
3537 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3538 * THANKS (Goran Uddeborg): Add.
3539 * src/reduce.c (reduce_print): Report the number of nonterminals and
3540 rules useless in the grammar in separate sentences.
3541 * tests/reduce.at (Useless Rules): Update output.
3542 (Reduced Automaton): Likewise.
3543 (Underivable Rules): Likewise.
3544 (Empty Language): Likewise.
3545
35462008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3547
3548 Fix some .gitignore and .cvsignore problems.
3549 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3550 (insert_vc_ignore): ... this new function, which prepends `/' to all
3551 .gitignore entries before passing them to insert_sorted_if_absent.
3552 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3553 .cvsignore files are maintained even though Bison developers run
3554 bootstrap while using Git.
3555 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3556 unneeded by Bison.
3557 (gnulib): Add.
3558 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3559 unneeded. Reported by Eric Blake.
3560 * lib/.gitignore (/*~): Add.
3561 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3562 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3563 Blake.
3564 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3565
35662008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3567
3568 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3569 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3570 * bootstrap.conf (gnulib_modules): Add unsetenv.
3571 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3572 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3573 (/setenv.m4): Add.
3574 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3575 the first argument because it may become position-dependent, and unset
3576 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3577 Add comments explaining these issues in more detail.
3578
35792008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3580
3581 Add .gitignore everywhere based on .cvsignore.
3582 * .gitignore: New.
3583 * build-aux/.gitignore: New.
3584 * data/.gitignore: New.
3585 * doc/.gitignore: New.
3586 * etc/.gitignore: New.
3587 * examples/.gitignore: New.
3588 * examples/calc++/.gitignore: New.
3589 * lib/.gitignore: New.
3590 * m4/.gitignore: New.
3591 * po/.gitignore: New.
3592 * runtime-po/.gitignore: New.
3593 * src/.gitignore: New.
3594 * tests/.gitignore: New.
3595
35962008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3597
3598 * NEWS (2.3b+): New section, empty for now.
3599 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3600
36012008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3602
3603 * NEWS (2.3b): Update release date since there has been a delay in
3604 getting the announcements and tarballs out.
3605
36062008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3607
3608 * NEWS: Version 2.3b.
3609 * configure.ac (AC_INIT): Likewise.
3610 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3611
36122008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3613
3614 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3615 been doing it for years.
3616 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3617 (Release Procedure): Add FIXME about make alpha being unmaintained.
3618
36192008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3620
3621 * data/yacc.c: Reformat m4 a little for readability.
3622 * src/lalr.c (build_relations): Correct comment.
3623
36242008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3625
3626 DJGPP specific issue.
3627 * djgpp/config.sed: Fixes required to run configure scripts generated
3628 by autoconf 2.62.
3629
36302008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3631
3632 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3633 coordinator@translationproject.org.
3634
36352008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3636
3637 * THANKS: Add Eric Blake.
3638
36392008-04-23 Eric Blake <ebb9@byu.net>
3640
3641 Revert prior patch, by working around autoconf regression.
3642 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3643 ("Output file name: ("): Uncomment test.
3644 ("Output file name: )"): Likewise.
3645 Based on an idea from Noah Misch.
3646
36472008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3648
3649 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3650 2.61. Reported by Juan Manuel Guerrero at
3651 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3652 * tests/output.at ("Output file name: ("): Comment out test case for
3653 now.
3654 ("Output file name: )"): Likewise.
3655
36562008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3657
3658 * GNUmakefile: Update git-version-gen invocation so make dist
3659 succeeds.
3660
36612008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3662
3663 Update to the current gnulib CVS repository, and fix trigraph handling
3664 in Bison.
3665 * bootstrap: Update gnulib CVS repository URL.
3666 (symlink_to_dir): Encapsulate the code that guarantees the destination
3667 directory exists into...
3668 (check_dst_dir): ... this new function, and...
3669 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3670 fail when copying files into lib/uniwidth/.
3671 * src/output.c (prepare_symbols): When writing yytname muscles, where
3672 symbol names will be encoded in C-string literals, tell quotearg to
3673 escape trigraphs. This used to be the default in gnulib.
3674 * tests/regression.at (Token definitions): Because of the change in
3675 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3676 escapes trigraphs in symbol names. Thus, yytname no longer has
3677 trigraphs unnecessarily doubly escaped. Update test case output.
3678 Extend test case to be sure Bison's own error messages will no longer
3679 have trigraphs in symbol names unnecessarily escaped once.
3680
36812008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3682
3683 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3684 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3685 * .cvsignore: Add .version.
3686 * .version.in: New.
3687 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3688 * configure.ac (AC_CONFIG_FILES): Add .version.
3689 * build-aux/.cvsignore: Add git-version-gen.
3690
36912008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3692
3693 * NEWS (2.3a+): Mention that -g now takes an argument.
3694 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3695 consistency. Update the -g and -x entries now that they take
3696 arguments. Use brackets to indicate optional arguments.
3697 * src/getargs.c (usage): Explain the relationship between arguments of
3698 long and short options more completely. Document --defines and -d
3699 separately since the former takes an argument but, for POSIX Yacc, the
3700 latter does not.
3701 (short_options): Let -W take an optional argument like --warnings.
3702 (getargs): Sort cases.
3703
37042008-02-28 Akim Demaille <demaille@gostai.com>
3705
3706 * doc/bison.texinfo: Fix a few typos.
3707
37082008-02-28 Akim Demaille <akim@epita.fr>
3709
3710 * doc/bison.texinfo (Bison Options): Document -W.
3711 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3712
37132008-02-28 Akim Demaille <akim@epita.fr>
3714
3715 * src/getargs.c (short_options): Split and sort for readability.
3716 -g and -x take optional arguments, just like their long options.
3717 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3718 understand.
3719 Fix the handling of $opt which resulted in all the argument to be
3720 considered as optional.
3721
37222008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3723
3724 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3725 say its interface is experimental.
3726 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3727 Java.
3728 (Bison Options): In the -L and --language entry, mention Java.
3729 (Java Bison Interface): Say the interface is experimental.
3730 * src/getargs.c (usage): Mention -L and --language.
3731
3732 * NEWS (2.3a+): Say the push parsing interface is experimental.
3733 * doc/bison.texinfo (Push Decl): Likewise.
3734 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3735 (Push Parser Function): Likewise.
3736 (Pull Parser Function): Likewise.
3737 (Parser Create Function): Likewise.
3738 (Parser Delete Function): Likewise.
3739 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3740 yypull_parse, and yypush_parse entries.
3741
3742 * NEWS (2.3a+): Mention XML support, and say the schema is
3743 experimental.
3744 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3745 * src/getargs.c (usage): Say the XML schema is experimental.
3746
3747 * NEWS (2.3a+): Say option instead of flag.
3748
37492008-02-21 Wojciech Polak <polak@gnu.org>
3750
3751 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3752 text.
3753
37542008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3755
3756 Fix impure push parser compile error reported by Bob Rossi at
3757 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3758 * data/yacc.c: Clean up whitespace in the output a little.
3759 (yypstate_allocated): Define for impure push parsers regardless of
3760 whether the pull interface is also requested.
3761 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3762 check impure push parsers without the pull interface.
3763
3764 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3765 yyerror takes arguments specified by %parse-param while yypstate_new
3766 does not.
3767 * doc/bison.texinfo (Parser Create Function): Document that
3768 yypstate_new returns 0 for multiple impure parser instances.
3769 * tests/push.at (Push Parsing: Multiple impure instances): Update
3770 expected stderr output.
3771
37722008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3773
3774 * runtime-po/POTFILES.in (push.c): Remove.
3775
37762008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3777
3778 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3779 * data/push.c: Rename to...
3780 * data/yacc.c: ... this, overwriting it.
3781 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3782 `%push-pull-parser' -> `%define api.push_pull "both"'.
3783 Remove old yacc.c tests, and update push.c tests to yacc.c.
3784
37852008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3786
3787 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3788 `"%code top" blocks' instead of `%code "top" blocks'.
3789 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3790 Clean up whitespace in the output a little.
3791
37922008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3793
3794 Fix documentation problems reported by Tim Josling at
3795 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3796 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3797 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3798 integers. Explain the effect of literal string aliases on error
3799 messages. Copy token 0 documentation from the C++ skeleton
3800 documentation.
3801
38022008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3803
3804 Accept a token number in a %left, %right, or %nonassoc for POSIX
3805 conformance. Reported by Tim Josling at
3806 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3807 * NEWS (2.3a+): Mention.
3808 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3809 and code numbers are treated by precedence declarations.
3810 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3811 of symbols.1.
3812 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3813 of symbol.
3814 (symbol.prec): New, just like symbol but allows INT.
3815 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3816 longer holds.
3817 * tests/regression.at (Token number in precedence declaration): New
3818 test case.
3819
38202008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3821
3822 DJGPP specific issues.
3823 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3824 be changed. Copyright timestamp adjusted.
3825 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3826 be changed. Copyright timestamp adjusted.
3827 * djgpp/config.site: Copyright timestamp adjusted.
3828 * djgpp/config_h.sed: Copyright timestamp adjusted.
3829 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3830 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3831 filename translation list.
3832 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3833 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3834 files shall be created. Before trying to use the temp dir where the
3835 environment variable points to check that the dir really exists. If
3836 not default to the cwd as temp dir. Copyright timestamp adjusted.
3837 * djgpp/subpipe.h: Copyright timestamp adjusted.
3838 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3839
38402008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3841
3842 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3843
38442008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3845
3846 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3847 Problem reported by Claudio Saavedra in
3848 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3849
38502008-01-05 Wojciech Polak <polak@gnu.org>
3851
3852 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3853 document's title with the input grammar file name.
3854
38552007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3856
3857 Automate regression testing of the XML/XSLT implementation. Discussed
3858 starting at
3859 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3860 * configure.ac (XSLTPROC): New substitution.
3861 * Makefile.am (maintainer-xml-check): New phony target invoking...
3862 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3863 invoking make maintainer-check with BISON_TEST_XML=1.
3864 * tests/atlocal.in (XSLTPROC): New.
3865 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3866 not to report reachable memory when Bison is expected to have a
3867 non-zero exit status and (2) to compare XML/XSLT output with --graph
3868 and --report=all output for every working grammar when
3869 BISON_TEST_XML=1.
3870 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3871 (AT_BISON_CHECK_XML): New.
3872 (AT_QUELL_VALGRIND): New.
3873 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3874 (AT_CHECK): ... don't redefine this since this was the old way to
3875 quell Valgrind.
3876 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3877 AT_BISON_CHECK invocations.
3878 * tests/c++.at: Likewise.
3879 * tests/calc.at: Likewise.
3880 * tests/conflicts.at: Likewise.
3881 * tests/cxx-type.at: Likewise.
3882 * tests/existing.at: Likewise.
3883 * tests/glr-regression.at: Likewise.
3884 * tests/headers.at: Likewise.
3885 * tests/input.at: Likewise.
3886 * tests/java.at: Likewise.
3887 * tests/output.at: Likewise.
3888 * tests/push.at: Likewise.
3889 * tests/reduce.at: Likewise.
3890 * tests/regression.at: Likewise.
3891 * tests/sets.at: Likewise.
3892 * tests/skeletons.at: Likewise.
3893 * tests/synclines.at: Likewise.
3894 * tests/torture.at: Likewise.
3895 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3896 tends to hang xsltproc.
3897 (Big horizontal): Likewise.
3898
38992007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3900
3901 In XML output, remove redundant class attribute on symbol element.
3902 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3903 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3904 look up a symbol to determine whether it's a nonterminal or terminal.
3905 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3906 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3907
3908 Add prec/assoc information to XML output.
3909 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3910 %prec, add a percent_prec attribute.
3911 * src/print-xml.c (print_grammar): For each terminal that has a
3912 precedence or associativity, add a prec or assoc attribute.
3913 (xml_indent): New.
3914 (xml_puts): Use xml_indent.
3915 (xml_printf): Use xml_indent.
3916 * src/print-xml.h (xml_indent): Prototype.
3917
3918 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3919 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3920
39212007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3922
3923 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3924 (bison:ruleByNumber): ... this for clarity.
3925 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3926 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3927 (xsl:template match="reduction"): Update.
3928 (xsl:template match="item"): Update.
3929 (xsl:template match="reduction"): Update.
3930
3931 In the XML output, don't print the list of rules where symbols appear.
3932 Compute it in XSLT instead. Discussed at
3933 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3934 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3935 (bison:ruleByRhs): New.
3936 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3937 bison:ruleByRhs.
3938 (xsl:template match="terminal/rule"): Remove.
3939 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3940 bison:ruleByRhs.
3941 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3942 Remove.
3943 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3944 bison:ruleByRhs and mode="number-link" for rule template.
3945 (xsl:template match="terminal/rule"): Remove.
3946 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3947 bison:ruleByRhs and mode="number-link" for rule template.
3948 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3949 Rewrite as...
3950 (xsl:template match="rule" mode="number-link"): ... this.
3951 * src/print-xml.c (print_grammar): Don't print the list of rules.
3952
39532007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3954
3955 Don't let --report affect XML output; always print all information.
3956 Discussed at
3957 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3958 * src/conflicts.c (log_resolution): Implement.
3959 * src/print-xml.c (print_core): Implement.
3960 (print_state): Implement.
3961 (print_xml): Implement.
3962
3963 * NEWS (2.3a+): Fix quotes.
3964 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3965 don't let %verbose clear the list specified by --report.
3966
39672007-11-26 Akim Demaille <akim@epita.fr>
3968
3969 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3970
39712007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3972
3973 In the XML output, list useless and unused symbols and rules with the
3974 useful ones and add a "usefulness" attribute. Discussed starting at
3975 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3976 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3977 (grammar_rules_print_xml): Print all rules instead of just those
3978 useful in the grammar, and add a "usefulness" attribute.
3979 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3980 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3981 (print_grammar): Print all nonterminals instead of just useful ones,
3982 and add a "usefulness" attribute to nonterminals and terminals.
3983 (print_xml): Don't print a separate "reductions" or
3984 "rules-useless-in-parser" element.
3985 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3986 (reduce_xml): Remove.
3987 (reduce_token_unused_in_grammar): New.
3988 (reduce_nonterminal_useless_in_grammar): New.
3989 * src/reduce.h (reduce_xml): Remove prototype.
3990 (reduce_token_unused_in_grammar): Add prototype.
3991 (reduce_nonterminal_useless_in_grammar): Add prototype.
3992 * data/xslt/xml2text.xsl: Update for XML changes.
3993 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3994 * tests/reduce.at (Useless Terminals): Update output.
3995 (Useless Rules): Update output.
3996 (Reduced Automaton): Update output.
3997
3998 Say "Terminals unused in grammar" instead of "Unused terminals".
3999 * NEWS (2.3a+): Update.
4000 * doc/bison.texinfo (Understanding): Update example output.
4001 * src/reduce.c (reduce_output): Implement.
4002 * data/xslt/xml2text.xsl: Implement.
4003 * data/xslt/xml2xhtml.xsl: Implement.
4004
40052007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
4006
4007 Accept --report-file=FILE to override the default `.output' filename.
4008 * NEWS (2.3a+): Mention.
4009 * doc/bison.texinfo (Bison Options): Add an entry.
4010 * src/files.c (compute_output_file_names): Don't override
4011 spec_verbose_file if already set.
4012 * src/getargs.c (usage): Document --report-file.
4013 (REPORT_FILE_OPTION): New anonymous enum member.
4014 (long_options): Add entry for it.
4015 (getargs): Add case for it setting spec_verbose_file.
4016
4017 * build-aux/cross-options.pl: Don't record a short option just because
4018 there's an arg.
4019 * doc/.cvsignore: Add yacc.1.
4020
40212007-11-14 Akim Demaille <akim@epita.fr>
4022
4023 * doc/yacc.1.in: New.
4024 * configure.ac, doc/Makefile.am: Adjust.
4025 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
4026 config.h symbol.
4027 Use AC_SUBST for assignments too.
4028 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
4029
40302007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4031
4032 * src/gram.c: Remove comments that duplicate comments in gram.h.
4033
4034 When reporting useless rules and nonterminals, say "useless in grammar"
4035 instead of "useless", and say "useless in parser" instead of "never
4036 reduced". Discussed starting at
4037 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
4038 * NEWS (2.3a+): Mention this change.
4039 * data/xslt/xml2text.xsl: Update output text and expected input XML
4040 element names to match changes below.
4041 * data/xslt/xml2xhtml.xsl: Likewise.
4042 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4043 Contents: "Rules useless in parser due to conflicts".
4044 * doc/bison.texinfo (Decl Summary): Reword a little.
4045 (Understanding): Update example output for changes below.
4046 * src/gram.c: (rule_useful_p): Rename to...
4047 (rule_useful_in_grammar_p): ... this.
4048 (rule_useless_p): Rename to...
4049 (rule_useless_in_grammar_p): ... this.
4050 (rule_never_reduced_p): Rename to...
4051 (rule_useless_in_parser_p): ... this.
4052 (grammar_rules_print): Update for renames.
4053 (grammar_rules_print_xml): Update for renames.
4054 (grammar_rules_never_reduced_report): Rename to...
4055 (grammar_rules_useless_report): ... this since it is used for either
4056 kind of useless rule.
4057 * src/gram.h: Reword comments and update function names in prototypes.
4058 * src/main.c (main): Say "rule useless in parser due to conflicts".
4059 * src/print-xml.c (print_rules_never_reduced): Rename to...
4060 (print_rules_useless_in_parser): ... this, and rename output XML
4061 element "rules-never-reduced" to "rules-useless-in-parser".
4062 (print_xml): Update for rename.
4063 * src/print.c (print_results): Say "Rules useless in parser due to
4064 conflicts".
4065 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4066 (nonterminals_reduce): Say "nonterminal useless in grammar".
4067 (reduce_output): Say "Nonterminals useless in grammar".
4068 Say "Rules useless in grammar".
4069 (reduce_xml): Rename output XML element "useless" to
4070 "useless-in-grammar".
4071 (reduce_print): Don't report the count of grammatically useless rules
4072 as "rules never reduced" just because %yacc is specified.
4073 In the correct report of this count, say nonterminal(s) and rule(s)
4074 "useless in grammar".
4075 * tests/conflicts.at (S/R in initial): Update expected output.
4076 (Defaulted Conflicted Reduction): Likewise.
4077 (Unreachable States After Conflict Resolution): Likewise.
4078 * tests/existing.at (GNU pic Grammar): Likewise.
4079 * tests/reduce.at (Useless Nonterminals): Likewise.
4080 (Useless Rules): Likewise.
4081 (Reduced Automaton): Likewise.
4082 (Underivable Rules): Likewise.
4083 (Empty Language): Likewise.
4084
40852007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4086
4087 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4088 here document and before the EOF so that BSD's implementation of Bourne
4089 shell doesn't parse the delimiter as part of the here document.
4090 * doc/.cvsignore: Add cross-options.texi.
4091 * src/getargs.c (usage): Add a blank line after the warning categories.
4092
40932007-11-08 Paolo Bonzini <bonzini@gnu.org>
4094
4095 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4096
40972007-11-05 Akim Demaille <akim@epita.fr>
4098
4099 Remove Id: from bison.1.
4100 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4101 (perl -0777 -pi -e 's/\.PP\nId): New.
4102 (.x.1): Use it to ignore the version control revision.
4103
41042007-11-05 Akim Demaille <demaille@gostai.com>
4105
4106 * build-aux/Makefile.am: Ship cross-options.pl.
4107 * doc/Makefile.am: Always refer to cross-options.texi with
4108 $(srcdir).
4109 (MAINTAINERCLEANFILES): Add it.
4110
41112007-11-04 Akim Demaille <demaille@gostai.com>
4112
4113 Generate the long/short option cross-table.
4114 * build-aux/cross-options.pl: New.
4115 * doc/Makefile.am (cross-options.texi): New.
4116 * doc/bison.texinfo: Use it.
4117
41182007-11-04 Akim Demaille <demaille@gostai.com>
4119
4120 Generate bison.1 using help2man.
4121 * doc/common.x, doc/bison.x: New.
4122 * doc/Makefile.am (bison.1, .x.1): New.
4123 The code is taken from autoconf-2.61/man/Makefile.am.
4124 * configure.ac: Look for help2man.
4125
41262007-11-04 Akim Demaille <demaille@gostai.com>
4127
4128 Complete --help.
4129 * src/getargs.c (usage): Document -W, make it clear that -d,
4130 -g and -x have optional arguments.
4131
41322007-11-04 Akim Demaille <demaille@gostai.com>
4133
4134 Find sha1sum when named gsha1sum.
4135 * bootstrap (find_tool): New.
4136 ($SHA1SUM): New.
4137
41382007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4139
4140 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
4141 at
4142 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
4143 * NEWS (2.3a+): Mention.
4144 * data/bison.m4 (b4_pure_if): Don't define it here.
4145 * data/c.m4 (b4_identification): Depend on individual skeletons to
4146 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
4147 values of the %define variables api.pure or api.push_pull. Define
4148 YYPURE, YYPUSH, and YYPULL accordingly.
4149 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
4150 glr.cc has already defined b4_pure_flag.
4151 * data/push.c: Define b4_pure_if based on `%define api.pure'.
4152 Remove YYPUSH and YYPULL since they're back in b4_identification again.
4153 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
4154 * doc/bison.texinfo (Pure Decl): Update.
4155 (Push Decl): Update.
4156 (Decl Summary): Add api.pure to %define entry.
4157 In %pure-parser entry, say it's deprecated and reference %define.
4158 (Pure Calling): Update.
4159 (Error Reporting): Update.
4160 (C++ Scanner Interface): Update.
4161 (How Can I Reset the Parser): Update.
4162 (Table of Symbols): In %pure-parser entry, say it's deprecated and
4163 reference %define.
4164 * src/getargs.c (pure_parser): Remove global variable.
4165 * src/getargs.h (pure_parser): Remove extern.
4166 * src/output.c (prepare): Don't define pure_flag muscle.
4167 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
4168 wrapper around `%define api.pure'.
4169 * tests/calc.at (Simple LALR Calculator): Update.
4170 (Simple GLR Calculator): Update.
4171 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
4172 Update.
4173 (GLR: Resolve ambiguity, pure, locations): Update.
4174 (GLR: Merge conflicting parses, pure, no locations): Update.
4175 (GLR: Merge conflicting parses, pure, locations): Update.
4176 * tests/glr-regression.at (Uninitialized location when reporting
4177 ambiguity): Update
4178 * tests/input.at (Unused %define api.pure): New test case.
4179 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
4180 AT_PURE_IF and AT_PURE_AND_LOC_IF.
4181 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4182
41832007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4184
4185 %define push_pull -> %define api.push_pull. Discussed starting at
4186 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
4187 * data/push.c: Expect the new name.
4188 * data/yacc.c: Likewise.
4189 * doc/bison.texinfo (Push Decl): Update.
4190 (Decl Summary): Update %define entry.
4191 (Push Parser Function): Update.
4192 (Pull Parser Function): Update.
4193 (Parser Create Function): Update.
4194 (Parser Delete Function): Update.
4195 * tests/calc.at (Simple LALR Calculator): Update.
4196 * tests/input.at (%define enum variables): Update.
4197 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4198 (Push Parsing: Multiple impure instances): Update.
4199 (Push Parsing: Unsupported Skeletons): Update.
4200 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
4201 (Exploding the Stack Size with Malloc): Update.
4202
4203 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
4204 other entries some.
4205
42062007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
4207
4208 For the XML output's terminal element, rename @number to @token-number,
4209 and add @symbol-number. In the nonterminal element, rename @number to
4210 @symbol-number. Discussed starting at
4211 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
4212 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
4213 renames.
4214 (xsl:template match="nonterminal"): Likewise.
4215 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
4216 (xsl:template match="nonterminal"): Likewise.
4217 * src/print-xml.c (print_grammar): Implement.
4218
42192007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4220
4221 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4222 2007-10-11 change, the child elements here are items not rules.
4223 (xsl:template match="item"): New.
4224 (xsl:template match="rule"): Update for new reduced itemset.
4225 (xsl:template match="point"): Remove.
4226 (xsl:template match="empty"): For consistency with --graph, don't
4227 output "/* empty */".
4228 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
4229 line-wrap, don't pass a negative value as first-line-length since this
4230 won't work with the following changes.
4231 (xsl:template name="line-wrap"): Simplify slightly.
4232 (xsl:template name="ws-search"): Eliminate recursion.
4233 * src/print_graph.c (print_core): Don't print a reduction's lookahead
4234 set next to an item whose dot is not at the end of the RHS even if it
4235 happens to be associated with the same rule.
4236
42372007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4238
4239 Add %define lr.keep_unreachable_states.
4240 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
4241 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
4242 * src/main.c (main): Implement it.
4243 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4244 Extend to test it, and fix a typo.
4245
42462007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4247
4248 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
4249 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
4250 the example .output text.
4251 * tests/regression.at (Extra lookahead sets in report): Improve wording
4252 of comments.
4253
42542007-10-17 Wojciech Polak <polak@gnu.org>
4255
4256 * src/print-xml.c (print_grammar): Renamed
4257 <terminal> and <nonterminal> attributes:
4258 "type" to "number" and "symbol" to "name".
4259 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
4260 Use new attribute names.
4261 (xsl:template match="nonterminal"): Likewise.
4262 * data/xslt/xml2xhtml.xsl: Likewise.
4263
42642007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
4265
4266 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
4267 (Option Cross Key): Likewise.
4268
4269 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
4270 next to an item whose dot is not at the end of the RHS even if it
4271 happens to be associated with the same rule.
4272 * src/print.c (print_core): Likewise.
4273 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4274 (Resolved SR Conflicts): Update output.
4275 * tests/regression.at (Extra lookahead sets in report): New test case.
4276
42772007-10-11 Wojciech Polak <polak@gnu.org>
4278
4279 * src/print-xml.c (print_core): Remove item set
4280 redundancy.
4281 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4282 Improve processing time. Suggested by Joel E. Denny.
4283 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4284 Write xsl:param "required" attribute as comment.
4285 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4286 (xsl:template match="rule"): Support new reduced itemset.
4287 (xsl:template match="point"): Remove.
4288 * data/xslt/xml2xhtml.xsl: Likewise.
4289
42902007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4291
4292 * src/getargs.c (version): Update copyright year.
4293
42942007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4295
4296 Make xml2dot.xsl and --graph produce the same output.
4297 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
4298 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4299 escaped later.
4300 (xsl:template name="output-node"): Use the new escape template instead
4301 of the string-replace template directly.
4302 (xsl:template name="output-edge"): Likewise.
4303 (xsl:template name="escape"): New, escapes backslashes and newlines in
4304 addition to quotation marks.
4305 * src/graphviz.c (start_graph, output_node, output_edge): Add
4306 whitespace to output for legibility.
4307
4308 Make xml2text.xsl and --report produce the same output, and remove the
4309 XML "conflicts" element since a conflict summary is easily extracted
4310 from the automaton.
4311 * data/xslt/bison.xsl: New.
4312 (xsl:template match="state" mode="bison:count-conflicts): New.
4313 * data/xslt/xml2text.xsl: Import bison.xsl.
4314 (xsl:template match="bison-xml-report"): Instead of styling the
4315 "conflicts" element, style the "automaton" element with mode
4316 "conflicts". Unlike the former, the latter lists S/R and R/R
4317 conflicts for a state on the same line.
4318 (xsl:template match="conflicts"): Remove.
4319 (xsl:template match="conflict"): Remove.
4320 (xsl:template match="terminal"): Line-wrap the list of rules in which
4321 the terminal is used.
4322 (xsl:template match="nonterminal"): Likewise for nonterminals.
4323 (xsl:template match="automaton" mode="conflicts"): New.
4324 (xsl:template match="state" mode="conflicts"): New.
4325 (xsl:template name="line-wrap"): New.
4326 (xsl:template name="ws-search"): New.
4327 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4328 (xsl:template match="bison-xml-report"): Instead of styling the
4329 "conflicts" element, style the "automaton" element with mode
4330 "conflicts."
4331 (xsl:template match="conflicts"): Remove.
4332 (xsl:template match="conflict"): Remove.
4333 (xsl:template match="automaton" mode="conflicts"): New.
4334 (xsl:template match="state" mode="conflicts): New.
4335 * src/conflicts.c (conflicts_output_xml): Remove.
4336 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4337 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4338 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4339 the corresponding XSLT is easier. Also, never wrap between a word and
4340 the comma that follows it.
4341
43422007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4343
4344 Improve C++ namespace support. Discussed starting at
4345 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4346 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4347 b4_namespace_close): New macros that interpret the %define variable
4348 "namespace" so its value can contain "::" to indicate nested
4349 namespaces.
4350 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4351 the above macros.
4352 * data/lalr1.cc (b4_namespace): Likewise.
4353 * data/location.cc (b4_namespace): Likewise.
4354 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4355 inside a new table in the general %define entry. Document `%define
4356 namespace' there as well. Point the %name-prefix entry to it since it
4357 explains it more completely in the case of C++.
4358 (C++ Bison Interface): Mention `%define namespace' instead of
4359 %name-prefix.
4360 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4361 entry suffices.
4362 * tests/c++.at (Relative namespace references): New test case.
4363 (Absolute namespace references): New test case.
4364 (Syntactically invalid namespace references): New test case.
4365 * tests/input.at (C++ namespace reference errors): New test case.
4366
43672007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4368
4369 Add syncline support and location accessor to internal %define
4370 interfaces.
4371 * data/bison.m4 (b4_percent_define_get_loc): New.
4372 (b4_percent_define_get_syncline): New.
4373 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4374 (b4_percent_define_default): Record defining location as line 1 rather
4375 than 0 for the sake of synchronizing #line's, and define
4376 b4_percent_define_syncline(VARIABLE).
4377 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4378 * src/muscle_tab.c (muscle_syncline_grow): New.
4379 (muscle_code_grow): Use muscle_syncline_grow.
4380 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4381 define b4_percent_define_syncline(VARIABLE).
4382 (muscle_percent_define_get_loc): New.
4383 (muscle_percent_define_get_syncline): New.
4384 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4385 remove some unused variables.
4386 (muscle_percent_define_default): Record defining location as line 1
4387 rather than 0 for the sake of synchronizing #line's, and define
4388 b4_percent_define_syncline(VARIABLE).
4389 (muscle_percent_define_check_values): Use
4390 muscle_percent_define_get_loc.
4391 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4392 (muscle_percent_define_get_syncline): Prototype.
4393 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4394 defaults): Update output for location change.
4395 (Complaining during macro argument expansion): Extend to test
4396 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4397
43982007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4399
4400 Fix some error-reporting macro bugs.
4401 * data/bison.m4 (b4_cat): New.
4402 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4403 to stdout so they don't become arguments to other macros. Update
4404 comments and add examples.
4405 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4406 add examples.
4407 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4408 after printing the error directive so that M4 doesn't report subsequent
4409 problems that are induced by this problem.
4410 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4411 instead of just in them. Recognize @\n in both places. Both expand to
4412 the empty string. Needed by b4_cat.
4413 * tests/skeletons.at (Complaining during macro argument expansion):
4414 New test case.
4415 (Fatal errors make M4 exit immediately): New test case.
4416
44172007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4418
4419 Implement --print-datadir.
4420 * src/getargs.c (usage): Mention.
4421 (PRINT_DATADIR_OPTION): New anonymous enum member.
4422 (long_options): Add entry for it.
4423 (getargs): Add case for it calling compute_pkgdatadir.
4424 * src/output.c (output_skeleton): Encapsulate data directory
4425 computation from here...
4426 (prepare): ... and from here...
4427 (compute_pkgdatadir): ... into this new function.
4428 * src/output.h (compute_pkgdatadir): Prototype.
4429
44302007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4431
4432 * src/print-xml.c (escape_bufs): New static global variable
4433 replacing...
4434 (xml_escape_n): ... the static local variable buf here.
4435 (print_xml): Free memory for escape_bufs.
4436 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4437
44382007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4439
4440 Replace `%push-parser' and `%push-pull-parser' with
4441 `%define push_pull "push"' and `%define push_pull "both"'.
4442 `%define push_pull "pull"' is the default.
4443 * doc/bison.texinfo (Push Decl, Push Parser Function,
4444 Pull Parser Function, Parser Create Function, Parser Delete Function):
4445 Update declarations.
4446 (Decl Summary, Table of Symbols): Replace %push-parser and
4447 %push-pull-parser entries with a %define push_pull entry.
4448 * data/bison.m4 (b4_percent_define_check_values): New macro.
4449 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4450 definitions...
4451 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4452 definitions...
4453 * data/push.c: ... to here and compute them from the value of the
4454 %define variable push_pull.
4455 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4456 parsing requests here...
4457 * data/yacc.c: ... hack this to switch to push.c any time
4458 b4_use_push_pull_flag or the %define variable push_pull is set. This
4459 will go away when we mv push.c yacc.c.
4460 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4461 push parsing is not supported since unused %define variables are
4462 reported anyway.
4463 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4464 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4465 comments for consistency with b4_percent_define_check_values.
4466 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4467 muscles.
4468 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4469 Remove.
4470 (prologue_declaration): Remove %push-parser and %push-pull-parser
4471 rules.
4472 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4473 * tests/calc.at: Update declarations.
4474 * tests/input.at (%define enum variables): New test case.
4475 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4476 declaration.
4477 (Push Parsing: Multiple impure instances): Update declaration.
4478 (Push Parsing: Unsupported Skeletons): New test case.
4479 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4480 declaration.
4481 (Exploding the Stack Size with Malloc): Update declaration.
4482
44832007-09-24 Wojciech Polak <polak@gnu.org>
4484
4485 Add XSLT transformations.
4486
4487 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4488 * data/xslt/xml2text.xsl: Transform XML into plain text.
4489 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4490 * data/Makefile.am (xsltdir): New variable.
4491 (dist_xslt_DATA): Add xslt/*.xsl files.
4492
44932007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4494
4495 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4496 Problem reported by Wojciech Polak.
4497 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4498 (xml_printf): Undo change I made on 21 September; that is,
4499 indent 2 spaces, not 1.
4500
45012007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4502
4503 Pacify ./configure --enable-gcc-warnings.
4504 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4505 `char const *' instead of `char *'.
4506 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4507 local variable `sep'.
4508
45092007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4510
4511 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4512 elsewhere.
4513 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4514 (xml_printf): Indent just 1 space for level.
4515 (e_char, xlate_char): Remove.
4516 (xml_escape_string): Rewrite to avoid undefined behavior (used
4517 storage that was freed from the stack).
4518 (xml_escape_n): Don't bother checking for subscript error.
4519
45202007-09-21 Wojciech Polak <polak@gnu.org>
4521
4522 Add Bison XML Automaton Report.
4523
4524 Add support for an -x option to generate an XML report.
4525 It is not documented yet.
4526 * src/print-xml.c: New file.
4527 * src/print-xml.h: Likewise.
4528 * lib/timevar.def (TV_XML): New var.
4529 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4530 * src/conflicts.c: Include print-xml.h.
4531 (solved_conflicts_xml_obstack): New var.
4532 (log_resolution, conflicts_solve, conflicts_free):
4533 Add support for XML report.
4534 (conflicts_output_val): New function.
4535 * src/conflicts.h (conflicts_output_val): New decl.
4536 * src/files.c (spec_xml_file): New var.
4537 (compute_output_file_names, output_file_names_free): Add XML support.
4538 * src/files.h (spec_xml_file): New decl.
4539 * src/getargs.c (xml_flag): New var.
4540 (usage, short_options, long_options, getargs): Add XML support.
4541 * src/getargs.h (xml_flag): New decl.
4542 * src/gram.c: Include print-xml.h.
4543 (rule_lhs_print_xml, rule_rhs_print_xml):
4544 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4545 New functions.
4546 * src/gram.h: Declare external ones.
4547 * src/main.c: Include print-xml.h.
4548 (main): Add XML support.
4549 * src/reduce.c: Include print-xml.h.
4550 (reduce_xml): New function.
4551 * src/reduce.h: Declare it.
4552 * src/state.c: Include print-xml.h.
4553 (state_new): Add XML support.
4554 (state_rule_lookahead_tokens_print_xml): New function.
4555 * src/state.h: Declare it.
4556 (struct state): New member solved_conflicts_xml.
4557 * src/symtab.c (symbol_class_get_string): New function.
4558 * src/symtab.h: Declare it.
4559
45602007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4561
4562 * GNUmakefile: Switch to coreutils's version.
4563 * bootstrap: Likewise.
4564 * Makefile.cfg: Adjust to new GNUmakefile.
4565 * README-hacking: Likewise.
4566
4567 Import from gnulib:
4568
4569 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4570 Bruno Haible <bruno@clisp.org>
4571
4572 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4573 and is a script that invokes bison. Tighten the code. Add comments.
4574
45752007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4576
4577 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4578 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4579 * doc/bison.texinfo (Decl Summary): Fix.
4580 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4581 * tests/input.at (Boolean %define variables): Update output.
4582 * tests/skeletons.at (%define boolean variables: invalid skeleton
4583 defaults): Rename to...
4584 (%define Boolean variables: invalid skeleton defaults): ... this and
4585 update output.
4586
45872007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4588
4589 In impure push mode, don't allow more than one yypstate to be allocated
4590 since multiple impure parsers would corrupt yynerrs.
4591 * data/push.c (yypstate_allocated): New static global variable
4592 initialized to 0.
4593 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4594 exhaustion if yypstate_allocated is 1, but still return 2.
4595 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4596 already 1. Otherwise, set it to 1.
4597 (yypstate_delete): Set it to 0.
4598 * tests/push.at (Push Parsing: Multiple impure instances): New test
4599 case.
4600
46012007-08-17 Bob Rossi <bob@brasko.net>
4602
4603 * doc/bison.texinfo (Push Decl): Document the push parser.
4604 (Table of Symbols): Ditto.
4605 (Pure Decl): Ditto.
4606 (Decl Summary): Ditto.
4607 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4608 Parser Create Function, Parser Delete Function):
4609 Add new push parser symbols.
4610 (Table of Symbols): Document push-parser, push-pull-parser,
4611 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4612
46132007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4614
4615 Update to GPLv3.
4616 * doc/gpl-3.0.texi: New file.
4617 * doc/gpl.texi: Remove.
4618 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4619 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4620 * README-hacking, TODO, bootstrap, bootstrap.conf:
4621 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4622 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4623 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4624 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4625 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4626 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4627 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4628 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4629 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4630 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4631 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4632 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4633 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4634 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4635 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4636 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4637 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4638 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4639 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4640 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4641 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4642 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4643 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4644 * src/complain.c, src/complain.h, src/conflicts.c:
4645 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4646 * src/files.h, src/flex-scanner.h, src/getargs.c:
4647 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4648 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4649 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4650 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4651 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4652 * src/print.c, src/print.h, src/print_graph.c:
4653 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4654 * src/reduce.h, src/relation.c, src/relation.h:
4655 * src/revision.h, src/scan-code.h, src/scan-code.l:
4656 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4657 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4658 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4659 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4660 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4661 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4662 * tests/existing.at, tests/glr-regression.at:
4663 * tests/headers.at, tests/input.at, tests/java.at:
4664 * tests/local.at, tests/output.at, tests/push.at:
4665 * tests/reduce.at, tests/regression.at, tests/sets.at:
4666 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4667 * tests/torture.at:
4668 Update to GPLv3.
4669
46702007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4671
4672 Get rid of broken %no-parser, -n, and --no-parser implementation and
4673 documentation.
4674 * TODO: Don't mention them.
4675 * doc/bison.1: Likewise.
4676 * doc/bison.texinfo (Decl Summary): Likewise.
4677 (Bison Options): Likewise.
4678 (Option Cross Key): Likewise.
4679 * src/getargs.c (no_parser_flag): Remove global variable.
4680 (usage): Don't print description of -n and --no-parser.
4681 (long_options): Remove --no-parser entry here.
4682 (getargs): Remove -n case in the switch here.
4683 * src/getargs.h (no_parser_flag): Remove extern.
4684 * tests/regression.at (Web2c Actions): Remove comment that mentions
4685 --no-parser.
4686
46872007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4688
4689 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4690 name user variables starting with `yy'. Just pass NULL instead of a
4691 dummy local &yylval to yypush_parse.
4692 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4693 starting with `yy'.
4694
46952007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4696
4697 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4698 true since it's then always used regardless of whether yyoverflow is
4699 defined. Reported by Christian Burger at
4700 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4701 * THANKS: Add Christian Burger.
4702
4703 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4704 node names: say "Decl Summary" not "Bison Declaration Summary".
4705
47062007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4707
4708 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4709 determine whether this function has already complained about an invalid
4710 value for a %define boolean variable, don't check whether Bison has
4711 ever examined the value. As written, the check was a tautology.
4712 Instead, record and check for this complaint using a separate muscle.
4713
47142007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4715
4716 Fix push parsing memory leak reported by Brandon Lucia at
4717 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4718 * THANKS: Add Brandon Lucia.
4719 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4720 but the parse never completed and thus freed it.
4721 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4722 * tests/testsuite.at: Include push.at.
4723 * test/push.at: New.
4724 (Push Parsing: Memory Leak for Early Deletion): New test case.
4725
47262007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4727
4728 Improve handling of multiple S/R conflicts in the same state and of S/R
4729 conflicts involving multiple reductions.
4730 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4731 set for a state here or Bison will abort if it is reassigned on a
4732 later conflicted reduction in the same state.
4733 Similarly, don't finalize and assign the solved conflicts report here
4734 or it will be lost if it is reassigned on a later conflicted reduction
4735 in the same state.
4736 (set_conflicts): Instead, assign them both here after all S/R conflicts
4737 in the state have been fully examined.
4738 * src/print.c (shift_set): Rename to...
4739 (no_reduce_set): ... this.
4740 (print_reductions): Update for rename, and add %nonassoc error action
4741 tokens to no_reduce_set so that, when printing the first remaining
4742 reduction on an error action token, the reduction is enclosed in
4743 brackets.
4744 (print_results): Update for rename.
4745 * tests/conflicts.at (Solved conflicts report for multiple reductions
4746 in a state): New test case.
4747 (%nonassoc error actions for multiple reductions in a state): New test
4748 case.
4749
4750 * src/main.c (main): Don't depend on C99 features.
4751
47522007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4753
4754 * build-aux/.cvsignore: Add compile.
4755 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4756 uniwidth.
4757
47582007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4759
4760 * bootstrap (slurp): Create target directories that don't exist.
4761 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4762
47632007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4764
4765 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4766 than item number.
4767 * closure.c (closure): Likewise.
4768 * state.h (reductions): Comment sorting of rules.
4769 (state): Comment sorting of items.
4770
47712007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4772
4773 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4774 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4775 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4776 definition in order to avoid Gnulib headers since we don't use config.h
4777 here.
4778 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4779 rather than AT_DATA so that config.h is included.
4780
47812007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4782
4783 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4784 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4785 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4786 and so that YYFPRINTF is guaranteed to be defined here.
4787
47882007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4789
4790 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4791 with...
4792 (muscle_percent_define_check_values): ... this more helpful function.
4793 Again, it's not used yet, but it will be.
4794 * src/muscle_tab.h: Likewise.
4795
4796 Improve some comments in parser table construction.
4797 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4798 (generate_states): Don't mention ruleset, which is internal to closure.
4799 * src/closure.c (closure): Explain sorting of core and itemset, which
4800 is required for this function to behave correctly.
4801 * src/closure.h (closure): Mention sorting.
4802
48032007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4804
4805 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4806 move the check for disabled transitions to an aver since conflict
4807 resolution hasn't happened yet.
4808
4809 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4810 labels a state as inconsistent just because it has error transitions.
4811 The original form of this check appeared in revision 1.1 of lalr.c,
4812 which was committed on 1991-12-21. Now (at least), changing the
4813 consistency label on such a state appears to have no useful effect in
4814 any of the places it is examined, which I enumerate below. The key
4815 point to understanding each item in this enumeration is that a state
4816 with an error transition is labelled consistent in the first place only
4817 if it has no rules, so the check cannot matter for states that have
4818 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4819 to try to identify its conflicts, and a state must have *rules* to have
4820 conflicts. (2) Labelling a state as inconsistent will affect how
4821 action_row sets the default *rule* for the state. (3) Labelling a
4822 state as inconsistent will cause build_relations to add lookback edges
4823 to *rules* in that state.
4824 * src/state.h (struct state): Word the comment for member consistent
4825 more carefully.
4826
48272007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4828
4829 Don't depend on C99 features.
4830 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4831 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4832 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4833 * src/state.c (state_mark_reachable_states): Fix for-loop.
4834 (state_remove_unreachable_states): Fix for-loop.
4835
4836 Don't widen struct state with member reachable just to temporarily
4837 record reachability. Instead, use a local bitset.
4838 * src/state.h (struct state): Remove member.
4839 * src/state.c (state_new): Don't initialize it.
4840 (state_mark_reachable_states): Rename to...
4841 (state_record_reachable_states): ... this, and use bitset.
4842 (state_remove_unreachable_states): Use bitset.
4843
48442007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4845
4846 * src/Makefile.am (yacc): Quote target action commands properly so
4847 that the yacc script isn't corrupt. Reported by Hans Aberg at
4848 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4849
4850 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4851 the case of pure parsers. Reported by Frans Englich at
4852 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4853 * THANKS: Add Frans Englich.
4854
4855 * NEWS (2.3a+): In the %code entry, reference section `Bison
4856 Declaration Summary' from the manual now since the %code summary has
4857 moved there.
4858 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4859 in the rules section must be terminated by semicolons.
4860
48612007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4862
4863 Extend the front-end API for %define variables to more completely
4864 mirror the back-end. This will be useful in the future.
4865 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4866 Update comments to mention the new front-end counterparts of these
4867 macros.
4868 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4869 for muscle_string_decode and muscle_location_decode.
4870 (muscle_string_decode): New static function.
4871 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4872 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4873 functions.
4874 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4875 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4876 implementation more closely.
4877 (muscle_percent_define_invalid_value): New function.
4878 * src/muscle_tab.h (muscle_percent_define_get,
4879 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4880 Prototype.
4881
48822007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4883
4884 * NEWS (2.3a+): Mention yesterday's state-removal change.
4885 (2.3a): Remove the %language entry, which was added after 2.3a.
4886 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4887 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4888 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4889 tests/existing.at: Update copyright date.
4890
48912007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4892
4893 If conflict resolution makes states unreachable, remove those states,
4894 report rules that are then unused, and don't report conflicts in those
4895 states.
4896 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4897 New global function.
4898 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4899 function.
4900 * src/main.c (main): After conflict resolution, remove the unreachable
4901 states and update all data structures that reference states by number.
4902 * src/state.c (state_new): Initialize each state's reachable member to
4903 false.
4904 (state_mark_reachable_states): New static function.
4905 (state_remove_unreachable_states): New global function.
4906 * src/state.h (struct state): Add member bool reachable.
4907 (state_remove_unreachable_states): Prototype.
4908 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4909 New test case.
4910 * tests/existing.at (GNU pic Grammar): Update test case output now that
4911 an unused rule is discovered.
4912
49132007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4914
4915 Minor code cleanup in parser table construction.
4916 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4917 (new_itemsets, save_reductions): Update for rename to nitemset.
4918 * src/closure.c (nritemset): Rename to...
4919 (nitemset): ... this since the "r" appears to meaningless and isn't
4920 used in the comments.
4921 (closure): Update for rename.
4922 * src/closure.h (nritemset): Update extern to...
4923 (nitemset): ... this.
4924 * src/lalr.c (LA): Fix a typo in comments.
4925 * src/print.c (print_core): Update for rename to nitemset.
4926 * src/print_graph.c (print_graph): Likewise.
4927 * src/state.h: Fix some typos in header comments.
4928
49292007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4930
4931 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4932 still sticks to ASCII. Sorry!
4933
4934 * README-hacking: New file, taken mostly from coreutils, with changes
4935 for Bison. Contains much of the contents of:
4936 * README-cvs: Remove.
4937 * bootstrap: Sync from gnulib.
4938 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4939 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4940
49412007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4942
4943 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4944 Setzer.
4945 (Java Differences): Fix some typos.
4946 * THANKS: Add Sebastian Setzer.
4947
49482007-03-07 Paolo Bonzini <bonzini@gnu.org>
4949
4950 * data/java.m4 (b4_single_class_if): Remove.
4951 (b4_abstract_if): Look at "%define abstract".
4952 (b4_lexer_if): New.
4953 (b4_union_name): Rename...
4954 (b4_yystype): ... to this. Map to "%define stype".
4955 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4956 b4_maybe_throws): Fix quoting.
4957 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4958 * data/lalr1.java (Lexer interface): Always define.
4959 (Lexer interface within parser class): Remove.
4960 (YYLexer class): New, used when "%code lexer" is present.
4961 (constructor): When "%code lexer" is used, pass %lex-param
4962 to the lexer constructor.
4963 (yylex, yyparse): Remove %lex-param from method invocations
4964 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4965
4966 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4967 abstract". Rename "%define union_name" to "%define stype".
4968 Rename method names according to previous patch.
4969 (Java Scanner Interface): Describe "%code lexer" instead of
4970 "%pure-parser" and "%define single_class".
4971 (Java Differences): Mention "%code lexer".
4972
4973 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4974 Include scanner here, using macros from tests/local.at.
4975 (AT_DATA_CALC_Y): Remove final argument.
4976 (_AT_CHECK_JAVA_CALC): Likewise.
4977 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4978 of %locations and %error-verbose.
4979 (main): Test with and without %lex-param.
4980 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4981 (AT_BISON_OPTION_POPDEFS): Pop it.
4982
49832007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4984
4985 DJGPP spefic issue. Inhibit the use of disallowed characters for
4986 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4987 and concern testsuite case 46.
4988 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4989 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4990 * djgpp/config.bat: Inhibit the use of disallowed characters.
4991
49922007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4993
4994 Miscellaneous %define and %code cleanup.
4995 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4996 values are interpreted.
4997 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4998 documentation a little more.
4999 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
5000 muscle_percent_define_insert, muscle_percent_code_grow): New
5001 functions/macros.
5002 * src/muscle_tab.h (muscle_percent_define_insert,
5003 muscle_percent_code_grow): Prototype.
5004 * src/parse-gram.y (prologue_declaration): Use
5005 muscle_percent_define_insert and muscle_percent_code_grow when parsing
5006 %define and %code directives.
5007
5008 Make it easy to share %define boolean variables between the front-end
5009 and back-end. Though not used yet, this will be useful in the future.
5010 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
5011 Bison uses of names rather than just skeleton uses of names.
5012 (b4_percent_define_get, b4_percent_define_ifdef): Rename
5013 b4_percent_define_skeleton_variables(VARIABLE) to
5014 b4_percent_define_bison_variables(VARIABLE).
5015 (b4_percent_code_get, b4_percent_code_ifdef): Rename
5016 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
5017 b4_percent_code_bison_qualifiers(QUALIFIER).
5018 (b4_check_user_names_wrap): Update for renames.
5019 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
5020 muscle_percent_define_default): New functions mimicking
5021 b4_percent_define_flag_if and b4_percent_define_default.
5022
5023 For %define variables, report locations for invalid values and
5024 redefinitions.
5025 * data/bison.m4 (b4_percent_define_flag_if): Read
5026 b4_percent_define_loc(VARIABLE) to report the location of an invalid
5027 value for VARIABLE.
5028 (b4_percent_define_default): Save a special location in
5029 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
5030 must later be reported as invalid.
5031 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
5032 functions.
5033 (muscle_percent_define_insert): Record the location of VARIABLE in
5034 muscle percent_define_loc(VARIABLE), and use it to report the previous
5035 location for a redefinition.
5036 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
5037 (muscle_percent_define_default): Update like b4_percent_define_default.
5038 (muscle_grow_user_name_list): Rename to...
5039 (muscle_user_name_list_grow): ... this for consistency and use
5040 muscle_location_grow.
5041 * src/muscle_tab.h (muscle_location_grow): Prototype.
5042 * tests/input.at (%define errors): Update expected output.
5043 * tests/skeletons.at (%define boolean variables: invalid skeleton
5044 defaults): New test case.
5045
50462007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5047
5048 * src/print.c (lookahead_set, state_default_rule): Remove.
5049 (print_reductions): Replace state_default_rule invocation with
5050 equivalent use of yydefact, which was computed in token_actions in
5051 tables.c.
5052 (print_results): Don't allocate lookahead_set.
5053
50542007-02-27 Paolo Bonzini <bonzini@gnu.org>
5055
5056 * data/lalr1.java: Prefix all private members with yy.
5057
50582007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5059
5060 Use YYFPRINTF instead of fprintf where appropriate. Reported by
5061 Sebastien Fricker at
5062 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
5063 * THANKS: Add Sebastien Fricker.
5064 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5065 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5066 accept a variable number of arguments.
5067
50682007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5069
5070 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5071
50722007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5073
5074 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5075 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5076 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5077
50782007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5079
5080 Undo my 2007-02-07 change, switching back to the c-strcase module
5081 introduced in the 2007-02-03 change. Bruno Haible reported that
5082 the 2007-02-07 change would be dangerous in Turkish if we add a
5083 language whose name contains "i", since "i" is not lowercase "I"
5084 in Turkish.
5085 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5086 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5087 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5088 * m4/.cvsignore: Remove strcase.m4.
5089 * src/getargs.c: Revert 2007-02-07 change, as follows.
5090 Include c-strcase.h.
5091 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5092
50932007-02-11 Bruno Haible <bruno@clisp.org>
5094
5095 Enable the Java related testsuite tests when the only Java compiler
5096 found is a gcj < 4.3. Discussed at
5097 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5098 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5099
51002007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5101
5102 * data/Makefile.am: Update copyright date.
5103 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5104 yypstate_new returns NULL.
5105 (yypstate_new): Return NULL if malloc does.
5106 * src/reader.c (packgram): Move translation of rule actions from the
5107 beginning of packgram to...
5108 (check_and_convert_grammar): ... here right before packgram is invoked
5109 so it's easier to write more complete comments, and remove redundant
5110 code.
5111
51122007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5113
5114 As in semantic actions, make @$ in %initial-action, %destructor, and
5115 %printer imply %locations.
5116 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5117 scanning @$.
5118 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5119 (@$ in %initial-action implies %locations,
5120 @$ in %destructor implies %locations,
5121 @$ in %printer implies %locations): ... these new test cases.
5122
51232007-02-07 Paul Eggert <eggert@cs.ucla.edu>
5124
5125 Undo most of the 2007-02-03 change, switching to the strcase module
5126 now that gnulib strcase has been fixed.
5127 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
5128 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
5129 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
5130 * m4/.cvsignore: Add strcase.m4.
5131 * src/getargs.c: Revert 2007-02-03 change, as follows.
5132 Don't include c-strcase.h.
5133 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
5134 strcasecmp has "unspecified behavior" outside the POSIX locale,
5135 but it works fine in practice if at least one argument is ASCII,
5136 as is the case in Bison.
5137
51382007-02-07 Paolo Bonzini <bonzini@gnu.org>
5139
5140 * tests/java.at: Skip tests if only one of javac/java is present.
5141 Reported by Joel E. Denny.
5142 * tests/atlocal.in: Adjust copyright years.
5143
51442007-02-05 Paolo Bonzini <bonzini@gnu.org>
5145
5146 * data/lalr1.java (Stack): Work around old verifiers that disallow
5147 access to the private fields of an inner class, from the outer class.
5148 We can make Stack's fields public because user code doesn't have access
5149 to the instance of Stack used by parse(). Reported by Paul Eggert.
5150
51512007-02-03 Paul Eggert <eggert@cs.ucla.edu>
5152
5153 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
5154 the right spot for these files?
5155 * bootstrap.conf (gnulib_modules): Add c-strcase.
5156 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
5157 c-strncasecmp.c.
5158 * src/getargs.c: Include c-strcase.h.
5159 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
5160 to avoid unspecified behavior.
5161
51622007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
5163
5164 * doc/bison.texinfo (Decl Summary): Correct typo.
5165
51662007-01-30 Paolo Bonzini <bonzini@gnu.org>
5167
5168 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
5169 Complain if the value does not match empty, "true" or "false".
5170 * data/c++.m4: Adjust default definitions of %define variables.
5171 * data/java.m4: Adjust default definitions of %define variables.
5172 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
5173 to above behavior.
5174 * tests/input.at (Boolean %define variables): Test new behavior.
5175
51762007-01-29 Paolo Bonzini <bonzini@gnu.org>
5177
5178 * NEWS: Mention java.
5179 * TODO: Remove things that are done.
5180 * bootstrap.conf: Add javacomp-script and javaexec-script.
5181 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
5182
5183 * data/Makefile.am: Add new files.
5184 * data/java-skel.m4: New.
5185 * data/java.m4: New.
5186 * data/lalr1.java: New.
5187
5188 * doc/bison.texinfo: Put "A Complete C++ Example" under
5189 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
5190 under Other Languages.
5191
5192 * src/getargs.c (valid_languages): Add Java.
5193 * src/getargs.h (struct bison_language): Update size of string fields.
5194
5195 * tests/Makefile.am: Add java.at.
5196 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
5197 * tests/java.at: New.
5198 * tests/testsuite.at: Include it.
5199
52002007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
5201
5202 Clean up.
5203 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
5204 at_directive_argv arguments so these no longer have to be global
5205 variables. Also, update the implementation for the following changes.
5206 (fail_for_at_directive_too_many_args,
5207 fail_for_at_directive_too_few_args): Add at_directive_name argument.
5208 (at_directive_name): Remove as at_directive_argv[0] will be used for
5209 this now.
5210 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
5211 for the directive name.
5212 (at_directive_argc, at_directive_argv): Make these local within
5213 skel_lex instead of global.
5214 (INITIAL): Update directive start action for above changes.
5215 (SC_AT_DIRECTIVE_ARG): Rename to...
5216 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
5217 (SC_AT_DIRECTIVE_SKIP_WS): Update.
5218 (scan_skel): Move yylex_destroy to...
5219 (skel_scanner_free): ... here.
5220 * tests/skeletons.at (installed skeleton file name): Rename to...
5221 (installed skeleton file names): ... this.
5222
52232007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
5224
5225 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5226 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
5227 Summary" not "Directives".
5228 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
5229 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
5230 since the former is now the more complete one.
5231 (Prologue Alternatives): Likewise and do the same for %defines.
5232 (Table of Symbols): Add summary of %code, add summary of %define, and
5233 move full %code documentation to...
5234 (Decl Summary): ... here for consistency with other entries in these
5235 sections.
5236 Move %define entry in order to keep this list alphabetized.
5237 Reword %define entry a little to put less emphasis on the skeleton
5238 concept, which most users shouldn't have to think about.
5239
52402007-01-26 Paul Eggert <eggert@cs.ucla.edu>
5241
5242 Adjust to recent gnulib changes.
5243 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
5244 Add string.h, string_.h, unistd_.h, wchar_.h.
5245 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
5246 * src/system.h: Don't include <stpcpy.h>; this is now done by
5247 <string.h>.
5248
52492007-01-23 Paolo Bonzini <bonzini@gnu.org>
5250
5251 Simplify implementation of unqualified %code, implement macros for
5252 uniform treatment of boolean %define flags. Document %define.
5253 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
5254 b4_percent_code_ifdef): New.
5255 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
5256 * data/c++.m4: Define default value for global_tokens_and_yystype.
5257 * data/glr.cc: Likewise.
5258 * data/location.cc: Use b4_percent_define_flag_if.
5259
5260 * doc/bison.texinfo (Decl Summary): Document %define.
5261
5262 * src/parse-gram.y (Unqualified %code): Change muscle name to
5263 b4_percent_code().
5264 (content.opt): Default to empty.
5265
52662007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5267
5268 Implement support for relative and absolute skeleton file names.
5269 Discussed starting at
5270 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5271 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5272 (Bison Options): Document in --skeleton entry.
5273 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5274 full_skeleton can't necessarily hold all of pkgdatadir.
5275 If the specified skeleton file name contains a `/', don't prepend
5276 pkgdatadir.
5277 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5278 file name contains a `/', prepend the grammar file directory.
5279 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5280 * skeletons.at: New file.
5281 (relative skeleton file names): New test case.
5282 (installed skeleton file names): New test case.
5283 * tests/testsuite.at: Include skeletons.at.
5284
5285 * bootstrap: Update copyright to 2007.
5286
52872007-01-17 Paolo Bonzini <bonzini@gnu.org>
5288
5289 * bootstrap: Remove occurrences of .#bootmp from the files.
5290
52912007-01-17 Akim Demaille <akim@epita.fr>
5292
5293 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5294 nonterminals.
5295 Use per-type %printer.
5296
52972007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5298
5299 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5300 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5301 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5302 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5303 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5304 tests/glr-regression.at, tests/input.at, tests/local.at,
5305 tests/output.at, tests/torture.at: Update copyright to 2007.
5306
53072007-01-16 Akim Demaille <akim@epita.fr>
5308
5309 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5310 error code.
5311 (Calc++ Scanner): Exit with failure if we can't open the input
5312 file.
5313 Accept "-" standing for stdin.
5314 (Calc++ Top Level): Print the result only if the parsing was
5315 successful.
5316
53172007-01-16 Akim Demaille <akim@epita.fr>
5318
5319 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5320
53212007-01-15 Paolo Bonzini <bonzini@gnu.org>
5322 and Joel E. Denny <jdenny@ces.clemson.edu>
5323
5324 Clean up %define and %code implementation in M4 some. Most
5325 importantly, rename all related macros to be in the b4_percent_define
5326 and b4_percent_code namespaces. Also, complete support for `.' in
5327 %define variable names and %code qualifiers.
5328 * data/bison.m4 (b4_check_user_names): Check for special
5329 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5330 m4_foreach loops.
5331 (b4_get_percent_define, b4_get_percent_code): Rename to...
5332 (b4_percent_define_get, b4_percent_code_get): ... these.
5333 Extend documentation with examples.
5334 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5335 b4_percent_define_skeleton_variables and
5336 b4_percent_code_skeleton_qualifiers.
5337 Expect any value for the %define variable `foo' to be stored in the
5338 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5339 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5340 expect any unqualified %code blocks to be stored in a macro named
5341 `b4_percent_code_unqualified'.
5342 Use m4_indir so that %define variable names and %code qualifiers can
5343 contain `.', which is allowed by the grammar parser.
5344 (b4_percent_define_default): New macro to set a default value for a
5345 %define variable.
5346 (m4_wrap): Update wrapped code, and fix some underquoting.
5347 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5348 Expect grammar uses of %define variables and %code qualifiers to be
5349 defined in b4_percent_define_user_variables and
5350 b4_percent_code_user_qualifiers.
5351 * data/c++.m4: Use b4_percent_define_default rather than
5352 m4_define_default. Fix some underquoting. Skeleton usage of %define
5353 variable define_location_comparison now implies skeleton usage of
5354 %define variable filename_type.
5355 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5356 data/push.c, data/yacc.c: Update macro names.
5357 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5358 muscle names.
5359
53602007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5361
5362 DJGPP specific issues.
5363
5364 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5365 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5366
53672007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5368
5369 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5370 run parsers in all tests so that Valgrind is invoked during
5371 maintainer-check-valgrind.
5372 (Duplicate representation of merged trees): Free all semantic values.
5373 (Duplicated user destructor for lookahead): Likewise.
5374
53752007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5376
5377 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5378 command-line prefix.
5379 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5380 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5381 miss Valgrind messages.
5382 (Exploding the Stack Size with Malloc): Likewise.
5383
53842007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5385
5386 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5387 locals. Reported by Juan Manuel Guerrero at
5388 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5389 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5390 Fix some indentation also.
5391 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5392 explaining this issue.
5393
53942007-01-09 Paolo Bonzini <bonzini@gnu.org>
5395 and Joel E. Denny <jdenny@ces.clemson.edu>
5396
5397 Simplify union and prologue handling, and escape union and lex/parse
5398 params with digraphs.
5399 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5400 values to the empty string since these are no longer guaranteed
5401 initialized by the front-end.
5402 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5403 braces around b4_user_stype since this is no longer done by the
5404 front-end.
5405 * src/files.c, src/files.h (pre_prologue_obstack,
5406 post_prologue_obstack): Remove.
5407 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5408 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5409 with digraphs. This fixes lex params and parse params.
5410 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5411 * src/output.c (prepare): Remove muscle insertion of the prologues.
5412 (output): Remove freeing of pre_prologue_obstack and
5413 post_prologue_obstack.
5414 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5415 than prologue_augment for prologue parsing so you don't need prologue
5416 obstacks.
5417 (grammar_declaration): For %union RHS, use `braceless' instead of
5418 "{...}" so that braces are already stripped and code is escaped with
5419 digraphs.
5420 * src/reader.c (prologue_augment): Remove.
5421 (reader): Remove initialization of pre_prologue_obstack and
5422 post_prologue_obstack.
5423 * src/reader.h (prologue_augment): Remove.
5424
5425 * data/c.m4: Remove stray parenthesis.
5426
54272007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5428
5429 Remove quotes from variables names in %define directives and from
5430 qualifiers in %code directives, and restrict the characters that are
5431 allowed in them to M4-friendly ones. For %define, continue to support
5432 the quoted form as a deprecated feature. Discussed starting at
5433 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5434 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5435 %code.
5436 * doc/bison.texinfo (Prologue Alternatives): Update.
5437 (Decl Summary): In %defines entry, update mention of `%code requires'
5438 and `%code provides'.
5439 (C++ Location Values): Update %define uses.
5440 (Calc++ Parser Interface): Likewise.
5441 (Calc++ Parser): Likewise, and update `%code requires' uses.
5442 (Table of Symbols): Update %code documentation.
5443 * src/parse-gram.y (prologue_declaration): For %define variables, use
5444 `variable' instead of `STRING'.
5445 (grammar_declaration): For %code qualifiers, use `ID' instead of
5446 `STRING'.
5447 (variable): New nonterminal that takes an `ID' or a `STRING'.
5448 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5449 and %define uses.
5450 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5451 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5452 (%define errors): Update %define uses.
5453
54542007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5455
5456 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5457 instead of muscle_insert for %define values so that M4-special
5458 characters are replaced with digraphs.
5459 * tests/input.at (%define errors): Extend to check weird values.
5460
54612007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5462
5463 Instead of having skeletons declare all valid %define variables and
5464 %code qualifiers, provide macros that retrieve the associated values
5465 and build these lists automatically. Thus Bison will now warn when a
5466 variable or qualifier is not used by the skeleton in the current
5467 invocation regardless of whether it might sometimes be used by that
5468 skeleton in other invocations. Also, move all %define value macros to
5469 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5470 form, which is replaced by %code.
5471 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5472 (b4_check_user_names): ... this, and change the series of valid name
5473 arguments to a single list argument for names used in the skeleton
5474 similar to the existing list argument for names used in the grammar.
5475 Warn instead of complaining.
5476 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5477 values and %code code, to format %code code properly, and to build
5478 lists of all %define variables and %code qualifiers used in the
5479 skeleton: b4_skeleton_percent_define_variables and
5480 b4_skeleton_percent_code_qualifiers.
5481 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5482 Remove, and...
5483 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5484 the skeleton names lists can finish building first. In place of
5485 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5486 expect the lists b4_user_percent_define_variables and
5487 b4_user_percent_code_qualifiers.
5488 * data/c++.m4: Where setting default values for b4_parser_class_name,
5489 b4_location_type, b4_filename_type, b4_namespace, and
5490 b4_define_location_comparison, update their names to the
5491 b4_percent_define_ namespace.
5492 * data/glr.c: Don't use b4_check_percent_define_variables and
5493 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5494 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5495 (b4_parser_class_name, b4_namespace): Define these using
5496 b4_get_percent_define for parser_class_name and namespace.
5497 * data/location.cc: Use b4_get_percent_define.
5498 * data/push.c: Don't use b4_check_percent_define_variables and
5499 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5500 * data/yacc.c: Likewise, and don't call m4_exit in
5501 b4_use_push_for_pull_if or m4_wrap code will never execute.
5502 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5503 Rename to...
5504 (muscle_grow_user_name_list): ... this for consistency with the
5505 terminology used in bison.m4.
5506 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5507 %define variable names, and rename muscle used_percent_define_variables
5508 to user_percent_define_variables.
5509 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5510 user_percent_code_qualifiers.
5511 (content): Remove.
5512 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5513 {CODE} form is no longer accepted.
5514 * tests/input.at (Reject bad %code qualifiers): Rename to...
5515 (Reject unused %code qualifiers): ... this, and update test output.
5516 (%define error): Update test output.
5517
55182007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5519
5520 Check for unrecognized %define variables similar to checking for
5521 unrecognized %code qualifiers. Check for redefined %define variables.
5522 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5523 generalizes...
5524 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5525 (b4_check_percent_define_variables): New, also wraps it.
5526 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5527 variables using b4_check_percent_define_variables.
5528 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5529 all those exercised in the test suite and all those listed in the
5530 `Default values' section of c++.m4. Are there others?
5531 * data/push.c, data/yacc.c: Declare no valid %define variables.
5532 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5533 similar to muscle_find, but it works even when the muscle stores a
5534 const value.
5535 (muscle_grow_used_name_list): New function for constructing the used
5536 name list muscles that b4_check_for_unrecognized_names requires.
5537 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5538 %define'd more than once. Define the b4_used_percent_define_variables
5539 muscle with muscle_grow_used_name_list.
5540 (grammar_declaration): Abbreviate %code code with
5541 muscle_grow_used_name_list.
5542 * tests/input.at (%define errors): New.
5543
55442007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5545
5546 Provide warn_at, complain_at, and fatal_at function callbacks to the
5547 skeletons, and use this for %code qualifier complaints.
5548 * data/bison.m4 (b4_error_at): New, invoked by...
5549 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5550 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5551 @fatal_at(...@) directives.
5552 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5553 qualifiers in b4_used_percent_code_qualifiers and to use
5554 b4_complain_at.
5555 * src/location.c, src/location.h (boundary_set_from_string): New global
5556 function.
5557 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5558 function.
5559 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5560 to b4_used_percent_code_qualifiers.
5561 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5562 function.
5563 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5564 (lineno): Rename to...
5565 (out_lineno): ... this so I don't misunderstand it again.
5566 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5567 here; these newlines are in the input but not the output file.
5568 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5569 (at_directive_perform): ... this new static function, and add handling
5570 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5571 directives.
5572 * tests/input.at (Reject bad %code qualifiers): Update test output with
5573 locations and extend.
5574
5575 * tests/output.at (Output file name: [, Output file name: ]): Remove
5576 bogus comment about these tests failing.
5577
55782007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5579
5580 Clean up b4_check_percent_code_qualifiers a little.
5581 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5582 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5583 documentation and add examples.
5584 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5585 qualifiers here.
5586
55872007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5588
5589 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5590 unreliable -- especially when they're hidden inside another macro.
5591 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5592 data/c.m4: Remove m4_divert(-1).
5593 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5594 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5595 m4_divert_push(0) and m4_divert_pop(0).
5596 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
5597 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5598 pushed and popped by m4sugar, should be first on the stack.
5599
5600 Provide warn, complain, and fatal function callbacks to the skeletons.
5601 This provides more flexibility than m4_fatal, improves the error
5602 message format, and captures messages for translation. Discussed
5603 starting at
5604 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5605 * data/bison.m4 (b4_error): New, invoked by...
5606 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5607 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5608 directives. Because these M4 macros might be called when the current
5609 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5610 the previous removal of uses of m4_divert, which caused trouble.
5611 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5612 m4_fatal to report unrecognized %code qualifiers.
5613 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5614 push parser requests.
5615 * data/glr.c: Use b4_complain instead of m4_fatal to report
5616 non-deterministic push parser requests.
5617 Update @output usage to @output(...@) form.
5618 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5619 report missing %defines. Update @output usage to @output(...@) form.
5620 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5621 @output(...@) form.
5622 * src/main.c (main): Invoke skel_scanner_free.
5623 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5624 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5625 obstack_for_string from flex-scanner.h.
5626 (YY_DECL): Use to declare skel_lex static.
5627 (decode_at_digraphs): Remove; now handled in the new
5628 SC_AT_DIRECTIVE_ARG start condition.
5629 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5630 functions.
5631 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5632 at_directive_argv): New static globals.
5633 (INITIAL): Use fail_for_invalid_at.
5634 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5635 recognize the start of a generalized `@directive(...@)' form and
5636 start...
5637 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5638 directive args (using the new obstack_for_string), to decode the
5639 contained @ diagraphs, and to perform the directive. It recognizes
5640 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5641 @output(...@).
5642 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5643 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5644 `@,'.
5645 (scan_skel): Initialize obstack_for_string on the first call.
5646 (skel_scanner_free): New function to free obstack_for_string.
5647 * tests/input.at (Reject bad %code qualifiers): Update test output.
5648
56492007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5650
5651 Consolidate the 4 prologue alternative directives (%code, %requires,
5652 %provides, and %code-top) into a single %code directive with an
5653 optional qualifier field. Discussed at
5654 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5655 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5656 alternatives.
5657 * doc/bison.texinfo (Prologue Alternatives): Update.
5658 (Decl Summary): Update to %code "requires" and %code "provides".
5659 (Calc++ Parser): Update to %code "requires".
5660 (Table of Symbols): Remove entries for %requires, %provides, and
5661 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5662 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5663 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5664 which are skeleton-specific.
5665 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5666 declare what %code qualifiers it supports and to complain if any other
5667 qualifiers were used in the grammar.
5668 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5669 and b4_user_code([b4_percent_code_provides]) in place of
5670 b4_user_requires and b4_user_provides.
5671 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5672 Add b4_user_code([b4_percent_code_top]) and
5673 b4_user_code([b4_percent_code]).
5674 Invoke b4_check_percent_code_qualifiers.
5675 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5676 PERCENT_REQUIRES): Remove.
5677 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5678 %requires. Rewrite the %code RHS as the unqualified form defining the
5679 muscle b4_percent_code. Add another RHS for the qualified %code form,
5680 which defines muscles of the form b4_percent_code_QUALIFIER and the
5681 b4_used_percent_code_qualifiers muscle.
5682 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5683 PERCENT_REQUIRES): Remove.
5684 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5685 %code "requires" and %code "provides".
5686 * tests/input.at (Reject bad %code qualifiers): New.
5687
56882007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5689
5690 Use the new code_props interface for destructors and printers.
5691 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5692 printer_location members, and change the type of the destructor and
5693 printer members to code_props.
5694 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5695 symbol_printer_get, semantic_type_destructor_set,
5696 semantic_type_printer_set, default_tagged_destructor_set,
5697 default_tagless_destructor_set, default_tagged_printer_set,
5698 default_tagless_printer_set): Use code_props in arguments and return
5699 types in place of char const * and location.
5700 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5701 since the locations are now contained in the return of
5702 symbol_destructor_get and symbol_printer_get.
5703 * src/output.c (symbol_destructors_output, symbol_printers_output):
5704 Replace with...
5705 (symbol_code_props_output): ... this to eliminate duplicate code.
5706 (output_skeleton): Update to use symbol_code_props_output.
5707 * src/reader.c (symbol_should_be_used): Update use of
5708 symbol_destructor_get.
5709 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5710 Update uses of the various _destructor_set and _printer_set functions.
5711 * src/symtab.c: (default_tagged_destructor_location,
5712 default_tagless_destructor_location, default_tagged_printer_location,
5713 default_tagless_printer_location): Remove since we...
5714 (default_tagged_destructor, default_tagless_destructor,
5715 default_tagged_printer, default_tagless_printer): ... change the type
5716 of these to code_props.
5717 (symbol_new, semantic_type_new, symbol_destructor_set,
5718 semantic_type_destructor_set, symbol_destructor_get,
5719 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5720 symbol_check_alias_consistency, default_tagged_destructor_set,
5721 default_tagless_destructor_set, default_tagged_printer_set,
5722 default_tagless_printer_set): Update.
5723 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5724 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5725 code_props members.
5726 (symbol_print): Use SYMBOL_CODE_PRINT.
5727
57282007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5729
5730 Use the new code_props interface for rule actions.
5731 * src/symlist.h (symbol_list): Replace action, action_location, and
5732 used members with a code_props action_props member.
5733 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5734 grammar_midrule_action, grammar_current_rule_merge_set,
5735 grammar_current_rule_symbol_append, packgram): Update.
5736 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5737 * src/scan-code.l (handle_action_dollar): Update.
5738 (translate_rule_action): Remove, no longer used.
5739 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5740
57412007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5742
5743 Use the new code_props interface in parse-gram.y.
5744 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5745 Update all uses of translate_* functions to use the new code_props
5746 interface and to use gram_scanner_last_string_free and
5747 code_scanner_last_string_free where possible.
5748 (grammar_declaration): symbol_list_destructor_set and
5749 symbol_list_printer_set now perform the translation, so don't do it
5750 here. Use gram_scanner_last_string_free where possible.
5751 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5752 translate_code): Remove, no longer used.
5753 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5754 symbol_list_printer_set): Perform code translation here rather than
5755 depending on the caller to do so.
5756
5757 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5758 * src/scan-gram.h (gram_last_string): Remove declaration.
5759 * src/scan-gram.l (last_string): Declare it static.
5760
57612007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5762
5763 Encapsulate code properties and related functionality for the various
5764 destructors, printers, and actions into a code_props structure and
5765 interface. This patch merely implements code_props in scan-code.h and
5766 scan-code.l. Future patches will rewrite other modules to use it.
5767 Discussed starting at
5768 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5769 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5770 consistently initialize const structs that have an empty location
5771 field.
5772 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5773 to ensure consistency.
5774 * src/scan-code.h (code_props): New structure.
5775 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5776 function, macro, and const global variable for initializing a
5777 code_props with no code.
5778 (code_props_plain_init, code_props_symbol_action_init,
5779 code_props_rule_action_init, code_props_translate_code): The rest of
5780 the new code_props functional interface. Among other things, the init
5781 functions set the code_props kind field so that
5782 code_props_translate_code will know whether to behave like
5783 translate_symbol_action, translate_rule_action, or translate_code.
5784 These old translate functions must remain until all other modules are
5785 updated to use the new code_props interface.
5786 (code_scanner_last_string_free): New function similar to
5787 gram_scanner_last_string_free.
5788 (code_scanner_free): Add documentation.
5789 * src/scan-code.l: Implement the new interface.
5790 (code_lex): Make it static, add a code_props* argument, and remove the
5791 rule argument.
5792 (last_string): New static global similar to the one in scan-gram.l.
5793 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5794 instead of rule.
5795 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5796 code_props since Bison may one day use this information for destructors
5797 and printers.
5798 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5799 (handle_action_dollar): Use symbol_list_n_get and set used flag
5800 directly since symbol_list_n_used_set is removed.
5801 (translate_action): Add a code_props* argument and remove the rule,
5802 action, and location arguments. Pass the code_props* on to code_lex.
5803 (translate_rule_action, translate_symbol_action, translate_code):
5804 Rewrite as wrappers around the new code_props interface.
5805 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5806 it would eventually need to break the encapsulation of code_props.
5807
58082007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5809
5810 * etc/.cvsignore: New.
5811
58122007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5813
5814 Add maintainer-push-check to run maintainer-check using push parsing in
5815 place of pull parsing where available.
5816 * Makefile.am (maintainer-push-check): New.
5817 * data/bison.m4 (b4_use_push_for_pull_if): New.
5818 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5819 appropriately based on their existing values.
5820 (yypush_parse): Don't print push-parser-specific diagnostics if push
5821 parsing is being used in place of pull parsing.
5822 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5823 push.c.
5824 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5825 variable, and insert b4_use_push_for_pull_flag into muscles.
5826 * tests/Makefile.am (maintainer-push-check): New.
5827
58282006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5829
5830 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5831 (whether successful or failed) so that yypush_parse can be invoked
5832 again to start a new parse using the same yypstate.
5833 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5834 check multiple yypull_parse invocations on the same yypstate. For pull
5835 mode, extend to check multiple yyparse invocations.
5836 (Exploding the Stack Size with Alloca): Extend to try with
5837 %push-pull-parser.
5838 (Exploding the Stack Size with Malloc): Likewise.
5839
5840 * tests/calc.at (Simple LALR Calculator): Don't specify
5841 %skeleton "push.c" since %push-pull-parser implies that now.
5842 * tests/headers.at (export YYLTYPE): Don't check for the push
5843 declarations. Otherwise, this test case can't be used to see if push
5844 mode can truly emulate pull mode.
5845 * tests/input.at (Torturing the Scanner): Likewise.
5846 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5847 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5848 AT_YACC_IF, which now includes the case of push mode since %skeleton
5849 need not be used for push mode. This will be more intuitive once
5850 push.c is renamed to yacc.c.
5851
58522006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5853
5854 For push mode, convert yyparse from a macro to a function, invoke yylex
5855 instead of passing a yylexp argument to yypull_parse, and don't
5856 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5857 Discussed starting at
5858 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5859 * data/bison.m4 (b4_pull_if): New.
5860 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5861 * data/push.c: Improve M4 quoting a little.
5862 (b4_generate_macro_args, b4_parenthesize): Remove.
5863 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5864 any time a pull parser is requested.
5865 Don't #define this as a wrapper around yypull_parse. Instead, when
5866 both push and pull are requested, make it a function that does that
5867 same thing.
5868 (yypull_parse): If there's a b4_prefix, #define this to
5869 b4_prefix[pull_parse] when both push and pull are requested.
5870 Don't define this as a function unless both push and pull are
5871 requested.
5872 Remove the yylexp argument and hard-code yylex invocation instead.
5873 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5874 %push-parser.
5875 * src/getargs.c (pull_parser): New global initialized to true.
5876 * getargs.h (pull_parser): extern it.
5877 * src/output.c (prepare): Insert pull_flag muscle.
5878 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5879 (prologue_declaration): Set both push_parser and pull_parser = true for
5880 %push-pull-parser. Set push_parser = true and pull_parser = false for
5881 %push-parser.
5882 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5883 %push-parser since there's no backward-compatibility concern here.
5884 Scan %push-pull-parser.
5885 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5886 instead of %push-parser.
5887 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5888 prototype it in the module that calls yyparse.
5889 * tests/input.at (Torturing the Scanner): Likewise.
5890 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5891
58922006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5893
5894 Update etc/bench.pl. Optimize push mode a little (the yyn change
5895 deserves most of the credit).
5896 * Makefile.am (SUBDIRS): Add etc subdirectory.
5897 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5898 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5899 yytoken, yyval, and yyloc declarations to...
5900 (yyparse or yypush_parse): ... here to improve performance. For
5901 yypush_parse invocations after the first, be sure to assign yyn its old
5902 value again.
5903 (yypstate_new): Don't bother initializing the yyresult field since the
5904 initial value isn't used.
5905 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5906 remove the #define that, in push mode, set it to yyps->NAME.
5907 * etc/Makefile.am: New.
5908 * etc/bench.pl: Remove and build it instead from...
5909 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5910 "tests/bison" from the build directory by default rather than just
5911 invoking "bison" from $PATH.
5912 (calc_grammar): Update push parser code: don't declare yylval globally,
5913 don't define yyparse_wrapper, and don't #define yyparse.
5914 (bench_grammar): Update to check all working combinations of yacc.c,
5915 push.c, impure, pure, pull, and push.
5916
59172006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5918
5919 For push mode, add pull wrappers around yypush_parse.
5920 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5921 (yypull_parse): New function wrapping yypush_parse.
5922 (yyparse): New #define wrapping yypull_parse.
5923 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5924 is declared.
5925 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5926 prototype yylex in the module that calls yyparse, and don't prototype
5927 yyparse there. Otherwise, the yyparse expansion won't compile.
5928 * tests/input.at (Torturing the Scanner): Likewise.
5929
59302006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5931
5932 Enable push parsers to operate in impure mode. Thus, %push-parser no
5933 longer implies %pure-parser. The point of this change is to move
5934 towards being able to test the push parser code by running the entire
5935 test suite as if %push-parser had been declared.
5936 * data/push.c (yypush_parse): For impure mode, remove the
5937 yypushed_char, yypushed_val, and yypushed_loc arguments.
5938 Instead, declare these as local variables initialized to the global
5939 yychar, yylval, and yylloc.
5940 For the first yypush_parse invocation only, restore the initial values
5941 of these global variables when it's time to read a token since they
5942 have been overwritten.
5943 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5944 %push-parser.
5945 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5946 %pure-parser along with %push-parser since this test case was designed
5947 for pure push parsers.
5948 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5949 (AT_YACC_OR_PUSH_IF): New.
5950 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5951 add a note that it's still wrong for some cases (as it has been for a
5952 while).
5953 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5954 %push-parser no longer implies %pure-parser.
5955
59562006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5957
5958 Remove some unnecessary differences between the pull parser code and
5959 the push parser code. This patch enables yynerrs in push mode.
5960 * data/push.c: Reformat M4 a little.
5961 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5962 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5963 because push mode is on. Instead, if pure mode is on, move yynerrs
5964 to...
5965 (b4_declare_parser_state_variables): ... here.
5966 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5967 to yyps->NAME so it can be used in yypush_parse.
5968 (yypush_parse): Don't omit uses of yynerrs in push mode.
5969
59702006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5971
5972 Fix bug such that the first pushed token's value and location are
5973 sometimes overwritten (sometimes by %initial-action) before being used.
5974 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5975 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5976 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5977 more closely mimic the pull parser logic.
5978 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5979 time to read a token, which is after any initialization of yylval and
5980 yylloc.
5981 (gottoken): Rename label to...
5982 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5983 user namespace.
5984
59852006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5986
5987 Rearrange initialization of the parser state variables so that the
5988 skeleton doesn't have to have a copy for pull mode and another for push
5989 mode. This patch also fixes at least a bug such that yylloc was not
5990 initialized (with b4_location_initial_line and
5991 b4_location_initial_column) upon calling yypush_parse. However, that
5992 initialization now overwrites the first token's location;
5993 %initial-action assigning @$ already did the same thing, and both bugs
5994 will be fixed in a later patch.
5995 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5996 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5997 yyss, yyvs, yyls, and yystacksize.
5998 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5999 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
6000 yylsp.
6001 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
6002 yyps->NAME so it can be used in yypush_parse.
6003 (yyparse or yypush_parse): For yypush_parse, don't print the
6004 "Starting parse" diagnostic for invocations after the first.
6005 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
6006 yypush_parse, only do it for the first invocation.
6007 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
6008 initialization to occur in yypush_parse but only on the first
6009 invocation.
6010
60112006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6012
6013 * data/push.c: Add CPP guards around push parser declarations in both
6014 the header and the code file.
6015 In the code file, move the push parser declarations to the same place
6016 they appear in the header file.
6017 Clean up the M4 some, especially the inconsistent underquoting in
6018 some b4_c_function_def and b4_c_function_decl uses.
6019
60202006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6021
6022 Encapsulate the push parser state variables into an M4 macro so the
6023 push skeleton doesn't have to list them again for pull mode's yyparse.
6024 For push mode, remove yypush_parse's local equivalents of these
6025 variables to eliminate unnecessary copying between the two sets at
6026 run-time. This patch also fixes at least a bug related to multiple
6027 %initial-action invocations in push mode.
6028 * data/push.c (b4_declare_parser_variables): Rename to...
6029 (b4_declare_scanner_communication_variables): ... this for clarity and
6030 update both uses.
6031 (b4_declare_yyparse_variables): Remove and move its contents to the one
6032 spot where it was invoked.
6033 (b4_declare_parser_state_variables): New macro containing the parser
6034 state variables required by push mode.
6035 (struct yypstate): Replace all fields but yynew with
6036 b4_declare_parser_state_variables.
6037 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
6038 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
6039 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6040 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6041 parser state variable declarations with
6042 b4_declare_parser_state_variables.
6043 Don't initialize parser state variables when calling yypush_parse since
6044 yypstate_new already does that.
6045 Invoke the user's initial action only upon the first yypush_parse
6046 invocation.
6047 Remove all code that copies between the local parser state variables
6048 and the yypstate.
6049
60502006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6051
6052 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6053 prevent a name collision in a future patch where these names will
6054 sometimes be #define'd.
6055 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6056 since it no longer has the same name as the existing argument.
6057 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6058
60592006-12-19 Paolo Bonzini <bonzini@gnu.org>
6060 and Joel E. Denny <jdenny@ces.clemson.edu>
6061
6062 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6063 that the argument is case-insensitive, and there's no `=' here.
6064 For the %skeleton entry, mention that %language is better.
6065 (Bison Options): Likewise for --language and --skeleton. Move the
6066 --skeleton entry so that the `Tuning the parser' section is sorted
6067 alphabetically on long options.
6068 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6069 %language directive in detail here; cross-reference the %language
6070 documentation instead.
6071 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6072 `%require "2.3b"' so that the example is always up-to-date.
6073 (Table of Symbols): Add entries for %language and %skeleton.
6074 * examples/extexi (normalize): Instead of replacing every %require
6075 argument with the current Bison version, just substitute for
6076 `@value{VERSION}'. This guarantees that we're testing what actually
6077 appears in the documentation.
6078 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6079 rather than `@VERSION@'.
6080
60812006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6082
6083 * NEWS: Reword the %language news a bit, and put it earlier.
6084
6085 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6086 Rewrite to simplify the logic.
6087 (language_argmatch): Likewise.
6088 (program_name): We now own this var.
6089 * src/getargs.h (struct bison_language): Use char[] rather than
6090 const char *.
6091
6092 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6093 Java is supported.
6094 * src/complain.c (program_name): Remove decl; no longer needed.
6095 * src/main.c (program_name): Remove; now belongs to getargs.
6096
60972006-12-18 Paolo Bonzini <bonzini@gnu.org>
6098
6099 * NEWS: Document %language.
6100
6101 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6102
6103 * data/c-skel.m4, data/c++-skel.m4: New files.
6104 * data/glr.c: Complain on push parsers.
6105
6106 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6107 over %skeleton.
6108 (Decl Summary): Document %language and %skeleton.
6109 (Command line): Document -L.
6110
6111 * examples/extexi: Rewrite %require directive.
6112 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6113
6114 * src/files.c (compute_exts_from_gc): Look in language structure
6115 for .y extension.
6116 (compute_file_name_parts): Check whether .tab should be added.
6117 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6118 (language, skeleton_arg, language_argmatch): New.
6119 (long_options): Add --language.
6120 (getargs): Use skeleton_arg, add -L/--language.
6121 * src/getargs.h: Include location.h.
6122 (struct bison_language, language, skeleton_arg, language_argmatch): New.
6123 * src/output.c (prepare): Pick default skeleton from struct language.
6124 Don't dispatch C skeletons here.
6125 * src/parse-gram.y (PERCENT_LANGUAGE): New.
6126 (prologue_declaration): Add "%language" rule, use skeleton_arg.
6127 * src/scan-gram.l ("%language"): New rule.
6128
6129 * tests/calc.at: Test %skeleton and %language.
6130 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
6131 (AT_GLR_IF): Look for %skeleton "glr.cc".
6132 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
6133 (AT_YACC_IF): Reject %language.
6134
61352006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6136
6137 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
6138 since it wasn't used; only the typedef name 'semantic_type' is needed.
6139 Also, omit trailing white space.
6140
6141 * bootstrap: Sync from coreutils.
6142 (gnulib_extra_files): Add build-aux/announce.gen.
6143 (slurp): Adjust .gitignore files like .cvsignore files.
6144 * build-aux/announce-gen: Remove from CVS, since bootstrap
6145 now creates this.
6146
61472006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
6148
6149 Make %push-parser imply %pure-parser. This fixes several bugs; see
6150 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
6151 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6152 pure_parser = true.
6153 * data/push.c: Don't bother testing b4_push_if when deciding whether
6154 to expand b4_declare_parser_variables globally.
6155 (yypush_parse): Likewise in here.
6156
6157 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
6158 (yy_reduce_print): Reformat M4 for readability.
6159
61602006-12-15 Bob Rossi <bob@brasko.net>
6161 and Joel Denny <jdenny@ces.clemson.edu>
6162
6163 * data/push.c (yypstate): Add typedef, and update all uses of
6164 struct yypstate to just yypstate.
6165 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
6166
61672006-12-14 Bob Rossi <bob@brasko.net>
6168
6169 * data/push.c (yypush_parse): Declare prototype regardless of
6170 %locations option.
6171
61722006-12-14 Bob Rossi <bob@brasko.net>
6173
6174 * data/push.c (yyparse): Remove the prototype and the #define when in
6175 push-parser mode.
6176
61772006-12-13 Bob Rossi <bob@brasko.net>
6178
6179 * data/push.c (yypstate_init): Rename to...
6180 (yypstate_new): ... this and use b4_c_function_def.
6181 (yypstate_delete): New.
6182 (yypush_parse): Change parameters yynval and yynlloc to be const.
6183 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
6184 yypstate_delete functions.
6185
61862006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
6187
6188 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
6189 strange test case titles. Reported by Bob Rossi.
6190
61912006-12-13 Paul Eggert <eggert@cs.ucla.edu>
6192
6193 * TODO: Add pointer to Sylvain Schmitz's work on static detection
6194 of potential ambiguities in GLR grammers.
6195
61962006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
6197
6198 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
6199 `bison ', use m4_index instead of m4_substr since chopping up a string
6200 containing M4-special characters causes problems here.
6201
6202 Fix a couple of bugs related to special characters in user-specified
6203 file names, and make it easier for skeletons to compute output file
6204 names with the same file name prefix as Bison-computed output file
6205 names.
6206 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
6207 b4_parser_file_name and b4_spec_defines_file instead of
6208 @output_parser_name@ and @output_header_name@, which are now redundant.
6209 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
6210 b4_parser_file_name, b4_spec_defines_file, and the new
6211 @basename(FILENAME@) instead of @output_parser_name@ and
6212 @output_header_name@, which inappropriately escaped the file names as
6213 C string literals.
6214 * src/files.c (all_but_ext): Remove static qualifier.
6215 (compute_output_file_names): Move `free (all_but_ext)' to...
6216 (output_file_names_free): ... here since all_but_ext is needed later.
6217 * src/files.h (all_but_ext): Extern.
6218 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
6219 exactly what MUSCLE_INSERT_STRING used to do.
6220 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
6221 characters are escaped properly.
6222 * src/output.c (prepare): Define muscle file_name_all_but_ext as
6223 all_but_ext.
6224 For pkgdatadir muscle, maintain previous functionality by using
6225 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
6226 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
6227 digraphs would never be expanded. Hopefully no one has M4-special
6228 characters in his Bison installation path.
6229 * src/scan-skel.l: Don't parse @output_header_name@ and
6230 @output_parser_name@ anymore since they're now redundant.
6231 In @output, use decode_at_digraphs.
6232 Parse a new @basename command that invokes last_component.
6233 (decode_at_digraphs): New.
6234 (BASE_QPUTS): Remove unused.
6235 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
6236 (Output file name): New tests.
6237
62382006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
6239
6240 Warn about output files that are generated by the skeletons and that
6241 conflict with other output files.
6242 * data/glr.c: Don't generate the header file here when glr.cc does.
6243 * src/files.c (file_names, file_names_count): New static globals.
6244 (compute_output_file_names): Invoke output_file_name_check for files
6245 not generated by the skeletons and remove existing checks.
6246 (output_file_name_check): New function that warns about conflicting
6247 output file names.
6248 (output_file_names_free): Free file_names.
6249 * src/files.h (output_file_name_check): Declare.
6250 * src/scan-skel.l: Invoke output_file_name_check for files generated by
6251 the skeletons.
6252 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
6253 (Conflicting output files): New tests.
6254
62552006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6256
6257 * doc/bison.texinfo: Fix a couple of typos.
6258
62592006-12-08 Bob Rossi <bob@brasko.net>
6260
6261 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
6262 Rename to...
6263 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
6264 update all uses.
6265 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
6266 (yypush_parse): Rename yypvars argument to yyps and remove redundant
6267 local pv.
6268 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
6269 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
6270
62712006-12-07 Bob Rossi <bob@brasko.net>
6272 and Joel Denny <jdenny@ces.clemson.edu>
6273
6274 * data/push.c (yypvarsinit): Change return type from void* to struct
6275 yypvars*. No longer cast to void* on return.
6276 (struct yypvars): Remove yylen since it need not be remembered between
6277 yypushparse invocations.
6278 (yypushparse): Don't copy between yylen and pv->yylen.
6279
62802006-12-05 Bob Rossi <bob@brasko.net>
6281
6282 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6283 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6284 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6285 (struct yypvars): Remove b4_declare_parser_variables.
6286 (yypvarsinit): Remove init code for removed variables.
6287 (global scope): Do not declare b4_declare_parser_variables if
6288 push or pure mode.
6289 (yypushparse): Add b4_declare_parser_variables.
6290 Init new local variables, and remove init code for removed
6291 yypvars variables.
6292 (yyparse): Delete.
6293 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6294 and yyparse for other modes.
6295 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6296 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6297 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6298 (AT_PURE_LEX_IF): True if pure or push parser.
6299
63002006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6301
6302 Document Yacc prologue alternatives and default %destructor's and
6303 %printer's as experimental. Don't mention Java yet. Discussed at
6304 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6305 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6306 (2.3a): Annotate this entry to say the old forms of these features were
6307 also experimental.
6308 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
6309 Table of Symbols): Say they're experimental. Comment out any mention
6310 of Java (we'll want this back eventually).
6311
63122006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6313
6314 Support a file name argument to %defines. Deprecate `=' in
6315 %file-prefix, %name-prefix, and %output. Discussed at
6316 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6317 * NEWS (2.3a+): Mention.
6318 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
6319 form of %defines, and remove `=' from entries for %file-prefix,
6320 %name-prefix, and %output.
6321 * src/parse-gram.y (prologue_declaration): Implement.
6322 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6323 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6324 all but one occurrence of %name-prefix.
6325 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6326 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6327 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6328 occurrence of each of %file-prefix and %output. Add check for %defines
6329 with argument.
6330 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6331 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6332 Remove the `=' from %output.
6333
63342006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6335
6336 Don't escape $ in test case titles since Autoconf 2.61 now does that
6337 correctly.
6338 * tests/actions.at (Default %printer and %destructor are not for error
6339 or $undefined): Here.
6340 (Default %printer and %destructor are not for $accept): Here.
6341 * tests/input.at (Invalid $n and @n): Here.
6342
63432006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6344
6345 Rename <!> to <>. Discussed starting at
6346 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6347 * NEWS (2.3a+): Update.
6348 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
6349 Update.
6350 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6351 * src/scan-gram.l (INITIAL): Implement.
6352 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6353 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6354 comment.
6355 * tests/actions.at (Default tagless %printer and %destructor,
6356 Default tagged and per-type %printer and %destructor,
6357 Default %printer and %destructor are not for error or $undefined,
6358 Default %printer and %destructor are not for $accept,
6359 Default %printer and %destructor for mid-rule values): Update.
6360 * tests/input.at (Default %printer and %destructor redeclared,
6361 Unused values with default %destructor): Update.
6362
63632006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6364
6365 Don't let %prec take a nonterminal.
6366 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6367 token.
6368 * tests/input.at (%prec takes a token): New test checking that %prec
6369 won't take a nonterminal.
6370
63712006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6372
6373 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6374 it was double-quoted.
6375 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6376 grammar is maintained with Bison's highest standards.
6377 * src/getargs.c: Fix some typos in Doxygen comments.
6378
63792006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6380
6381 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6382 later. Reported by Paul Eggert in
6383 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6384 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6385 * src/scan-code.l (translate_action): Don't bother invoking
6386 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6387 (code_scanner_free): Instead of invoking
6388 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6389 which frees more.
6390 * src/scan-gram.l (gram_scanner_free): Likewise.
6391 * src/scan-skel.l (scan_skel): Likewise.
6392
63932006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6394
6395 * src/files.c (tr): Change return type to void.
6396 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6397 has been called previously for the same key.
6398 (muscle_find): Return storage instead of value so that
6399 --enable-gcc-warnings doesn't produce warnings that the return discards
6400 const. aver that the value and storage are the same since storage
6401 could potentially be NULL when value is not.
6402 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6403 same as 0.
6404
64052006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6406
6407 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6408 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6409 us a slightly cleaner distribution, and also works.
6410 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6411 gnulib changes.
6412
64132006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6414 and Paul Eggert <eggert@cs.ucla.edu>
6415
6416 Don't let Bison leak memory except when it complains.
6417 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6418 (spec_defines_file, dir_prefix): Now char *, not const char *,
6419 since they are freed.
6420 * src/files.c: Likewise.
6421 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6422 Likewise.
6423 (tr): Now operates in-place. All uses changed.
6424 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6425 values.
6426 (compute_file_name_parts, compute_output_file_names): Don't store
6427 read-only data in variables that will be freed.
6428 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6429 src_extension, and header_extension.
6430 (output_file_names_free): New public function to free
6431 spec_verbose_file, spec_graph_file, spec_defines_file,
6432 parser_file_name, and dir_prefix.
6433 * src/getargs.c (getargs): Don't store read-only data in variables that
6434 will be freed.
6435 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6436 (which previously existed but was unused), and quotearg_free.
6437 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6438 * src/muscle_tab.c: Likewise.
6439 (muscle_entry): Make the value char const *,
6440 and add a new storage member that is char * and can be freed.
6441 (muscle_entry_free): New private function.
6442 (muscle_init): Use it instead of free.
6443 (muscle_insert, muscle_grow): Update and use new storage member.
6444 (muscle_code_grow): Free the string passed to muscle_grow
6445 since it's not needed anymore.
6446 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6447 add a new `char *code' member.
6448 ("{...}"): Declare semantic type as code.
6449 * src/scan-code.h (translate_rule_action):
6450 (translate_symbol_action, translate_code, translate_action): Return
6451 `char const *' rather than `char *' since external code should not free
6452 these strings.
6453 * src/scan-code.l: Likewise.
6454 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6455 which is "{...}" in the parser.
6456 * tests/Makefile.am (maintainer-check-valgrind): Set
6457 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6458 Valgrind.
6459 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6460 complain.
6461 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6462 expecting a non-zero exit status sets --leak-check=summary and
6463 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6464 this case, and we don't want to hear about it.
6465
64662006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6467
6468 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6469 instead of from the template, to simplify configuration a bit.
6470 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6471 and m4/wint_t.m4, as they are needed with the latest gnulib.
6472
64732006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6474
6475 Disable unset/unused mid-rule value warnings by default, and recognize
6476 --warnings=midrule-values to enable them. Discussed starting at
6477 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6478 * NEWS (2.3a+): Mention.
6479 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6480 warnings): Add entry for midrule-values subargument.
6481 * src/reader.c (symbol_should_be_used): Don't return true just because
6482 the value is a set/used mid-rule value unless
6483 --warnings=midrule-values was specified.
6484 * tests/input.at (Unused values, Unused values before symbol
6485 declarations): Run tests with and without --warnings=midrule-values.
6486
6487 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6488 than LIST_FREE directly.
6489
64902006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6491
6492 Finish implementing --warnings=error, which should not be implied by
6493 --warnings=all (or by its synonyms -W and --warnings without
6494 subarguments).
6495 * src/complain.c (set_warning_issued): New function to report that
6496 warnings are being treated as errors and to record an error if so.
6497 Invoke...
6498 (warn_at, warn): ... here.
6499 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6500 "error - warnings are errors" does not appear above "all - all of the
6501 above".
6502 (getargs): For -W and --warnings without subarguments, don't let
6503 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6504 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6505
65062006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6507
6508 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6509 empty subargument list. For example: `bison --warnings= parser.y'.
6510
65112006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6512
6513 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6514 the parser header file so that gcc doesn't warn.
6515
65162006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6517
6518 Split the default %destructor/%printer into two kinds: <*> and <!>.
6519 Discussed starting at
6520 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6521 * NEWS (2.3a+): Mention.
6522 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6523 previous change today related to mid-rules.
6524 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
6525 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
6526 (TYPE_TAG_ANY): Add as <*>.
6527 (TYPE_TAG_NONE): Add as <!>.
6528 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6529 for <*> and <!>.
6530 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6531 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6532 * src/symlist.c (symbol_list_default_new): Split into tagged and
6533 tagless versions.
6534 (symbol_list_destructor_set, symbol_list_printer_set): Split
6535 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6536 SYMLIST_DEFAULT_TAGLESS.
6537 * src/symlist.h: Update symbol_list_default*_new prototypes.
6538 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6539 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6540 * src/symtab.c (default_destructor, default_destructor_location,
6541 default_printer, default_printer_location): Split each into tagged and
6542 tagless versions.
6543 (symbol_destructor_get, symbol_destructor_location_get,
6544 symbol_printer_get, symbol_printer_location_get): Implement tagged
6545 default and tagless default cases.
6546 (default_destructor_set, default_printer_set): Split each into tagged
6547 and tagless versions.
6548 * src/symtab.h: Update prototypes.
6549 * tests/actions.at (Default %printer and %destructor): Rename to...
6550 (Default tagless %printer and %destructor): ... this, and extend.
6551 (Per-type %printer and %destructor): Rename to...
6552 (Default tagged and per-type %printer and %destructor): ... this, and
6553 extend.
6554 (Default %printer and %destructor for user-defined end token): Extend.
6555 (Default %printer and %destructor are not for error or $undefined):
6556 Update.
6557 (Default %printer and %destructor are not for $accept): Update.
6558 (Default %printer and %destructor for mid-rule values): Extend.
6559 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6560 (Unused values with default %destructor): Extend.
6561
65622006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6563
6564 Don't apply the default %destructor/%printer to an unreferenced midrule
6565 value. Mentioned at
6566 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6567 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6568 like $@n instead of just @n so that the default %destructor/%printer
6569 logic doesn't see them as user-defined symbols.
6570 (symbol_is_dummy): Check for both forms of the name.
6571 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6572 name for which the midrule value is referenced in any action.
6573 * tests/actions.at (Default %printer and %destructor for mid-rule
6574 values): New test.
6575 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6576 for change to dummy symbol names.
6577
65782006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6579
6580 Warn about unset midrule $$ if the corresponding $n is used.
6581 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6582 $n usage.
6583 (packgram): Before invoking grammar_rule_check on any rule, make sure
6584 all actions have already been scanned in order to set `used' flags.
6585 Otherwise, checking that a midrule's $$ is set will not always work
6586 properly because the midrule check must forward-reference the midrule's
6587 parent rule.
6588 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6589 warning.
6590
65912006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6592
6593 More improvements to the documentation of the prologue alternatives:
6594 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6595 Bison manual.
6596 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6597 some text to clarify the relative importance of the new directives and
6598 to show how these directives may be viewed as code labels.
6599
66002006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6601
6602 Similar to the recently removed %before-header, add %code-top as the
6603 alternative to the pre-prologue. Mentioned at
6604 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6605 Also, let the prologue alternatives appear in the grammar section.
6606 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6607 (prologue_declaration): Move the existing prologue alternatives to...
6608 (grammar_declaration): ... here and add %code-top.
6609 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6610
6611 Clean up and extend documentation for the prologue alternatives.
6612 * NEWS (2.3a+): Describe prologue alternatives.
6613 * doc/bison.texinfo (Prologue): Move discussion of prologue
6614 alternatives to...
6615 (Prologue Alternatives): ... this new section, and extend it to discuss
6616 all 4 directives in detail.
6617 (Table of Symbols): Clean up discussion of prologue alternatives and
6618 add %code-top.
6619
66202006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6621
6622 DJGPP specific issues.
6623
6624 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6625 config.bat accordingly.
6626 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6627 * djgpp/config.site: Likewise.
6628
66292006-10-16 Paolo Bonzini <bonzini@gnu.org>
6630
6631 Replace %*-header with %provides, %requires, %code. See discussion at
6632 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6633
6634 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6635 (b4_user_start_header): Remove.
6636 * data/glr.c: Use new macros instead of b4_*start_header
6637 and b4_*end_header.
6638 * data/glr.cc: Likewise.
6639 * data/lalr1.cc: Likewise.
6640 * data/push.c: Likewise.
6641 * data/yacc.c: Likewise.
6642
6643 * doc/bison.texinfo: Remove %before-header, rename
6644 %{start,end,after}-header to %requires, %provides, %code.
6645
6646 * src/parse-gram.y: Likewise (also rename token names accordingly).
6647 * src/scan-gram.l: Likewise.
6648 * tests/actions.at: Likewise.
6649
66502006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6651
6652 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6653 Problem reported by Joel E. Denny.
6654
66552006-10-14 Jim Meyering <jim@meyering.net>
6656
6657 (Sync from coreutils.)
6658 Work also when the working directory (with e.g. coreutils sources)
6659 is version controlled with git, rather than CVS.
6660 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6661 rather than CVS.
6662 In messages and comments, say e.g., "checked-out sources",
6663 rather than "CVS sources".
6664 (version_controlled_file): New function. Work for git as well as
6665 for CVS. Don't use grep's -q option.
6666 (slurp): Call it here, in place of CVS-specific code.
6667
66682006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6669
6670 Fix testsuite for ./configure --enable-gcc-warnings:
6671 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6672 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6673 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6674 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6675 * test/regression.at (Diagnostic that expects two alternatives):
6676 Likewise.
6677
66782006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6679
6680 * bootstrap.conf (gnulib_modules): Add config-h.
6681 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6682 worry about HAVE_CONFIG_H.
6683 * lib/abitset.c: Likewise.
6684 * lib/bitset.c: Likewise.
6685 * lib/bitset_stats.c: Likewise.
6686 * lib/bitsetv-print.c: Likewise.
6687 * lib/bitsetv.c: Likewise.
6688 * lib/ebitset.c: Likewise.
6689 * lib/get-errno.c: Likewise.
6690 * lib/lbitset.c: Likewise.
6691 * lib/subpipe.c: Likewise.
6692 * lib/timevar.c: Likewise.
6693 * lib/vbitset.c: Likewise.
6694 * lib/bitset.c: Include "bitset.h" first, to test interface.
6695 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6696 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6697 * lib/bitsetv.c: Include "bitsetv.h" first.
6698 * lib/get-errno.c: Include "get-errno.h" first.
6699 * m4/.cvsignore: Add config-h.m4.
6700 * tests/actions.at (Default %printer and %destructor for ...):
6701 Adjust expected line numbers in output to reflect removal of #if
6702 HAVE_CONFIG_H lines.
6703 * tests/glr-regression.at (Missed %merge type warnings when ...):
6704 Likewise.
6705 * tests/regression.at (Braced code in declaration in rules section):
6706 Likewise.
6707 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6708 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6709 Include <config.h> unconditionally.
6710
6711 * bootstrap: Sync from coreutils, as follows:
6712
6713 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6714
6715 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6716 variable was sometimes used without being initialized. This
6717 messed up the installation of the INSTALL file in some cases.
6718
6719 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6720
6721 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6722 --copy. Inspired by a suggestion from Bruno Haible.
6723
6724 2006-10-03 Jim Meyering <jim@meyering.net>
6725
6726 * bootstrap: Undo last change to this file, since now gnulib-tool
6727 sticks with the automake default in generating dependencies.
6728
67292006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6730
6731 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6732 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6733
6734 * doc/bison.1: Add copyright notice.
6735
6736 * data/glr.c: Don't include <stdarg.h>; not used.
6737
6738 * NEWS: The -g and --graph options now output graphs in Graphviz
6739 DOT format, not VCG format.
6740 * doc/bison.1: Likewise.
6741 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
6742 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6743 of this change in
6744 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
6745 * TODO: Remove Graphviz entry.
6746 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6747 remove vcg.c, vcg.h, vcg_defaults.h.
6748 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6749 * src/graphviz.c, src/graphviz.h: New files.
6750 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6751 * src/files.h: Make comment more generic.
6752 * src/main.c (main): Likewise.
6753 * src/print_graph.h: Likewise.
6754 * src/getargs.c (usage): Make usage description more generic.
6755 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6756 (static_graph, fgraph): Remove. All uses changed to pass
6757 arguments instead of sharing a static var.
6758 (print_core, print_actions, print_state, print_graph):
6759 Output graphviz format rather than VCG format.
6760 * tests/.cvsignore: Remove *.vcg; add *.dot.
6761 * tests/output.at: Expect *.dot files, not *.vcg files.
6762
6763 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6764 accommodates the 2006-10-08 change.
6765
67662006-10-11 Bob Rossi <bob@brasko.net>
6767
6768 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6769 (b4_yyssa, b4_yyerror_range): New macros.
6770 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6771 (yypvarsinit): Remove init of removed fields.
6772 (yypushparse): Remove use of removed fields; use new macros instead.
6773
67742006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6775
6776 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6777 in a push parser. Reindent slightly to match yacc.c better.
6778
67792006-10-11 Bob Rossi <bob@brasko.net>
6780
6781 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6782 yymsg_alloc fields.
6783 (yypvarsinit, yypushparse): Remove init of removed fields.
6784 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
6785
67862006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6787
6788 * THANKS: Add Paolo Bonzini and Bob Rossi.
6789
67902006-10-08 Paolo Bonzini <bonzini@gnu.org>
6791
6792 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6793 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6794 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6795 b4_define_user_cde and uses): Remove.
6796 (b4_comment, b4_prefix, b4_sync_start): New.
6797 * data/bison.m4: New file, with most of the content removed from c.m4.
6798 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6799 * src/output.c (output_skeleton): Pass bison.m4.
6800 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6801 only if specified.
6802
68032006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6804
6805 Fix test failure reported by Tom Lane in
6806 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6807 and try to make such failures easier to catch in the future.
6808 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6809 that's now the caller's responsibility.
6810 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6811 Set yychar = YYEOF if it's negative.
6812 * tests/actions.at (yylex): Abort if asked to read past EOF.
6813 * tests/conflicts.at (yylex): Likewise.
6814 * tests/cxx-type.at (yylex): Likewise.
6815 * tests/glr-regression.at (yylex): Likewise.
6816 * tests/input.at (yylex): Likewise.
6817 * tests/regression.at (yylex): Likewise.
6818 * tests/torture.at (yylex): Likewise.
6819
68202006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6821
6822 Fix problems with translating English-language diagnostics.
6823 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6824 respect to bison-runtime pot generation. The YY_ stuff
6825 wasn't being captured.
6826 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6827 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6828 * runtime-po/POTFILES.in: Add data/push.c.
6829
68302006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6831
6832 Merge bootstrap changes from coreutils.
6833
6834 2006-09-28 Jim Meyering <jim@meyering.net>
6835
6836 Automatically generated dependencies are important even
6837 when all of the sources in a directory come from gnulib.
6838 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6839 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6840
6841 2006-09-23 Jim Meyering <jim@meyering.net>
6842
6843 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6844
6845 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6846
6847 * bootstrap: Add support for --force.
6848 (usage): New function. Describe usage less tersely.
6849 (CVS_only_file): New var.
6850
68512006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6852
6853 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6854 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6855 Adjust white space and comments to match GNU style better.
6856
68572006-09-20 Bob Rossi <bob@brasko.net>
6858
6859 * data/push.c (yyresult_get): Remove function.
6860 (YYPUSH_MORE): Add #define.
6861 (yypushparse): Modify return value.
6862
68632006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6864
6865 * stamp-h.in: Remove; no longer needed.
6866 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6867 Remove config.h, config.hin, intl (no longer created).
6868 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6869 stamp-h1.
6870
6871 Sync bootstrap from coreutils, as follows:
6872
6873 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6874
6875 * bootstrap (symlink_to_gnulib): New function.
6876 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6877 to copies-of-gnulib.
6878 (cp_mark_as_generated, slurp, gnulib_files):
6879 Avoid making a copy if it's the same as the old version.
6880 (gnulib_files): Add support for this variable (used by Bison).
6881
68822006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6883
6884 * src/getargs.c (usage): Rework to use conventions similar to
6885 coreutils, to make translation a bit easier and the code a bit
6886 smaller. Problem reported by Tim Van Holder.
6887
68882006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6889
6890 Use some of gnulib's new modules, taken from coreutils.
6891
6892 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6893 * bootstrap.conf: New file.
6894 (gnulib_modules): Add configmake, inttypes, unistd.
6895 (XGETTEXT_OPTIONS): Add complain, complain_at,
6896 fatal, fatal_at, warn, warn_at, unexpected_end.
6897 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6898 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6899 (gl_EARLY): Add.
6900 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6901 (gl_INIT): Add
6902 (GNULIB_AUTOCONF_SNIPPET): Remove.
6903 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6904 the pickiest.
6905 * lib/.cvsignore: Add inttypes_.h.
6906 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6907 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6908 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6909 no-longer-necessary initializations.
6910 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6911 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6912 use the unistd module.
6913 * src/system.h: Likewise.
6914 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6915 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6916 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6917 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6918 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6919 * src/system.h: Include inttypes.h unconditionally, now that we
6920 use the inttypes module. Don't bother to include stdint.h, since
6921 inttypes.h now does that for us.
6922 (LOCALEDIR): Remove, now that we use the configmake module.
6923 * src/getargs.c: Include configmake.h.
6924 * src/main.c: Likewise.
6925 * src/output.c: Likewise.
6926 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6927 not from $abs_top_builddir, since config.h moved.
6928
6929
6930 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6931 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6932
6933 * src/parse-gram.y (symbol_declaration): Don't put statements
6934 before declarations; it's not portable to C89.
6935 * src/scan-code.l (handle_action_at): Likewise.
6936
6937 * src/scan-code.l: Always initialize braces_level; the old code
6938 left it uninitialized and therefore had undefined behavior.
6939
6940 Don't attempt to redefine 'assert', since it runs afoul of
6941 systems where standard headers (mistakenly) include <assert.h>.
6942 Instead, define and use our own alternative, called 'aver'.
6943 * src/reader.c: Don't include assert.h, since we no longer
6944 use assert.
6945 * src/scan-code.l: Likewise.
6946 * src/system.h (assert): Remove, replacing with....
6947 (aver): New function, taking a bool arg. All uses changed.
6948 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6949 not merely an integer.
6950
69512006-09-15 Bob Rossi <bob@brasko.net>
6952
6953 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6954 * data/c.m4 (YYPUSH): New.
6955 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6956 * src/getargs.c (push_parser): New var.
6957 * src/getargs.h (push_parser): New declaration.
6958 * src/output.c (prepare): Add macro insertion of `push_flag'.
6959 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6960 (prologue_declaration): Parse %push-parser.
6961 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6962 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6963 list of removed lines from the traces observed.
6964 (AT_CHECK_CALC_LALR): Added push parser tests.
6965
69662006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6967
6968 * NEWS: Version 2.3a.
6969 * configure.ac (AC_INIT): Likewise.
6970
6971 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6972 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6973 due to header ordering dependencies. I don't know why the #define
6974 was there.
6975
6976 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6977 runtime cost when YYDEBUG is not defined, and so that some tests
6978 that used to fail now work. Problem and initial suggestion by
6979 Paolo Bonzini.
6980 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6981 * data/glr.cc (b4_parser_class_name):
6982 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6983 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6984 (yydebug_) [YYDEBUG]: New member.
6985 (yycdebug_): Now defined only if YYDEBUG.
6986 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6987 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6988 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6989 if YYYDEBUG.
6990 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6991 Define only if YYDEBUG.
6992 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6993 set_debug_level.
6994 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6995 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6996 AT_CHECK_CALC_GLR_CC that are working now.
6997
69982006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6999
7000 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
7001 We don't need them in glr.cc, and glr.c defines them.
7002 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
7003 assumes that defining it to anything is the same as defining
7004 it to 1. Problem reported by Paolo Bonzini.
7005
70062006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
7007
7008 * data/c.m4 (b4_null, b4_case): Define.
7009 * src/output.c (prepare_symbols): Use b4_null.
7010 (user_actions_output): Use b4_case.
7011
70122006-09-11 Paul Eggert <eggert@cs.ucla.edu>
7013
7014 * data/glr.c (b4_shared_declarations): Put start-header first,
7015 before any #includes that we generate, so that feature-test
7016 macros work. Problem reported by Michael Deutschmann in
7017 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7018 * data/lalr1.cc: Likewise.
7019 * doc/bison.texinfo (Prologue): Document that feature-test macros
7020 should be defined before any Bison declarations.
7021 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
7022 that depend on location.hh after, not before, Bison decls, since
7023 we now include location.hh after the first user prologue.
7024
7025 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
7026 Sander Brandenburg in
7027 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
7028 Also, fix minor white space and comment issues.
7029 (Prologue): Mention that it's better to define feature-test macros
7030 before Bison declarations. Problem reported by Michael Deutschmann.
7031
7032 * README-cvs: Fix typo: "&" should be "&&". Problem reported
7033 by Jim Meyering.
7034 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
7035 This adjusts to recent gnulib changes.
7036
70372006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7038
7039 Finish implementation of per-type %destructor/%printer. Discussed
7040 starting at
7041 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7042 and
7043 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7044 * NEWS (2.3+): Add a description of this feature to the default
7045 %destructor/%printer description.
7046 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7047 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7048 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7049 list node contains a semantic type.
7050 * src/symtab.c, src/symtab.h: Extend with a table that associates
7051 semantic types with their %destructor's and %printer's.
7052 (semantic_type_from_uniqstr, semantic_type_get,
7053 semantic_type_destructor_set, semantic_type_printer_set): New functions
7054 composing the public interface of that table.
7055 (symbol_destructor_get, symbol_destructor_location_get,
7056 symbol_printer_get, symbol_printer_location_get): If there's no
7057 per-symbol %destructor/%printer, look up the per-type before trying
7058 the default.
7059 * tests/actions.at (Per-type %printer and %destructor): New test case.
7060 * tests/input.at (Default %printer and %destructor redeclared):
7061 Extend to check that multiple occurrences of %symbol-default in a
7062 single %destructor/%printer declaration is an error.
7063 (Per-type %printer and %destructor redeclared, Unused values with
7064 per-type %destructor): New test cases.
7065
70662006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7067
7068 Require default %destructor/%printer to be declared using
7069 %symbol-default instead of an empty symbol list, and start working on
7070 new per-type %destructor/%printer. Discussed at
7071 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7072 * NEWS (2.3+): Add %symbol-default to example.
7073 * bison.texinfo (Freeing Discarded Symbols): Likewise.
7074 (Table of Symbols): Add entry for %symbol-default.
7075 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7076 (generic_symlist, generic_symlist_item): New nonterminals for creating
7077 a list in which each item is a symbol, semantic type, or
7078 %symbol-default.
7079 (grammar_declaration): Use generic_symlist in %destructor and %printer
7080 declarations instead of symbols.1 or an empty list.
7081 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7082 for changes to symbol_list.
7083 * src/reader.c: Update for changes to symbol_list.
7084 * src/scan-code.l: Likewise.
7085 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7086 * src/symlist.c, src/symlist.h: Extend such that a list node may
7087 represent a semantic type or a %symbol-default in addition to just an
7088 ordinary symbol. Add switched functions for setting %destructor's and
7089 %printer's.
7090 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7091 %destructor/%printer declarations.
7092
70932006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7094
7095 Whether the default %destructor/%printer applies to a particular symbol
7096 isn't a question of whether the user *declares* that symbol (in %token,
7097 for example). It's a question of whether the user by any means
7098 *defines* the symbol at all (by simply using a char token, for
7099 example). $end is defined by Bison whereas any other token with token
7100 number 0 is defined by the user. The error token is always defined by
7101 Bison regardless of whether the user declares it with %token, but we
7102 may one day let the user define error as a nonterminal instead.
7103 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7104 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7105 the meaning of "user-defined".
7106 * tests/actions.at (Default %printer and %destructor for user-declared
7107 end token): Rename to...
7108 (Default %printer and %destructor for user-defined end token): ...
7109 this.
7110
7111 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7112 computation of whether to apply the default, don't maintain a list of
7113 every Bison-defined symbol. Instead, just check for a first character
7114 of '$', which a user symbol cannot have, and check for the error token.
7115
71162006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7117
7118 Don't apply the default %destructor or %printer to the error token,
7119 $undefined, or $accept. This change fits the general rule that the
7120 default %destructor and %printer are only for user-declared symbols,
7121 and it solves several difficulties that are described in the new test
7122 cases listed below.
7123 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
7124 * tests/actions.at (Default %printer and %destructor are not for error
7125 or $undefined, Default %printer and %destructor are not for $accept):
7126 New test cases.
7127
71282006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
7129
7130 Allow %start after the first rule.
7131 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
7132 when parsing the first rule.
7133 (check_and_convert_grammar): Search for it here after all grammar
7134 declarations have been parsed. Skip midrules, which have dummy LHS
7135 nonterminals.
7136 * src/symtab.c (symbol_is_dummy): New function.
7137 * src/symtab.h (symbol_is_dummy): Declare it.
7138 * tests/input.at (%start after first rule): New test.
7139
71402006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7141
7142 Redo some of the previous commit: add back the ability to use
7143 non-aliased/undeclared string literals since it might be useful to
7144 those declaring %token-table.
7145 * src/reader.c (check_and_convert_grammar): Undo changes in previous
7146 commit: don't worry about complaints from symbols_pack.
7147 * src/symtab.c (symbol_new, symbol_class_set,
7148 symbol_check_alias_consistency): Undo changes in previous commit: count
7149 each string literal as a new symbol and token, assign it a symbol
7150 number, and don't complain about non-aliased string literals.
7151 (symbols_pack): Since symbol_make_alias still does not decrement symbol
7152 and token counts but does still set aliased tokens to the same number,
7153 symbol_pack_processor now leaves empty slots in the symbols array.
7154 Remove those slots.
7155 * tests/regression.at (Undeclared string literal): Remove test case
7156 added in previous commit since non-aliased string literals are allowed
7157 again.
7158 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
7159 remove unnecessary string literal declarations.
7160 * tests/sets.at (Firsts): Likewise.
7161
71622006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7163
7164 Don't allow an undeclared string literal, but allow a string literal to
7165 be used before its declaration.
7166 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
7167 symbols_pack complained.
7168 * src/symtab.c (symbol_new): Don't count a string literal as a new
7169 symbol.
7170 (symbol_class_set): Don't count a string literal as a new token, and
7171 don't assign it a symbol number since symbol_make_alias does that.
7172 (symbol_make_alias): It's not necessary to decrement the symbol and
7173 token counts anymore. Don't assume that an alias declaration occurs
7174 before any uses of the identifier or string, and thus don't assert that
7175 one of them has the highest symbol number so far.
7176 (symbol_check_alias_consistency): Complain if there's a string literal
7177 that wasn't declared as an alias.
7178 (symbols_pack): Bail if symbol_check_alias_consistency failed since
7179 symbol_pack asserts that every token has been assigned a symbol number
7180 although undeclared string literals have not.
7181 * tests/regression.at (String alias declared after use, Undeclared
7182 string literal): New test cases.
7183 (Characters Escapes, Web2c Actions): Declare string literals as
7184 aliases.
7185 * tests/sets.at (Firsts): Likewise.
7186
71872006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
7188
7189 In the grammar scanner, STRING_FINISH unclosed constructs and return
7190 them to the parser in order to improve error messages.
7191 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
7192 SC_BRACED_CODE, SC_PROLOGUE): Implement.
7193 * tests/input.at (Unclosed constructs): New test case.
7194 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
7195 seen.
7196
7197 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
7198 unused global.
7199
72002006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
7201
7202 Handle string aliases for character tokens correctly.
7203 * src/symtab.c (symbol_user_token_number_set): If the token has an
7204 alias, check and set its alias's user token number instead of its own,
7205 which is set to indicate the alias. Previously, every occurrence of
7206 the character token in the grammar overwrote that alias indicator with
7207 the character code.
7208 * tests/input.at (String aliases for character tokens): New test.
7209
72102006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
7211
7212 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
7213
72142006-08-11 Paul Eggert <eggert@cs.ucla.edu>
7215
7216 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
7217 to prevent failures when building on older platforms.
7218 Check for autopoint failure.
7219 Set XGETTEXT_OPTIONS to values that check for C format strings,
7220 so that translators are warned about them (this also helps
7221 prevent core dumps).
7222
7223 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
7224 function, since it simplifies our code a bit.
7225
7226 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
7227 rather than -W, so we don't get bogus warnings about sign comparisons.
7228 Add -Wpointer-arith, since that warning is useful (it reports code
7229 that does not conform to C89 and that some compilers reject).
7230 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
7231 since it's no longer needed.
7232
72332006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
7234
7235 Clean up scanners a bit.
7236 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
7237 definitions so gcc won't warn when obstack_for_string is unused.
7238 * src/scan-code.l: config.h and system.h are already #include'd by
7239 scan-code-c.c, so get rid of them here.
7240 * src/scan-gram.l: Likewise.
7241 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
7242 definitions rather than duplicating the rest of it.
7243 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
7244
72452006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
7246
7247 Suppress signed/unsigned comparison warnings for yycheck.
7248 * data/c.m4 (b4_safest_int_type): New macro.
7249 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
7250 a signed int type, cast it to b4_safest_int_type first.
7251 * data/yacc.c: Likewise.
7252 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
7253 also overwritten.
7254
72552006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
7256
7257 * doc/bison.texinfo: Fix some typos.
7258
72592006-08-02 Paul Eggert <eggert@cs.ucla.edu>
7260
7261 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
7262 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
7263
7264 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
7265 the latest gnulib does this a different way.
7266 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
7267 translation was patched, so stop omitting it.
7268
72692006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7270
7271 Enable declaration of default %printer/%destructor. Make the parser
7272 use these for all user-declared grammar symbols for which the user does
7273 not declare a specific %printer/%destructor. Thus, the parser uses it
7274 for token 0 if the user declares it but not if Bison generates it as
7275 $end. Discussed starting at
7276 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7277 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7278 and
7279 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7280 * NEWS (2.3+): Mention.
7281 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7282 declare a %destructor for a mid-rule's semantic value. It's just
7283 impossible to declare one specific to it.
7284 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7285 code. Describe default %destructor form.
7286 * src/parse-gram.y (grammar_declaration): Parse default
7287 %printer/%destructor declarations.
7288 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7289 and symbol_destructor_location_get rather than accessing the destructor
7290 and destructor_location members of struct symbol.
7291 (symbol_printers_output): Likewise but for %printer's.
7292 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7293 again.
7294 * src/symtab.c (default_destructor, default_destructor_location,
7295 default_printer, default_printer_location): New static global
7296 variables to record the default %destructor and %printer.
7297 (symbol_destructor_get, symbol_destructor_location_get,
7298 symbol_printer_get, symbol_printer_location_get): New functions to
7299 compute the appropriate %destructor and %printer for a symbol.
7300 (default_destructor_set, default_printer_set): New functions to set the
7301 default %destructor and %printer.
7302 * src/symtab.h: Prototype all those new functions.
7303 * tests/actions.at (Default %printer and %destructor): New test to
7304 check that the right %printer and %destructor are called, that they're
7305 not called for $end, and that $$ and @$ work correctly.
7306 (Default %printer and %destructor for user-declared end token): New
7307 test to check that the default %printer and %destructor are called for
7308 a user-declared end token.
7309 * tests/input.at (Default %printer and %destructor redeclared, Unused
7310 values with default %destructor): New tests to check related grammar
7311 warnings and errors.
7312
73132006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7314
7315 Clean up handling of %destructor for the end token (token 0).
7316 Discussed starting at
7317 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7318 and
7319 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7320
7321 Make the skeletons consistent in how they pop the end token and invoke
7322 its %destructor.
7323 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7324 state, which has token number 0, since this would invoke the
7325 %destructor for the end token.
7326 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7327 until after shifting the end token, or else it won't be popped.
7328 * data/yacc.c (yyparse): Likewise.
7329
7330 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7331 it's the end token. Upon termination, destroy an unshifted lookahead
7332 even when it's the end token.
7333 * data/lalr1.cc (yy::parser::parse): Likewise.
7334 * data/yacc.c (yyparse): Likewise.
7335
7336 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7337 value warnings for the end token when the user gives the end token a
7338 %destructor.
7339
7340 * tests/actions.at (Printers and Destructors): Test all the above.
7341
73422006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7343
7344 Update to latest gnulib and gettext versions.
7345 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7346 Add fopen-safer.
7347 (gnulib_files): Add m4/warning.m4. Don't worry about files
7348 overwritten by autopoint.
7349 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7350 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7351 rejects them.
7352 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7353 so that we can remove the intl files at a better time.
7354 (intl_files_to_remove): Remove aclocal.m4, since it gets
7355 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7356 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7357 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7358 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7359 Remove datarootdir hack; no longer needed.
7360 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7361 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7362 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7363 strdup.h.
7364 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7365 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7366
73672006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7368
7369 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7370 it with --assume-autoconf='latest-stable'.
7371
73722006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7373
7374 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7375 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7376 YYSTYPE' and `{'.
7377 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7378 those from muscle_tab.c since the old ones are misleading.
7379
73802006-07-13 Akim Demaille <akim@epita.fr>
7381
7382 Support %define "KEY" {VALUE}.
7383 * src/scan-code.h, src/scan-code.l (translate_action)
7384 (translate_rule_action, translate_symbol_action, translate_code):
7385 Return char *, not const char *.
7386 * src/parse-gram.y (declaration): Rename as...
7387 (prologue_declaration): this.
7388 (string_content): Remove this nonterminal, use STRING.
7389 (braceless, content, content.opt): New nonterminal.
7390 Use them.
7391 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7392 as value.
7393 * src/scan-gram.l (getargs.h): Don't include it.
7394
73952006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7396
7397 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7398 rather than a for-loop that declares a local bool variable. This
7399 should work around a compatibility problem with a Cray x1e C++
7400 compiler reported by Hung Nguyen in
7401 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7402 The for-loop was introduced in the 2004-11-17 change but I don't
7403 know why it was needed.
7404
74052006-07-12 Akim Demaille <akim@epita.fr>
7406
7407 * data/c.m4: Comment changes.
7408
74092006-07-10 Akim Demaille <akim@lrde.epita.fr>
7410
7411 * src/complain.c (error_message, ERROR_MESSAGE): New.
7412 To factor...
7413 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7414 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7415
74162006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7417
7418 * NEWS: Instead of %union, you can define and use your own union type
7419 YYSTYPE if your grammar contains at least one <type> tag.
7420 Your YYSTYPE need not be a macro; it can be a typedef.
7421 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7422 (Union Decl, Decl Summary): Document this.
7423 * data/glr.c (YYSTYPE): Implement this.
7424 * data/glr.cc (YYSTYPE): Likewise.
7425 * data/lalr1.cc (YYSTYPE): Likewise.
7426 * data/yacc.c (YYSTYPE): Likewise.
7427 * src/output.c (prepare): Output tag_seen_flag.
7428 * src/parse-gram.y (declaration, grammar_declaration):
7429 Use 'union_seen' rather than 'typed' to determine whether
7430 %union has been seen, since grammars can now be typed without
7431 %union.
7432 (symbol_declaration, type.opt, symbol_def):
7433 Keep track of whether a tag has been seen.
7434 * src/reader.c (union_seen, tag_seen): New vars.
7435 (typed): remove.
7436 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7437 * src/scan-code.l (untyped_var_seen): New variable.
7438 (handle_action_dollar): Adjust to above changes.
7439 (handle_action_dollar, handle_action_at):
7440 Improve overflow checking for outlandish numbers.
7441 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7442 avoid new diagnostics generated by above changes.
7443 * tests/regression.at (YYSTYPE typedef): Add test to check
7444 for type tags without %union.
7445
7446 * src/symlist.c (symbol_list_length): Return int, not unsigned
7447 int, since callers expect int. This may need to get revisited
7448 once we have proper integer overflow checking.
7449
7450 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7451 object is now static.
7452
7453 * src/getargs.c (flags_argmatch): Return void, not int,
7454 to pacify ./configure --enable-gcc-warnings.
7455
7456 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7457 since last_string is already defined to FLEX_PREFIX (last_string).
7458
74592006-07-09 Akim Demaille <akim@lrde.epita.fr>
7460
7461 Implement --warnings/-W.
7462 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7463 replaced by...
7464 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7465 Adjust callers.
7466 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7467 (warnings_args, warnings_types): New.
7468 (getargs, short_options, long_options): Accept -W/--warnings.
7469 Sort the options by alphabetical order, upper case letter right
7470 before its lower case.
7471
74722006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7473
7474 Change %merge result type clash warnings to errors. Discussed at
7475 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7476 * src/reader.c (record_merge_function_type): Use complain_at.
7477 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7478 declared later): Update test case results.
7479
74802006-07-09 Akim Demaille <akim@lrde.epita.fr>
7481
7482 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7483 to be in alphabetical order.
7484 (trace_args): Spelling fixes.
7485
74862006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7487
7488 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7489 so they don't collide with user-defined macros.
7490 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7491 this was never guaranteed, and now that we're using gnulib stdint,
7492 which defines int_fast16_t to long int, the problem is exposed.
7493
74942006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7495
7496 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7497 need the full POSIX semantics (and weren't implementing them
7498 anyway).
7499
7500 Adjust to Autoconf 2.60 and today's gnulib.
7501 * bootstrap (gnulib_modules): Add stdint.
7502 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7503 no longer copies it.
7504 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7505 since stdint needs the former and wcwidth (which is now required
7506 by mbswidth) needs the latter.
7507 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7508 work around a compatibility glitch between gettext 0.14.6 and
7509 Autoconf 2.60.
7510 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7511 Do not check for uintptr_t, since new stdint module does the right
7512 thing.
7513 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7514 Add stdint.h, stdint_.h, wcwidth.h.
7515 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7516 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7517 stdint.m4, wchar_t.m4, wcwidth.m4.
7518 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7519 usual order for ../lib/*.h files.
7520 (file_name_split): Use last_component, not base_name, to adjust
7521 to gnulib changes.
7522 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7523 for ../lib/*.h files.
7524 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7525 Define unconditionally, since we now assume the stdint module.
7526 * src/scan-skel.l: Include <dirname.h>.
7527 (BASE_QPUTS): Use last_component, not base_name.
7528 * src/system.h: Include <unlocked-io.h> in the usual order
7529 for ../lib/*.h files. Include <stdint.h> unconditionally,
7530 since we now use the stdint module.
7531 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7532 HAVE_UINTPTR_T, since we now use the stdint module.
7533 (base_name): Remove decl, since files now include <dirname.h>
7534 to get the decl.
7535
75362006-07-08 Akim Demaille <akim@lrde.epita.fr>
7537
7538 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7539 New, default to 1.
7540 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7541 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7542 default.
7543 * tests/calc.at: Adjust.
7544
75452006-07-08 Akim Demaille <akim@lrde.epita.fr>
7546
7547 * data/c.m4 (b4_basename): New.
7548 (b4_syncline): Also output the location of its invocation (from
7549 the skeleton).
7550 (b4_user_action, b4_define_user_action, b4_user_actions)
7551 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7552 (b4_user_stype): New.
7553 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7554
75552006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7556
7557 In the grammar file, the first column is 1 not 0 on the first line as
7558 on every other line.
7559 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7560 * tests/input.at (Torturing the Scanner): Update output.
7561
7562 * src/scan-gram.l (scanner_cursor): Declare it static.
7563
75642006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7565
7566 In warnings, say "previous declaration" rather than "first
7567 declaration".
7568 * src/symtab.c (redeclaration): Do that here.
7569 * src/reader.c (record_merge_function_type): In the case of a result
7570 type clash, report the previous declaration rather than the very first
7571 one in the grammar file.
7572 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7573 declared later): Add a third declaration to check this behavior.
7574 * tests/input.at (Incompatible Aliases): Update output.
7575
75762006-06-27 Akim Demaille <akim@epita.fr>
7577
7578 * doc/Doxyfile.in: New.
7579 * doc/Makefile.am: Use it.
7580 * src/lalr.h, src/symtab.h: Initial doxygenation.
7581
75822006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7583
7584 Don't miss %merge result type warnings just because the LHS types are
7585 declared after the %merge. This continues the effort of the previous
7586 patch.
7587 * src/reader.c (get_merge_function): Don't set the merger type yet.
7588 (record_merge_function_type): New function for setting the merger type
7589 and checking for clashes.
7590 (grammar_current_rule_merge_set): Set the location of the %merge for
7591 the current rule.
7592 (packgram): Invoke record_merge_function_type for each rule now that
7593 all symbol type declarations have been parsed.
7594 * src/reader.h (merger_list.type_declaration_location): New member
7595 storing the location of the first %merge from which the type for this
7596 merging function was derived.
7597 * src/symlist.h (symbol_list.merger_declaration_location): New member
7598 storing the location of a rule's %merge, if any.
7599 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7600 declared later): New test to catch the error fixed by the above patch.
7601
76022006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7603
7604 Get action warnings (grammar_rule_check) right even when symbol
7605 declarations appear after the rules. Discussed at
7606 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7607 and
7608 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7609 Don't mistake the type of $$ in a midrule to be that of its parent
7610 rule's $$.
7611 * src/reader.c (grammar_current_rule_end): Don't invoke
7612 grammar_rule_check yet since not all symbol declarations may have been
7613 parsed yet.
7614 (grammar_midrule_action): Likewise.
7615 Don't record whether the midrule's $$ has been used yet since actions
7616 haven't been translated yet.
7617 Record the midrule's parent rule and its RHS index within the parent
7618 rule.
7619 (grammar_current_rule_action_append): Don't translate the action yet
7620 since not all symbol declarations may have been parsed yet and, thus,
7621 warnings about types for $$, $n, @$, and @n can't be reported yet.
7622 (packgram): Translate the action and invoke grammar_rule_check now that
7623 all symbol declarations have been parsed.
7624 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7625 after parsing the entire grammar file, the symbol list here in the case
7626 of a midrule is actually the midrule's empty RHS, so reference its
7627 parent rule's RHS where necessary.
7628 On the other hand, now that you can already know it's a midrule, you
7629 aren't forced to think $$ has the same type as its parent rule's $$.
7630 (handle_action_at): In the case of a midrule, reference the parent rule
7631 where necessary.
7632 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7633 members.
7634 (symbol_list_length): Now that this is invoked after all rules have
7635 been parsed, a NULL symbol (rather than a NULL symbol list node)
7636 terminates a rule. symbol_list_print already does this correctly.
7637 * src/symlist.h (symbol_list.midrule_parent_rule,
7638 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7639 remember their relationships with their parents.
7640 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7641 fixed by the above patch.
7642 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7643 implementing...
7644 (Unused values): ... this old test case and...
7645 (Unused values before symbol declarations): ... this new test case.
7646 This one is the same as `Unused values' except that all symbol
7647 declarations appear after the rules in order to catch the rest of the
7648 errors fixed by the above patch.
7649
76502006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7651
7652 More cleanup.
7653 * src/reader.c (current_rule): Declare it static since it's no longer
7654 used outside this file.
7655 (grammar_current_rule_action_append): Remove redundant arguments from
7656 translate_rule_action invocation.
7657 * src/reader.h (current_rule): Remove this unused extern.
7658 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7659 * src/scan-code.l (translate_rule_action): Likewise.
7660
76612006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7662
7663 Clean up yesterday's patch.
7664 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7665 to...
7666 * src/reader.c (grammar_current_rule_action_append): ... here for
7667 consistency with grammar_current_rule_symbol_append.
7668 * tests/regression.at (Braced code in declaration in rules section):
7669 Make yyerror and yylex static as usual.
7670
76712006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7672
7673 Fix bug that mistakes braced code in a declaration in the rules section
7674 to be a rule action. Mentioned at
7675 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7676 * src/scan-gram.l: Move midrule action detection from the start of the
7677 scanning of any braced code to...
7678 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7679 action. For readability, use $2 and @2 rather than the equivalent
7680 global variables.
7681 * tests/regression.at (Braced code in declaration in rules section):
7682 New test to catch the error fixed by the above patch.
7683
7684 Work on code readability some.
7685 * src/scan-code.l (current_rule): Get rid of this misleading and
7686 redundant declaration: it's actually extern'ed in reader.h.
7687 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7688 translate_action): Add a rule argument and use it instead of the global
7689 current_rule.
7690 (translate_rule_action): This already receives current_rule through an
7691 argument, so pass it on to translate_action instead of assigning
7692 current_rule to current_rule.
7693 (translate_symbol_action, translate_code): Pass rule = NULL to
7694 translate_action.
7695
76962006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7697
7698 Rename %before-definitions to %start-header and %after-definitions to
7699 %end-header. Don't use these declarations to separate pre-prologue
7700 blocks from post-prologue blocks. Add new order-independent
7701 declarations %before-header and %after-header as alternatives to the
7702 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7703 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7704 * NEWS (2.3+): Update for these changes.
7705 * data/glr.c (b4_before_definitions): Update to...
7706 (b4_start_header): ... this.
7707 (b4_after_definitions): Update to...
7708 (b4_end_header): ... this.
7709 * data/glr.cc: Likewise.
7710 * data/lalr1.cc: Likewise.
7711 * data/yacc.c: Likewise.
7712 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7713 prologue blocks with %*-header declarations.
7714 (Calc++ Parser): Likewise.
7715 (Decl Summary): Update names.
7716 (Table of Symbols): Update description.
7717 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7718 (PERCENT_END_HEADER): ... this.
7719 (PERCENT_BEFORE_DEFINITIONS): Update to...
7720 (PERCENT_START_HEADER): ... this.
7721 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7722 (declaration): Update token names and m4 macro names.
7723 When parsing %end-header and %start-header, invoke translate_code
7724 before muscle_code_grow, and no longer set global booleans to remember
7725 whether these declarations have been seen.
7726 Parse new %after-header and %before-header.
7727 * src/reader.c (before_definitions, after_definitions): Remove.
7728 (prologue_augment): Accept a new bool argument to specify whether to
7729 augment the pre-prologue or post-prologue.
7730 * src/reader.h (before_definitions, after_definitions): Remove these
7731 extern's.
7732 (prologue_augment): Add new bool argument.
7733 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7734 (PERCENT_END_HEADER): ... this.
7735 (PERCENT_BEFORE_DEFINITIONS): Update to...
7736 (PERCENT_START_HEADER): ... this.
7737 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7738 * tests/actions.at (Printers and Destructors): Update names.
7739
77402006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7741
7742 Add comparison operators for C++ location classes. Discussed at
7743 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7744 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7745 declaration indicating whether filename_type has an operator==. If
7746 filename_type is `std::string', it defaults to `1', `0' otherwise.
7747 * data/location.cc: Iff b4_define_location_comparison is `1', add
7748 operator== and operator!= for class position and for class location.
7749
7750 Some minor fixes.
7751 * src/scan-action.l: Remove unused file.
7752 * src/symtab.c (symbol_printer_set): Use printer_location not
7753 destructor_location.
7754 * src/symtab.h (struct symbol): Replace incorrect source comment for
7755 printer members.
7756 * tests/input.at (Incompatible Aliases): Update output with correct
7757 printer location.
7758
77592006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7760
7761 Don't put the pre-prologue in the header file. For the yacc.c code
7762 file and the glr.c header and code files, move the pre-prologue before
7763 the token definitions. Add new %before-definitions and
7764 %after-definitions to declare code that will go in both the header file
7765 and code file. Discussed at
7766 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7767 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7768 and
7769 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7770 * NEWS (2.3+): Describe these changes.
7771 * data/glr.c (b4_pre_prologue): Move from within to before...
7772 (b4_shared_declarations): ... this.
7773 Add new b4_before_definitions before b4_token_enums.
7774 Add new b4_after_definitions at the end.
7775 * data/glr.cc (b4_pre_prologue): Replace with...
7776 (b4_before_definitions): ... this in the header file.
7777 (b4_after_definitions): New near the end of the header file.
7778 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7779 code file right before including the header file.
7780 (b4_before_definitions): New in the previous position of
7781 b4_pre_prologue in the header file.
7782 (b4_after_definitions): New near the end of the header file.
7783 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7784 (b4_token_enums_defines): In the code file, move to right before
7785 YYSTYPE for consistency with the header file.
7786 (b4_before_definitions): New right before b4_token_enums_defines in
7787 both the header and code file.
7788 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7789 header and code file.
7790 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7791 of prologues for %union dependencies.
7792 (Decl Summary): In %defines description, mention the effect of
7793 %before-definitions and %after-definitions on the header file.
7794 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7795 than in the pre-prologue so that make check succeeds.
7796 (Table of Symbols): Add entries for %before-definitions and
7797 %after-definitions.
7798 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7799 %before-definitions.
7800 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7801 (declaration): Parse those declarations and append to
7802 b4_before_definitions and b4_after_definitions, respectively.
7803 * src/reader.c (before_definitions, after_definitions): New bools to
7804 track whether those declarations have been seen.
7805 (prologue_augment): Add to the post-prologue if %union,
7806 %before-definitions, or %after-definitions has been seen.
7807 * src/reader.h (before_definitions, after_definitions): New extern's.
7808 * src/scan-gram.l: Scan the new declarations.
7809 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7810 prologue block in a %before-definitions or a %after-definitions based
7811 on whether the %union is declared.
7812 * tests/regression.at (Early token definitions with --yacc, Early token
7813 definitions without --yacc): Move tests for token definitions into the
7814 post-prologue since token names are no longer defined in the
7815 pre-prologue.
7816
78172006-06-20 Akim Demaille <akim@epita.fr>
7818
7819 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7820 (symbol_get): Use it.
7821 * src/parse-gram.y: Use it.
7822
78232006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7824
7825 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7826 build succeeds when configured with --enable-gcc-warnings.
7827
78282006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7829
7830 * src/parse-gram.y (char_name): New function.
7831 (CHAR, STRING, string_content): For %printer, properly escape.
7832 (ID): Prefer fputs to fprintf.
7833 (id): Reindent to be consistent with other rules.
7834 Properly quote char.
7835
7836 The Translation Project changed its way of publishing translations
7837 to maintainers. I haven't received any responses to my request
7838 for supporting the old way, or for documenting the new way. I
7839 have modified 'bootstrap' to use screen scraping
7840 (in this case, HTML scraping). This is unreliable and inelegant,
7841 but I don't see any better way. Yuck.
7842 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7843 (get_translations): New function, which uses HTML scraping to
7844 deduce locations of latest translations.
7845 Use this function to grab both bison and bison-runtime .po files.
7846 Don't bother priming the pump for the runtime-po domain any more,
7847 as it's now translated better than bison is.
7848
78492006-06-19 Akim Demaille <akim@epita.fr>
7850
7851 * src/scan-gram.l: No longer "parse" things after `%union' until
7852 `{'. Rather, return a single "%union" token.
7853 No longer make symbols: return strings, and leave the conversion
7854 to symbols to the parser.
7855 (SC_PRE_CODE, token_type): Remove.
7856 * src/parse-gram.y (%union): New field `character'.
7857 Sort tokens.
7858 (CHAR): New token.
7859 (ID, ID_COLON): Now that the scanner no longer makes them
7860 identifiers, adjust all uses to invoke symbol_get.
7861 (id_colon): New, wraps the conversion from string to symbol.
7862 (%union): Accept a possible union_name.
7863 (symbol): Now can be a char.
7864 * data/c.m4 (b4_union_name): Leave a default value.
7865 * data/glr.c, data/yacc.c: Use it.
7866
78672006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7868
7869 For associating token numbers with token names for "yacc.c", don't use
7870 #define statements unless `--yacc' is specified; always use enum
7871 yytokentype. Most important discussions start at:
7872 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7873 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7874 and
7875 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7876 * NEWS (2.3+): Mention.
7877 * data/c.m4 (b4_yacc_if): New.
7878 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7879 token #define's.
7880 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7881 on token name definitions.
7882 * src/getargs.c (usage): Capitalize `Yacc' in English.
7883 * src/output.c (prepare): Define b4_yacc_flag.
7884 * tests/regression.at (Early token definitions): Test that tokens names
7885 are defined before the pre-prologue not just before the post-prologue.
7886 Remove this test case and copy to...
7887 (Early token definitions with --yacc): ... this to test #define's.
7888 (Early token definitions without --yacc): ... and this to test enums.
7889
78902006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7891
7892 * NEWS: Reword the post-2.3 change to not be so optimistic about
7893 removing the old "look-ahead" spelling.
7894 Update previous look-ahead/lookahead change reports.
7895 * REFERENCES: look-ahead -> lookahead (since that's
7896 what he actually wrote).
7897 * doc/refcard.tex: look ahead -> lookahead,
7898 look-ahead -> lookahead
7899
79002006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7901
7902 For consistency, use `lookahead' instead of `look-ahead' or
7903 `look_ahead'. Discussed starting at
7904 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7905 and then at
7906 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7907 * NEWS: For the next release, note the change to `--report'.
7908 * TODO, doc/bison.1: Update English.
7909 * doc/bison.texinfo: Update English.
7910 (Understanding Your Parser, Bison Options): Document as
7911 `--report=lookahead' rather than `--report=look-ahead'.
7912 * src/conflicts.c: Update English in comments.
7913 (lookahead_set): Rename from look_ahead_set.
7914 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7915 (resolve_sr_conflict): Rename local look_ahead_tokens to
7916 lookahead_tokens, and update other uses.
7917 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7918 count_rr_conflicts, conflicts_free): Update uses.
7919 * src/getargs.c (report_args): Move "lookahead" before alternate
7920 spellings.
7921 (report_types): Update uses.
7922 (usage): For `--report' usage description, state `lookahead' spelling
7923 rather than `look-ahead'.
7924 * src/getargs.h (report.report_lookahead_tokens): Rename from
7925 report_look_ahead_tokens.
7926 * src/lalr.c: Update English in comments.
7927 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7928 (state_lookahead_tokens_count): Rename from
7929 state_look_ahead_tokens_count.
7930 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7931 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7932 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7933 Update other uses.
7934 Update English in output.
7935 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7936 * src/print.c: Update English in comments.
7937 (lookahead_set): Rename from look_ahead_set.
7938 (print_reduction): Rename argument lookahead_token from
7939 look_ahead_token.
7940 (print_core, state_default_rule, print_reductions, print_results):
7941 Update uses.
7942 * src/print_graph.c: Update English in comments.
7943 (print_core): Update uses.
7944 * src/state.c: Update English in comments.
7945 (reductions_new): Update uses.
7946 (state_rule_lookahead_tokens_print): Rename from
7947 state_rule_look_ahead_tokens_print, and update other uses.
7948 * src/state.h: Update English in comments.
7949 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7950 (state_rule_lookahead_tokens_print): Rename from
7951 state_rule_look_ahead_tokens_print.
7952 * src/tables.c: Update English in comments.
7953 (conflict_row, action_row): Update uses.
7954 * tests/glr-regression.at
7955 (Incorrect lookahead during deterministic GLR,
7956 Incorrect lookahead during nondeterministic GLR): Rename
7957 print_look_ahead to print_lookahead.
7958 * tests/torture.at: Update English in comments.
7959 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7960 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7961 (Many lookahead tokens): Update uses.
7962 * data/glr.c: Update English in comments.
7963 * lalr1.cc: Likewise.
7964 * yacc.c: Likewise.
7965 * src/conflicts.h: Likewise.
7966 * src/lalr.h: Likewise.
7967 * src/main.c: Likewise.
7968 * src/output.c: Likewise.
7969 * src/parse-gram.c: Likewise.
7970 * src/tables.h: Likewise.
7971 * tests/calc.at: Likewise.
7972
79732006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7974
7975 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7976
79772006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7978
7979 * TODO: Add request from Nelson H. F. Beebe to be able to install
7980 Bison without installing the yacc script.
7981
79822006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7983
7984 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7985 and yytext if they're already #define'd.
7986 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7987 * src/scan-code-c.c: ... here.
7988 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7989 <config.h>.
7990
79912006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7992
7993 Get Bison to build again when configured with --enable-gcc-warnings.
7994 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7995 missing #include's.
7996 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7997 loc argument as it shadows a global.
7998 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7999 invocation.
8000
8001 * src/.cvsignore: Add scan-code.c.
8002
80032006-06-07 Akim Demaille <akim@epita.fr>
8004
8005 * src/scan-gram.l: Move the "add a trailing ; to actions" code
8006 to...
8007 * src/scan-code.l: here.
8008 * tests/input.at (Torturing the Scanner): Fix another location
8009 error.
8010
80112006-06-07 Akim Demaille <akim@epita.fr>
8012
8013 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
8014
80152006-06-06 Akim Demaille <akim@epita.fr>
8016
8017 Extract the parsing of user actions from the grammar scanner.
8018 As a consequence, the relation between the grammar scanner and
8019 parser is much simpler. We can also split "composite tokens" back
8020 into simple tokens.
8021 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
8022 * src/scan-gram.l (add_column_width, adjust_location): Move to and
8023 rename as...
8024 * src/location.h, src/location.c (add_column_width)
8025 (location_compute): these.
8026 Fix the column count: the initial column is 0.
8027 (location_print): Be robust to ending column being 0.
8028 * src/location.h (boundary_set): New.
8029 * src/main.c: Adjust to scanner_free being renamed as
8030 gram_scanner_free.
8031 * src/output.c: Include scan-code.h.
8032 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
8033 Use boundary_set.
8034 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
8035 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
8036 which is now, again, a separate token.
8037 Adjust all dependencies.
8038 Whereever actions with $ and @ are used, use translate_code.
8039 (action): Remove this nonterminal which is now useless.
8040 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8041 (grammar_current_rule_action_append): Use translate_code.
8042 (packgram): Bound check ruleno, itemno, and rule_length.
8043 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8044 (last_string, last_braced_code_loc, max_left_semantic_context)
8045 (scanner_initialize, scanner_free, scanner_last_string_free)
8046 (gram_out, gram_lineno, YY_DECL_): Move to...
8047 * src/scan-gram.h: this new file.
8048 (YY_DECL): Rename as...
8049 (GRAM_DECL): this.
8050 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8051 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8052 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8053 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8054 Move these declarations, and...
8055 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8056 these to...
8057 * src/flex-scanner.h: this new file.
8058 * src/scan-gram.l (rule_length, rule_length_overflow)
8059 (increment_rule_length): Remove.
8060 (last_braced_code_loc): Rename as...
8061 (gram_last_braced_code_loc): this.
8062 Adjust to the changes of the parser.
8063 Move all the handling of $ and @ into...
8064 * src/scan-code.l: here.
8065 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8066 (handle_action_dollar, handle_action_at): Move to...
8067 * src/scan-code.l: here.
8068 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8069 scan-code.h, scan-code-c.c, scan-gram.h.
8070 (EXTRA_bison_SOURCES): Add scan-code.l.
8071 (BUILT_SOURCES): Add scan-code.c.
8072 (yacc): Be robust to white spaces.
8073
8074 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8075 * tests/regression.at: Adjust the column numbers.
8076 * tests/regression.at: Adjust the error message.
8077
80782006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8079
8080 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8081 Use Akim's wording from
8082 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8083
80842006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8085
8086 Between Bison releases, manually append `+' to the previous Bison
8087 release number, and use that as a signal to automatically print the
8088 ChangeLog's CVS Id keyword from --version. Discussed starting at
8089 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8090 * ChangeLog: Add Id header.
8091 * configure.ac (AC_INIT): Append `+' to `2.3'.
8092 * src/.cvsignore: Add revision.c.
8093 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8094 (BUILT_SOURCES): Add revision.c.
8095 (revision.c): New target rule. This file defines a new global variable
8096 named revision. It initializes it with either the Id from ChangeLog
8097 or, if VERSION doesn't contain `+', with the empty string.
8098 * src/getargs.c (version): Print the value of revision.
8099 * src/revision.h: Extern revision.
8100
81012006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8102
8103 * NEWS: Version 2.3.
8104 * configure.ac (AC_INIT): Likewise.
8105
81062006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8107
8108 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8109 with no arguments, not as an object-like macro. This is for
8110 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8111 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8112 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8113 Document this.
8114
81152006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8116
8117 * src/getargs.c (usage): Back out yesterday's modification of the
8118 --help output so that we don't have to wait for translation before
8119 releasing 2.3.
8120
81212006-05-29 Paul Eggert <eggert@cs.ucla.edu>
8122
8123 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
8124 Problem reported by Akim Demaille.
8125
81262006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
8127
8128 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8129
81302006-05-26 Paul Eggert <eggert@cs.ucla.edu>
8131
8132 * data/yacc.c (yy_reduce_print): Omit trailing white space in
8133 generated source code. Problem reported by Frans Englich in
8134 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
8135
81362006-05-22 Paul Eggert <eggert@cs.ucla.edu>
8137
8138 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
8139 shell, not within 'make', so that 'make' by an ordinary builder
8140 (using GNU make) does not worry about configuring gzip. This also
8141 works around a bug reported independently by Keith Thompson and by
8142 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
8143 stderr rather than stdout, messing up the build logs.
8144
81452006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8146
8147 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
8148 to make sure that YYID will never be unused. This fixes a 'make
8149 maintainer-check' failure caused by the recent changes to the 'Trivial
8150 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
8151 not used.
8152 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
8153
81542006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8155
8156 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
8157 state before an empty RHS is always resolved here. Only the location
8158 of that state is guaranteed to be resolved, and that's enough. This
8159 fixes the remaining bug reported by Derek M. Jones in
8160 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8161 * tests/glr-regression.at (Uninitialized location when reporting
8162 ambiguity): Test the above case.
8163 Also, the embedded comments in this test case claim it checks the case
8164 of an empty RHS that has inherited the initial location. However, the
8165 corresponding LHS was already resolved, so yyresolveLocations didn't
8166 actually have reason to modify it. Fix this by forcing
8167 nondeterministic operation at the beginning of the parse.
8168
81692006-05-20 Paul Eggert <eggert@cs.ucla.edu>
8170
8171 * data/c.m4 (b4_yy_symbol_print_generate):
8172 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
8173 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
8174 of the bugs reported today by Derek M Jones in
8175 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8176 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
8177 defined to be a type name without parens or brackets.
8178 (Location Type): Similarly for YYLTYPE.
8179 * tests/regression.at (Trivial grammars): Put in a test for this
8180 bug that will be caught by 'make maintainer-check' (though not,
8181 alas, by 'make check' unless your compiler is picky).
8182
81832006-05-19 Paul Eggert <eggert@cs.ucla.edu>
8184
8185 * NEWS: Version 2.2.
8186 * configure.ac (AC_INIT): Likewise.
8187
81882006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
8189
8190 * data/glr.c (yyreportTree): Make room in yystates for the state
8191 preceding the RHS. This fixes the segmentation fault reported by Derek
8192 M. Jones in
8193 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
8194 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
8195 to the user. Reported for yyreportTree by Derek M. Jones later in the
8196 same thread.
8197 * THANKS: Add Derek M. Jones.
8198 Update my email address.
8199 Fix typo in Steve Murphy's name.
8200
82012006-05-14 Paul Eggert <eggert@cs.ucla.edu>
8202
8203 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
8204 checking against YYLAST that caused the parser to miss a potential
8205 alternative in its diagnostic.
8206 Problem reported by Maria Jose Moron Fernandez in
8207 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
8208 * data/lalr1.cc (yysyntax_error_): Likewise.
8209 * data/yacc.c (yysyntax_error): Likewise.
8210 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
8211 tokens, in case we run into an older C compiler.
8212 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
8213 Use them to check for the off-by-one error fixed above.
8214
8215 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
8216 YYSIZE_T, not size_t.
8217 * tests/regression.at (Trivial grammars): New test, to catch
8218 the error fixed by the above patch.
8219
82202006-05-14 Akim Demaille <akim@lrde.epita.fr>
8221
8222 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
8223 scheme.
8224 Reported by Steve Murphy.
8225
82262006-05-14 Akim Demaille <akim@lrde.epita.fr>
8227
8228 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
8229 * data/glr.cc: b4_location_flag is now b4_locations_flag.
8230
82312006-05-14 Akim Demaille <akim@lrde.epita.fr>
8232
8233 Implement --trace=m4.
8234 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
8235 * src/output.c (output_skeleton): When set, pass -dV to m4.
8236
8237 Factor the handling of flags in m4.
8238 * src/output.c (prepare): Rename the muscle names debug, defines,
8239 error_verbose to debug_flag, defines_flag, error_verbose_flag.
8240 * data/c.m4: Adjust.
8241 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
8242 Use b4_define_flag_if to define other b4_FLAG_if macros.
8243 (b4_location_if): As a consequence, rename as...
8244 (b4_locations_if): this, for consistency.
8245 Adjust all the skeletons.
8246
82472006-05-14 Akim Demaille <akim@lrde.epita.fr>
8248
8249 * etc/bench.pm: Shorten bench names.
8250
82512006-05-14 Akim Demaille <akim@lrde.epita.fr>
8252
8253 * src/output.h, src/output.c (error_verbose): Move to...
8254 * src/getargs.h, src/getargs.c: here.
8255 Sort the flags.
8256 Adjust dependencies.
8257
82582006-05-13 Paul Eggert <eggert@cs.ucla.edu>
8259
8260 * data/c.m4 (b4_copyright): Put the special exception for Bison
8261 skeletons here, so we don't have to put it in each skeleton. All
8262 uses changed. Suggested by Akim Demaille. Also, wrap the
8263 copyright notice, in case it is longer than 80 columns. Replace
8264 comma by newline after title.
8265
82662006-05-11 Paul Eggert <eggert@cs.ucla.edu>
8267
8268 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
8269 incompatibility, not a bug. Mention that it wasn't fixed as of
8270 flex 2.5.33.
8271
82722006-05-11 Akim Demaille <akim@lrde.epita.fr>
8273
8274 * examples/extexi: Enforce the precedence of concatenation over
8275 >>.
8276 Reported by Tommy Nordgren.
8277
82782006-05-11 Akim Demaille <akim@lrde.epita.fr>
8279
8280 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8281 with the member "token".
8282 Reported by Martin Nylin.
8283
82842006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8285
8286 * data/glr.c: Switch to Bison 2.2 special-exception language in
8287 the copyright notice. Use more-regular format for titles and
8288 copyright notices.
8289 * data/glr.cc: Likewise.
8290 * data/location.cc: Likewise.
8291 * data/yacc.cc: Likewise.
8292 * doc/bison.texinfo (Conditions): Document this.
8293 * NEWS: likewise. Upgrade version to 2.2.
8294
82952006-04-27 Akim Demaille <akim@lrde.epita.fr>
8296
8297 * data/glr.cc: Remove dead code.
8298
82992006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8300
8301 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8302 that variable and the line breaks the bootstrap. Problem reported
8303 by Juan M. Guerrero.
8304
83052006-04-24 Akim Demaille <akim@lrde.epita.fr>
8306
8307 * doc/bison.texinfo (Multiple start-symbols): New.
8308
83092006-04-24 Akim Demaille <akim@lrde.epita.fr>
8310
8311 * etc/README, etc/bench.pl: New.
8312
83132006-04-03 Akim Demaille <akim@lrde.epita.fr>
8314
8315 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8316 rule.
8317 Reported by Mickael Labau.
8318 * tests/input.at (Torturing the Scanner): Test it.
8319
83202006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8321
8322 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8323 Problem reported by Bob Rossi.
8324
83252006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8326
8327 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8328 and didn't really work.
8329 For the index, use @ifnotinfo, not @iftex.
8330 Minor cleanups of spacing and terminology.
8331
83322006-03-12 Akim Demaille <akim@lrde.epita.fr>
8333
8334 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8335 of AT_NAME_PREFIX when %name-prefix is not used.
8336
83372006-03-12 Akim Demaille <akim@lrde.epita.fr>
8338
8339 Apply --prefix to C++ skeletons too: they change the namespace.
8340 The test suite already exercize these cases.
8341 * data/c++.m4 (b4_namespace): New.
8342 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8343 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8344 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8345 * doc/bison.texinfo: Document it.
8346 (Option Cross Key): Use @multitable in all formats. It looks
8347 nicer, even in TeX outputs.
8348 (Rules): Use the same code whatever the output type is.
8349 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8350 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8351 * tests/calc.at: Use it, instead of hard coding `yy'.
8352
83532006-03-10 Akim Demaille <akim@lrde.epita.fr>
8354
8355 * TODO: Remove dead items.
8356
83572006-03-10 Akim Demaille <akim@lrde.epita.fr>
8358
8359 * doc/FAQ: Remove, merged into...
8360 * doc/bison.texinfo (FAQ): this.
8361 * doc/Makefile.am (EXTRA_DIST): Adjust.
8362
83632006-03-10 Akim Demaille <akim@lrde.epita.fr>
8364
8365 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8366 even if empty.
8367 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8368 * doc/bison.texinfo (Calc++ Scanner): Use it.
8369
83702006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8371
8372 Fix two nits reported by twlevo, plus one more that I discovered.
8373
8374 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8375 this is the usual Bison style.
8376 * src/location.h (location_print): Likewise.
8377
8378 * src/reader.h (token_name): Likewise.
8379
83802006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8381
8382 Fix some nits reported by twlevo.
8383 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8384 and "POSIX". Use more-modern syntax for URLs. Mention C++
8385 and ask for Java. Don't hardwire OS version numbers. Add
8386 copyright notice.
8387 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8388 * src/conflicts.c (solved_conflicts_obstack): Now static.
8389
83902006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8391
8392 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8393 page. Say "you can use it" not "you may use it" as on the web page;
8394 we're describing capabilities not granting permission.
8395
83962006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8397
8398 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8399 shadowing warnings. Use usual patter for iterating through RHS.
8400 * tests/glr-regression.at
8401 (Uninitialized location when reporting ambiguity):
8402 Modify yylex so that it uses its argument, rather than trying
8403 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8404 const char -> char const.
8405
8406 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8407 Don't use tabs inside commands; it messes up 'ps'.
8408 Problem reported by twlevo.
8409
84102006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8411
8412 * tests/glr-regression.at (Uninitialized location when reporting
8413 ambiguity): New test case.
8414 * data/glr.c (yyresolveLocations): New function, which uses
8415 YYLLOC_DEFAULT.
8416 (yyresolveValue): Invoke yyresolveLocations before reporting an
8417 ambiguity.
8418 * doc/bison.texinfo (Default Action for Locations): Note
8419 YYLLOC_DEFAULT's usage for ambiguity locations.
8420 (GLR Semantic Actions): Cross-reference those notes.
8421
84222006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8423
8424 * tests/glr-regression.at (Leaked semantic values when reporting
8425 ambiguity): Remove unnecessary union and type declarations.
8426 (Leaked lookahead after nondeterministic parse syntax error): New test
8427 case.
8428 * data/glr.c (yyparse): Check for zero stacks remaining before
8429 attempting to shift the lookahead so that you don't lose it.
8430
84312006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8432
8433 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8434 * tests/glr-regression.at (Leaked semantic values when reporting
8435 ambiguity): New test case.
8436 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8437 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8438 now unnecessary yystackp parameter.
8439 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8440 destructors can be called.
8441
8442 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8443 in existing testcases.
8444
84452006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8446
8447 Don't leak semantic values for parent RHS when a user action cuts the
8448 parser, and clean up related code a bit.
8449 * tests/glr-regression.at (Leaked merged semantic value if user action
8450 cuts parse): Rename to...
8451 (Leaked semantic values if user action cuts parse): ... this. Add check
8452 for leaked parent RHS values.
8453 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8454 between an unresolved state (non-empty chain of semantic options) and
8455 an incomplete one (signaled by an empty chain).
8456 (yyresolveStates): Document the interface. Move all manipulation of a
8457 successfully or unsuccessfully resolved yyGLRState to...
8458 (yyresolveValue): ... here so that yyresolveValue always leaves a
8459 yyGLRState with consistent data and thus is easier to understand.
8460 Remove the yyvalp and yylocp parameters since they are always just
8461 taken from the yys parameter. When reporting a discarded merged value
8462 in debugging output, note that it is incompletely merged. Document the
8463 interface.
8464 (yyresolveAction): If resolving any of the RHS states fails, destroy
8465 them all rather than leaking them. Thus, as long as user actions are
8466 written to clean up the RHS correctly, yyresolveAction always cleans up
8467 the RHS of a semantic option. Document the interface.
8468
84692006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8470
8471 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8472 led to a segmentation fault in GNU Pascal. Problem reported
8473 by Waldek Hebisch.
8474
84752006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8476
8477 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8478 mid-rule action inside a nonterminal symbol in order to declare a
8479 destructor for its semantic value.
8480
84812006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8482
8483 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8484 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8485 __cplusplus && ! defined _STDLIB_H && !
8486 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8487 defined free))]: Include <stdlib.h> rather than rolling our own
8488 declarations of malloc and free, to avoid problems with
8489 incompatible declarations (using 'throw') C++'s stdlib.h. This
8490 should fix Debian bug 340012
8491 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8492 reported by Guillaume Melquiond.
8493
84942006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8495
8496 * NEWS: Clarify symbols versus types in unused-value warnings.
8497
8498 * configure.ac (AC_INIT): Bump version number.
8499
85002006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8501
8502 * NEWS: Version 2.1a.
8503 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8504 since C99 requires this.
8505
85062006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8507
8508 * m4/c-working.m4: New file.
8509 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8510
85112006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8512
8513 * Makefile.maint: Merge from coreutils.
8514
85152006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8516
8517 More portability fixes for problems summarized by Nelson H. F. Beebe.
8518
8519 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8520 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8521 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8522 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8523 messes up because C++ code is compiled in 32-bit mode but linked
8524 in 64-bit mode.
8525
85262006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8527
8528 More portability fixes for problems summarized by Nelson H. F. Beebe.
8529
8530 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8531 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8532
8533 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8534 nodist_PROGRAMS, since we don't need to actually compile the
8535 example if we're just doing a plain 'make'. This avoids bothering
8536 the installer unnecessarily about problems due to weird C++
8537 compilers.
8538
85392006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8540
8541 More portability fixes for problems summarized by Nelson H. F. Beebe.
8542
8543 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8544 than #include "...", and compile with -I'.'. The old method was
8545 not portable, according to Posix and the C standard, and it does
8546 not work with Sun C 5.7, where previous #line directives affect
8547 the working directory used in later #include "..." directives.
8548
85492006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8550
8551 Various DJGGP specific issues in /djgpp
8552
85532006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8554
8555 More portability fixes for problems summarized by Nelson H. F. Beebe.
8556
8557 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8558 '#include <map>' works and that you can apply ++ to iterators.
8559
85602006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8561
8562 Work around portability problems summarized by Nelson H. F. Beebe in
8563 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8564
8565 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8566 that '#include <string>' works.
8567
8568 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8569 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8570 "warning: sorry: semantics of inline function static data `const
8571 unsigned char translate_table[262]' are wrong (you'll wind up with
8572 multiple copies)".
8573
8574 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8575 or, xor to not_, and_, or_, and xor_, respectively. This works
8576 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8577 random system header somewhere that includes the equivalent of
8578 <iso646.h>.
8579
8580 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8581 -E" works; it apparently doesn't work with PathScale EKO Compiler
8582 Suite Version 2.0.
8583
85842006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8585
8586 During deterministic GLR operation, user actions should be able to
8587 influence the parse by changing yychar. To make this easier to fix and
8588 to make glr.c easier to evolve in general, don't maintain yytoken in
8589 parallel with yychar; just compute yytoken when needed.
8590 * tests/glr-regression.at (Incorrect lookahead during deterministic
8591 GLR): Check that setting yychar in a user action has the intended
8592 effect.
8593 * data/glr.c (yyGLRStack): Remove yytokenp member.
8594 (yyclearin): Don't set *yytokenp.
8595 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8596 yychar rather than *yytokenp to determine the current lookahead.
8597 Compute yytoken locally when needed.
8598 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8599 point to.
8600
8601 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8602 after `--report' documentation.
8603
86042006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8605
8606 * src/parse-gram.y (grammar_declaration): Location of printer
8607 symbol is @1, not list->location. Bug reported by twlevo.
8608 * tests/input.at (Incompatible Aliases): Adjust to above change.
8609
86102006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8611
8612 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8613 all the test at once. This makes the output easier to read in the
8614 normal case.
8615
8616 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8617 got from <http://bro-ids.org/download.html>. The bug is that
8618 when two actions appeared in succession, the second one was
8619 scanned before the first one was added to the grammar rule
8620 as a midrule action. Bison then output the incorrect warning
8621 "parse.y:905.17-906.36: warning: unused value: $3".
8622 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8623 associated with a value.
8624 (rhs): Don't invoke grammar_current_rule_action_append.
8625 (action): Invoke it here instead.
8626 * src/reader.c (grammar_midrule_action): Now extern.
8627 (grammar_current_rule_action_append): Don't invoke
8628 grammar_midrule_action; that is now the scanner's job.
8629 * src/reader.h (last_string, last_braced_code_loc):
8630 (grammar_midrule_action): New decls.
8631 * src/scan-gram.l (last_string): Now extern, sigh.
8632 (last_braced_code_loc): New extern variable.
8633 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8634 rule already has an action.
8635 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8636 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8637 Add some tests to check that the above changes fixed the bug.
8638
86392006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8640
8641 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8642 All used changed. Check whether the symbol has a destructor,
8643 not whether it is typed.
8644 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8645 that the values are still reported as unused. All line numbers
8646 adjusted.
8647
86482006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8649
8650 Work around a bug in bro 0.8, which underparenthesizes its
8651 definition of YYLLOC_DEFAULT.
8652 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8653 their arguments.
8654 * data/lalr1.cc: Likewise.
8655 * data/yacc.cc: Likewise.
8656
86572006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8658
8659 Work around a bug in Pike 7.0, and give the Pike folks a
8660 better way to override the usual int widths.
8661 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8662 user can override the types.
8663 (short): #undef, to work around a bug in Pike 7.0.
8664 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8665 (union yyalloc.yyss): Use yytype_int16 rather than short.
8666 All uses changed.
8667 (yysigned_char): Remove.
8668 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8669 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8670 * tests/regression.at (Web2c Actions): Adjust to above changes.
8671
8672 * src/reader.c (check_and_convert_grammar): New function.
8673 (reader): Close the input file even if something went wrong during
8674 parsing. Minor file descriptor leak reported by twlevo.
8675
8676 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8677 to pacify gcc -Wswitch-default.
8678 * src/scan-gram.l (adjust_location): Use a default: break; case
8679 to pacify gcc -Wswitch-default.
8680 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8681 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8682 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8683 Move these decls to scan-skel.l, since they don't need to be
8684 visible elsewhere.
8685 * src/scan-skel.l: Accept the above decls.
8686 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8687 is used.
8688
86892006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8690
8691 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8692 since we don't want to insist on a version number at the start
8693 of the changelog every time.
8694 * Makefile.maint: Sync from coreutils a bit better.
8695 (sc_trailing_blank): Renamed from sc_trailing_space.
8696 All uses changed.
8697 (sc_no_if_have_config_h, sc_require_config_h):
8698 (sc_prohibit_assert_without_use): New rules.
8699 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8700 (sc_dd_max_sym_length): Fix leading spaces in rule.
8701 (sc_system_h_headers): Prefix with @.
8702 (sc_useless_cpp_parens, m4-check): Output line numbers.
8703 (changelog-check): Allow version only in head.
8704 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8705 satisfy new Makefile.maint rule.
8706 * data/glr.c: Likewise.
8707 * data/glr.cc: Likewise.
8708 * data/lalr1.cc: Likewise.
8709 * data/yacc.c: Likewise.
8710 * lib/ebitsetv.c: Likewise.
8711 * lib/lbitset.c: Likewise.
8712 * lib/subpipe.c: Likewise.
8713 * lib/timevar.c: Likewise.
8714 * src/system.h: Likewise.
8715 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8716 * djgpp/Makefile.maint: Add copyright notice.
8717 * djgpp/README.in: Likewise.
8718 * djgpp/config.bat: Likewise.
8719 * djgpp/config.site: Likewise.
8720 * djgpp/config_h.sed: Likewise.
8721 * djgpp/djunpack.bat: Likewise.
8722 * djgpp/config.sed: Fix copyright notice to match standard format.
8723 * djgpp/subpipe.h: Likewise.
8724 * lib/bitsetv-print.c: Likewise.
8725 * lib/bitsetv.c: Likewise.
8726 * lib/subpipe.h: Likewise.
8727 * lib/timevar.c: Likewise.
8728 * lib/timevar.h: Likewise.
8729 * djgpp/subpipe.c: Use standard recipe for config.h.
8730 * lib/abitset.c: Likewise.
8731 * lib/bitset.c: Likewise.
8732 * lib/bitset_stats.c: Likewise.
8733 * lib/bitsetv-print.c: Likewise.
8734 * lib/bitsetv.c: Likewise.
8735 * lib/ebitsetv.c: Likewise.
8736 * lib/get-errno.c: Likewise.
8737 * lib/lbitset.c: Likewise.
8738 * lib/subpipe.c: Likewise.
8739 * lib/timevar.c: Likewise.
8740 * lib/vbitset.c: Likewise.
8741 * tests/local.at: Likewise.
8742 * src/scan-gram.l: Don't include verify.h, since system.h does
8743 that for us.
8744 * .x-sc_require_config_h: New file.
8745 * .x-sc_unmarked_diagnostics: New file.
8746
87472006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8748
8749 Be a bit more systematic about using 'abort'.
8750 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8751 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8752 Put 'default: abort ();' before some other case, to satisfy older
8753 pedantic compilers.
8754 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8755 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8756 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8757 * src/conflicts.c (resolve_sr_conflict): Likewise.
8758 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8759 (get_decision_str, get_orientation_str, get_node_alignment_str):
8760 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8761 (get_linestyle_str, get_arrowstyle_str): Likewise.
8762 * src/conflicts.c (resolve_sr_conflict):
8763 Use a default case rather than one for the one remaining enum
8764 value, to catch invalid enum values as well.
8765 * src/lalr.c (set_goto_map, map_goto):
8766 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8767 * src/nullable.c (nullable_compute, token_definitions_output):
8768 Likewise.
8769 * src/reader.c (packgram, reader): Likewise.
8770 * src/state.c (transitions_to, state_new, state_reduction_find):
8771 Likewise.
8772 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8773 (symbol_pack): Likewise.
8774 * src/tables.c (conflict_row, pack_vector): Likewise.
8775 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8776 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
8777 * src/system.h: Don't include <assert.h>.
8778 (assert): New macro.
8779
8780 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8781 (Destructor Decl, Parser Function, Pure Calling):
8782 Describe rules for braces inside C code more carefully.
8783
87842006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8785
8786 Fix some porting glitches found by Nelson H. F. Beebe.
8787 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8788 compilers that don't understand that abort () does not return.
8789 * src/state.c (transitions_to): Likewise.
8790 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8791 that '#include <cstdlib>' works.
8792 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8793 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8794 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8795 for the benefit of some pre-C99 compilers.
8796
8797 * bootstrap: Undo changes to gnulib files that autoreconf made.
8798
8799 Minor fixups to get 'make maintainer-check' to work.
8800 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8801 with the new verify.h implementation.
8802 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8803 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8804 * data/yacc.c (YYUSE): Likewise.
8805 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8806 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8807 * src/parse-gram.y (declaration): Don't pass a string constant
8808 to a function that expects char *, since GCC might complain
8809 about the constant value.
8810 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8811 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8812 before #defining them.
8813 * tests/glr-regression.at
8814 (Incorrectly initialized location for empty right-hand side in GLR):
8815 In yyerror, use the msg arg.
8816 (Corrupted semantic options if user action cuts parse):
8817 (Incorrect lookahead during deterministic GLR):
8818 (Incorrect lookahead during nondeterministic GLR):
8819 Don't name a local var 'index'; it shadows string.h's 'index'.
8820
88212006-01-19 Akim Demaille <akim@epita.fr>
8822
8823 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8824 location, not just parts of it.
8825
88262006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8827
8828 * NEWS: Document the fact that multiple %unions are now allowed.
8829 * doc/bison.texinfo (Union Decl): Likewise.
8830 * TODO: This feature is now implemented, so remove it from
8831 the wishlist.
8832
8833 * Makefile.maint: Merge with coreutils Makefile.maint.
8834 (CVS_LIST): Use build-aux version if available.
8835 (VERSION_REGEXP): New macro.
8836 (syntax-check-rules): Add sc_no_if_have_config_h,
8837 sc_prohibit_assert_without_use, sc_require_config_h,
8838 sc_useless_cpp_parens.
8839 (sc_obsolete_symbols): Check for O_NDELAY.
8840 (sc_dd_max_sym_length): Track coreutils.
8841 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8842 (sc_useless_cpp_parens): New rule.
8843 (news-date-check): Look for version or today's date.
8844 (changelog-check): Don't require version number near head.
8845 (copyright-check): Use current year instead of hardwiring 2005.
8846 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8847 (announcement): Add --gpg-key-ID.
8848
8849 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8850 with "file system".
8851
8852 Avoid undefined behavior that addressed just before the start of an
8853 array. Problem reported by twlevo.
8854 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8855 * src/lalr.c (build_relations): Rely on new sentinel.
8856 * src/gram.c (gram_free): Adjust to new sentinel.
8857
88582006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8859
8860 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8861 yylookaheadNeeds. All uses updated.
8862 (yysplitStack): Rename local yynewLookaheadStatuses to
8863 yynewLookaheadNeeds.
8864 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8865 GLR): In comments, change `lookahead status' to `lookahead need'.
8866
88672006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8868
8869 * data/glr.c (yysplitStack): A little stylistic rewrite.
8870
88712006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8872
8873 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8874
88752006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8876
8877 * doc/bison.texinfo: Fix some typos.
8878 (GLR Semantic Actions): New subsection discussing special
8879 considerations because GLR semantic actions might be deferred.
8880 (Actions): Mention look-ahead usage of yylval.
8881 (Actions and Locations): Mention look-ahead usage of yylloc.
8882 (Special Features for Use in Actions): Add YYEOF entry and mention it
8883 in the yychar entry.
8884 In the yychar entry, remove mention of the local yychar case (pure
8885 parser) since this is irrelevant information when writing semantic
8886 actions and since it's already discussed in `Table of Symbols' where
8887 yychar is otherwise described as an external variable.
8888 In the yychar entry, don't call it the `current' look-ahead since it
8889 isn't when semantic actions are deferred.
8890 In the yychar and yyclearin entries, add note about deferred semantic
8891 actions.
8892 Add yylloc and yylval entries discussing look-ahead usage.
8893 (Look-Ahead Tokens): When discussing yychar, don't call it the
8894 `current' look-ahead, and do mention yylval and yylloc.
8895 (Error Recovery): Cross-reference `Action Features' when mentioning
8896 yyclearin.
8897 (Table of Symbols): In the yychar entry, don't call it the `current'
8898 look-ahead.
8899 In the yylloc and yylval entries, mention look-ahead usage.
8900
89012006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
8902
8903 * tests/glr-regression.at: Update copyright year to 2006.
8904
89052006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8906
8907 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8908 use during nondeterministic operation to track which stacks have
8909 actually needed the current lookahead.
8910 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8911 Allocate, deallocate, resize, and otherwise shuffle space for
8912 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8913 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8914 appropriately during nondeterministic operation.
8915 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8916 members to store the current lookahead to be used by the deferred
8917 user action.
8918 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8919 from which the RHS is taken. Set the lookahead members of the new
8920 yySemanticOption according to the lookahead status for stack yyk.
8921 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8922 yyaddDeferredAction.
8923 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8924 members of yySemanticOption before invoking yyuserAction, and then set
8925 them back to their current values afterward.
8926 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8927 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8928 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8929 titles for consistency.
8930 (Leaked merged semantic value if user action cuts parse): In order to
8931 suppress lint warnings, use arguments in merge function, and assign
8932 char value < 128 in main.
8933 (Incorrect lookahead during deterministic GLR): New test case.
8934 (Incorrect lookahead during nondeterministic GLR): New test case.
8935
89362006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8937
8938 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
8939 !yyvaluep as signal that no semantic value is available to print.
8940 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8941 to print a semantic value.
8942
89432006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8944
8945 * tests/glr-regression.at: For consistency with my newer test cases,
8946 don't thank myself.
8947
89482006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8949
8950 * data/glr.c (yyresolveValue): When merging semantic options, if at
8951 least one user action succeeds but a later one cuts the parse, then
8952 destroy the semantic value before returning rather than leaking it.
8953 (yyresolveStates): If a user action cuts the parse and thus
8954 yyresolveValue fails, ignore the (unset) semantic value rather than
8955 corrupting the yyGLRState, and empty the semantic options list since
8956 the user actions should have called all necessary destructors.
8957 Simplify code with YYCHK.
8958 * tests/glr-regression.at (Corrupted semantic options if user action
8959 cuts parse): New test case.
8960 (Undesirable destructors if user action cuts parse): New test case.
8961 Before applying any of this patch, this test case never actually failed
8962 for me... but only because the corrupted semantic options usually
8963 masked this bug.
8964 (Leaked merged semantic value if user action cuts parse): New test
8965 case.
8966
89672006-01-05 Akim Demaille <akim@epita.fr>
8968
8969 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8970
89712006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8972
8973 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8974 _MSC_VER. Problem reported by Cenzato Marco.
8975 (b4_c_function_def): Use it.
8976 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8977 b4_c_modern.
8978 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8979 than rolling our own.
8980
89812006-01-04 Akim Demaille <akim@epita.fr>
8982
8983 Also warn about non-used mid-rule values.
8984 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8985 member.
8986 (symbol_list_new): Adjust.
8987 * src/reader.c (symbol_typed_p): New.
8988 (grammar_rule_check): Use it.
8989 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8990 Check its rule.
8991 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8992 Use it.
8993 * tests/actions.at (Exotic Dollars): Adjust.
8994
89952006-01-04 Akim Demaille <akim@epita.fr>
8996
8997 * src/reader.c (grammar_midrule_action): If $$ is set in a
8998 mid-rule, move the `used' bit to its lhs.
8999 * tests/input.at (Unused values): New.
9000 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
9001
90022006-01-03 Paul Eggert <eggert@cs.ucla.edu>
9003
9004 * doc/bison.texinfo (Bison Options): Say more accurately what
9005 --yacc does.
9006 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
9007 about declarations in the grammar when in Yacc mode, as POSIX does
9008 not require a diagnostic when the grammar uses extensions.
9009
9010 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
9011
9012 Warn about dubious constructions like "%token T T".
9013 Reported by twlevo.
9014 * src/symtab.h (struct symbol.declared): New member.
9015 * src/symtab.c (symbol_new): Initialize it to false.
9016 (symbol_class_set): New arg DECLARING, specifying whether
9017 this is a declaration that we want to warn about, if there
9018 is more than one of them. All uses changed.
9019
9020 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
9021 Allow multiple %union directives, whose contents concatenate.
9022 * src/parse-gram.y (grammar_declaration): Likewise.
9023 Use muscle_code_grow, so that we don't need stype_line any more.
9024 All uses changed.
9025
9026 * src/muscle_tab.c (muscle_grow): Fix comment.
9027
9028 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
9029 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
9030 Update copyright year to 2006.
9031
90322006-01-03 Akim Demaille <akim@epita.fr>
9033
9034 Have glr.cc pass (some of) the calc.at tests.
9035 * data/glr.cc (b4_parse_param_orig): New.
9036 (b4_parse_param): Improve its definition, and bound it more
9037 clearly in the skeleton.
9038 (b4_epilogue): Append, instead of prepending, in order to keep
9039 #line consistency.
9040 Simplify the generation of auxiliary functions: locations and
9041 purity are mandated.
9042 (b4_global_tokens_and_yystype): Honor it.
9043 * data/location.cc (c++.m4): Don't include it.
9044 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9045 and AT_SKEL_CC_IF.
9046 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9047 AT_LALR1_CC_IF.
9048 Be sure to initialize the first position's filename.
9049 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9050 mandated anyway.
9051 (AT_CHECK_CALC_GLR_CC): New.
9052 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9053
90542006-01-02 Akim Demaille <akim@epita.fr>
9055
9056 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9057 c.m4.
9058 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
9059 * data/glr.cc: Do not include stack.hh.
9060
90612006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9062
9063 * data/glr.c: Reformat whitespace with tabs.
9064 (b4_lpure_formals): Remove this unused m4 macro.
9065 * tests/cxx-type.at: Reformat whitespace with tabs.
9066 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9067 since it's a member. Rename type to isNterm for clarity.
9068
90692005-12-29 Akim <akim@sulaco.local>
9070
9071 Let glr.cc catch up with symbol_value_print.
9072 * data/glr.cc (b4_yysymprint_generate): Replace by...
9073 (b4_yy_symbol_print_generate): this.
9074 (yy_symbol_print, yy_symbol_value_print): Declare them.
9075
90762005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9077
9078 * src/location.h (boundary): Note that a line or column equal
9079 to INT_MAX indicates an overflow.
9080 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9081 (rule_length_overflow, increment_rule_length, add_column_width):
9082 New functions.
9083 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9084 (<SC_BRACED_CODE>"}"):
9085 Use increment_rule_length rather than incrementing it by hand.
9086 (adjust_location, handle_syncline): Diagnose overflow.
9087 (handle_action_dollar, handle_action_at):
9088 Fix bug with monstrosities like $-2147483648.
9089 Remove now-unnecessary checks.
9090 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9091 (convert_ucn_to_byte): Verify assumptions.
9092 (handle_syncline): New arg LOC. All callers changed.
9093 Don't store through a value derived from char const * pointer.
9094
9095 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9096 GCC warnings.
9097
90982005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9099
9100 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9101 Remove unnecessary forward static decls.
9102
91032005-12-27 Akim Demaille <akim@epita.fr>
9104
9105 * src/reader.c (grammar_current_rule_check): Also check that $$
9106 is used.
9107 Take the rule to check as argument, hence rename as...
9108 (grammar_rule_check): this.
9109 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9110 Rename as...
9111 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9112 (grammar_midrule_action, grammar_symbol_append): Now static.
9113 * tests/torture.at (input): Don't rely on the default action
9114 being always performed.
9115 * tests/calc.at: "Set" $$ even when the action is "cut" with
9116 YYERROR or other.
9117 * tests/actions.at (Exotic Dollars): Instead of using unused
9118 values, check that the warning is issued.
9119
91202005-12-22 Paul Eggert <eggert@cs.ucla.edu>
9121
9122 * NEWS: Improve wording for unused-value warnings.
9123
91242005-12-22 Akim Demaille <akim@epita.fr>
9125
9126 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
9127 (b4_yysymprint_generate): Rename as...
9128 (b4_yy_symbol_print_generate): this.
9129 Generate yy_symbol_print instead of yysymprint.
9130 Generate also yy_symbol_value_print, and use it.
9131
91322005-12-22 Akim Demaille <akim@epita.fr>
9133
9134 * NEWS: Warn about unused values.
9135 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
9136 a `used' member.
9137 (symbol_list_n_get, symbol_list_n_used_set): New.
9138 (symbol_list_n_type_name_get): Use symbol_list_n_get.
9139 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
9140 * src/reader.c (grammar_current_rule_check): Check that values are
9141 used.
9142 * src/symtab.c (symbol_print): Accept 0.
9143 * tests/existing.at: Remove the type information.
9144 Empty the actions.
9145 Remove useless actions (beware of mid-rule actions: perl -000
9146 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
9147 * tests/actions.at (Exotic Dollars): Use unused values.
9148 * tests/calc.at: Likewise.
9149 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9150 Likewise.
9151
9152 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
9153 rule_useful_p.
9154
91552005-12-21 Paul Eggert <eggert@cs.ucla.edu>
9156
9157 Undo 2005-12-01 tentative license wording change. The wording is
9158 still being reviewed by the lawyers, and we don't want to wait for
9159 them before publishing a test release. For now, revert to the
9160 previous wording.
9161 * NEWS: Undo 2005-12-01 change.
9162 * data/glr.c: Revert to previous license wording.
9163 * data/glr.cc: Likewise.
9164 * data/lalr1.cc: Likewise.
9165 * data/location.cc: Likewise.
9166 * data/yacc.c: Likewise.
9167
9168 * NEWS: Reword %destructor vs YYABORT etc.
9169 * data/glr.c: Use American spacing, for consistency.
9170 * data/glr.cc: Likewise.
9171 * data/lalr1.cc: Likewise.
9172 * data/yacc.c: Likewise.
9173 * data/yacc.c: Reformat comments slightly.
9174 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
9175 for consistency. Fix some spelling errors and reword recently-included
9176 text slightly.
9177 * tests/cxx-type.at: Cast results of malloc, for C++.
9178
91792005-12-21 Joel E. Denny <address@hidden>
9180
9181 * tests/cxx-type.at: Construct a tree, count the parents of shared
9182 nodes, and free each node once and only once. Previously, the memory
9183 for semantic values was leaked instead.
9184
91852005-12-21 Joel E. Denny <address@hidden>
9186
9187 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
9188 (yylval, yylloc): If pure, #define to yystackp->yyval and
9189 yystackp->yyloc similar to yychar and yynerrs.
9190 (yyparse): If pure, remove local yylval and yylloc. Add local
9191 yystackp to accommodate pure definitions of yylval and yylloc.
9192 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
9193 yylvalp and yyllocp to &yylval and &yylloc.
9194 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
9195 namespace. Previously, nerrs and char were missing, but lval and lloc
9196 weren't necessary.
9197 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
9198 yylvalp and yyllocp parameters since, if pure, these are now always
9199 accessible through yystackp. If not pure, they are still accessible
9200 globally.
9201 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
9202 `if (YYID (N))' to pacify lint.
9203
92042005-12-21 Akim Demaille <akim@epita.fr>
9205
9206 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
9207 destroy the RHS symbols of a rule.
9208 * data/yacc.c (yylen): Initialize to 0.
9209 Keep its value to the number of items to possibly shift.
9210 In particular, a regular successful parse that ends on YYFINAL by
9211 a (internal) YYACCEPT must not have yylen != 0.
9212 (yyerrorlab, yyreturn): Pop the RHS.
9213 Reorder a bit to emphasize the `shifting' bits of code.
9214 (YYPOPSTACK): Now accept a number of items to pop.
9215 * data/lalr1.cc: Likewise.
9216 * data/glr.c: Formatting changes.
9217 Use goto instead of fall through.
9218 * doc/bison.texinfo (Destructor Decl): Complete.
9219
92202005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9221
9222 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9223 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
9224 * djgpp/config.bat: Replace every occurence of the file name
9225 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9226 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9227 * djgpp/config.sed: Replace every occurence of the file name
9228 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9229 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9230 * djgpp/djunpack.bat: DJGPP specific file.
9231 * djgpp/fnchange.lst: DJGPP specific file.
9232 * djgpp/README.in: Add new information about how to unpack the bison
9233 source on MSDOS and other systems which have 8.3 file name restrictions
9234 using djunpack.bat and fnchange.lst.
9235
92362005-12-12 Paul Eggert <eggert@cs.ucla.edu>
9237
9238 * bootstrap (build_cvs_prefix): Remove; unused.
9239 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
9240 when getting gnulib.
9241
92422005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
9243
9244 * data/glr.c: Reorder typedef declarations for structs to match order
9245 of struct declarations.
9246 Rename yystack everywhere to yystackp except in yyparse where it's not
9247 a pointer.
9248 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
9249 consistency.
9250 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
9251 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
9252 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
9253 lint.
9254
92552005-12-09 Paul Eggert <eggert@cs.ucla.edu>
9256
9257 * tests/sets.at (Accept): Fix typos in regular expression used to
9258 sed out the final state number.
9259
9260 Work around portability problem on Solaris 10: flex-generated
9261 files include <stdio.h> before <config.h>, which messes up
9262 because the latter defines __EXTENSIONS__. Address the problem
9263 by creating two new little files that include <config.h> first,
9264 then include the flex-generated files. Rewrite everyone else
9265 to include <config.h> first, as well.
9266 * lib/timevar.c: Always include "config.h".
9267 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
9268 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
9269 (EXTRA_bison_SOURCES): New macro.
9270 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9271 * src/system.h: Don't include config.h.
9272 * src/LR0.c: Include <config.h> first.
9273 * src/assoc.c: Likewise.
9274 * src/closure.c: Likewise.
9275 * src/complain.c: Likewise.
9276 * src/conflicts.c: Likewise.
9277 * src/derives.c: Likewise.
9278 * src/files.c: Likewise.
9279 * src/getargs.c: Likewise.
9280 * src/gram.c: Likewise.
9281 * src/lalr.c: Likewise.
9282 * src/location.c: Likewise.
9283 * src/main.c: Likewise.
9284 * src/muscle_tab.c: Likewise.
9285 * src/nullable.c: Likewise.
9286 * src/output.c: Likewise.
9287 * src/parse-gram.y: Likewise.
9288 * src/print.c: Likewise.
9289 * src/print_graph.c: Likewise.
9290 * src/reader.c: Likewise.
9291 * src/reduce.c: Likewise.
9292 * src/relation.c: Likewise.
9293 * src/state.c: Likewise.
9294 * src/symlist.c: Likewise.
9295 * src/symtab.c: Likewise.
9296 * src/tables.c: Likewise.
9297 * src/uniqstr.c: Likewise.
9298 * src/vcg.c: Likewise.
9299
9300 * src/parse-gram.y: Fix minor problems uncovered by lint.
9301 (current_lhs, current_lhs_location): Now static.
9302 (current_assoc): Remove unused variable.
9303
9304 Cleanups so that Bison-generated parsers have less lint.
9305 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9306 Prepend /*ARGSUSED*/, for lint's sake.
9307 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9308 definition if 'lint' is defined.
9309 (YYID): New macro (or function, if lint).
9310 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9311 * data/yacc.c: Likewise.
9312 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9313 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9314 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9315 is C++ only.
9316 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9317 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9318 Use YYID(0) rather than 0, for lint.
9319 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9320 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9321
93222005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9323
9324 * tests/glr-regression.at
9325 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9326 Close memory leak reported by twlevo.
9327
93282005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9329
9330 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9331 all stacks.
9332 (yyparse): Iterate another stack in order to call user destructors.
9333 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9334 New test case.
9335 (Duplicated user destructor for lookahead): This test now is expected
9336 to succeed.
9337
93382005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9339
9340 * NEWS: Document the following change.
9341 * data/yacc.c: Say "parser skeleton" rather than "file", since
9342 it's no longer just a file.
9343 * data/glr.c: Grant a special exception for C GLR parsers, that
9344 reads like the already-existing exception for C LALR(1) parsers.
9345 * data/glr.cc: Likewise.
9346 * data/lalr1.cc: Likewise.
9347 * data/location.cc: Likewise.
9348 * data/yacc.c: Reword the "written by" statement to clarify that
9349 it was the parser skeleton, not the entire output file.
9350 * data/glr.c: Written by Paul Hilfinger.
9351 * data/glr.cc: Written by Akim Demaille.
9352 * data/lalr1.cc: Likewise.
9353
93542005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9355
9356 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9357 Fix typos in previous change that broke 'make check'.
9358 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9359 supported in C.
9360 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9361 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9362 We can revert this once things settle down.
9363
9364 * src/conflicts.c (conflicts_print): Don't print file name twice
9365 when %expect fails because there were no conflicts.
9366 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9367 change.
9368 * tests/conflicts.at (%expect not enough, %expect too much):
9369 (%expect with reduce conflicts): Adjust to new behavior.
9370
93712005-11-18 Akim Demaille <akim@epita.fr>
9372
9373 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9374 errors.
9375 * NEWS: Document this.
9376 * doc/bison.texinfo (Expect Decl): Likewise.
9377
93782005-11-16 Akim Demaille <akim@epita.fr>
9379
9380 Generalize the display of semantic values and locations in traces.
9381 * data/glr.c (yy_reduce_print): Fix indices (again).
9382 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9383 literal integers.
9384 * data/lalr1.cc (yyreduce_print): Rename as...
9385 (yy_reduce_print): this.
9386 Display values and locations.
9387 * data/yacc.c (yy_reduce_print): Likewise.
9388 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9389 (yysymprint): Move higher to be visible from yy_reduce_print).
9390 (yyparse): Adjust.
9391 * tests/calc.at: Adjust the expected length of the traces.
9392
93932005-11-14 Akim Demaille <akim@epita.fr>
9394
9395 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9396 from 1 to N, while values and location start at 0.
9397 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9398
93992005-11-14 Akim Demaille <akim@epita.fr>
9400
9401 * data/glr.c (yy_reduce_print): Fix the $ number.
9402
94032005-11-14 Akim Demaille <akim@epita.fr>
9404
9405 "Use" parse parameters.
9406 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9407 * data/glr.c, data/glr.cc: Use them.
9408 * data/glr.c (YYUSE): Have a C++ definition that supports
9409 non-pointer types.
9410
94112005-11-14 Akim Demaille <akim@epita.fr>
9412
9413 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9414
94152005-11-14 Akim Demaille <akim@epita.fr>
9416
9417 * data/glr.cc: New.
9418 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
9419
94202005-11-12 Akim Demaille <akim@epita.fr>
9421
9422 Let position and location be PODs.
9423 * data/location.cc (position::initialize, location::initialize): New.
9424 (position::position, location::location): Define only if
9425 b4_location_constructors is defined.
9426 * data/lalr1.cc (b4_location_constructors): Define it for backward
9427 compatibility.
9428 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9429
94302005-11-12 Akim Demaille <akim@epita.fr>
9431
9432 * data/lalr1.cc: Move the body of the ctor and dtor into the
9433 parser file (instead of the header).
9434 Wrap the implementations in a "namespace yy".
9435
94362005-11-12 Akim Demaille <akim@epita.fr>
9437
9438 Have glr.c include its header file when created.
9439 * data/glr.c (b4_shared_declarations): New.
9440 Output them verbatim in the parser if !%defines, otherwise
9441 output then in the header file, and include it instead.
9442
94432005-11-11 Akim Demaille <akim@epita.fr>
9444
9445 * data/glr.c: Comment changes.
9446
94472005-11-11 Akim Demaille <akim@epita.fr>
9448
9449 When yydebug, report semantic and location values for reductions.
9450 * data/glr.c (yy_reduce_print): Report the semantic values and the
9451 locations.
9452 (YY_REDUCE_PRINT): Adjust.
9453 (yyglrReduce): Use them.
9454 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9455 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9456 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9457 traces.
9458
94592005-11-10 Akim Demaille <akim@epita.fr>
9460
9461 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9462 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9463 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9464
94652005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9466
9467 * m4/cxx.m4, examples/Makefile.am: Don't build
9468 examples/calc++ if no C++ compiler is available. (trivial change)
9469
94702005-11-09 Akim Demaille <akim@epita.fr>
9471
9472 * src/scan-skel.l: Use a couple of asserts.
9473
94742005-11-03 Akim Demaille <akim@epita.fr>
9475
9476 In some (weird) cases, the final state number is incorrect.
9477 Reported by Alexandre Duret-Lutz.
9478 * src/LR0.c (state_list_append): Remove the computation of
9479 final_state.
9480 (save_reductions): Do it here.
9481 (get_state): Alpha conversion.
9482 (generate_states): Use a for loop.
9483 * src/gram.h (item_number_is_rule_number)
9484 (item_number_is_symbol_number): New.
9485 * src/state.c: Use assert.
9486 * src/system.h: Include assert.h.
9487 * tests/sets.at (Accept): New.
9488
94892005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9490
9491 * data/glr.c (yyfill): Adjust comment.
9492 (yyresolveAction): Initialize default location properly
9493 for empty right-hand sides.
9494 (yydoAction): Ditto.
9495 Add comment explaining apparently dead code.
9496 * tests/glr-regression.at
9497 (Incorrectly initialized location for empty right-hand side in GLR):
9498 New test.
9499
95002005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9501
9502 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9503 gnulib when interrupted. This fixes some race conditions and
9504 works around some portability problems (one noted by Paul
9505 Hilfinger).
9506
95072005-10-22 Akim <akim@epita.fr>
9508
9509 * Makefile.cfg: Adjust to config -> build-aux.
9510 Reported by twledo.
9511
95122005-10-21 Akim Demaille <akim@epita.fr>
9513
9514 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9515 the %parse-params.
9516 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9517 * data/yacc.c (b4_Pure_if): Rename as...
9518 (b4_yacc_pure_if): this.
9519 (YY_SYMBOL_PRINT, yyparse): Adjust.
9520 * doc/bison.texinfo: Formatting changes.
9521
95222005-10-21 Akim Demaille <akim@epita.fr>
9523
9524 Finish the transition config -> build-aux.
9525 * configure.ac, Makefile.am: Use build-aux.
9526 * config/prev-version, config/announce-gen, config/Makefile.am:
9527 Move to...
9528 * build-aux/prev-version, build-aux/announce-gen,
9529 * build-aux/Makefile.am: here.
9530
95312005-10-14 Akim Demaille <akim@epita.fr>
9532
9533 * examples/calc++/test: Use set -x only when VERBOSE.
9534
95352005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9536
9537 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9538 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9539
95402005-10-13 Akim Demaille <akim@epita.fr>
9541
9542 * src/scan-skel.l: Output the base name parts of the parser and
9543 header file names.
9544 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
9545 additional checks.
9546 Use this to exercise C++ outputs in subdirs.
9547 Reported by Oleg Smolsky.
9548
95492005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9550
9551 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9552 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9553 Problem reported by John P. Hartmann.
9554 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9555 already defined it.
9556
95572005-10-12 Akim Demaille <akim@epita.fr>
9558
9559 * src/parse-gram.y (version_check): Exit 63 to please missing
9560 (stands for "version mismatch).
9561 * tests/input.at, doc/bison.texinfo: Adjust.
9562
95632005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9564
9565 Work around portability problems with Visual Age C compiler
9566 (xlc and xlC_r) reported by John P. Hartmann.
9567 * data/location.cc (initial_column, initial_line): Remove.
9568 All uses replaced by 0 and 1.
9569 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9570 that xlc complains about.
9571 * src/scan-skel.l (skel_wrap): Likewise.
9572 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
9573 as __STDC__.
9574 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9575 __STDC_VERSION__. Use it everywhere instead of looking at
9576 __STDC__ and __cplusplus.
9577
95782005-10-10 Akim Demaille <akim@epita.fr>
9579
9580 * examples/calc++/test: Be quiet unless VERBOSE.
9581
95822005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9583
9584 * data/c.m4 (yydestruct, yysymprint):
9585 Use YYUSE instead of casting to void.
9586 * data/glr.c (YYUSE): New macro.
9587 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9588 Use it instead of rolling our own.
9589 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9590 (YYCHK1):
9591 Use /*CONSTCOND*/ to suppress lint warnings.
9592 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9593 (YY_STACK_PRINT): Use 'false' not '0'.
9594 (YYUSE): New macro.
9595 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9596 * data/yacc.c (YYUSE): New macro.
9597 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9598 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9599 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9600
9601
9602 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9603 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9604
96052005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9606
9607 Undo the parts of the unlocked-I/O change that substituted
9608 putc or puts for printf. This might hurt performance a bit,
9609 but some people prefer the printf style.
9610 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9611 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9612 All uses replaced by YYFPRINTF and YYDPRINTF.
9613 * data/yacc.c: Likewise.
9614 * lib/bitset.c (bitset_print): Likewise.
9615 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9616 putc and puts.
9617 * lib/lbitset.c (debug_lbitset): Likewise.
9618 * src/closure.c (print_firsts, print_fderives): Likewise.
9619 * src/gram.c (grammar_dump): Likewise.
9620 * src/lalr.c (look_ahead_tokens_print): Likewise.
9621 * src/output.c (escaped_output): Likewise.
9622 (user_actions_output): Break apart two printfs.
9623 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9624 * src/reduce.c (reduce_print): Likewise.
9625 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9626 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9627
9628 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9629 Use assignments rather than casts-to-void to suppress
9630 unused-variable warnings. This pacifies 'lint'.
9631 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9632 unused-variable warnings.
9633
96342005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9635
9636 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9637
96382005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9639
9640 Use unlocked I/O for a minor performance improvement on hosts like
9641 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9642 is to use the gnlib unlocked-io module, and to prefer putc and
9643 puts to printf when either will work (since the latter doesn't
9644 come in an unlocked flavor).
9645 * bootstrap (gnulib_modules): Add unlocked-io.
9646 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9647 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9648 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9649 and similarly for puts and putc and printf.
9650 * data/yacc.c: Likewise.
9651 * lib/bitset.c (bitset_print): Likewise.
9652 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9653 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9654 to printf.
9655 * lib/lbitset.c (debug_lbitset): Likewise.
9656 * src/closure.c (print_firsts, print_fderives): Likewise.
9657 * src/gram.c (grammar_dump): Likewise.
9658 * src/lalr.c (look_ahead_tokens_print): Likewise.
9659 * src/output.c (escaped_output): Likewise.
9660 (user_actions_output): Coalesce two printfs.
9661 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
9662 * src/reduce.c (reduce_print): Likewise.
9663 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9664 * src/system.h: Include unlocked-io.h rather than stdio.h.
9665
9666 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9667 this confuses xgettext.
9668
96692005-10-02 Akim Demaille <akim@epita.fr>
9670
9671 * bootstrap (gnulib_modules): Add strverscmp.
9672 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9673 * m4/.cvsignore: Add strverscmp.m4.
9674 * src/parse-gram.y (%require): New token, new rule.
9675 (version_check): New.
9676 * src/scan-gram.l (%require): Adjust.
9677 * tests/input.at (AT_REQUIRE): New.
9678 Use it.
9679 * doc/bison.texinfo (Require Decl): New.
9680 (Calc++ Parser): Use %require.
9681
96822005-10-02 Akim Demaille <akim@epita.fr>
9683
9684 * data/location.cc: New.
9685
96862005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9687 Akim Demaille <akim@epita.fr>
9688
9689 Make sure -odir/foo.cc creates dir/location.hh etc.
9690 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9691 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9692 (spec_defines_file): Now const.
9693 (dir_prefix): New.
9694 (short_base_name): Remove.
9695 * src/files.c: Adjust.
9696 (dirname.h): Include.
9697 (base_name): Don't prototype it.
9698 (finput): Remove, duplicates gram_in.
9699 (full_base_name, short_base_name): Replace by...
9700 (all_but_ext, all_but_tab_ext): these.
9701 (compute_base_names): Rename as...
9702 (compute_file_name_parts): this.
9703 Update to compute the new variables, including dir_prefix.
9704 Adjust dependencies.
9705 * src/output.c (prepare): Output them.
9706 * src/reader.c: Adjust to use gram_in, not finput.
9707 * src/scan-skel.l (@dir_prefix@): New.
9708
97092005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9710
9711 * lib/subpipe.c: New function end_of_output_subpipe() added
9712 to allow support for non-posix systems. This is a no-op function
9713 for posix systems.
9714
9715 * lib/subpipe.h: New function end_of_output_subpipe() added
9716 to allow support for non-posix systems. This is a no-op function
9717 for posix systems.
9718
9719 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9720 handle the lack of pipe/fork functionality on non-posix systems.
9721
9722 * djgpp/Makefile.maint: DJGPP specific file.
9723
9724 * djgpp/README.in: DJGPP specific file.
9725
9726 * djgpp/config.bat: DJGPP specific configuration file.
9727
9728 * djgpp/config.sed: DJGPP specific configuration file.
9729
9730 * djgpp/config.site: DJGPP specific configuration file.
9731
9732 * djgpp/config_h.sed: DJGPP specific configuration file.
9733
9734 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9735
9736 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9737
97382005-10-02 Akim Demaille <akim@epita.fr>
9739
9740 * data/location.cc: New, extract from...
9741 * data/lalr1.cc: here.
9742 (location.hh): Include it after the user prologue, in case the
9743 filename type is defined by the user.
9744 Forward declation location and position before the pre-prologue.
9745 (yyresult_): Rename as...
9746 (yyresult): this, it's a local variable, not an attribute.
9747 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9748
97492005-10-01 Akim Demaille <akim@epita.fr>
9750
9751 * examples/extexi: Restore the #line generation.
9752
97532005-09-30 Akim Demaille <akim@epita.fr>,
9754 Alexandre Duret-Lutz <adl@gnu.org>
9755
9756 Move the token type and YYSTYPE in the parser class.
9757 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9758 (parser::token): New, from the moved free definition of tokens.
9759 (parser::semantic_value): Now a full definition instead of an
9760 indirection to YYSTYPE.
9761 (b4_post_prologue): No longer included in the header file, but
9762 in the implementation file.
9763 * doc/bison.texi (C+ Language Interface): Update.
9764 * src/parse-gram.y: Support unary %define.
9765 * tests/actions.at: Define global_tokens_and_yystype for backward
9766 compatibility until we update the tests.
9767 * tests/calc.at: Idem.
9768 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9769 to simplify the code.
9770
97712005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9772
9773 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9774 Ah, the good old days! Problem reported by Peter Klein.
9775 * bootstrap (gnulib_modules): Add strerror, strtoul.
9776 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9777 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9778
97792005-09-29 Akim Demaille <akim@epita.fr>
9780
9781 * data/c.m4 (b4_error_verbose_if): New.
9782 * data/lalr1.cc: Use it.
9783 (YYERROR_VERBOSE_IF): Remove.
9784 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9785 parser members, replaced by...
9786 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9787 local variables.
9788 (yysyntax_error_): Takes the state number as argument.
9789 (yyreduce_print_): Use the argument yyrule, not the former
9790 attribute yyn_.
9791
97922005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9793
9794 * bootstrap (gnulib_modules): Add verify.
9795 * lib/.cvsignore: Add verify.h.
9796 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9797 * src/system.h (verify): Remove.
9798 Include verify.h instead.
9799 * src/tables.c (tables_generate): Use new API for 'verify'.
9800
98012005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9802
9803 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9804 local variables whose names begin with 'yy'.
9805 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9806 Trivial changes from Joel E. Denny.
9807
9808 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9809 it itself.
9810 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9811 don't use alloca any more.
9812
9813 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9814 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
9815 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
9816 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9817 to match yacc.c, to test more hosts.
9818
98192005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9820
9821 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9822 doesn't affect behavior.
9823 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9824 Solaris, AIX, MSC.
9825 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9826 This works a bit better with glibc, if user code has already included
9827 stdlib.h.
9828 * doc/bison.texinfo (Bison Parser): Document that users can't
9829 arbitrarily use malloc and free for other purposes. Document
9830 that <alloca.h> and <malloc.h> might be included.
9831 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9832 user must declare alloca.
9833
9834 * HACKING (release): Forwarn the Translation Project about
9835 stable releses.
9836
98372005-09-20 Akim Demaille <akim@epita.fr>
9838
9839 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9840
98412005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9842
9843 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9844 (YYSTACK_ALLOC_MAXIMUM): Use it.
9845 (yysyntax_error): New function.
9846 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9847 multiple syntax errors are reported, and alloca is being used.
9848 Instead, reallocate buffers twice as big each time, so that
9849 we waste at most half the allocated memory. Start with a small
9850 (128-byte) buffer that will suffice in most cases anyway.
9851 Use yysyntax_error to do most of the work.
9852
9853 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9854 yynerrs is the number of errors reported, not the number of
9855 errors encountered.
9856
9857 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9858 Mark it as expected to fail.
9859 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9860 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9861 Don't start user-code symbols with "yy", to avoid name space problems.
9862
98632005-09-19 Akim Demaille <akim@epita.fr>
9864
9865 Remove the traits, failed experiment.
9866 It never proved useful, and anyway because of the current
9867 definition, it was not possible to have several specialization of
9868 this traits, making it useless.
9869 * data/lalr1.cc (yy:traits): Remove.
9870 Inline its definitions in the parser class.
9871
98722005-09-19 Akim Demaille <akim@epita.fr>
9873
9874 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9875 least Mac OSX with a /usr/local install of gettext.
9876
98772005-09-19 Akim Demaille <akim@epita.fr>
9878
9879 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9880 and yytoken for similarity with the other skeletons.
9881
98822005-09-19 Akim Demaille <akim@epita.fr>
9883
9884 * NEWS, configure.ac: update version number to 2.1a.
9885
98862005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9887
9888 * NEWS: Version 2.1.
9889
9890 * NEWS: Remove notice of yytname change, since it was never in an
9891 official release.
9892 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9893 diagnostic.
9894 * src/output.c (prepare): Likewise.
9895 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9896 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9897 is not defined. This is an awful hack, but it's enough for now.
9898 All callers changed.
9899 * tests/glr-regression-at (make_value): Args are const pointers now,
9900 to avoid GCC warning.
9901 (Duplicated user destructor for lookahead): New test. Currently
9902 skipped. It fails on my host but I'm not sure it'll always fail.
9903
99042005-09-16 Akim Demaille <akim@epita.fr>
9905
9906 * src/symtab.h (struct symbol): Declare the printer and destructor
9907 as const, to avoid accidental calls to free.
9908 (symbol_destructor_set, symbol_printer_set): Adjust.
9909 * src/symtab.c: Adjust.
9910
99112005-09-16 Akim Demaille <akim@epita.fr>
9912
9913 * data/c.m4 (b4_token_enums): New.
9914 (b4_token_defines): Rename as...
9915 (b4_token_enums_defines): this.
9916 (b4_token_defines): New, output only the #defines.
9917 * data/yacc.c, data/glr.c: Adjust.
9918 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9919 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9920 as default values.
9921
99222005-09-16 Akim Demaille <akim@epita.fr>
9923
9924 * data/lalr1.cc (yylex_): Remove, inline its code.
9925 (yyreport_syntax_error_): Remove, replaced by...
9926 (yysyntax_error_): this which returns a string and leaves to the
9927 caller the call to the users' error function.
9928 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9929 Move from members of the parser object...
9930 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9931 to local variables of the parse function.
9932
99332005-09-16 Akim Demaille <akim@epita.fr>
9934
9935 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9936 since it's in Bison's name space.
9937
99382005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9939
9940 * data/glr.c (yyresolveValue): Add default case to pacify
9941 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9942
9943 * NEWS: Document when yyparse started to return 2.
9944 * doc/bison.texinfo (Parser Function): Document when yyparse
9945 returns 2.
9946
9947 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9948 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9949 changed.
9950 (class position): file_name -> filename (reverting). All uses changed.
9951
99522005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9953
9954 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9955 do anything if $@ exists. This reverts part of the 2005-07-07
9956 patch.
9957
99582005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9959
9960 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9961 contains obsolete information and isn't worth distributing as a
9962 separate file anyway.
9963 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9964 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9965 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9966 (yyparse): Abort if user code uses longjmp to throw an unexpected
9967 value.
9968
99692005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9970
9971 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9972 Suggested by twlevo@xs4all.nl.
9973
9974 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9975 This avoids a diagnostic from gcc -Wswitch-enum.
9976 Problem reported by twlevo@xs4all.nl.
9977
9978 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9979 standards. Use "file name" or "file" or "name", depending on
9980 the context.
9981 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9982 not to hack/foo.tab.c.
9983 (Calc++ Top Level): 2nd arg of main is not const.
9984 * data/glr.c: b4_filename -> b4_file_name.
9985 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9986 All uses changed.
9987 (class position): filename -> file_name. All uses changed.
9988 * data/yacc.c: b4_filename -> b4_file_name.
9989 * lib/bitset.h: filename -> file_name in local vars.
9990 * lib/bitset_stats.c: Likewise.
9991 * src/files.c: Likewise.
9992 * src/scan-skel.l ("@output ".*\n): Likewise.
9993 * src/files.c (file_name_split): Renamed from filename_split.
9994 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
9995
99962005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9997
9998 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9999 to accommodate latest gnulib.
10000
10001 * tests/glr-regression.at (Duplicate representation of merged trees):
10002 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
10003
10004 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
10005 needed.
10006
100072005-08-26 Paul Eggert <eggert@cs.ucla.edu>
10008
10009 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
10010 All uses changed. Invoke user destructor after an error during a
10011 split parse (trivial change from Joel E. Denny).
10012
10013 * tests/glr-regression.at
10014 (User destructor after an error during a split parse): New test case.
10015 Problem reported by Joel E. Denny in:
10016 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
10017
100182005-08-25 Paul Eggert <eggert@cs.ucla.edu>
10019
10020 * README-cvs: Give URLs for recommended tools.
10021 Mention Gzip version problem, and bootstrapping issues.
10022 Remove troubleshooting section, as it's somewhat obsolete.
10023
10024 * bootstrap (no_cache): New var, to accommodate different wget
10025 variants. Use it instead of '-C off'. Problem reported by
10026 twlevo@xs4all.nl.
10027
10028 * data/glr.c (yydestroyStackItem): New function.
10029 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
10030 debugging information. Problem reported by Joel E. Denny.
10031
100322005-08-25 Akim Demaille <akim@epita.fr>
10033
10034 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
10035
100362005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10037
10038 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10039 Don't invoke destructor on unresolved entries.
10040 * tests/glr-regression.at
10041 (User destructor for unresolved GLR semantic value): New test case.
10042 Problem reported by Joel E. Denny in:
10043 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10044
100452005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10046
10047 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10048 Add strnlen.c.
10049 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10050 lib-prefix.m4, po.m4.
10051
10052 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10053 in yydestruct diagnostic, since it might not be an error.
10054 Problem reported by Joel Denny near end of
10055 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10056 * data/lalr1.cc (yyerturn): Likewise.
10057 * data/yacc.c (yyreturn): Likewise.
10058 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10059
10060 * src/files.c: Remove obsolete FIXME comment.
10061
10062 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10063 with the other templates, and to fix bogus run-on messages such
10064 as the one reported at the end of
10065 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10066 All callers changed to avoid the newline.
10067 (yyprocessOneStack): Output two lines rather than one, to accommodate
10068 the above change. This changes the debug output format slightly.
10069
10070 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10071 reported by Joel E. Denny in
10072 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10073 (trivial change).
10074 * tests/glr-regression.at (Duplicate representation of merged trees):
10075 New test, from Joel E. Denny in:
10076 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10077 * THANKS: Add Joel E. Denny.
10078
10079 * configure.ac (AC_INIT): Bump to 2.0c.
10080
100812005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10082
10083 * NEWS: Version 2.0b.
10084
10085 * Makefile.am (SUBDIRS): Put examples before tests, so that
10086 "make check" doesn't finish with "All 1 tests passed".
10087
10088 * tests/regression.at (Token definitions): Don't rely on
10089 AT_PARSER_CHECK for data that contains backslashes. It currently
10090 uses 'echo', and 'echo' isn't portable if its argument contains
10091 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10092 that the byte '\0xff' is not printable in the C locale; it is,
10093 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10094 not printable, so use '\0x81' to test.
10095
10096 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10097 version of GCC, since the macro is used with non-GCC compilers.
10098
10099 Fix core dump reported by Pablo De Napoli in
10100 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10101 * tests/regression.at (Invalid inputs with {}): New test.
10102 * src/parse-gram.y (token_name): Translate type before using
10103 it as an index.
10104
10105 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10106 the user's name space. All uses changed to __attribute__
10107 ((__unused__)).
10108 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10109 Add __attribute__ ((__noreturn__)).
10110
10111 * etc/clcommit: Remove. We weren't using it, and it failed
10112 "make maintainer-distcheck".
10113 * Makefile.maint: Merge from coreutils.
10114 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10115 (syntax-check-rules): Change list of rules as described below.
10116 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10117 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10118 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10119 (sc_trailing_space): New rules.
10120 (sc_xalloc_h_in_src): Remove.
10121 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
10122 (sc_space_tab, sc_error_exit_success, sc_changelog):
10123 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
10124 (makefile-check, po-check, author_mark_check):
10125 (makefile_path_separator_check, copyright-check):
10126 Use grep -n, to make it easier to find violations.
10127 Use CVS_LIST and CVS_LIST_EXCEPT.
10128 (header_regexp, h_re): Remove.
10129 (dd_c): New macro.
10130 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
10131 (my-distcheck): Use more-modern GCC flags.
10132 (signatures, %.asc): Remove.
10133 (rel-files, announcement): Remove signatures.
10134 Restore old updating code, even though we don't use it, so
10135 that we're the same as coreutils.
10136 (alpha, beta, major): Depend on news-date-check.
10137 Make the upload commands.
10138
10139 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
10140 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
10141 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
10142 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
10143 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
10144 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
10145 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
10146 * tests/sets.at: Likewise.
10147
10148 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
10149 we comment out the Autoconf version number.
10150 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
10151 it's error-prone and "make maintainer-distcheck" rejects it.
10152
10153 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
10154 Indent calls to "error" to pacify "make maintainer-distcheck",
10155 when the calls are not intended to be translated.
10156 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
10157
10158 * src/Makefile.am (DEFS): Use +=, to pacify
10159 "make maintainer-distcheck".
10160 (bison_SOURCES): Add scan-skel.h.
10161 (sc_tight_scope): New rule, from coreutils.
10162
10163 * src/files.c (src_extension, header_extension):
10164 Now static, not extern.
10165 * src/getargs.c (short_options): Likewise.
10166 * src/muscle_tab.c (muscle_table): Likewise.
10167 * src/parse-gram.y (current_class, current_type, current_prec):
10168 Likewise.
10169 * src/reader.c (grammar_end, previous_rule_end): Likewise.
10170 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
10171 * src/main.c (main): Cast bindtextdomain and textdomain calls to
10172 void, to avoid warning when NLS is disabled.
10173 * src/output.c: Include scan-skel.h.
10174 (scan_skel): Remove decl, since scan-skel.h does this.
10175 (output_skeleton):
10176 Indent calls to "error" to pacify "make maintainer-distcheck".
10177 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
10178 * src/reader.h (gram_end, gram_lineno): New decls to pacify
10179 "make maintainer-distcheck".
10180 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
10181 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
10182 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
10183 (skel_lex_destroy, scan_skel): Move these decls to...
10184 * src/scan-skel.h: New file.
10185 * src/uniqstr.c (uniqstr_assert):
10186 Indent calls to "error" to pacify "make maintainer-distcheck".
10187
10188 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
10189 not @VAR@.
10190
10191 * tests/torture.at: Revamp to avoid misuse of atoi that
10192 "make maintainer-distcheck" complained about.
10193
10194 * examples/extexi (message): Don't print a message more than once,
10195 and omit line-number decoration that makes Emacs compile think
10196 that informative messages are worth worrying about.
10197
101982005-07-22 Paul Eggert <eggert@cs.ucla.edu>
10199
10200 * configure.ac: Update version number.
10201
10202 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
10203 accidentally.
10204 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
10205 autogenerated by the maintainer.
10206 * examples/calc++/.cvsignore: Add *.yy.
10207
10208 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
10209 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10210 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10211
10212 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
10213
10214 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
10215 from maintainer-distcheck about casting the argument of 'free'.
10216
10217 * NEWS: Mention recent yytname changes.
10218 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
10219
10220 * bootstrap: For translations that have not yet been upgraded to
10221 the new runtime-po domain, prime the pump by extracting the
10222 relevant strings from the obsolete translations. This code can be
10223 removed once the bison-runtime domain has been translated by each
10224 team.
10225
10226 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
10227 now that token names are already quoted.
10228
10229 Fix problem reported by Anthony Heading.
10230 * data/glr.c (YYTOKEN_TABLE): New macro.
10231 (yytname): Define if YYTOKEN_TABLE.
10232 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
10233 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
10234 (YYERROR_VERBOSE): Define the same way the other skeletons do.
10235 * src/output.c (prepare_symbols): Output token_table_flag.
10236
102372005-07-21 Paul Eggert <eggert@cs.ucla.edu>
10238
10239 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
10240 again if the first call fails.
10241
10242 * data/glr.c (yytnamerr): New function.
10243 (yyreportSyntaxError): Use it to dequote most string literals.
10244 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
10245 with other skeletons. All uses changed.
10246 (yytnameerr_): New function.
10247 (yyreport_syntax_error): Use it to dequote most string literals.
10248 * data/yacc.c (yytnamerr): New function.
10249 (yyerrlab): Use it to decode most string literals.
10250 * doc/bison.texinfo (Decl Summary, Calling Convention):
10251 Clarify quoting convention of yytname.
10252 * src/output.c (prepare_symbols): Quote all names. This undoes
10253 the 2005-04-17 change, which is now accomplished (mostly) via
10254 changes in the parsers as described above.
10255 * tests/regression.at (Token definitions, Web2c Actions):
10256 Undo most 2005-04-17 change here, too.
10257
102582005-07-20 Paul Eggert <eggert@cs.ucla.edu>
10259
10260 Fix more problems reported by twlevo@xs4all.nl.
10261 * tests/cxx-type.at: Don't pipe output of ./types through sed to
10262 remove trailing spaces. This loses the exit status of ./types,
10263 and isn't needed since ./types shouldn't be emitting trailing
10264 spaces.
10265 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
10266 as the stack isn't valid in that case.
10267
10268 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10269 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10270 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10271 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10272 is used.
10273 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10274 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10275 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10276 Likewise.
10277
10278 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10279 overly-picky compilers that reject 'char *foo = "bar";'.
10280
10281 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10282 to FILE * parameter, not to stderr. This fixes a typo introduced
10283 in the 2005-07-12 change.
10284
10285 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10286 warnings from GCC 4.
10287
10288 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10289 (yyglrShiftDefer, yysplitStack):
10290 Remove unused parameters b4_pure_formals. All uses changed.
10291 (yyglrShift): Remove unused parameters b4_user_formals.
10292 All uses changed.
10293 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10294
102952005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10296
10297 Destructor cleanups and regularization among the three skeletons.
10298 * NEWS: Document the behavior changes.
10299 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10300 stack before failing, as the cleanup code will do it for us now.
10301 * data/lalr1.cc (yyerrlab): Likewise.
10302 * data/glr.c (yyparse): Pop everything off the stack before
10303 freeing it, so that destructors get called properly.
10304 * data/lalr1.cc (yyreturn): Likewise.
10305 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10306 This is more consistent.
10307 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10308 why destructors might be called. 1.875 -> 2.1.
10309 (Destructor Decl, Decl Summary, Table of Symbols):
10310 Some English-language cleanups for %destructor.
10311 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10312 Add output line for destructor of start symbol.
10313 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10314 because of that same extra output line.
10315
10316 * NEWS: Document minor wording changes in diagnostics of
10317 Bison-generated parsers.
10318 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10319 Remove unused formals. All uses changed.
10320 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10321 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10322 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10323 Rename yyoverflowab to yyexhaustedlab.
10324 When memory exhaustion occurs during syntax-error reporting,
10325 report it separately rather than in a single diagnostic; this
10326 eases translation.
10327 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10328 (Memory Exhausted): Renamed from Parser Stack Overflow.
10329 Revamp wording slightly to prefer "memory exhaustion".
10330 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10331
10332 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10333
10334 Add i18n support to the GLR skeleton. Partially fix the C++
10335 skeleton; a C++ expert needs to finish this. Remove debugging
10336 msgids; there's little point to having them translated, since they
10337 can be understood only by someone who can read the
10338 (English-language) source code.
10339
10340 Generate runtime-po/bison-runtime.pot automatically, so that we
10341 don't have to worry about garbage getting in that file. We'll
10342 make sure after the next official release that old msgids don't
10343 get lost. See
10344 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10345
10346 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10347 Now auto-generated.
10348 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10349 Fix typos in explanations of the runtime file.
10350 * bootstrap: Change gettext keyword from YYI18N to YY_.
10351 Use standard Makefile.in.in in runtime-po, since we'll arrange
10352 for backward-compatible bison-runtime.po files in a different way.
10353 * data/glr.c (YY_): New macro, from yacc.c.
10354 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10355 Translate messages intended for users.
10356 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10357 the wording in the other skeletons. We don't know that the memory
10358 is virtual.
10359 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10360 Use same method that yacc.c uses.
10361 Don't translate debugging messages.
10362 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10363 it doesn't work (yet), and requires C++ expertise to fix.
10364 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10365 Move defn to a more logical place, to be consistent with other
10366 skeletons.
10367 Don't translate debugging messages.
10368 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10369 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10370 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10371 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10372
10373 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10374 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10375 void, not int.
10376 * tests/glr-regression.at (Badly Collapsed GLR States):
10377 Likewise.
10378 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10379 yylex should return 0 at EOF rather than aborting.
10380
10381 Improve tests for stack overflow in GLR parser.
10382 Problem reported by twlevo@xs4all.nl.
10383 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10384 All uses removed.
10385 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10386 can handle the problem.
10387 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10388 (yyparse): New local variable yyresult to record the result.
10389 Use result of setjmp to set it, rather than storing itinto
10390 struct.
10391 (yyDone): Remove label.
10392 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10393 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10394 if YYABORT is used).
10395 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10396 yyparse status; put status > 1 into diagnostic.
10397 Check that status==2 works.
10398 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10399 Use exit status 3 for failure to open (which shouldn't happen).
10400
104012005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10402
10403 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10404 1 on syntax error; just let yyparse do its thing.
10405 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10406 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10407 (Exploding the Stack Size with Alloca):
10408 (Exploding the Stack Size with Malloc):
10409 Expect exit status 2, not 1, since the parser is supposed to blow
10410 its stack. Problem reported by twlevo@xs4all.nl.
10411
10412 * data/glr.c (yyparse): Don't assume that the initial calls
10413 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10414 Print a stack-overflow message and fail instead.
10415 Initialize the line-number information before creating the stack,
10416 so that the stack-overflow message can report line zero safely.
10417
104182005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10419
10420 Fix problems reported by twlevo@xs4all.nl.
10421 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10422 (yyuserMerge): Provide a default case if b4_mergers is empty.
10423 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10424 * tests/glr-regression.at
10425 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10426 Add casts to pacify C++ compilers.
10427 * tests/glr-regression.at (Improper merging of GLR delayed action
10428 sets): Declare yylex before using it.
10429 * tests/Makefile.am (maintainer-check-g++): Fix a stray
10430 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10431 test for valgrind; valgrind is independent of g++.
10432 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10433 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10434 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10435 Use a destructor, so that we can expand the stack. Change
10436 YYSTYPE to char * so that we can free it. Cast result of malloc.
10437
104382005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10439
10440 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10441 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10442
104432005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10444
10445 * PACKAGING: New file, suggested by Bruno Haible and taken from
10446 similar wording in gettext's PACKAGING file.
10447 * NEWS: Mention PACKAGING.
10448 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10449
104502005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10451
10452 * NEWS: Document recent i18n improvements.
10453 * bootstrap: Get runtime translations into runtime-po.
10454 Create runtime-po files automatically, if possible.
10455 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10456 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10457 does not infringe on the user's name space.
10458 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10459 * doc/bison.texinfo (Internationalization): Revamp the English
10460 and Texinfo syntax a bit, to try to make it clearer.
10461 (Bison Options, Option Cross Key): Mention --print-localedir.
10462 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10463 YYENABLE_NLS. Quote a bit more.
10464 * runtime-po/.cvsignore: New file.
10465 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10466 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10467 * runtime-po/quot.sed: Likewise.
10468 * runtime-po/boldquot.sed: Likewise.
10469 * runtime-po/en@quot.header: Likewise.
10470 * runtime-po/en@boldquot.header: Likewise.
10471 * runtime-po/insert-header.sin: Likewise.
10472 * runtime-po/remove-potcdate.sin: Likewise.
10473 * runtime-po/Makevars: Likewise.
10474 * runtime-po/LINGUAS: Likewise.
10475 * runtime-po/de.po: Likewise; we will rely on the translation project
10476 to maintain this, so "bootstrap" should get it.
10477 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
10478 its value.
10479 * src/main.c (main): Bind the bison-runtime domain, too.
10480
104812005-07-12 Bruno Haible <bruno@clisp.org>
10482
10483 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10484 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10485 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10486 * runtime-po: New directory.
10487 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10488 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10489 * runtime-po/Rules-quot: New file, copied from po/.
10490 * runtime-po/quot.sed: Likewise.
10491 * runtime-po/boldquot.sed: Likewise.
10492 * runtime-po/en@quot.header: Likewise.
10493 * runtime-po/en@boldquot.header: Likewise.
10494 * runtime-po/insert-header.sin: Likewise.
10495 * runtime-po/remove-potcdate.sin: Likewise.
10496 * runtime-po/Makevars: New file.
10497 * runtime-po/POTFILES.in: New file.
10498 * runtime-po/LINGUAS: New file.
10499 * runtime-po/bison-runtime.pot: New file.
10500 * runtime-po/de.po: New file.
10501 * m4/bison.m4: New file.
10502 * Makefile.am (SUBDIRS): Add runtime-po.
10503 (aclocaldir, aclocal_DATA): New variables.
10504 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10505 Define aclocaldir.
10506 * src/getargs.c (usage): Document --print-localedir option.
10507 (PRINT_LOCALEDIR_OPTION): New enum item.
10508 (long_options): Add --print-localedir option.
10509 (getargs): Handle --print-localedir option.
10510 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10511 (Internationalization): New section.
10512
105132005-07-12 Akim Demaille <akim@epita.fr>
10514
10515 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10516 for consistency with the rest of the code.
10517 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10518 Add separators.
10519
105202005-07-12 Akim Demaille <akim@epita.fr>
10521
10522 * src/parse-gram.y: Use %printer instead of YYPRINT.
10523
105242005-07-12 Akim Demaille <akim@epita.fr>
10525
10526 * src/symtab.h, src/symtab.c (symbol_print): New.
10527 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10528 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10529
105302005-07-12 Akim Demaille <akim@epita.fr>
10531
10532 * data/glr.c (b4_syncline): Fix (swap) the definitions of
10533 b4_at_dollar and b4_dollar_dollar.
10534
105352005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10536
10537 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10538 and Pennello's paper.
10539
105402005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10541
10542 * data/yacc.c (yyparse): Undo previous patch. Instead,
10543 set yylsp[0] and yyvsp[0] only if the initial action
10544 sets yylloc and yylval, respectively.
10545
10546 * data/yacc.c (yyparse): In the initial action, set
10547 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10548 This avoids the use of undefined variables if the initial
10549 action does not set yylloc and/or yylval.
10550
105512005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10552
10553 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10554 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10555 Remove from CVS. These files are automatically generated.
10556 * examples/extexi: Clarify that this file is now part of Bison,
10557 not GNU M4, and that it works with any POSIX-compatible Awk.
10558 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10559 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10560 so that we also get calc++-parser.yy. Geneate it.
10561 Use $(AWK), not gawk, since any conforming Awk will do.
10562 Put comment before action, since older 'make' can't handle comment
10563 in action.
10564 $(BUILT_SOURCES): List all built sources, not just some of them.
10565 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10566 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10567 $($(calc_sources_generated)): Remove unnecessary test for existence
10568 of target. (This had a shell syntax error anyway; a stray "x".)
10569 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10570 calc++-parser.yy.
10571 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10572
10573 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10574 implied by the other modules.
10575
105762005-07-06 Akim Demaille <akim@epita.fr>
10577
10578 Bind examples/calc++ to the package.
10579 * examples/calc++/Makefile: Remove, replaced by...
10580 * examples/calc++/Makefile.am: ... this new file.
10581 * examples/calc++/test: Remove input.
10582 * examples/calc++/compile: Remove.
10583 * examples/Makefile.am: New.
10584 * configure.ac, Makefile.am: Adjust.
10585 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10586
105872005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10588
10589 * data/glr.c (yyFail): Drastically simplify; since the format argument
10590 never had any % directives, we can simply pass it to yyerror.
10591 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10592 be modified later, as that is the usual style in glr.c.
10593 Problems reported by Paul Hilfinger.
10594
10595 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10596 and size overflow errors.
10597 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10598 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10599 (YYSIZEMAX): New macro.
10600 (yystpcpy): New function, taken from yacc.c.
10601 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10602 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10603 so that we don't have to maintain their signatures.
10604 (yyFail): Check for buffer overflow, by using vsnprintf rather
10605 than vsprintf. Allocate a bigger buffer if possible.
10606 Report an error if buffer allocation fails.
10607 (yyStackOverflow): New function.
10608 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10609 the initialization was successful. It might fail if storage was
10610 exhausted.
10611 (yyexpandGLRStack): Add more checks for storage allocation failure.
10612 Use yyStackOverflow to report failures.
10613 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10614 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10615 Don't assume stack number fits in int.
10616 (yysplitStack): Check for storage allocation failure.
10617 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10618 can print diagnostics on storage allocation failure. All callers
10619 changed.
10620 (yyresolveValue): Use yybool for boolean.
10621 (yyreportSyntaxError): Check for size-calculation overflow.
10622 This code is taken from yacc.c.
10623 (yyparse): Check for storage allocation errors when allocating
10624 the initial stack.
10625
106262005-07-05 Akim Demaille <akim@epita.fr>
10627
10628 Extract calc++ from the documentation.
10629 * doc/bison.texinfo (Calc++): Add the extraction marks.
10630 * examples/extexi: New, from the aborted GNU Programming 2E.
10631 Separate the different paragraph of a file with empty lines.
10632 * examples/Makefile: Use it to extract the whole calc++ example.
10633
106342005-06-24 Akim Demaille <akim@epita.fr>
10635
10636 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10637 class typedefs.
10638
106392005-06-22 Akim Demaille <akim@epita.fr>
10640
10641 * doc/bison.texinfo (C++ Language Interface): First stab.
10642 (C++ Parsers): Remove.
10643
106442005-06-22 Akim Demaille <akim@epita.fr>
10645
10646 * data/lalr1.cc (yylex_): Honor %lex-param.
10647
106482005-06-22 Akim Demaille <akim@epita.fr>
10649
10650 Start a set of simple examples.
10651 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10652 * examples/calc++/calc++-driver.hh,
10653 * examples/calc++/calc++-parser.yy,
10654 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10655 * examples/calc++/compile, examples/calc++/test: New.
10656
106572005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10658
10659 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10660 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10661 which stems from the 2005-05-27 patch.
10662
106632005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10664
10665 * data/glr.c: Modify treatment of unused parameters to permit use
10666 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10667
106682005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10669
10670 Fix infringement on user name space reported by Janos Zoltan Szabo.
10671 * data/yacc.c (yyparse): strlen -> yystrlen.
10672
106732005-05-30 Akim Demaille <akim@epita.fr>
10674
10675 * data/lalr1.cc (_): New.
10676 Translate the various messages.
10677
106782005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10679
10680 Fix infringement on user name space reported by Bruno Haible.
10681 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10682 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10683 the user's name space.
10684 (alloca): Include <stdlib.h> to get it, if it's not built in.
10685 (YYMALLOC, YYFREE): Define only if needed.
10686 (malloc, free): Declare, but only if needed, as this infringes on
10687 the user name space.
10688
106892005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10690
10691 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10692 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10693 with %d format.
10694 * lib/ebitset.c (min, max): Undef before defining.
10695 * lib/vbitset.c (min, max): Likewise.
10696 * lib/subpipe.c (create_subpipe): Save local variables in case
10697 vfork clobbers them.
10698
106992005-05-24 Bruno Haible <bruno@clisp.org>
10700
10701 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10702 error message syntax used by gcc-4.0.
10703
107042005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10705
10706 * README: Mention m4 1.4.3. Remove obsolete advice about
10707 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10708
10709 * bootstrap: Remove workaround for problem I encountered with
10710 gettext 0.14.1; it seems to be fixed now.
10711
107122005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10713
10714 * NEWS: Version 2.0a.
10715
10716 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10717 the previous change.
10718
10719 Various maintainer cleanups.
10720 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10721 conftest*, for benefit of CVS commands run at the same time as
10722 "configure". Add build-aux, since "bootstrap" now creates it and
10723 its subfiles.
10724 * Makefile.cfg (move_if_change): Remove.
10725 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10726 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10727 (po_repo, do-po-update, po-update, wget_files, get-targets):
10728 (config.guess-url_prefix, config.sub-url_prefix):
10729 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10730 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10731 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10732 Remove.
10733 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10734 this is now the recommended name.
10735 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10736 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10737 ylwrap. These files now go into build-aux.
10738 * config/move-if-change: Remove.
10739 * config/prev-version.txt: Bump from 1.75 to 2.0.
10740
10741 * bootstrap: Add stdio-safer, unistd-safer modules.
10742 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10743 we don't need it).
10744 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10745 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10746 * lib/subpipe.c: Include "unistd-safer.h".
10747 (create_subpipe): Make sure all the newly-created
10748 file descriptors are > 2, so that diagnostics don't
10749 get sent down them (which might cause Bison to hang, in theory).
10750 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10751 * src/files.c (xfopen): Use fopen_safer, not fopen.
10752
10753 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10754 yesterday's yacc.c fix.
10755
107562005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10757
10758 * data/glr.c, data/lalr1.cc: Update copyright date.
10759
10760 Fix a destructor bug reported by Wolfgang Spraul in
10761 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10762 * data/yacc.c (yyabortlab): Don't call destructor, and
10763 don't set yychar to EMPTY.
10764 (yyoverflowlab): Don't call destructor.
10765 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10766 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10767 since we no longer output the message "discarding lookahead token
10768 end of input ()".
10769
107702005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10771
10772 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10773 fix a small glitch in debugging output.
10774 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10775 after YY_SYMBOL_PRINT where needed.
10776
10777 (struct yyGLRState): Add some comments.
10778 (struct yySemanticOption): Add some comments.
10779 (union yyGLRStackItem): Add comment.
10780
10781 (yymergeOptionSets): Correct this to properly perform the union,
10782 avoiding infinite reported by Michael Rosien.
10783 Update comment.
10784
10785 * tests/glr-regression.at: Add test for GLR merging error reported
10786 by M. Rosien.
10787
107882005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10789
10790 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10791 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10792 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10793 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10794 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10795 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10796 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10797 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10798 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10799 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10800 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10801 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10802 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10803 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10804 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10805 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10806 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10807 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10808 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10809 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10810 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10811 src/output.h, src/parse-gram.c, src/parse-gram.h,
10812 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10813 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10814 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10815 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10816 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10817 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10818 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10819 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10820 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10821 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10822 tests/reduce.at, tests/regression.at, tests/sets.at,
10823 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10824 Update FSF postal mail address.
10825
108262005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10827
10828 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10829 Problem reported by Ralf Menzel.
10830
108312005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10832
10833 * tests/actions.at: Test that stack overflow invokes destructors.
10834 From Marcus Holland-Moritz.
10835 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10836 from here....
10837 (yyreturn): to here. That way, destructors are called properly
10838 even if the stack overflows, or the user calls YYACCEPT or
10839 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10840 (yyoverflowlab): Destroy the lookahead.
10841
108422005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10843
10844 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10845
108462005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10847
10848 * NEWS: Bison-generated C parsers no longer quote literal strings
10849 associated with tokens.
10850 * src/output.c (prepare_symbols): Don't escape strings,
10851 since users don't want to see C escapes.
10852 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10853 in diagnostics.
10854 * tests/input.at (Torturing the Scanner): Likewise.
10855 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10856
108572005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10858
10859 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10860 the data size is known to be too small and we can't increase it.
10861 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10862
108632005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10864
10865 * src/parse-gram.y: Include quotearg.h.
10866 (string_as_id): Quote $1 before using it as a key, since the
10867 lexer no longer quotes it for us.
10868 (string_content): Don't strip quotes, since lexer no longer
10869 quotes it for us.
10870 * src/scan-gram.l: Include quotearg.h.
10871 ("\""): Omit quote.
10872 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10873 a key, since the rest of the lexer doesn't quote it.
10874 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10875 * tests/regression.at (Token definitions): Check for backslashes
10876 in token strings.
10877
10878 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10879 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10880 (yyparse): Revamp code to generate long syntax error message, to
10881 make it easier to translate, and to avoid problems with arithmetic
10882 overflow. Change "virtual memory" to "memory" in diagnostic, since
10883 we don't know whether the memory is virtual.
10884
108852005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10886
10887 * NEWS: Bison-generated C parsers now use the _ macro to
10888 translate strings.
10889 * data/yacc.c (_) [!defined _]: New macro.
10890 All English strings wrapped inside this macro.
10891 * doc/bison.texinfo (Bison Parser): Document _.
10892 * po/POTFILES.in: Include src/parse-gram.c, since it now
10893 includes translateable strings that parse-gram.y doesn't.
10894
108952005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10896
10897 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10898 reverting the 2004-10-11 change to this function.
10899 (symbol_check_alias_consistency): Don't call symbol_type_set
10900 if the type name is already correct.
10901 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10902
109032005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10904
10905 * tests/regression.at (Token definitions): Don't use a token named
10906 c, as that generates a "#define c ..." that runs afoul of buggy
10907 stdlib.h that uses the identifier c as a member of struct
10908 drand48_data. Problem reported by Horst Wente.
10909
109102005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10911
10912 * bootstrap: Change translation URL from
10913 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10914 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10915 redirection glitches. Problem reported by twlevo@xs4all.nl.
10916
109172005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10918
10919 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10920 after operands; POSIX says this isn't portable for the c99 command.
10921
109222005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10923
10924 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10925 immediately if a data overrun has occurred; this may help us track
10926 down what may be a spurious failure on MacOS.
10927
109282005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10929
10930 Respond to problems reported by twlevo@xs4all.nl.
10931
10932 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10933
10934 * src/vcg.h: Comment fix.
10935 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10936 (G_CMAX): Change to -1 instead of INT_MAX.
10937
10938 * data/yacc.c (yyparse): Omit spaces before #line.
10939
109402005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10941
10942 * src/tables.c (state_number_to_vector_number): Put it inside an
10943 "#if 0", since it's not currently used. Problem reported by
10944 Roland McGrath.
10945
109462005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10947
10948 * src/output.c (escaped_output): Renamed from
10949 escaped_file_name_output, since we now use it for symbol tags as
10950 well. All uses changed.
10951 (symbol_destructors_output, symbol_printers_output):
10952 Escape symbol tags too.
10953 Problem reported by Matyas Forstner in
10954 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10955
10956 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10957 not needed.
10958 * src/output.c (user_actions_output, token_definitions_output,
10959 symbol_destructors_output, symbol_printers_output): Likewise.
10960 * src/reader.c (prologue_augment): Likewise.
10961 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10962
10963 * src/vcg.c (output_edge): Don't quote linestyle arg.
10964 Problem reported by twlevo@xs4all.nl.
10965
109662005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10967
10968 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10969 example, reported by Derek M Jones. Also, make the example even
10970 more outrageous, to better illustrate how bad the problem is.
10971
109722005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10973
10974 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10975 putsym. Typo reported by Sebastian Piping.
10976
109772005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10978
10979 * doc/bison.texinfo (Language and Grammar): some -> same
10980 (Epilogue): int he -> in the
10981 Typos reported by Sebastian Piping via Justin Pence.
10982
109832005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10984
10985 * tests/glr-regression.at (Improper handling of embedded actions
10986 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10987 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10988 with dollar signs in test names.
10989 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10990 for a similar reason.
10991
109922005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10993
10994 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10995 wants to redefine G_VIEW.
10996
109972005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10998
10999 * src/vcg.c (get_view_str): Remove case for normal_view.
11000 Problem reported by twlevo@xs4all.nl.
11001
110022005-01-24 Paul Eggert <eggert@cs.ucla.edu>
11003
11004 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
11005 Problem reported by twlevo@xs4all.nl.
11006
11007 * doc/bison.texinfo: Change @dircategory from "GNU programming
11008 tools" to "Software development". Requested by Richard Stallman
11009 via Karl Berry.
11010
110112005-01-23 Paul Eggert <eggert@cs.ucla.edu>
11012
11013 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
11014 Problem reported by twlevo@xs4all.nl.
11015
110162005-01-21 Paul Eggert <eggert@cs.ucla.edu>
11017
11018 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
11019 keyword; it's not needed with modern compilers, and it doesn't
11020 affect correctness with older compilers. Suggested by
11021 twlevo@xs4all.nl.
11022
110232005-01-17 Paul Eggert <eggert@cs.ucla.edu>
11024
11025 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
11026 gcc -Wswitch-default.
11027 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11028 * data/yacc.c (yyparse): Likewise.
11029
110302005-01-12 Paul Eggert <eggert@cs.ucla.edu>
11031
11032 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
11033 already. Let config.h define any nonstandard values.
11034
110352005-01-10 Paul Eggert <eggert@cs.ucla.edu>
11036
11037 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11038 for the benefit of slower hosts. Problem reported by
11039 Nelson H. F. Beebe.
11040
110412005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11042
11043 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11044 being defined and not used.
11045 * data/lalr1.cc (yyparse): Likewise.
11046 Use "if (false)" rather than "if (0)".
11047
110482005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11049
11050 * TODO: Mention that we should allow NUL bytes in tokens.
11051
110522005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11053
11054 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11055 Problem reported by Hans Aberg.
11056
110572005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11058
11059 * src/getargs.c (version): Happy new year; update overall
11060 program copyright date from 2004 to 2005.
11061
11062 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11063 Problem reported by Hans Aberg.
11064 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11065 (Output file names.): Add a test for the case when standard output
11066 is closed.
11067
110682004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11069
11070 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11071 to fix an oversight in the Bison 2.0 manual.
11072
110732004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11074
11075 * NEWS: Version 2.0. Reformat the existing news items since
11076 1.875, so that related items are grouped together.
11077 * configure.ac (AC_INIT): Bump version to 2.0.
11078 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11079
11080 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11081 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11082 otherwise, we're not testing alloca. Unfortunately there's no
11083 simple way to consult HAVE_ALLOCA here.
11084
11085 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11086 for yymsg, too.
11087
11088 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11089 hand. This avoids a warning about comparing int to size_t when
11090 GCC warnings are enabled.
11091
110922004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11093
11094 * NEWS: Bison-generated parsers no longer default to using the
11095 alloca function (when available) to extend the parser stack, due
11096 to widespread problems in unchecked stack-overflow detection.
11097 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11098 responsibility to set it to a positive value. This lets the user
11099 specify a value that is not a preprocessor constant.
11100 * data/yacc.c (YYMAXDEPTH): Likewise.
11101 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11102 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11103 to be a compile-time constant. However, explain the constraints on it.
11104 Also, explain the constraints on YYINITDEPTH.
11105 (Table of Symbols): Explain that alloca is no longer the default.
11106 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11107 to 1.
11108
11109 * doc/bison.texinfo (Location Default Action): Mention that n must
11110 be zero when k is zero. Suggested by Frank Heckenbach.
11111
111122004-12-22 Akim Demaille <akim@epita.fr>
11113
11114 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11115 (parser::state_type, parser::semantic_type, parser::location_type):
11116 Private, not public.
11117 (parser::parse): Return ints, not bool.
11118 Returning a bool introduces a problem: 0 corresponds to false, and
11119 it seems weird to return false on success. Returning true changes
11120 the conventions for yyparse.
11121 Alternatively we could return void and send an exception.
11122 There is no clear consensus (yet?).
11123 (state_stack, semantic_stack, location_stack): Rename as...
11124 (state_stack_type, semantic_stack_type, location_stack_type): these.
11125 Private, not public.
11126 * tests/c++.at: New.
11127 * tests/testsuite.at, tests/Makefile.am: Adjust.
11128
111292004-12-21 Akim Demaille <akim@epita.fr>
11130
11131 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
11132
111332004-12-21 Akim Demaille <akim@epita.fr>
11134
11135 Don't impose std::string for filenames.
11136
11137 * data/lalr1.cc (b4_filename_type): New.
11138 (position::filename): Use it.
11139 (parser.hh): Move the inclusion of stack.hh and location.hh below
11140 the user code, so that needed headers for the filename type can be
11141 included first.
11142 Forward declare them before the user code.
11143 * tests/Makefile.am (check-local, installcheck-local): Pass
11144 TESTSUITEFLAGS to the TESTSUITE.
11145
111462004-12-20 Akim Demaille <akim@epita.fr>
11147
11148 Use more STL like names: my_class instead of MyClass.
11149
11150 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
11151 (SemanticStack, SemanticType, StateStack, StateType)
11152 (TokenNumberType, Stack, Slice, Traits, Parser::location)
11153 (Parser::value): Rename as...
11154 (location_stack, location_type, rhs_number_type, semantic_stack)
11155 (semantic_type, state_stack, state_type, token_number_type, stack)
11156 (slice, traits, parser::yylloc, parser::yylval): these.
11157
11158 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
11159
111602004-12-19 Paul Eggert <eggert@cs.ucla.edu>
11161
11162 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
11163 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11164
111652004-12-17 Paul Eggert <eggert@cs.ucla.edu>
11166
11167 Remove uses of 'short int' and 'unsigned short int'. This raises
11168 some arbitrary limits. It uses more memory but nowadays that's
11169 not much of an issue.
11170
11171 This change does not affect the generated parsers; that's a different
11172 task, as some users will want to conserve memory there.
11173
11174 Ideally we should use size_t to represent all object counts, and
11175 something like ptrdiff_t to represent signed differences of object
11176 counts; but that will require more code-cleanup than I have the
11177 time to do right now.
11178
11179 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
11180 Use size_t, not int or short int, to count objects.
11181 * src/closure.c (nritemset, closure): Likewise.
11182 * src/closure.h (nritemset, closure): Likewise.
11183 * src/nullable.c (nullable_compute): Likewise.
11184 * src/print.c (print_core): Likewise.
11185 * src/print_graph.c (print_core): Likewise.
11186 * src/state.c (state_compare, state_hash): Likewise.
11187 * src/state.h (struct state): Likewise.
11188 * src/tables.c (default_goto, goto_actions): Likewise.
11189
11190 * src/gram.h (rule_number, rule): Use int, not short int.
11191 * src/output.c (prepare_rules): Likewise.
11192 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
11193 errs, reductions): Likewise.
11194 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
11195 Likewise.
11196 * src/tables.c (vector_number, tally, action_number,
11197 ACTION_NUMBER_MINIMUM): Likewise.
11198 * src/output.c (muscle_insert_short_int_table): Remove.
11199
112002004-12-17 Akim Demaille <akim@epita.fr>
11201
11202 * data/lalr1.cc: Extensive Doxygenation.
11203 (error_): Rename as...
11204 (error): this, since it is visible to the user.
11205 Adjust callers.
11206 (Parser::message): Now an automatic variable from...
11207 (Parser::yyreport_syntax_error_): here.
11208 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
11209 Parser::error.
11210 * tests/input.at: Escape $.
11211
112122004-12-16 Paul Eggert <eggert@cs.ucla.edu>
11213
11214 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
11215 Parenthesize rhs to avoid obscure problems with mistakes like
11216 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
11217 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11218 b4_rhs_location): Likewise.
11219 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11220 b4_rhs_location): Likewise.
11221
112222004-12-16 Akim Demaille <akim@epita.fr>
11223
11224 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
11225 yacc.c: be sure to stay within yycheck_.
11226 * tests/actions.at: Re-enable C++ tests.
11227
112282004-12-16 Akim Demaille <akim@epita.fr>
11229
11230 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
11231 real.
11232
112332004-12-16 Akim Demaille <akim@epita.fr>
11234
11235 Use #define to handle the %name-prefix.
11236
11237 * data/glr.c, data/yacc.c: Comment changes.
11238 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
11239 so that one can refer to yylex in the parser file, and have it
11240 renamed, as is the case with other skeletons.
11241
112422004-12-16 Akim Demaille <akim@epita.fr>
11243
11244 Move lalr1.cc internals into yy*.
11245
11246 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
11247 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
11248 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
11249 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
11250 (empty_, final_, terror_, errcode_, ntokens_)
11251 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
11252 (looka_, ilooka_, error_range_, nerrs_):
11253 Rename as...
11254 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
11255 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
11256 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
11257 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
11258 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
11259 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
11260 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
11261 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
11262 these.
11263
112642004-12-15 Paul Eggert <eggert@cs.ucla.edu>
11265
11266 Fix some problems reported by twlevo at xs4all.
11267 * src/symtab.c (symbol_new): Report an error if the input grammar
11268 contains too many symbols. This is better than calling abort() later.
11269 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
11270 (struct node, struct graph):
11271 Rename member expand to stretch. All uses changed.
11272 (struct graph): Remove member layoutalgorithm. All uses removed.
11273 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11274 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11275 All uses changed.
11276 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11277
112782004-12-15 Akim Demaille <akim@epita.fr>
11279
11280 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11281 Add more Doxygen comments.
11282 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11283 (report_syntax_error_, translate_): Rename as...
11284 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11285 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11286
112872004-12-15 Akim Demaille <akim@epita.fr>
11288
11289 * data/lalr1.cc (lex_): Rename as...
11290 (yylex_): this.
11291 Move the trace here.
11292 Take the %name-prefix into account.
11293 Reported by Alexandre Duret-Lutz.
11294
112952004-12-15 Akim Demaille <akim@epita.fr>
11296
11297 Simplify the C++ parser constructor.
11298
11299 * data/lalr1.cc (debug_): Rename as...
11300 (yydebug_): so that the parser's internals are always in the yy*
11301 pseudo namespace.
11302 Adjust uses.
11303 (b4_parse_param_decl): Remove the leading comma as it is now only
11304 called as unique argument list.
11305 (Parser::Parser): Remove the constructor accepting a location and
11306 an initial debugging level.
11307 Remove from the other ctor the argument for the debugging level.
11308 (debug_level_type, debug_level, set_debug_level): New.
11309
11310 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11311 constructor calls.
11312
113132004-12-15 Akim Demaille <akim@epita.fr>
11314
11315 Remove b4_root related material: failure experiment
11316 (which goal was to allow to derive from a class).
11317
11318 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11319 definitions and uses.
11320
113212004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11322
11323 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11324 not 2, since it's not portable to subtract 1 from the start of an
11325 array. The new item 0 is never set or used. All uses changed.
11326
11327 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11328 the default definition of YYLLOC_DEFAULT. Problem reported
11329 by Frank Heckenbach.
11330
113312004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11332
11333 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11334 the normal case and one for the error case. Just use the
11335 first one uniformly. Problem reported by Frank Heckenbach.
11336 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11337 use exactly the same macro in both places.
11338 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11339 so that the normal-case YYRHSLOC works for the error case too.
11340 All uses changed.
11341 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11342 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11343 * doc/bison.texinfo (Location Default Action): Don't claim that
11344 we have an array of locations. Use the same macro for both glr
11345 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11346 the index is 0.
11347
113482004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11349
11350 * HACKING: Update email addresses to send announcements to.
11351
11352 * configure.ac (AC_INIT): Bump version to 1.875f.
11353
113542004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11355
11356 * NEWS: Version 1.875e.
11357 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11358
11359 * src/scan-skel.l: Include "complain.h", for "fatal".
11360
11361 * src/relation.h (relation_print, relation_digraph):
11362 Relation sizes are of type relation_node, not size_t (this is
11363 merely a doc fix, since the two types are equivalent).
11364 (relation_transpose): Relation sizes are of type relation_node,
11365 not int.
11366 * src/relation.c: Likewise.
11367 (top, infinity): Now of type relation_node, not int.
11368 (traverse, relation_transpose): Use relation_node, not int.
11369
11370 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11371 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11372 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11373
11374 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
11375 specifying whether the test should be skipped. Use it tp
11376 specify that the [%defines %skeleton "lalr1.cc"] tests currently
11377 fail on some hosts, and should be skipped.
11378
113792004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11380
11381 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11382 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11383 unless otherwise specified below.
11384
11385 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11386 to allocate kernel_base, kernel_items, kernel_size, since
11387 they needn't be initialized to 0.
11388 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11389 * src/closure.c (new_closure): Likewise, for itemset.
11390 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11391 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11392 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11393 (build_relations): Likewise for edge, states1, includes.
11394 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11395 * src/reader.c (packgram): Likewise, for ritem, rules.
11396 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11397 * src/relation.c (relation_digraph): Likewise for VERTICES.
11398 (relation_transpose): Likewise for new_R, end_R.
11399 * src/symtab.c (symbols_token_translations_init): Likewise for
11400 token_translations.
11401 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11402 (token_actions): Likewise for yydefact, actrow, conflrow,
11403 conflict_list.
11404 (save_column): Likewise for froms[symno], tos[symno].
11405 (goto_actions): Likewise for state_count.
11406 (pack_table): Likewise for base, pos, check.
11407 (tables_generate): Likewise for width.
11408
11409 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11410 for initial core. Just have a separate core, so we needn't worry
11411 about whether kernel_size and kernel_base are initialized.
11412
11413 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11414 kernel_size, kernel_items): Remove unnecessary initialization.
11415 * src/conflicts.c (conflicts): Likewise.
11416 * src/derives.c (derives): Likewise.
11417 * src/muscle_tablc (muscle_insert): Likewise.
11418 * src/relation.c (relation_digraph): Likewise.
11419 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11420 conflrow, conflict_table, conflict_list, table, check):
11421 Likewise.
11422
11423 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11424 This is because all callers pass unsigned int.
11425 * src/closure.h (new_closure): Likewise.
11426
11427 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11428 (build_relations): Initialize includes[i] in all cases.
11429 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11430 and rules[ruleno].precsym. Initialize members in order.
11431 * src/relation.c (relation_transpose): Always initialize new_R[i]
11432 and end_R[i].
11433 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11434
11435 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11436 conflict_list[0] was always 0, but now it isn't initialized.
11437
11438 * src/table.c (table_grow): When conflict_table grew, the grown
11439 area wasn't cleared. Fix this.
11440
11441 * lib/.cvsignore: Add strdup.c, strdup.h.
11442 * m4/.cvsignore: Add strdup.m4.
11443
114442004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11445
11446 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11447 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11448 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11449 ngotos + 1 without checking for overflow.
11450 (build_relations): Use END_NODE, not -1, to denote end of edges.
11451 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11452 build_relations): Use goto_number, not int, for goto numbers.
11453 * src/tables.c (save_column, default_goto): Likewise.
11454
114552004-11-23 Akim Demaille <akim@epita.fr>
11456
11457 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11458 of #defining from yystype.
11459 Don't typedef yystype, C++ does not need it.
11460 This lets it possible to forward declare it as union.
11461
114622004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11463
11464 * bootstrap (gnulib_modules): Add extensions.
11465 Problem reported by Jim Meyering.
11466
114672004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11468
11469 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11470 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11471 src/system.h, src/tables.c: XFREE -> free, to accommodate
11472 recent change to gnulib xalloc.h.
11473 Problem reported by Jim Meyering.
11474
114752004-11-17 Akim Demaille <akim@epita.fr>
11476
11477 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11478
114792004-11-17 Akim Demaille <akim@epita.fr>,
11480 Alexandre Duret-Lutz <adl@gnu.org>
11481
11482 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11483 changes.
11484 (YYCDEBUG): Adjust.
11485 Use it instead of cdebug_.
11486 (Parser::debug_stream, Parser::set_debug_stream): New.
11487 (Parser::symprint_): Define cdebug_ for temporary backward
11488 compatibility.
11489 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11490 debug_stream ().
11491
114922004-11-17 Akim Demaille <akim@epita.fr>
11493
11494 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11495 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11496 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11497 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11498
114992004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11500
11501 * data/glr.c (yyloc_default): Remove; not used.
11502 Problem reported by Frank Heckenbach.
11503
115042004-10-25 Akim Demaille <akim@epita.fr>
11505
11506 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11507 Introduce another definition to address simple location arrays.
11508 (yyGLRStack): New member: yyerror_range.
11509 (yyrecoverSyntaxError, yyparse): Update it.
11510 (yyrecoverSyntaxError): Use it when shifting the error token to
11511 have an accurate range, equivalent to the one computed by both
11512 yacc.c and lalr1.cc.
11513 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11514 that column numbers start at column 0, as per GNU Coding
11515 Standards, the others tests, and the doc.
11516 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11517 Adjust to the above change (first column is 0).
11518 And adjust the location of the "<error>", now covering the whole
11519 line.
11520
115212004-10-22 Akim Demaille <akim@epita.fr>
11522 and Paul Eggert <eggert@cs.ucla.edu>
11523
11524 Remove some arbitrary limits on goto numbers and relations.
11525 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11526 initial values, since they're never used.
11527 (set_goto_map): ngotos is now unsigned, so test for overflow
11528 by seeing whether it wraps around to zero.
11529 * src/lalr.h (goto_number): Now size_t, not short int.
11530 (GOTO_NUMBER_MAXIMUM): Remove.
11531 * src/relation.c (relation_print, traverse, relation_transpose):
11532 Check for END_NODE rather than looking at sign.
11533 * src/relation.h (END_NODE): New macro.
11534 (relation_node): Now size_t, not short int.
11535
115362004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11537
11538 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11539 keyword, not an identifier. Problem reported by Baron Schwartz in
11540 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11541
115422004-10-11 Akim Demaille <akim@epita.fr>
11543
11544 * src/symtab.c (symbol_check_alias_consistency): Also check
11545 type names, destructors, and printers.
11546 Reported by Alexandre Duret-Lutz.
11547 Recode the handling of associativity and precedence in terms
11548 of symbol_precedence_set.
11549 Accept no redeclaration at all, not even equal to the previous
11550 value.
11551 (redeclaration): New.
11552 Use it to factor redeclaration complaints.
11553 (symbol_make_alias): Don't set the type of the alias, let
11554 symbol_check_alias_consistency do it as for other features.
11555 * src/symtab.h (symbol): Add new member prec_location, and
11556 type_location.
11557 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11558 * tests/input.at (Incompatible Aliases): New.
11559
115602004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11561
11562 .cvsignore fixes to accommodate gnulib changes,
11563 and the practice of naming build directories "_build".
11564 * .cvsignore: Add "_*". Sort.
11565 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11566 * m4/.cvsignore: Add "*_gl.m4".
11567
115682004-10-06 Akim Demaille <akim@epita.fr>
11569
11570 * src/parse-gram.y (add_param): Fix the truncation of trailing
11571 spaces.
11572
115732004-10-05 Akim Demaille <akim@epita.fr>
11574
11575 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11576 whether the reducion was empty or not. This leaves room to
11577 improve the use of YYLLOC_DEFAULT in such a case.
11578 lalr1.cc is still experimental, so changing this is acceptable.
11579 And finally, there are probably not many users who changed the
11580 handling of locations in GLR, so changing is admissible too.
11581
11582 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11583 empty reduction, set @$ to an empty location ending the previously
11584 stacked symbol.
11585 Adjust uses to make sure the code is triggered on empty
11586 reductions.
11587 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11588 expected output: empty reductions have empty locations.
11589
115902004-09-29 Akim Demaille <akim@epita.fr>
11591
11592 * data/lalr1.cc: Move towards a more standard C++ coding style
11593 for templates: Class < T > -> Class<T>.
11594
115952004-09-29 Akim Demaille <akim@epita.fr>
11596
11597 * data/lalr1.cc: Reinstall the former ctor, for sake of
11598 compatibility, but warn it will be removed.
11599 Move towards a more standard C++ coding style (i.e., type *var ->
11600 type* var).
11601
116022004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11603
11604 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11605 since it's less likely to work if NULs are involved in the future.
11606
116072004-09-27 Akim Demaille <akim@epita.fr>
11608
11609 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11610
116112004-09-27 Akim Demaille <akim@epita.fr>
11612
11613 * data/lalr1.cc (b4_parse_param_decl_1): New.
11614 (b4_parse_param_decl): Use it to have different names between attribute
11615 and argument names.
11616 (b4_cc_constructor_call): Likewise.
11617
116182004-09-24 Akim Demaille <akim@epita.fr>
11619
11620 * src/parse-gram.y (add_param): Strip the leading and trailing
11621 blanks from a formal argument declaration.
11622 (YY_LOCATION_PRINT): New.
11623
116242004-09-24 Akim Demaille <akim@epita.fr>
11625
11626 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11627 after the location.
11628
116292004-09-24 Akim Demaille <akim@epita.fr>
11630
11631 * doc/bison.texinfo (Table of Symbols): Sort.
11632
116332004-09-21 Akim Demaille <akim@epita.fr>
11634
11635 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11636 the useless parentheses.
11637 Suggested by Paul Eggert.
11638
116392004-09-20 Akim Demaille <akim@epita.fr>
11640
11641 Let the initial-action act on the look-ahead, and use it for the
11642 "initial push" (corresponding to an hypothetical beginning-of-file).
11643 And let lalr1.cc honor %initial-action.
11644
11645 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11646 example.
11647 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11648 (Parser::Parser): Remove the ctor that used to initialize it.
11649 (Parser::parse): Like in the other skeletons, issue the "starting
11650 parse" message before any action.
11651 Honor %initial-action.
11652 Initialize the stacks with the lookahead.
11653 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11654 look-ahead.
11655 Push them in the stacks.
11656 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11657
116582004-09-20 Akim Demaille <akim@epita.fr>
11659
11660 * doc/bison.texinfo (Initial Action Decl): New.
11661
116622004-09-20 Akim Demaille <akim@epita.fr>
11663
11664 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11665 clearer criterion to define it.
11666 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11667 When reducing on an empty RHS, use the latest stacked location as
11668 location.
11669 yylloc is not always available.
11670 * data/glr.c: Likewise.
11671 Also, honor initial-actions.
11672
116732004-09-20 Akim Demaille <akim@epita.fr>
11674
11675 * data/yacc.c (YY_LOCATION_PRINT): New.
11676 Define when we know YYLTYPE's structure, i.e., when the default
11677 YYLLOC_DEFAULT is used.
11678 * data/c.m4 (b4_yysymprint_generate): Use it.
11679 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11680 value of the result.
11681 (error_start_): Replace with...
11682 (error_range_): this location array.
11683 This allows to replace code relying on the implementation of
11684 locations by portable code.
11685 * data/yacc.c (yylerrsp): Replace with...
11686 (yyerror_range): this.
11687 Every time a token is popped, update yyerror_range[0], to have an
11688 accurate location for the error token.
11689 * data/glr.c (YY_LOCATION_PRINT): New.
11690 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11691 deference a pointer.
11692 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11693 report the location in %printers.
11694
11695 * src/scan-skel.l: Instead of abort, report error messages to ease
11696 understanding skeleton scanning failures.
11697
116982004-09-16 Akim Demaille <akim@epita.fr>
11699
11700 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11701 (iterator, const_iterator): these, to be more in the C++ spirit.
11702 Also, return reverse iterators so that when displaying the stack
11703 we display its bottom first.
11704 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11705 from yacc.c.
11706 We should probably use vector here though.
11707
117082004-09-16 Akim Demaille <akim@epita.fr>
11709
11710 Have more complete shift traces.
11711
11712 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11713 to report Shifts instead of ad hoc YYDPRINTF invocations,
11714 including for the error token.
11715 * data/lalr1.cc (symprint_): Output the location.
11716 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11717 output the location within the %printer.
11718 Activate GLR tests, at least to make sure they compile properly.
11719 They still don't pass though.
11720 * tests/calc.at: Adjust expect verbose output, since now "Entering
11721 state..." is on a different line than the "Shifting" message.
11722
117232004-09-08 Akim Demaille <akim@epita.fr>
11724
11725 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11726 Bison directive from the Bison file to the invocation of this
11727 macro, so that these directives are passed to
11728 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11729 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11730 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11731 the extra Bison directives instead of the whole series.
11732 Change the grammar so that there are recoverable errors, and
11733 unrecoverable errors. Now we can have the parser give up before
11734 consuming the whole input. As a result we now can observe that
11735 the lookahead is freed when needed.
11736 Change the parser source to parse argv[1] instead of a hard coded
11737 string.
11738 Simplify yylex, and give a value and location to EOF.
11739 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11740 passed directives already coded in the file.
11741 Add some tests to check the location of "error".
11742 For some tests, the C++ parser is correct, and not yacc.c.
11743 For other tests, they provide different, but unsatisfying, values,
11744 so keep the C++ value so that at least one parser is "correct"
11745 according to the test suite.
11746 (Actions after errors): Remove, this is subsumed by the
11747 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11748
117492004-09-06 Akim Demaille <akim@epita.fr>
11750
11751 * data/lalr1.cc: Adjust the indentation of the labels.
11752 (Parser::pop): New.
11753 Use it.
11754
117552004-09-06 Akim Demaille <akim@epita.fr>
11756
11757 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11758 argument, an informative message.
11759 Call YY_SYMBOL_PRINT.
11760 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11761 * data/lalr1.cc (destruct_): Likewise.
11762 In addition, no longer depend on b4_yysymprint_generate and
11763 b4_yydestruct_generate to generate these functions, do it "by
11764 hand".
11765
117662004-09-03 Akim Demaille <akim@epita.fr>
11767
11768 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11769 invoked, yydestruct the lookahead.
11770 * tests/calc.at (Calculator $1): Update the expected lengths of
11771 traces: there is an added line for the discarded lookahead.
11772 * doc/bison.texinfo (Destructor Decl): Some rewording.
11773 Define "discarded" symbols.
11774
117752004-09-02 Akim Demaille <akim@epita.fr>
11776
11777 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11778
117792004-09-02 Akim Demaille <akim@epita.fr>
11780
11781 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11782 (YYDSYMPRINTF): Rename as...
11783 (YY_SYMBOL_PRINT): this.
11784 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11785 two.
11786 Use it instead of direct symprint_ calls.
11787 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11788 one.
11789
117902004-09-02 Akim Demaille <akim@epita.fr>
11791
11792 * data/lalr1.cc (b4_yysymprint_generate): New.
11793 (symprint_): New member function, defined when YYDEBUG.
11794 Use it consistently instead of token/nterm debugging output by
11795 hand.
11796 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11797 %printer calls to use cdebug_ when using lalr1.cc.
11798
117992004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11800
11801 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11802 with #ifdef YYDEBUG.
11803
118042004-08-26 Akim Demaille <akim@epita.fr>
11805
11806 * doc/bison.texinfo (Implementing Loops): Rename as...
11807 (Implementing Gotos/Loops): this.
11808
118092004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11810
11811 Adjust to latest gnulib.
11812 * bootstrap (gnulib_modules): Add xalloc-die.
11813 Set LC_ALL=C so that file names sort consistently.
11814 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11815 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11816 uintmax_t.m4, ulonglong.m4.
11817 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11818 po.m4 since we are now using _gl.m4 instead.
11819
118202004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11821
11822 * src/scan-action.l: Remove. Scanning of semantic actions is
11823 handled in scan-gram.l.
11824
118252004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11826
11827 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11828
11829 * src/location.h (struct): The file member is a uniqstr.
11830 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11831
118322004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11833
11834 Fix bug with non-%union parsers that have printers or destructors,
11835 which led to a Bison core dump. Reported by Peter Fales in
11836 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
11837
11838 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11839 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11840 not to our own type.
11841 * src/output.c (symbol_destructors_output, symbol_printers_output):
11842 Don't assume %union.
11843 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11844 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11845 UNION-FLAG. All callers changed.
11846 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11847 Use type char, not unsigned int, when declaring an array of char;
11848 this lets us remove a cast.
11849 (Printers and Destructors): Add non-%union test cases.
11850
118512004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11852
11853 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11854 GLR writeups. E.g., avoid frenchspacing and the future tense,
11855 change "lookahead" to "look-ahead", and change "wrt" to "with
11856 respect to".
11857
118582004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11859
11860 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11861 New sections, split off from the GLR Parsers section. Put the new
11862 Simple GLR Parser near the start of the GLR section, for clarity.
11863 Rewrite connective text.
11864
118652004-06-21 Frank Heckenbach <frank@g-n-u.de>
11866
11867 * doc/bison.texinfo (Simple GLR Parsers): New section.
11868
118692004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11870
11871 * NEWS, TODO, doc/bison.texinfo:
11872 Use "look-ahead" instead of "lookahead", to be consistent.
11873 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11874 while we're fixing "look-ahead".
11875 * src/conflicts.c (shift_set): Renamed from shiftset.
11876 (look_ahead_set): Renamed from lookaheadset.
11877 * src/print.c: Likewise.
11878 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11879 name for "lookahead".
11880 (report_types, usage): Likewise.
11881 * src/getargs.h (report_look_ahead_tokens): Renamed from
11882 report_lookaheads.
11883 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11884 compute_lookaheads.
11885 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11886 (look_ahead_tokens_print): Renamed from lookaheads_print.
11887 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11888 state_rule_lookaheads_print.
11889 * src/state.h: Likewise.
11890 (reductions.look_ahead_tokens): Renamed from lookaheads.
11891 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11892 AT_DATA_LOOKAHEADS_GRAMMAR.
11893
118942004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11895
11896 * README: Update location of patched M4 distribution.
11897
118982004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11899
11900 Don't assume the C++ compiler takes the same arguments as the C compiler
11901 (trivial change).
11902 * configure.ac (O0CXXFLAGS): New var.
11903 * tests/atlocal.in (CXXFLAGS): Use it.
11904
119052004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11906
11907 Fix some "make check" problems with C++ reported by
11908 Albert Chin-A-Young for Tru64 C++ in this thread:
11909 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11910
11911 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11912 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11913 Output to a .cc file for C++, not to a .c file.
11914 * tests/calc.at (AT_CHECK_CALC): Likewise.
11915 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11916 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11917
119182004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11919
11920 * tests/calc.at, tests/actions.at: Workaround for SGI
11921 C++ compiler. (trivial change)
11922
119232004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11924
11925 Spent a few hours checking out which prerequisite versions the
11926 current sources actually require. I went all the way back to
11927 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11928 a seemingly endless set of combinations of versions more recent
11929 than that. The bottom line is that the current sources require
11930 fairly recent versions of the build tools, and it'll be some work
11931 to change this.
11932 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11933 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11934 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11935 Add comments explaining why those particular versions are
11936 currently needed.
11937
11938 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11939 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
11940 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
11941
11942 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11943 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11944
119452004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11946
11947 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11948 0.11.5. Suggested by Bruno Haible.
11949 * bootstrap: Remove gettext version checking.
11950
11951 * doc/bison.texinfo (Decl Summary): Also mention that %union
11952 can depend on prerequisite types. Problem reported by Tim
11953 Van Holder.
11954
119552004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11956
11957 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11958 * README-alpha: Don't tell people not to package this.
11959
11960 * bootstrap: Don't assume $(...) works; use `...` instead.
11961 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11962 gettext better.
11963
11964 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11965 put into the -d output file, and mention what to do if YYSTYPE is
11966 defined as a macro.
11967
119682004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11969
11970 Undo change made earlier today: it caused autopoint to not bring
11971 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11972 autopoint's.
11973
11974 * bootstrap: Check that gettext version matches what's in
11975 configure.ac. Warn users to ignore robots.txt ERROR 404.
11976 * bootstrap: Undo today's earlier change (logged below).
11977 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
11978
11979 The gettext version checking is causing more trouble than it's
11980 curing; remove it. Problem reported by Paul Hilfinger.
11981
11982 * bootstrap: Issue a warning that one can expect a message
11983 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11984 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11985
119862004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11987
11988 Ensure that the C++ compiler used for testing actually works on a
11989 simple test program; if not, skip the C++-related tests. Problem
11990 reported by Vin Shelton in:
11991 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
11992
11993 * m4/cxx.m4: New file.
11994 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11995 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11996 * tests/local.at (AT_COMPILE_CXX): Use it.
11997
119982004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11999
12000 * data/glr.c (yylloc): Output this macro even if locations are not
12001 being generated, as the GLR parser needs it even in that case.
12002 Problem reported by Troy A. Johnson
12003 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
12004
12005 * configure.ac (AC_INIT): Update to 1.875e.
12006
120072004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12008
12009 * NEWS: Version 1.875d.
12010 * configure.ac (AC_INIT): Likewise.
12011 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
12012
12013 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
12014 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
12015 lalr1.cc runs afoul of the first, and the last two are no longer
12016 supported by GCC 3.4.0.
12017 * README: Mention GNU m4 1.4 or later; mention m4 patches.
12018 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
12019
120202004-05-06 Paul Eggert <eggert@cs.ucla.edu>
12021
12022 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
12023 unsigned int, for compatibility with latest gnulib hash module.
12024 * src/state.c (state_hash, state_hasher): Likewise.
12025 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
12026 * src/uniqstr.c (hash_uniqstr): Likewise.
12027
120282004-05-03 Paul Eggert <eggert@cs.ucla.edu>
12029
12030 * NEWS: Unescaped newlines are no longer allowed in char & strings.
12031
12032 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
12033 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
12034 character and string literals.
12035 (unexpected_end): New function.
12036 (unexpected_eof): Use it.
12037 (unexpected_newline): New function.
12038 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12039 actions.
12040
12041 * NEWS: Document %expect-rr.
12042
12043 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12044 Fix typo by replacing $1 with $option.
12045 Remove more 'intl'-related files.
12046 Don't DEFUN AM_INTL_SUBDIR twice.
12047
12048 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12049 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12050 strtoul.c.
12051 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12052 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12053 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12054 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12055 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12056 * src/.cvsignore: Add *.output.
12057
12058 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12059 gets copied to the output file.
12060
120612004-04-28 Paul Eggert <eggert@twinsun.com>
12062
12063 Get files from the gnulib and po repositories, instead of relying
12064 on them being in our CVS. Upgrade to latest versions of gnulib
12065 and Automake.
12066
12067 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12068 * bootstrap: Bootstrap from gnulib and po repositories.
12069 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12070 * README-cvs: Document these changes. Remove version numbers from
12071 mentions of build tools, since they change so often. Mention Flex.
12072
12073 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12074 (gl_USE_SYSTEM_EXTENSIONS): Add.
12075 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12076 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
12077 does this for us.
12078 (AC_ISC_POSIX): Remove; we no longer support this
12079 ancient OS, as it gets in the way of latest Autoconf & gnulib.
12080 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12081 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12082 Do not check for C89 headers, except for locale.h which is used
12083 by the Yacc library and must port to K&R hosts.
12084 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12085 Do not check for C89 functions, except for setlocale which is
12086 used by the Yacc library.
12087 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12088 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12089 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12090 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12091 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12092 AM_GNU_GETTEXT): Remove; now done by:
12093 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12094 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12095 for us.
12096
12097 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12098 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12099 Define to empty, as gnulib.mk will do the rest for us.
12100 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12101 for us.
12102 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12103 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12104
12105 * src/files.c: Include gnulib's xstrndup.h.
12106
12107 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12108 (REALLOC): Use xnrealloc, for likewise.
12109 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12110 (strnlen, memrchr): Remove decls; functions no longer used.
12111 Include <stpcpy.h>.
12112
12113 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12114 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12115 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12116 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12117 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12118 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12119 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12120 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
12121 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
12122 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
12123 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
12124 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12125 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
12126 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
12127 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
12128 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
12129 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
12130 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
12131 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
12132 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
12133 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
12134 Remove, as these files are now generated automatically
12135 by bootstrap or automake.
12136
12137 * po/ChangeLog: Remove: all but one entry was a duplicate
12138 of this file, and I moved that 2000-11-02 entry here.
12139
12140 * config/.cvsignore: Add Makefile, depcomp, install-sh.
12141 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
12142 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
12143 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
12144 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
12145 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
12146 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
12147 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
12148 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
12149 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
12150 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
12151 xstrndup.h.
12152 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
12153 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
12154 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
12155 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
12156 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
12157 * src/.cvsignore: Remove *_.c.
12158
12159
12160 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
12161 support it. (The latest stable gzip doesn't.)
12162
121632004-04-27 Paul Eggert <eggert@twinsun.com>
12164
12165 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
12166 case, as stos_ is now used by destructors due to the 2004-02-09
12167 change.
12168
12169 Remove more K&R C support.
12170 * lib/libiberty.y (PARAMS): Remove. All uses removed.
12171 * lib/subpipe.c (errno): Remove decl.
12172 Include <stdlib.h> unconditionally.
12173 (EXIT_FAILURE): Remove macro.
12174 * src/complain.c (vfprintf, strerror): Remove.
12175 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
12176 unconditionally.
12177 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
12178 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
12179 (strchr, strspn, memchr): Remove decls.
12180 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
12181 unconditionally. Do not declare perror.
12182 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
12183 unconditionally.
12184
12185 * src/complain.c (_): Remove useless defn, as system.h defines this.
12186
12187 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
12188 with latest obstack.h.
12189 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
12190 to procedure types, as obstack.h now does that for us.
12191 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
12192
12193 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
12194 so that this include file can stand alone.
12195 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
12196 does this now. Include subpipe.h first after config.h, to
12197 test whether it can stand alone.
12198
12199 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
12200 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
12201 unused declaration.
12202
12203 * tests/synclines.at (%union synch line): Put a dummy member in
12204 the union, because empty unions aren't allowed in C. Caught
12205 by GCC 3.4.0.
12206
122072004-04-13 Jim Meyering <jim@meyering.net>
12208
12209 * src/conflicts.c (conflicts_print): Correct format string typo:
12210 use `%%' to produce literal `%'. (trivial change)
12211
122122004-03-30 Paul Eggert <eggert@twinsun.com>
12213
12214 * src/getargs.c (version): Update copyright year to 2004.
12215
12216 * data/c.m4 (b4_int_type): Use 'short int' rather than
12217 'short', and similarly for 'long', 'unsigned', etc.
12218 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
12219 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
12220 yy_yypstack, yydumpstack): Likewise.
12221 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
12222 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
12223 Likewise.
12224 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
12225 yy_stack_print, yyparse): Likewise.
12226 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
12227 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
12228 * lib/bitset.c (bitset_print): Likewise.
12229 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
12230 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12231 * lib/bitsetv.c (bitsetv_dump): Likewise.
12232 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
12233 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
12234 Likewise.
12235 * src/LR0.c (allocate_itemsets): Likewise.
12236 * src/gram.h (rule_number, rule): Likewise.
12237 * src/lalr.h (goto_number): Likewise.
12238 * src/nullable.c (nullable_compute): Likewise.
12239 * src/output.c (prepare_rules): Likewise.
12240 * src/relation.c (relation_print, relation_digraph): Likewise.
12241 * src/relation.h (relation_node): Likewise.
12242 * src/state.h (state_number, transitions, errs, reductions,
12243 struct state): Likewise.
12244 * src/symtab.h (symbol_number, struct symbol): Likewise.
12245 * src/tables.c (vector_number, tally, action_number,
12246 default_goto, goto_actions): Likewise.
12247 * tests/existing.at (GNU Cim Grammar): Likewise.
12248 * tests/regression.at (Web2c Actions): Likewise.
12249
12250 * src/output.c (muscle_insert_short_int_table): Renamed from
12251 muscle_insert_short_table. All uses changed.
12252
122532004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12254
12255 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
12256 (declaration): Replace expected_conflicts with expected_sr_conflicts.
12257 Add %expect-rr rule.
12258
12259 * src/scan-gram.l: Recognize %expect-rr.
12260
12261 * src/conflicts.h (expected_sr_conflicts): Rename from
12262 expected_conflicts.
12263 (expected_rr_conflicts): Declare.
12264
12265 * src/conflicts.c (expected_sr_conflicts): Rename from
12266 expected_conflicts.
12267 (expected_rr_conflicts): Define.
12268 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
12269 for GLR parsers.
12270 Use expected_sr_conflicts in place of expected_conflicts.
12271 Warn if expected_rr_conflicts used in non-GLR parser.
12272
12273 * doc/bison.texinfo: Add documentation for %expect-rr.
12274
122752004-03-08 Paul Eggert <eggert@gnu.org>
12276
12277 Add support for hex token numbers. Suggested by Odd Arild Olsen in
12278 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
12279
12280 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12281 in lalr1.cc.
12282 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12283 * src/scan-gram.l (scan_integer): New function.
12284 ({int}): Use it.
12285 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12286 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12287 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12288 Say "long int", not "long", for uniformity with GNU style.
12289
122902004-02-25 Paul Eggert <eggert@twinsun.com>
12291
12292 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12293 compilers. This fixes a problem with Intel's C++ compiler being
12294 chatty, reported by Guido Trentalancia in
12295 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
12296
122972004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12298
12299 Support %destructor and merge error locations in lalr1.cc.
12300
12301 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12302 (Parser::stos_): Define unconditionally.
12303 (Parser::destruct_): New method. Generate its body with
12304 b4_yydestruct_generate.
12305 (Parser::error_start_): New attribute.
12306 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12307 token which are discarded.
12308 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12309 error_start_ when erroneous token are discarded.
12310 (Parser::parse) <yyerrlab1>: Compute the location of the error
12311 token so that it covers all the discarded tokens.
12312 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12313 it can be called with `%skeleton "lalr1.cc"', and do that.
12314
123152004-02-02 Paul Eggert <eggert@twinsun.com>
12316
12317 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12318 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12319 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12320 There's no need to mention top_builddir since Automake does that
12321 for us.
12322 (INCLUDES): Remove, as Automake says it's obsolescent.
12323 Contents migrated into AM_CPPFLAGS as described above.
12324 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12325
123262004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12327
12328 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12329 (yyreportSyntaxError): Handle case where lookahead token is
12330 YYEMPTY.
12331
123322004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12333
12334 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12335 resulting parsers are compilable with C++.
12336
123372003-12-23 Paul Eggert <eggert@twinsun.com>
12338
12339 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12340 * src/output.c (output_skeleton): Rename local var.
12341 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12342 Bison tokens, as this runs afoul of the 2003-10-07 change that
12343 disallowed NUL bytes in character constants or string literals.
12344
12345 * tests/local.at: Require Autoconf 2.59's Autotest.
12346 * tests/testsuite.at: Don't include local.at, since we now assume
12347 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12348 including it.
12349 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12350 multiple inclusion warnings.
12351
123522003-12-02 Akim Demaille <akim@epita.fr>
12353
12354 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12355 conditions.
12356 From Bruno Haible.
12357
123582003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12359
12360 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12361
123622003-10-07 Paul Eggert <eggert@twinsun.com>
12363
12364 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12365 if testsuite doesn't exist.
12366
12367 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12368 literals, unfortunately.
12369 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12370 Complain about NUL bytes in character constants or string literals.
12371
123722003-10-05 Paul Eggert <eggert@twinsun.com>
12373
12374 * NEWS: Don't document %no-default-prec, as it's still
12375 too experimental.
12376 * doc/bison.texinfo: Document %no-default-prec only if
12377 the defaultprec flag is set. Normally it's not.
12378
123792003-10-04 Paul Eggert <eggert@twinsun.com>
12380
12381 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12382 non-modifiable lvalue, instead of a modifiable one.
12383 * doc/bison.texinfo (Actions): Document that $$ can
12384 be assigned to. Do not claim that $$ and $N are
12385 array element references: user code should not rely on this.
12386
123872003-10-01 Paul Eggert <eggert@twinsun.com>
12388
12389 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12390 (grammar_declaration): Use it.
12391 * src/scan-gram.l: New token %no-default-prec.
12392 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12393 * NEWS, doc/bison.texinfo: Document the above.
12394
123952003-10-01 Akim Demaille <akim@epita.fr>
12396
12397 VCG no longer supports long_straight_phase.
12398
12399 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12400 * src/print_graph.c (print_graph): Adjust.
12401
124022003-09-30 Frank Heckenbach <frank@g-n-u.de>
12403 and Paul Eggert <eggert@twinsun.com>
12404
12405 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12406 Table of Symbols): Document %default-prec.
12407 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12408 (grammar_declaration): Set default_prec on %default-prec.
12409 * src/scan-gram.l (%default-prec): New token.
12410 * src/reader.h (default_prec): New flag.
12411 * src/reader.c: Likewise.
12412 (packgram): Handle it.
12413 * tests/conflicts.at (%default-prec without %prec,
12414 %default-prec with %prec, %default-prec 1): New tests.
12415
124162003-09-30 Paul Eggert <eggert@twinsun.com>
12417
12418 * tests/testsuite.at: Include local.at, not input.at, fixing
12419 a typo in the 2003-08-25 patch.
12420
124212003-08-27 Akim Demaille <akim@epita.fr>
12422
12423 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12424 GCC warnings.
12425
124262003-08-26 Akim Demaille <akim@epita.fr>
12427
12428 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12429 "<\#" to avoid magic from Gnus when posting parts of this script.
12430
124312003-08-26 Akim Demaille <akim@epita.fr>
12432
12433 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12434 (Parser::parse): here.
12435 Adjust: nerrs and errstatus is now replaced by...
12436 (Parser::nerrs_, Parser::errstatus_): New.
12437
124382003-08-25 Akim Demaille <akim@epita.fr>
12439
12440 * config/announce-gen, Makefile.cfg: New.
12441 * Makefile.am: Adjust.
12442 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12443 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12444
124452003-08-25 Akim Demaille <akim@epita.fr>
12446
12447 When reducing initial empty rules, Bison parser read an initial
12448 location that is not defined. This results in garbage, and that
12449 affects Bison's own parser. Therefore we need (i) to extend Bison
12450 to support a means to initialize this location, and (ii) to use
12451 this CVS Bison to fix CVS Bison's parser.
12452
12453 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12454 with...
12455 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12456 * src/parse-gram.y: Adjust.
12457 (%initial-action): New.
12458 (%error-verbose): Since we require CVS Bison, there is no reason
12459 not to use it.
12460 * src/scan-gram.l: Adjust.
12461 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12462 * data/yacc.c (yyparse): Use b4_initial_action.
12463
124642003-08-25 Akim Demaille <akim@epita.fr>
12465
12466 * doc/bison.texinfo: Don't promote stdout for error messages.
12467
124682003-08-25 Akim Demaille <akim@epita.fr>
12469
12470 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12471 From Alexandre Duret-Lutz.
12472
124732003-08-25 Akim Demaille <akim@epita.fr>
12474
12475 Version 1.875c.
12476
124772003-08-25 Akim Demaille <akim@epita.fr>
12478
12479 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12480 Use them.
12481
124822003-08-25 Akim Demaille <akim@epita.fr>
12483
12484 * data/lalr1.cc (Parser::reduce_print_): New.
12485 Use it.
12486
124872003-08-25 Akim Demaille <akim@epita.fr>
12488
12489 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12490 error recovery loops. This patch is based on
12491 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
12492 Also, augment the similarity between lalr1.cc and yacc.c.
12493 Note: the locations of error recovery rules are not correct yet.
12494
12495 * data/lalr1.cc: Comment changes to augment the similarity between
12496 lalr1.cc and yacc.c.
12497 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12498 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12499 yyerrlab), when hitting EOF, pop the whole stack here instead of
12500 merely falling thru the default error handling mechanism.
12501 (yyerrorlab): New label, with the old contents of YYERROR,
12502 plus the following change: pop the stack of rhs corresponding
12503 to the production that invoked YYERROR. That is how Yacc
12504 behaves (required by POSIX).
12505 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12506 fail.
12507
125082003-08-25 Akim Demaille <akim@epita.fr>
12509
12510 Tune local.at so that people can "autom4te -l autotest calc.at -o
12511 calc" for instance, to extract a sub test suite.
12512
12513 * tests/testsuite.at: Move the initialization, Autotest version
12514 requirement, and AT_TESTED invocation into...
12515 * tests/local.at: here.
12516 * tests/testsuite.at: Include it for compatibility with Autoconf
12517 2.57.
12518 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12519 be ignore.
12520
125212003-08-04 Paul Eggert <eggert@twinsun.com>
12522
12523 Rework code slightly to avoid gcc -Wtraditional warnings.
12524 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12525 The returned value is now stored in *YY0. All callers changed.
12526 * src/output.c (merge_output): Adjust to the above change.
12527
125282003-07-26 Paul Eggert <eggert@twinsun.com>
12529
12530 * data/glr.c (YYASSERT): New macro.
12531 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12532 yyresolveStates, yyprocessOneStack):
12533 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12534 Derived from a suggestion by Frank Heckenbach.
12535
125362003-07-25 Paul Eggert <eggert@twinsun.com>
12537
12538 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12539 for portability to K&R C (after ansi2knr, presumably). See
12540 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
12541 by Frank Heckenbach, though I have omitted the structure-initialization
12542 part of his glr-knr.diff patch since I recall that the Portable
12543 C Compiler didn't require that change.
12544
12545 Let the user specify how to allocate and free memory.
12546 Derived from a suggestion by Frank Heckenbach in
12547 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
12548 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12549 All uses of free, malloc, realloc changed to use these macros,
12550 and unnecessary casts removed.
12551 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12552
125532003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12554
12555 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12556 use s.empty() rather than s == "" to test for empty string; see
12557 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
12558 (trivial change)
12559
125602003-06-25 Akim Demaille <akim@epita.fr>
12561
12562 * config/depcomp, config/install-sh: Update from masters.
12563
125642003-06-20 Paul Eggert <eggert@twinsun.com>
12565
12566 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12567 and return properly parenthesized result.
12568 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12569 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12570 Remove unnecessary parentheses from uses.
12571 * doc/bison.texinfo (Location Default Action): Describe the
12572 conventions for parentheses.
12573
125742003-06-19 Paul Eggert <eggert@twinsun.com>
12575
12576 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12577 yyreportTree): Do not assume that size_t is the same width as int,
12578 when printing sizes. Print sizes using an unsigned format.
12579 Problem reported by Frank Heckenbach in
12580 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
12581
12582 Port to Forte Developer 7 C compiler.
12583 * data/glr.c (struct YYLTYPE): If locations are not being used,
12584 declare a single dummy member, as empty structs do not conform
12585 to the C standard.
12586 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12587 the Forte Developer 7 C compiler complains that end-of-loop
12588 code is not reached.
12589
125902003-06-17 Paul Eggert <eggert@twinsun.com>
12591
12592 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12593 avoid warnings from picky compilers about redefinition of PARAMS.
12594
125952003-06-17 Paul Eggert <eggert@twinsun.com>
12596
12597 Version 1.875b.
12598
12599 * NEWS: Document 1.875b.
12600
12601 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12602 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12603 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12604 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12605 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12606 per recent gettext manual's suggestion.
12607 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12608 Use prototypes, not old-style definitions.
12609 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12610 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12611 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12612 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12613 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12614 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12615 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12616 vbitset_or_and_cmp, vbitset_copy): Likewise.
12617
12618 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12619 Do not include <stdlib.h>.
12620 (PARAMS): Define unconditionally for C89.
12621 (ATTRIBUTE_NORETURN): Remove.
12622 (ATTRIBUTE_UNUSED): Define unconditionally.
12623
12624 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
12625 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
12626 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12627 * lib/vbitset.c, lib/vbitset.h: New files.
12628 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12629 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12630 from libbitset.
12631
12632 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12633 `How Can I Reset @code{yyparse}', since texinfo does not allow
12634 arbitrary @ in node names.
12635
12636 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12637 shouldn't be needed according to the gettext 0.12.1 documentation
12638 but which seem to be needed anyway: codeset.m4 glibc21.m4
12639 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
12640 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
12641 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
12642
12643 * lib/.cvsignore: Add stdbool.h.
12644 * m4/.cvsignore: Add nls.m4, po.m4.
12645
12646 Upgrade to CVS gnulib.
12647 * stdbool_.h: File renamed from stdbool.h.in.
12648 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12649 AC_HEADER_STDBOOL.
12650 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12651 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12652 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12653 (MOSTLYCLEANFILES): New var.
12654 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12655 (stdbool.h): New rule.
12656 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12657 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12658 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12659 m4/quote.m4: Upgrade to today's gnulib.
12660
12661 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12662 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12663 the tests right now.
12664 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12665 yyerror are declared before use; C99 requires this.
12666
126672003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12668
12669 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12670 first.
12671 (yyrecoverSyntaxError): Correct the logic for setting and testing
12672 yyerrState.
12673 Correct comment on handling EOF.
12674 Allow states with only a default reduction, rather than failing
12675 (I can't quite reconstruct why these were not allowed before).
12676
12677 Fixes to avoid problem that $-N rules in GLR parsers can cause
12678 buffer overruns, corrupting state.
12679
12680 * src/output.c (prepare_rules): Output max_left_semantic_context
12681 definition.
12682 * src/reader.h (max_left_semantic_context): New variable declaration.
12683 * src/scan-gram.l (max_left_semantic_context): Define.
12684 (handle_action_dollar): Update max_left_semantic_context.
12685 * data/glr.c (YYMAXLEFT): New definition.
12686 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12687 (yyresolveAction): Ditto.
12688
12689 Fixes to problems with location handling in GLR parsers reported by
12690 Frank Heckenbach (2003/06/05).
12691
12692 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12693 (YYRHSLOC): Add parentheses, and define only if locations used.
12694 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12695 locations not used.
12696 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12697 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
12698
12699 * tests/cxx-type.at: Exercise location information; update tests
12700 to differentiate output with and without locations.
12701 Remove forward declarations of yylex and yyerror---caused errors
12702 because default YYLTYPE not yet defined.
12703 Change semantic actions to compute strings, rather than printing
12704 them directly (to test proper passing of semantics values). Change
12705 output to prefix notation and update test data and expected results.
12706 (yylex): Track locations.
12707 (stmtMerge): Return value rather than printing, and include arguments
12708 in value.
12709
127102003-06-03 Paul Eggert <eggert@twinsun.com>
12711
12712 Avoid warnings generated by GCC 2.95.4 when Bison is
12713 configured with --enable-gcc-warnings.
12714 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12715 yy::]b4_parser_class_name[::translate_,
12716 yy::Stack::operator[] (unsigned),
12717 yy::Stack::operator[] (unsigned) const,
12718 yy::Slice::operator[] (unsigned),
12719 yy::Slice::operator[] (unsigned) const):
12720 Rename local vars to avoid warnings.
12721 * tests/glr-regression.at (Improper handling of embedded actions
12722 and $-N in GLR parsers): Remove unused local variable from yylex.
12723 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12724 (void) as arg when not pure, since we now assume C89 when building
12725 Bison. Pacify GCC by using parameter.
12726
127272003-06-02 Paul Eggert <eggert@twinsun.com>
12728
12729 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12730 yy::Location::lines, yy::Location::columns): Rename arguments
12731 to avoid shadowing; this removes a warning generated by GCC 3.3.
12732
127332003-06-01 Paul Eggert <eggert@twinsun.com>
12734
12735 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12736 to g++, as GCC 3.3 complains if you do it.
12737 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12738 everything that WARNING_CFLAGS has, except omit warnings
12739 not suitable for C++.
12740 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12741 * tests/atlocal.in (CXXFLAGS): New var.
12742 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12743
12744 Fix a GLR parser bug I reported in February; see
12745 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
12746 The problem was that GLR parsers did not conform to the C standard,
12747 because actions like { $1 = $2 + $3; } expanded to expressions
12748 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12749 to a local variable. The C standard says that expressions
12750 like (var = f ()) + (var = f ()) have undefined behavior.
12751 Another problem was that GCC sometimes issues warnings that
12752 yyfill and its parameters are unused.
12753
12754 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12755 as possibly unused.
12756 (yyfill): New function.
12757 (YYFILL): Use it.
12758 (yyuserAction): Change type of yynormal to bool, so that it matches
12759 the new yyfill signature. Mark it as possibly unused.
12760
12761
12762 Follow up on a bug I reported in February, where a Bison-generated
12763 parser can loop. Provide a test case and a fix for yacc.c. I
12764 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12765 The original bug report is in:
12766 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
12767
12768 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12769 macro's size was becoming unwieldy.
12770 (yyerrlab): Do not discard an empty lookahead symbol, as this
12771 might destroy garbage.
12772 (yyerrorlab): New label, with the old contents of YYERROR,
12773 plus the following change: pop the stack of rhs corresponding
12774 to the production that invoked YYERROR. That is how Yacc
12775 behaves, and POSIX requires this behavior.
12776 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12777 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12778 Define 'alarm' to do nothing if unistd.h is not available.
12779 Add a new rule "exp: '-' error;" to test the above change to
12780 data/yacc.c. Use 'alarm' to abort any test taking longer than
12781 10 seconds, as it's probably looping.
12782 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12783 Also, the new yacc.c generates two fewer diagnostics for an
12784 existing test.
12785
127862003-05-24 Paul Eggert <eggert@twinsun.com>
12787
12788 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12789 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12790 This fixes a problem reported by John Bowman when the Compaq/HP
12791 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12792 -ansi -Wall -gall).
12793 * data/yacc.c (union yyalloc): Likewise.
12794 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
12795
12796 Switch from 'int' to 'bool' where that makes sense.
12797
12798 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12799 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12800 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12801 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12802 Return or accept bool, not int. All callers changed.
12803 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12804 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12805 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12806 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12807 bitset_or_and_cmp_): Likewise.
12808 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12809 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12810 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12811 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12812 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12813 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12814 bitset_stats_or_and_cmp): Likewise.
12815 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12816 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12817 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12818 ebitset_xor_cmp): Likewise.
12819 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12820 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12821 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12822 lbitset_xor_cmp): Likewise.
12823 * lib/bbitset.h: Include <stdbool.h>.
12824 (struct bitset_vtable): The following members now return bool, not
12825 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12826 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12827 or_and_cmp).
12828 * src/conflicts.c (count_rr_conflicts): Likewise.
12829 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12830 All uses changed.
12831 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12832 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12833 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12834 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12835 graph_flag): Likewise.
12836 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12837 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12838 graph_flag): Likewise.
12839 * src/output.c (error_verbose): Likewise.
12840 * src/output.h (error_verbose): Likewise.
12841 * src/reader.c (start_flag, typed): Likewise.
12842 * src/reader.h (typed): Likewise.
12843 * src/getargs.c (LOCATIONS_OPTION): New constant.
12844 (long_options, getargs): Use it.
12845 * src/lalr.c (build_relations): Use bool, not int.
12846 * src/nullable.c (nullable_compute): Likewise.
12847 * src/print.c (print_reductions): Likewise.
12848 * src/tables.c (action_row, pack_vector): Likewise.
12849 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12850 * src/output.c (prepare): Use it.
12851 * src/output.c (token_definitions_output,
12852 symbol_destructors_output, symbol_destructors_output): Use string,
12853 not boolean integer, to keep track of whether to output separator.
12854 * src/print_graph.c (print_core): Likewise.
12855 * src/state.c (state_rule_lookaheads_print): Likewise.
12856
12857 * config/install-sh: Sync from automake 1.7.5.
12858
128592003-05-14 Paul Eggert <eggert@twinsun.com>
12860
12861 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12862 semicolon after a grammar declaration, in the interest of possible
12863 future changes to the Bison input language.
12864 Do not allow a stray semicolon at the start of the grammar.
12865 (rhses.1): Allow one or more semicolons after any rule, including
12866 just before "|" as required by POSIX.
12867 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12868 grammar.
12869
128702003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12871
12872 %parse-param support for lalr1.cc.
12873
12874 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12875 b4_cc_constructor_calls, b4_cc_constructor_call,
12876 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12877 definitions.
12878 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12879 parse-param arguments.
12880 (yy::b4_parser_class_name): Declare instance variables to
12881 hold parse-param arguments.
12882 * tests/calc.at: s/value/semantic_value/ because value clashes
12883 with a member of yy::b4_parser_class_name. Adjust C++ code
12884 to handle %parse-param. Enable %parse-param test in C++.
12885
128862003-05-12 Paul Eggert <eggert@twinsun.com>
12887
12888 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12889 English a bit. Fix fclose typo. Change "const char" to "char
12890 const", and use ANSI C rather than K&R for "main". Suggest
12891 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12892 and suggest yy_switch_to_buffer.
12893
128942003-05-05 Paul Eggert <eggert@twinsun.com>
12895
12896 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12897 C89. This avoids a diagnostic on compilers that define __STDC__
12898 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
12899 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12900
129012003-05-03 Paul Eggert <eggert@twinsun.com>
12902
12903 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12904 Do not overrun array bounds.
12905 This should fix a bug reported today by Olatunji Oluwabukunmi in
12906 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
12907
129082003-04-29 Akim Demaille <akim@epita.fr>
12909
12910 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12911 * src/getargs.c, src/getargs.h: here, as bool, not int.
12912 (nondeterministic_parser): New.
12913 * src/parse-gram.y, src/scan-gram.l: Support
12914 %nondeterministic-parser.
12915 * src/output.c (prepare): Use nondeterministic_parser instead
12916 of glr_parser where appropriate.
12917 * src/tables.c (conflict_row, action_row, save_row)
12918 (token_actions, token_actions, pack_vector): Ditto.
12919
129202003-04-29 Akim Demaille <akim@epita.fr>
12921
12922 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12923
129242003-04-29 Akim Demaille <akim@epita.fr>
12925
12926 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12927 with %pure-parser and %locations to exercise the patch from Yakov
12928 Markovitch below.
12929
129302003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12931
12932 * data/yacc.c: (b4_lex_param): Corrected for the case where
12933 %lex-param is provided and %pure-parser isn't.
12934
129352003-04-27 Paul Eggert <eggert@twinsun.com>
12936
12937 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
12938 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
12939 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12940 if it is not defined.
12941 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12942
129432003-04-26 Paul Eggert <eggert@twinsun.com>
12944
12945 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12946 Declare to be of type suitable for the ninf value itself, not of
12947 type suitable for the corresponding table, since the latter might
12948 be unsigned but the ninf value might be negative. This fixes a
12949 bug reported by Alexandre Duret-Lutz in
12950 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
12951
12952 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12953 invokes it. We shouldn't invoke it twice because it will attempt
12954 to put error.o in the archive twice. This fixes a glitch reported
12955 by Martin Mokrejs in
12956 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12957
129582003-04-21 Paul Eggert <eggert@twinsun.com>
12959
12960 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12961 to gnulib.
12962
129632003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12964
12965 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12966 Fix obvious typo that results in uncompilable GLR parsers
12967 when both %pure-parser and %locations are used. (trivial change)
12968
129692003-04-17 Paul Eggert <eggert@twinsun.com>
12970
12971 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12972 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12973 Do not insert the expected token via unput, as this runs afoul
12974 of a POSIX-compatibility bug in flex 2.5.31.
12975 All uses changed to BEGIN the parent state,
12976 since we no longer insert the expected token via unput.
12977 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12978 that is no longer emitted after the above change.
12979
12980 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12981 the first one. This change is from Paul Hilfinger, and it fixes
12982 regression reported by Werner Lemberg in
12983 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
12984
12985 (resolve_sr_conflict): Don't invoke state_errs_set
12986 unless one or more tokens have been explicitly made errors.
12987 Otherwise, the above change causes Bison to abort.
12988
12989 * tests/existing.at (GNU pic Grammar): New test case, taken from
12990 Lemberg's email.
12991
129922003-03-31 Akim Demaille <akim@epita.fr>
12993
12994 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12995
129962003-03-31 Akim Demaille <akim@epita.fr>
12997
12998 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12999 output.
13000
130012003-03-31 Akim Demaille <akim@epita.fr>
13002
13003 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
13004 From Paul Hilfinger.
13005
130062003-03-29 Akim Demaille <akim@epita.fr>
13007
13008 * m4/error.m4: Do not put under dynamic conditions some code which
13009 expansion is under static control.
13010
130112003-03-29 Akim Demaille <akim@epita.fr>
13012
13013 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
13014
130152003-03-29 Akim Demaille <akim@epita.fr>
13016
13017 * doc/bison.texinfo (Strings are Destroyed): New.
13018
130192003-03-13 Paul Eggert <eggert@twinsun.com>
13020
13021 * .cvsignore: Add configure.lineno.
13022 * src/.cvsignore: Add yacc.
13023 * tests/.cvsignore: Add testsuite.log.
13024 * doc/fdl.texi: Sync with latest FSF version.
13025
130262003-03-12 Paul Eggert <eggert@twinsun.com>
13027
13028 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
13029 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
13030 cursor, instead of leaving it undefined. This fixes a bug
13031 reported by Tim Van Holder in
13032 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
13033 * tests/input.at (Torturing the Scanner): Test the scanner on
13034 an empty input file, which was Tim Van Holder's test case.
13035
13036 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13037 <sys/resource.h> can be included, include sys/time.h and
13038 sys/times.h first, if available. This works around the SunOS
13039 4.1.4 porting bug reported by Bruce Becker in
13040 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
13041
13042 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13043 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13044 AC_HEADER_SYS_WAIT.
13045
13046 Merge changes from gnulib. This was prompted because the CVS
13047 snapshot didn't build on Solaris 7 due to strnlen problems.
13048
13049 These changes need to be merged back into gnulib:
13050 * lib/hash.c: Include <stdbool.h> unconditionally.
13051 * m4/onceonly.m4 (m4_quote): New macro.
13052 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13053 Quote AC_FOREACH variable-expansions properly.
13054 The 2003-01-03 obstack.h change also needs merging.
13055 {end of changes requiring merging}
13056
13057 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13058 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13059 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13060 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13061 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13062 New files, imported from gnulib.
13063 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13064 above.
13065
13066 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13067 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13068 gnulib sources.
13069
13070 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13071 Add.
13072 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13073 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13074 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13075 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13076 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13077 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13078 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13079 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13080 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13081 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13082 (jm_PREREQ_ARGMATCH): Remove.
13083 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13084 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13085
13086 * src/system.h: Include <stdbool.h> unconditionally.
13087
13088 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13089 assuming at least C89 in the bitset code for some time now.
13090
130912003-03-03 Akim Demaille <akim@epita.fr>
13092
13093 * ro.po: New.
13094
130952003-03-02 Akim Demaille <akim@epita.fr>
13096
13097 * doc/bison.texinfo (Table of Symbols): Reactivate the
13098 documentation for %lex-param, and %parse-param.
13099
131002003-03-02 Akim Demaille <akim@epita.fr>
13101
13102 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13103 generate verbose error messages.
13104 Use the number of tokens as an upper bound in yytname, as it
13105 cannot be a non terminal.
13106
131072003-03-02 Akim Demaille <akim@epita.fr>
13108
13109 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13110 message.
13111
131122003-03-02 Akim Demaille <akim@epita.fr>
13113
13114 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13115 Use them to exercise yycheck overrun.
13116 Based on Andrew Suffield's grammar.
13117
131182003-03-02 Akim Demaille <akim@epita.fr>
13119
13120 Create tests/local.at for Bison generic testing macros.
13121
13122 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
13123 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
13124 This new file.
13125 * tests/calc.at (AT_CHECK_CALC): Adjust.
13126 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
13127 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
13128 * tests/local.at: here.
13129 (AT_COMPILE_CXX): Tags the tests using it as c++.
13130 Ignore the test if CXX is not functional.
13131
131322003-03-01 Paul Eggert <eggert@twinsun.com>
13133
13134 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
13135 not loc->end, since loc->end might contain garbage and this leads
13136 to undefined behavior on some platforms.
13137 (id_loc, token_start): Use (IF_LINTed) initial values that do not
13138 depend on *loc, so that the reader doesn't give the the false
13139 impression that *loc is initialized.
13140 (<INITIAL>"%%"): Do not bother setting code_start, since its value
13141 does not survive the return.
13142
131432003-03-01 Akim Demaille <akim@epita.fr>
13144
13145 * src/scan-gram.l (code_start): Always initialize it when entering
13146 into yylex, as SC_EPILOGUE is activated *before* the corresponding
13147 yylex invocation. An alternative would be making it static, but
13148 then it starts with the second %%'s beginning, instead of its end.
13149
131502003-02-28 Paul Eggert <eggert@twinsun.com>
13151
13152 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
13153 around a UnixWare 7.1.1 porting bug reported by John Hughes in
13154 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
13155
131562003-02-26 Paul Eggert <eggert@twinsun.com>
13157
13158 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
13159 Remove Sequent/Pyramid discussion (nobody uses them any more).
13160 Merge VMS and MS-DOS discussion; these ports may well be dead
13161 but let's keep mentioning them for now. Put <> around email
13162 addresses. Add copyright notice.
13163
131642003-02-24 Paul Eggert <eggert@twinsun.com>
13165
13166 * data/glr.c (yy_reduce_print): yylineno -> yylno,
13167 to avoid collision with flex use of yylineno.
13168 Problem reported by Bruce Lilly in
13169 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
13170 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13171 * data/yacc.c (yy_reduce_print): Likewise.
13172
13173 * config/depcomp: Sync with Automake 1.7.3.
13174
131752003-02-21 Akim Demaille <akim@epita.fr>
13176
13177 * data/lalr1.cc: Use temporary variables instead of casts to
13178 change integer types.
13179 Suggested by Paul Eggert.
13180
131812003-02-21 Akim Demaille <akim@epita.fr>
13182
13183 * doc/bison.texinfo: Use "location" consistently to refer to @n,
13184 to avoid confusions with lalr1.cc's notion of Position.
13185 Suggested by Paul Eggert.
13186
131872003-02-20 Akim Demaille <akim@epita.fr>
13188
13189 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
13190 before initial_columns.
13191 (location.hh): Use consistent variable names when defining the
13192 operator<<.
13193 Use "last" so that we subtract from Positions, not from unsigned.
13194
131952003-02-20 Akim Demaille <akim@epita.fr>
13196
13197 * data/lalr1.cc (position.hh): New subfile, including the extended
13198 and Doxygen'ed documentation of class Position.
13199 (location.hh): Use it.
13200 Document a` la Doxygen.
13201 With the help of Benoit Perrot.
13202
132032003-02-20 Akim Demaille <akim@epita.fr>
13204
13205 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
13206 AT_YACC_IF.
13207 Redefine AT_YYERROR_SEES_LOC_IF using it.
13208 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
13209 not defined.
13210 Don't use the location in yy::Parser::error_ and
13211 yy::Parser::print_ when not %locations.
13212 Activate more lalr1.cc tests.
13213
132142003-02-19 Akim Demaille <akim@epita.fr>
13215
13216 * data/lalr1.cc: When displaying a line number, be sure to make it
13217 an int.
13218
132192003-02-19 Akim Demaille <akim@epita.fr>
13220
13221 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
13222 Remove, useless.
13223 (YYABORT, YYACCEPT, YYERROR): New.
13224 * tests/calc.at: Renable the lalr1.cc test.
13225
132262003-02-19 Akim Demaille <akim@epita.fr>
13227
13228 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
13229 error recovery, mixing with/without pops and discarding of the
13230 lookahead.
13231 Exercise YYERROR.
13232 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
13233
132342003-02-17 Paul Eggert <eggert@twinsun.com>
13235
13236 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
13237 * tests/testsuite.at (AT_COMPILE): Use them.
13238 This fixes the testsuite problem reported by Robert Lentz in
13239 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
13240
132412003-02-12 Paul Eggert <eggert@twinsun.com>
13242
13243 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
13244 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
13245 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
13246 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
13247 Check for malloc failure, for consistency with yacc.c.
13248 (yytname_size): Remove, for consistency with yacc.c.
13249
13250 The bug still remains in data/lalr1.cc, as I didn't have time
13251 to fix it there.
13252
132532003-02-06 Akim Demaille <akim@epita.fr>
13254
13255 * configure.ac (GXX): Rename as...
13256 (CXX): this, to keep the original Autoconf semantics.
13257 Require 2.57.
13258 * data/lalr1.cc: Fix b4_copyright invocations.
13259 If YYDEBUG is not defined, don't depend upon name_ being defined.
13260 (location.hh): Include string and iostream.
13261 (Position::filename): New member.
13262 (Position::Position ()): New.
13263 (operator<< (Position)): New.
13264 (operator- (Position, int)): New.
13265 (Location::first, Location::last): Rename as...
13266 (Location::begin, Location::end): these, to mock the conventional
13267 iterator names.
13268 (operator<< (Location)): New.
13269 * tests/atlocal.in (CXX): New.
13270 * tests/testsuite.at (AT_COMPILE_CXX): New.
13271 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13272 locations in a more synthetic way.
13273 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13274 lalr1.cc is used.
13275 Adjust the C locations to match those from Emacs: first column is
13276 column 0.
13277 Change all the expected results.
13278 Conform to the GCS: simplify the locations when applicable.
13279 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13280 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13281 these CPP macros with the m4 macros new defined by...
13282 (AT_CHECK_PUSHDEFS): this, i.e.:
13283 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
13284 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
13285 New macros.
13286 (AT_CHECK_POPDEFS): Undefine them.
13287 (AT_CHECK_CALC_LALR1_CC): New.
13288 Use it for the first lalr1.cc test.
13289
132902003-02-04 Akim Demaille <akim@epita.fr>
13291
13292 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13293 Location as is defined.
13294
132952003-02-04 Akim Demaille <akim@epita.fr>
13296
13297 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13298 name_ being defined.
13299
133002003-02-03 Paul Eggert <eggert@twinsun.com>
13301
13302 * src/gram.h (start_symbol): Remove unused decl.
13303
13304 Use more-consistent naming conventions for local vars.
13305
13306 * src/derives.c (derives_compute): Change type of local var from
13307 int to rule_number.
13308 * src/gram.c (grammar_rules_partial_print): Likewise.
13309 * src/print.c (print_core): Likewise.
13310 * src/reduce.c (reduce_grammar_tables): Likewise.
13311
13312 * src/gram.c (grammar_dump): Change name of item_number *
13313 local var from r to rp.
13314 * src/nullable.c (nullable_compute): Likewise.
13315
13316 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13317
13318 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13319 for symbol or symbol_number var.
13320 * src/reader.c (grammar_start_symbol_set): Likewise.
13321 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13322 Likewise.
13323 * src/state.c (transitions_to): Likewise.
13324 * src/state.h: Likewise.
13325 * src/tables.c (symbol_number_to_vector_number): Likewise.
13326
13327 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13328 char * var.
13329
13330 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13331 var.
13332
13333 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13334 var.
13335
13336 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13337 Use str, not s, for char * var. Use ch, not c, for character var.
13338 Use size for size var.
13339
13340 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13341 char * var.
13342 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13343 uniqstr var.
13344 * src/uniqstr.h: Likewise.
13345
13346 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13347 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13348 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13349 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13350 param to have same name as that of enum, so that we don't use
13351 "s" to stand for a non-state.
13352
133532003-02-02 Akim Demaille <akim@epita.fr>
13354
13355 * src/scan-skel.l: Scan more than one inert character per yylex
13356 invocation.
13357
133582003-02-01 Paul Eggert <eggert@twinsun.com>
13359
13360 Version 1.875a.
13361
13362 * po/LINGUAS: Add ms.
13363
133642003-01-30 Akim Demaille <akim@epita.fr>
13365
13366 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13367
133682003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13369
13370 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13371 of $1.
13372
13373 Changes in response to error report by S. Eken: GLR mode does not
13374 handle negative $ indices or $ indices in embedded rules correctly.
13375 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
13376
13377 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13378 (b4_rhs_location): Ditto.
13379 (yyfill): New function to copy from stack tree into array
13380 incrementally.
13381 (yyuserAction): Modify to allow incremental move of semantic values
13382 to rhs array when in GLR mode.
13383 Define YYFILL to use in user-defined actions to fill semantic array
13384 as needed.
13385 Remove dummy use of yystack, as there is now a guaranteed use.
13386 (yydoAction): Modify to allow incremental move of semantic values
13387 to rhs array when in GLR mode.
13388 (yyresolveAction): Ditto.
13389 (yyglrShiftDefer): Update comment.
13390 (yyresolveStates): Use X == NULL for pointers, not !X.
13391 (yyglrReduce): Ditto.
13392 (yydoAction): Ditto
13393
13394 * tests/glr-regr1.at: Rename to ...
13395 * tests/glr-regression.at: Add new regression test for the problems
13396 described above (adapted from S. Eken).
13397 Update copyright notice.
13398 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13399 * tests/Makefile.am: Ditto.
13400
134012003-01-28 Paul Eggert <eggert@twinsun.com>
13402
13403 * data/lalr1.cc: Do not use @output_header_name@ unless
13404 b4_defines_flag is set. This fixes two bugs reported by
13405 Tim Van Holder in
13406 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13407 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
13408
134092003-01-21 Paul Eggert <eggert@twinsun.com>
13410
13411 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13412 we don't need to worry about yyerrlab1 being reported as an
13413 "unused label" by non-GCC C compilers. The downside is that if
13414 locations are used then a couple of statements are duplicated each
13415 time YYERROR is invoked, but the upside is that the warnings
13416 should vanish.
13417 (yyerrlab1): Move code to YERROR.
13418 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13419 This reverts some of the 2002-12-27 change.
13420
134212003-01-17 Paul Eggert <eggert@twinsun.com>
13422
13423 * src/output.c (symbol_printers_output): Fix typo that led
13424 to core dump. Problem reported by Antonio Rus in
13425 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
13426
134272003-01-13 Akim Demaille <akim@epita.fr>,
13428 Quoc Peyrot <chojin@lrde.epita.fr>,
13429 Robert Anisko <anisko_r@lrde.epita.fr>
13430
13431 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13432 when the stacks contain one element, as the loop would otherwise
13433 free the last state, and then use the top state (the one we just
13434 popped). This means that the initial elements will not be freed
13435 explicitly, as is the case in yacc.c; it is not a problem, as
13436 these elements have fake values.
13437
134382003-01-11 Paul Eggert <eggert@twinsun.com>
13439
13440 * NEWS: %expect-violations are now just warnings, reverting
13441 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13442 bootstrapping problem reported by Matthias Klose; see
13443 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
13444 * src/conflicts.c (conflicts_print): Likewise.
13445 * tests/conflicts.at (%expect not enough, %expect too much,
13446 %expect with reduce conflicts): Likewise.
13447 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13448 that the warning is enabled if the number of conflicts changes
13449 (not necessarily increases).
13450
13451 * src/getargs.c (version): Update copyright year.
13452
134532003-01-09 Akim Demaille <akim@epita.fr>
13454
13455 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13456
134572003-01-08 Paul Eggert <eggert@twinsun.com>
13458
13459 * Makefile.maint (WGETFLAGS):
13460 New macro, containing "-C off" to disable proxy caches.
13461 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13462 (rel-check): Use $(WGET) instead of wget.
13463
134642003-01-06 Paul Eggert <eggert@twinsun.com>
13465
13466 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13467 the GLR paper of Scott, Johnstone and Hussain.
13468
134692003-01-04 Paul Eggert <eggert@twinsun.com>
13470
13471 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13472 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13473 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13474 (EXTRA_LIBRARIES): New var, for liby.a.
13475 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13476 (EXTRA_SCRIPTS): New var, for yacc.
13477
13478 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13479 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13480 Problem reported by Nelson H. F. Beebe.
13481
134822003-01-03 Paul Eggert <eggert@twinsun.com>
13483
13484 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13485 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13486 when compiling Bison 1.875's `bitset bset = obstack_alloc
13487 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13488
13489 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13490 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13491 grow to a huge size with typical invocation.
13492
13493 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13494 Use the pattern recommended by Autoconf 2.57, except also protect
13495 against double-definition.
13496 * src/system.h: Likewise.
13497 Portability issues reported by Nelson H. F. Beebe.
13498
13499 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13500 All uses changed. Provide a definition in both C and C++.
13501 (yytrue, yyfalse): Define even if defined (__cplusplus).
13502
13503 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13504 Reported by Nelson H. F. Beebe.
13505
13506 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13507
135082003-01-02 Paul Eggert <eggert@twinsun.com>
13509
13510 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13511 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13512 Bug reported by Nelson H. F. Beebe.
13513
135142003-01-01 Paul Eggert <eggert@twinsun.com>
13515
13516 * Version 1.875.
13517
135182002-12-30 Paul Eggert <eggert@twinsun.com>
13519
13520 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13521 Moved here from...
13522 (<INITIAL>","): Here. This causes stray "," to be treated
13523 more uniformly.
13524
13525 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
13526 last brace in braced code when not in Yacc mode, for compatibility
13527 with Bison 1.35. This resurrects the 2001-12-15 patch to
13528 src/reader.c.
13529
13530 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13531 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13532
135332002-12-28 Paul Eggert <eggert@twinsun.com>
13534
13535 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13536 that of SYM's type. This fixes Debian bug 168069, reported by
13537 Thomas Olsson.
13538
135392002-12-28 Paul Eggert <eggert@twinsun.com>
13540
13541 Version 1.75f.
13542
13543 Switch back to the Yacc style of conflict reports, undoing some
13544 of the 2002-07-30 change.
13545 * doc/bison.texinfo (Understanding): Use Yacc style for
13546 conflict reports. Also, use new way of locating rules.
13547 * src/conflicts.c (conflict_report):
13548 Renamed from conflict_report_yacc, removing the old
13549 'conflict_report'. Translate the entire conflict report at once,
13550 so that we don't assume that "," has the same interpretation in
13551 all languages.
13552 (conflicts_output): Use Yacc-style conflict report for each state,
13553 instead of our more-complicated style.
13554 (conflicts_print): Use Yacc-style conflict report, except print
13555 the input file name when not emulating Yacc.
13556 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13557 Conflicted Reduction, %expect not enough, %expect too much,
13558 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13559 * tests/existing.at (GNU Cim Grammar): Likewise.
13560 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13561
13562 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13563 fatal): Don't invoke fflush; it's not needed and it might even be
13564 harmful for stdout, as stdout might not be open.
13565 * src/reduce.c (reduce_print): Likewise.
13566
135672002-12-27 Paul Eggert <eggert@twinsun.com>
13568
13569 Fix a bug where error locations were not being recorded correctly.
13570 This problem was originally reported by Paul Hilfinger in
13571 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
13572
13573 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13574 top of the location stack's error locations.
13575 (yyerrlab): Set it. When discarding a token, push its location
13576 onto yylerrsp so that we don't lose track of the error's end.
13577 (yyerrlab1): Now is only the target of YYERROR, so that we can
13578 properly record the location of the action that failed. For GCC
13579 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13580 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13581 (yyerrlab2): New label, which yyerrlab now falls through to.
13582 Compute the error's location by applying YYLLOC_DEFAULT to
13583 the locations of all the symbols that went into the error.
13584 * doc/bison.texinfo (Location Default Action): Mention that
13585 YYLLOC_DEFAULT is also invoked for syntax errors.
13586 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13587 Error locations include the locations of all the tokens that were
13588 discarded, not just the last token.
13589
135902002-12-26 Paul Eggert <eggert@twinsun.com>
13591
13592 * src/files.c: Include quote.h.
13593 (compute_output_file_names): Warn if we detect conflicting
13594 outputs to the same file. This should catch the misunderstanding
13595 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13596
13597 * src/conflicts.c (conflicts_print): If the user specifies
13598 "%expect N", report an error if there are any reduce/reduce
13599 conflicts. This is what the manual says should happen.
13600 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13601 * tests/conflicts.at (%expect with reduce conflicts): New test.
13602
13603 Don't use m4_include on relative file names, as it doesn't work as
13604 desired if there happens to be a file with that name under ".".
13605
13606 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13607 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13608 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13609 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13610 * src/output.c (output_skeleton): Use full path names when
13611 specifying a file to include; don't rely on include path, as
13612 it's unreliable when the working file contains a file with
13613 that name.
13614
136152002-12-25 Paul Eggert <eggert@twinsun.com>
13616
13617 Remove obsolete references to bison.simple and bison.hairy.
13618 Problem mentioned by Aubin Mahe in
13619 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
13620 * data/glr.c: Comment fix.
13621 * doc/bison.1: Remove references. Also, mention "yacc".
13622
13623 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13624 with -g option.
13625
13626 * src/parse-gram.y (declaration): Use enum "report_states" rather
13627 than its numeric value 1.
13628
13629 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13630 opening a new one. This fixes Debian bug 165349, reported by
13631 Bruce Stephens.
13632
136332002-12-24 Paul Eggert <eggert@twinsun.com>
13634
13635 Version 1.75e.
13636
13637 * Makefile.maint (cvs-update): Don't assume that the shell
13638 supports $(...), as Solaris sh doesn't.
13639
13640 * src/parse-gram.y (lloc_default): Remove test for empty
13641 nonterminals at the end, since it didn't change the result.
13642
136432002-12-24 Paul Eggert <eggert@twinsun.com>
13644
13645 If the user does not define YYSTYPE as a macro, Bison now declares it
13646 using typedef instead of defining it as a macro. POSIX requires this.
13647 For consistency, YYLTYPE is also declared instead of defined.
13648
13649 %union directives can now have a tag before the `{', e.g., the
13650 directive `%union foo {...}' now generates the C code
13651 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13652 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13653 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13654 instead of `yyltype'.
13655
13656 `yystype' and `yyltype' are now obsolescent macros instead of being
13657 typedefs or tags; they are no longer documented and will be
13658 withdrawn in a future release.
13659
13660 * data/glr.c (b4_location_type): Remove.
13661 (YYSTYPE): Renamed from yystype.
13662 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13663 (struct YYLTYPE): Renamed from struct yyltype.
13664 (YYLTYPE): Renamed from yyltype.
13665 (yyltype, yystype): New (and obsolescent) macros,
13666 for backward compatibility.
13667 * data/yacc.c: Likewise.
13668
13669 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13670 does not specify a union tag. This is for compatibility with
13671 Solaris 9 yacc.
13672
13673 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13674 const *, since it is now modified by stripping surrounding { }.
13675 (current_braced_code): Remove.
13676 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13677 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13678 trailing " {...}". Now of type <chars>.
13679 (grammar_declaration): Adjust to bundled tokens.
13680 (code_content): Remove; stripping is now done by add_param.
13681 (print_token_value): Print contents of bundled tokens.
13682 (token_name): New function.
13683
13684 * src/reader.h (braced_code, current_braced_code): Remove.
13685 (token_name): New decl.
13686
13687 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13688 token_type, not braced_code code_kind. All uses changed.
13689 (SC_PRE_CODE): New state, for scanning after a keyword that
13690 has (or usually has) an immediately-following braced code.
13691 (token_type): New local var, to keep track of which token type
13692 to return when scanning braced code.
13693 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
13694 <INITIAL>"%parse-param", <INITIAL>"%printer",
13695 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13696 instead of returning a token type immediately.
13697 (<INITIAL>"{"): Set token type.
13698 (<SC_BRACED_CODE>"}"): Use it.
13699 (handle_action_dollar, handle_action_at): Now returns bool
13700 indicating success. Fail if ! current_rule; this prevents a core dump.
13701 (handle_symbol_code_dollar, handle_symbol_code_at):
13702 Remove; merge body into caller.
13703 (handle_dollar, handle_at): Complain in invalid contexts.
13704
13705 * NEWS, doc/bison.texinfo: Document the above.
13706 * NEWS: Fix years and program names in copyright notice.
13707
137082002-12-17 Paul Eggert <eggert@twinsun.com>
13709
13710 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13711 Reporting, Table of Symbols): Omit mentions of %lex-param and
13712 %parse-param from the documentation for now.
13713
137142002-12-15 Paul Eggert <eggert@twinsun.com>
13715
13716 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13717 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13718 lookahead symbol, and which sets yychar in parser actions) and it
13719 disagreed with the Bison documentation. Bug
13720 reported by Andrew Walrond.
13721
13722 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13723 as the caller now does that.
13724 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13725 (YYEMPTY): Parenthesize right hand side, since others use it.
13726 (yyparse): Don't assume that our generated code is the only code
13727 that sets yychar.
13728
137292002-12-13 Paul Eggert <eggert@twinsun.com>
13730
13731 Version 1.75d.
13732
13733 POSIX requires a "yacc" command.
13734 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13735 (MOSTLYCLEANFILES): Add yacc.
13736 (yacc): New rule.
13737 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
13738 as an alias for bison y.
13739
13740 * po/LINGUAS: Add da.
13741
13742 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13743 problem with latest <getopt.h>.
13744 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13745
13746 * doc/fdl.texi: Upgrade to 1.2.
13747 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13748 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13749 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13750 gnulib.
13751 * config/install-sh: Sync with autotools.
13752
13753 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
13754 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13755 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13756 locations are requested.
13757 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13758 locations are requested.
13759
137602002-12-12 Paul Eggert <eggert@twinsun.com>
13761
13762 Remove unportable casts and storage allocation tricks.
13763 While we're at it, remove almost all casts, since they
13764 usually aren't needed and are a sign of trouble.
13765
13766 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13767
13768 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13769 the pointer DSET returned by malloc; this isn't portable.
13770 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13771 Similarly for DERIVES.
13772 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13773 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13774 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13775
13776 * src/derives.c (derives_compute): Do not bother invoking
13777 int_of_rule_number, since rule numbers are integers.
13778
13779 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13780 rather than XMALLOC (char, N).
13781
13782 * src/files.c (filename_split): Rewrite to avoid cast.
13783
13784 * src/gram.h (symbol_number_as_item_number,
13785 item_number_as_symbol_number, rule_number_as_item_number,
13786 item_number_as_rule_number):
13787 Now inline functions rather than macros, to avoid casts.
13788 * src/state.h (state_number_as_int): Likewise.
13789 * src/tables.c (state_number_to_vector_number,
13790 symbol_number_to_vector_number): Likewise.
13791
13792 * src/gram.h (int_of_rule_number): Remove; no longer used.
13793
13794 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13795 since the resulting storage is always stored into.
13796
13797 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13798 where it's needed.
13799
13800 * src/muscle_tab.c (muscle_m4_output):
13801 Now inline. Return bool, not int.
13802 * src/state.c (state_compare): Likewise.
13803 * src/symtab.c (symbol_check_defined,
13804 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13805 hash_compare_symbol, hash_symbol):
13806 Likewise.
13807 * src/uniqstr.c (uniqstr_print): Likewise.
13808 * src/muscle_tab.c (muscle_m4_output_processor):
13809 New function, to avoid casts.
13810 * src/state.c (state_comparator, stage_hasher): Likewise.
13811 * src/symtab.c (symbol_check_defined_processor,
13812 symbol_check_alias_consistency_processor, symbol_pack_processor,
13813 symbol_translation_processor, hash_symbol_comparator,
13814 hash_symbol_hasher): Likewise.
13815 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13816 * src/muscle_tab.c (muscles_m4_output):
13817 Use new functions instead of casting old functions unportably.
13818 * src/state.c (state_hash_new): Likewise.
13819 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13820 symbols_token_translations_init):
13821 Likewise.
13822 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13823
13824 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13825 var instead of casting to long, to avoid casts.
13826 (prepare_states): Use MALLOC rather than alloca, so that we don't
13827 have to worry about alloca.
13828 * src/state.c (state_hash_lookup): Likewise.
13829
13830 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13831 local var instead of casting to unsigned char, to avoid casts.
13832
13833 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13834 STATE_ALLOC): Remove.
13835 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13836 rather than calloc, and use offsetof to avoid allocating slightly
13837 too much storage.
13838 (state_new): Initialize all members.
13839
13840 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13841
13842 * src/symtab.c (symbol_free): Remove; unused.
13843 (symbol_get): Remove cast in lhs of assignment.
13844 (symbols_do): Now static. Accept generic arguments, not
13845 hashing-related ones.
13846
13847 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13848 (symbol_processor): Remove.
13849 (symbols_do): Remove decl; now static.
13850
13851 * src/system.h (alloca): Remove; decl no longer needed.
13852 (<stddef.h>): Include, for offsetof.
13853 (<inttypes.>, <stdint.h>): Include if available.
13854 (uintptr_t): New type, if system lacks it.
13855 (CALLOC, MALLOC, REALLOC): New macros.
13856 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13857 new macros.
13858
13859 * src/tables.c (table_size): Now int, to pacify GCC.
13860 (table_grow, table_ninf_remap): Use signed table size.
13861 (save_row): Don't bother initializing locals when not needed.
13862 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13863 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13864
13865 * src/vcg.h: Correct misspellings.
13866
13867 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13868
13869
13870 * src/getargs.c (getargs): Don't assume EOF == -1.
13871
138722002-12-09 Paul Eggert <eggert@twinsun.com>
13873
13874 Change identifier spellings to avoid collisions with names
13875 that are reserved by POSIX.
13876
13877 Don't use names ending in _t, since POSIX reserves them.
13878 For consistency, remove _e and _s endings -- they're weren't
13879 needed to remove ambiguity. All uses changed.
13880 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13881 turn was just renamed from struniq_t.
13882 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13883 which in turn was just renamed from struniq_processor_t.
13884 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13885 in turn was renamed from hash_compare_struniq_t.
13886 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13887 (state_list): Renamed from state_list_t.
13888 * src/assoc.h (assoc): Renamed from assoc_t.
13889 * src/conflicts.c (enum conflict_resolution): Renamed from
13890 enum conflict_resolution_e.
13891 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13892 (rule_list): Renamed from rule_list_t.
13893 * src/getargs.h (enum trace): Renamed from enum trace_e.
13894 (enum report): Renamed from enum report_e.
13895 * src/gram.h (item_number): Renamed from item_number_t.
13896 (rule_number): Renamed from rule_number_t.
13897 (struct rule_s): Remove the "rule_s" part; not used.
13898 (rule): Renamed from rule_t.
13899 (rule_filter): Renamed from rule_filter_t.
13900 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13901 (goto_list): Renamed from goto_list_t.
13902 * src/lalr.h (goto_number): Renamed from goto_number_t.
13903 * src/location.h (location): Renamed from location_t.
13904 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13905 and moved here from:
13906 * src/muscle_tab.h (muscle_entry_t): here.
13907 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13908 (rule_list): Renamed from rule_list_t.
13909 * src/print_graph.c (static_graph): Renamed from graph.
13910 * src/reader.h (braced_code): Renamed from braced_code_t.
13911 Remove brace_code_e tag.
13912 * src/relation.h (relation_node): Renamed from relation_node_t.
13913 (relation_nodes): Renamed from relation_nodes_t.
13914 (relation): Renamed from relation_t.
13915 * src/state.h (state_number): Renamed from state_number_t.
13916 (struct state): Renamed from struct state_s.
13917 (state): Renamed from state_t.
13918 (transitions): Renamed from transitions_t. Unused (and
13919 misspelled) transtion_s tag removed.
13920 (errs): Renamed from errs_t. Unused errs_s tag removed.
13921 (reductions): Renamed from reductions_t. Unused tag
13922 reductions_s removed.
13923 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13924 (struct symbol_list): Renamed from struct symbol_list_s.
13925 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13926 (struct symbol): Renamed from struct symbol_s.
13927 (symbol): Renamed from symbol_t.
13928 * src/tables.c (vector_number): Renamed from vector_number_t.
13929 (action_number): Renamed from action_t.
13930 * src/tables.h (base_number): Renamed from base_t.
13931 * src/vcg.h (enum color): Renamed from enum color_e.
13932 (enum textmode): Renamed from enum textmode_e.
13933 (enum shape): Renamed from enum shape_e.
13934 (struct colorentry): Renamed from struct colorentry_s.
13935 (struct classname): Renamed from struct classname_s.
13936 (struct infoname): Renamed from struct infoname_s.
13937 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13938 (enum decision): Renamed from enum decision_e.
13939 (enum orientation): Renamed from enum orientation_e.
13940 (enum alignment): Renamed from enum alignment_e.
13941 (enum arrow_mode): Renamed from enum arrow_mode_e.
13942 (enum crossing_type): Renamed from enum crossing_type_e.
13943 (enum view): Renamed from enum view_e.
13944 (struct node): Renamed from struct node_s.
13945 (node): Renamed from node_t.
13946 (enum linestyle): Renamed from enum linestyle_e.
13947 (enum arrowstyle): Renamed from enum arrowstyle_e.
13948 (struct edge): Renamed from struct edge.
13949 (edge): Renamed from edge_t.
13950 (struct graph): Renamed from struct graph_s.
13951 (graph): Renamed from graph_t.
13952 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13953 Rename value_t -> value.
13954 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13955 value_t_as_yystype -> value_as_yystype.
13956
13957 Don't include <errno.h> in the mainstream code, since it
13958 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13959 * lib/get-errno.c, lib/get-errno.h: New files.
13960 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13961 get-errno.c.
13962 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13963 * src/output.c (output_skeleton): Likewise.
13964 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13965 instead of errno.
13966 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13967 Likewise.
13968 (handle_action_dollar, handle_action_at): Likewise.
13969 * src/system.h: Do not include <errno.h>.
13970 (TAB_EXT): Renamed from EXT_TAB.
13971 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13972
13973 Avoid str[a-z]*, since <string.h> reserves that name space.
13974 Change all instances of "struniq" in names to "uniqstr", and
13975 likewise for "STRUNIQ" and "UNIQSTR".
13976 * src/uniqstr.c: Renamed from src/struniq.c.
13977 * src/uniqstr.h: Renamed from src/struniq.h.
13978 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13979 * src/files.c (strsuffix): Remove; unused.
13980 (concat2): Renamed from stringappend. Now static.
13981 * src/files.h (strsuffix, stringappend): Remove; unused.
13982 * src/parse-gram.y (<chars>): Renamed from <string>.
13983 (<uniqstr>): Renamed from <struniq>.
13984 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13985 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13986 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13987 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13988 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13989 (N_EXPAND): Renamed from N_STRETCH.
13990
13991 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13992 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13993 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13994 Remove; unused.
13995 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13996 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13997 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13998 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13999 (BASE_MAXIMUM): Renamed from BASE_MAX.
14000 (BASE_MINIMUM): Renamed from BASE_MIN.
14001 (ACTION_MAX): Remove; unused.
14002 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
14003 Unnecessary casts removed from above defines.
14004
14005
14006 Fix misspelling in names.
14007 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
14008 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
14009 G_NODE_ALIGNEMENT.
14010
14011
14012 * lib/timevar.c (timevar_report): Renamed from time_report,
14013 for consistency with other names.
14014 * lib/timevar.h (timevar_report): New decl.
14015 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
14016
14017
14018 Sort include-file uses.
14019
14020 Reorder all include files under src to be in the order "system.h".
14021 then the ../lib include files in angle brackets (alphabetized),
14022 then the . include files in double-quotes (alphabetized). Fix
14023 dependency breakages encountered in this process, as follows:
14024 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
14025 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
14026 * src/state.h: Include "symtab.h".
14027
140282002-12-08 Paul Eggert <eggert@twinsun.com>
14029
14030 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
14031 since this causes problems when __file__ contains character
14032 sequences like "@" that are treated specially by src/scan-skel.l.
14033 Instead, just use the file's basename. This fixes the bug
14034 reported by Martin Mokrejs in
14035 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
14036
140372002-12-06 Paul Eggert <eggert@twinsun.com>
14038
14039 Add support for rules that do not have trailing semicolons, as
14040 POSIX requires. Improve the quality of locations in Bison
14041 diagnostics.
14042
14043 * src/location.c: Include <quotearg.h>.
14044 (empty_location): Now const.
14045 (location_print): New function. Follow the recommendation of the
14046 GNU Coding Standards for locations that span file boundaries.
14047 * src/location.h: Do not include <quotearg.h>; no longer needed.
14048 (boundary): New type.
14049 (location_t): Use it. This allows locations to span file boundaries.
14050 All member uses changed: file -> start.file or end.file (as needed),
14051 first_line -> start.line, first_column -> start.column,
14052 last_line -> end.line, last_column -> end.column.
14053 (equal_boundaries): New function.
14054 (LOCATION_RESET, LOCATION_STEP): Remove.
14055 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14056 (empty_location): Now const.
14057 (location_print): New decl.
14058 * src/parse-gram.y (lloc_default): New function, which handles
14059 empty locations more accurately.
14060 (YYLLOC_DEFAULT): Use it.
14061 (%token COLON): Remove.
14062 (%token ID_COLON): New token.
14063 (rules): Use it.
14064 (declarations, rules): Remove trailing semicolon.
14065 (declaration, rules_or_grammar_declaration):
14066 Allow empty (";") declaration.
14067 (symbol_def): Remove empty actions; no longer needed.
14068 (rules_or_grammar_declaration): Remove trailing semicolon.
14069 (semi_colon.opt): Remove.
14070 * src/reader.h: Include location.h.
14071 (scanner_cursor): New decl.
14072 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14073 rolling our own.
14074 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14075 of *loc.
14076 (STEP): Remove. No longer needed, now that adjust_location does
14077 the work. All uses removed.
14078 (scanner_cursor): New var.
14079 (adjust_location): Renamed from extend_location. It now sets
14080 *loc and adjusts the scanner cursor. All uses changed.
14081 Don't bother testing for CR.
14082 (handle_syncline): Remove location arg; now updates scanner cursor.
14083 All callers changed.
14084 (unexpected_end_of_file): Now accepts start boundary of token or
14085 comment, not location. All callers changed. Update scanner cursor,
14086 not the location.
14087 (SC_AFTER_IDENTIFIER): New state.
14088 (context_state): Renamed from c_context. All uses changed.
14089 (id_loc, code_start, token_start): New local vars.
14090 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14091 processing of Yacc white space and equivalents here.
14092 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14093 instead of returning ID immediately, since we need to search for
14094 a subsequent colon.
14095 (<INITIAL>"'", "\""): Save token_start.
14096 (<INITIAL>"%{", "{", "%%"): Save code_start.
14097 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14098 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14099 BEGIN context_state at end, not INITIAL.
14100 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14101 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14102 Return correct token start.
14103 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14104 the start of a character, string or multiline comment is found.
14105 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14106 Reduction): Adjust reported locations to match the more-precise
14107 results now expected.
14108 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14109 * tests/reduce.at (Useless Rules, Reduced Automaton,
14110 Underivable Rules): Likewise.
14111 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14112 or "|"' now that so many other tokens are allowed by the new grammar.
14113
14114 * src/complain.h (current_file): Remove duplicate decl;
14115 current_file is now owned by files.h.
14116 * src/complain.c, src/scan-gram.l: Include files.h.
14117
141182002-12-06 Paul Eggert <eggert@twinsun.com>
14119
14120 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
14121 promotes to int; it might be unsigned int.
14122 * data/yacc.c (yy_reduce_print): Likewise.
14123
14124 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
14125 be #defined in the prologue, not in the Bison declarations.
14126 This fixes Debian Bug 102878, reported by Shaul Karl.
14127
141282002-12-02 Paul Eggert <eggert@twinsun.com>
14129
14130 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
14131 * lib/strtoul.c: New file, from gnulib.
14132 This fixes a porting bug reported by Peter Klein in
14133 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
14134
141352002-11-30 Paul Eggert <eggert@twinsun.com>
14136
14137 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
14138 and put only a forward declaration in the prologue. This is for
14139 consistency with the other scanner helper functions.
14140
14141 Type clashes now generate warnings, not errors, since it
14142 appears that POSIX may allow some grammars with type clashes.
14143 * src/reader.c (grammar_current_rule_check): Warn about
14144 type clashes instead of complaining.
14145 * tests/input.at (Type Clashes): Expect warnings, not complaints.
14146
14147 Add Yacc library, since POSIX requires it.
14148 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
14149 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
14150 * lib/main.c, lib/yyerror.c: New files.
14151
14152 gram_error can be static; it need not be extern.
14153 * src/reader.h (gram_error): Remove decl.
14154 * src/parse-gram.y (gram_error): Now static. Add static decl.
14155 (print_token_value): Omit parameter names from forward decl,
14156 for consistency.
14157
141582002-11-29 Paul Eggert <eggert@twinsun.com>
14159
14160 * doc/bison.texinfo: Emphasize that yylex and yyerror must
14161 be declared before being used. E.g., one should typically
14162 declare them in the prologue. Use GNU coding style in examples.
14163 Put "const" consistently after the type it modifies. Mention
14164 that C99 supports "inline". Mention that yyerror traditionally
14165 returns "int".
14166
14167 %parse-param and %lex-param now take just one argument, the
14168 declaration; the argument name is deduced from the declaration.
14169
14170 * doc/bison.texinfo (Parser Function, Pure Calling, Error
14171 Reporting, Table of Symbols): Document this.
14172 * src/parse-gram.y (add_param): New function.
14173 (COMMA): Remove.
14174 (declaration): Implement new rule for %parse-param and %lex-param.
14175 * src/scan-gram.l: "," now elicits a warning, rather than being
14176 a token; this is more compatible with byacc.
14177 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
14178
141792002-11-27 Paul Eggert <eggert@twinsun.com>
14180
14181 Rename identifiers to avoid real and potential collisions.
14182
14183 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
14184 to avoid collision with lex macro described by Bruce Lilly in
14185 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
14186 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
14187 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
14188 * src/parse-gram.y (print_token_value): Renamed from yyprint.
14189 All uses changed.
14190 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
14191 The name "yycontrol" violates the name space rules, and this stuff
14192 wasn't being used anyway.
14193 (input): Remove action; this stuff wasn't being used.
14194 (gram_error): Rename local variable yylloc -> loc.
14195 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
14196 (YY_DECL): Don't use "yy" at start of local variables.
14197 All uses changed, e.g., yylloc -> loc.
14198 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
14199 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
14200 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
14201 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
14202
14203 * src/parse-gram.y (gram_error): loc is now const *.
14204 * src/reader.h (gram_error): Likewise.
14205
142062002-11-24 Paul Eggert <eggert@twinsun.com>
14207
14208 Version 1.75c.
14209
14210 * tests/actions.at (Actions after errors): Use an output format
14211 more similar to that of the Printers and Destructors test.
14212 Test the position of the ';' token too.
14213 (Printers and Destructors): Likewise.
14214 (Printers and Destructors: %glr-parser): Remove for now, to avoid
14215 unnecessarily alarming people when the test fails.
14216
14217 * data/yacc.c (yyerrlab1): Move this label down, so that the
14218 parser does not discard the lookahead token if the user code
14219 invokes YYERROR. This change is required for POSIX conformance.
14220
14221 * lib/error.c: Sync with gnulib.
14222
142232002-11-22 Paul Eggert <eggert@twinsun.com>
14224
14225 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
14226 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
14227 * lib/xmalloc.c: Likewise.
14228
142292002-11-20 Paul Eggert <eggert@twinsun.com>
14230
14231 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
14232
142332002-11-20 Paul Eggert <eggert@twinsun.com>
14234
14235 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
14236 should use `if (! x) abort ();' rather than `assert (x);', and
14237 anyway it's one less thing to worry about configuring.
14238
14239 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
14240 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
14241 and replace all instances of assert with abort.
14242 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
14243 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
14244
14245 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
14246 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
14247 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
14248 hash_find_entry, hash_rehash, hash_insert): Likewise.
14249 * src/conflicts.c (resolve_sr_conflict): Likewise.
14250 * src/lalr.c (set_goto_map, map_goto): Likewise.
14251 * src/nullable.c (nullable_compute): Likewise.
14252 * src/output.c (prepare_rules, token_definitions_output): Likewise.
14253 * src/reader.c (packgram, reader): Likewise.
14254 * src/state.c (state_new, state_free, state_transitions_set,
14255 state_reduction_find): Likewise.
14256 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
14257 symbol_pack): Likewise.
14258 * src/tables.c (conflict_row, pack_vector): Likewise.
14259 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14260 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14261 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
14262 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
14263
14264 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
14265 (ARGMATCH_CONSTRAINT): New macro.
14266 (ARGMATCH_ASSERT): Use it.
14267
14268 * src/system.h (verify): New macro.
14269 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
14270 rather than assert.
14271 * src/tables.c (tables_generate): Likewise.
14272
14273 * src/struniq.c (struniq_assert): Now returns void, and aborts
14274 if the assertion is false.
14275 (struniq_assert_p): Remove.
14276 * src/struniq.h: Likewise.
14277
142782002-11-18 Paul Eggert <eggert@twinsun.com>
14279
14280 * data/glr.c (yygetLRActions): Replace `yyindex' with
14281 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14282 This fixes the regression with Sun ONE Studio 7 cc that I reported in
14283 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
14284
142852002-11-18 Akim Demaille <akim@epita.fr>
14286
14287 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14288 space.
14289 From Tim Van Holder.
14290
142912002-11-17 Paul Eggert <eggert@twinsun.com>
14292
14293 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14294 to "SyntaxError" for consistency with my 2002-11-15 change.
14295
14296 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14297 not define to {}, since this breaks the common use of `YYDPRINTF
14298 ((...));' if a single statement is desired (e.g. before `else').
14299 Work around GCC warnings by surrounding corresponding calls with
14300 {} if needed.
14301 (yyhasResolvedValue): Remove unused function.
14302 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14303 loop body.
14304 (yyreportSyntaxError): Renamed from yyreportParseError.
14305 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14306 All uses changed.
14307 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14308 extern when possible. Remove unused initializations.
14309
143102002-11-16 Akim Demaille <akim@epita.fr>
14311
14312 Augment the similarity between GLR and LALR traces.
14313
14314 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14315 (YY_REDUCE_PRINT): New.
14316 (yyparse): Use them.
14317 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14318 YYDPRINT here.
14319 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14320 state reached after the reduction/recovery, since...
14321 (yyparse, yyprocessOneStack): Report the state we are entering in.
14322
143232002-11-16 Akim Demaille <akim@epita.fr>
14324
14325 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14326 Add support for --trace=skeleton.
14327 * src/scan-skel.l: %option debug.
14328 Scan strings of non-@ or \n instead of character by character.
14329 (scan_skel): Handle trace_skeleton.
14330 (QPUTS): New.
14331 (@output_parser_name@, @output_header_name@): ``Restore'' their
14332 support (used to be M4 macros).
14333 * data/yacc.c: Quote larger chunks, a la glr.c.
14334 * data/lalr1.cc: Likewise.
14335 The header guards are no longer available, so use some other
14336 string than `YYLSP_NEEDED'.
14337
143382002-11-16 Akim Demaille <akim@epita.fr>
14339
14340 Make the ``Printers and Destructors'' test more verbose, taking
14341 `yacc.c''s behavior as (possibly wrong) reference.
14342
14343 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14344 instead of fprint on stdout.
14345 Set and report the last_line of the symbols.
14346 Consistently display values and locations.
14347
143482002-11-16 Paul Eggert <eggert@twinsun.com>
14349
14350 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14351
143522002-11-15 Paul Eggert <eggert@twinsun.com>
14353
14354 * tests/actions.at (Actions after errors): New test case.
14355
14356 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14357 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14358 tests/action.at, tests/calc.at, tests/conflicts.at,
14359 tests/cxx-type.at, tests/regression.at:
14360 "parse error" -> "syntax error" for POSIX compatibility.
14361 "parsing stack overflow..." -> "parser stack overflow" so
14362 that code matches Bison documentation.
14363
143642002-11-15 Akim Demaille <akim@epita.fr>
14365
14366 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14367 take two BRACED_CODE, not two string_content.
14368 Free the scanner's obstack when we are done.
14369 (code_content): New.
14370 * tests/calc.at: Adjust.
14371 * doc/bison.texinfo: Adjust.
14372 Also, make sure to include the `,' for these declarations.
14373
143742002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14375
14376 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14377 definition; avoids potential autoreconf problems.
14378
143792002-11-15 Akim Demaille <akim@epita.fr>
14380
14381 Always check the value returned by yyparse.
14382
14383 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14384 returned by yyparse.
14385 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14386 Adjust calls.
14387 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14388 returned by yyparse.
14389
143902002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14391
14392 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14393 on input.at test.
14394
143952002-11-14 Paul Eggert <eggert@twinsun.com>
14396
14397 * src/output.c (output_skeleton): Call xfopen instead of
14398 duplicating xfopen's body.
14399
14400 Fix bugs reported by Nelson H. F. Beebe in
14401 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
14402
14403 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14404 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14405 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14406 file twice in the grammar, as an extra check.
14407
14408 * tests/input.at (Torturing the Scanner): Surround the
14409 backslash-newline tests with "#if 0", to make it less likely that
14410 we'll run into compiler bugs. Bring back solitary \ inside
14411 comment, but add a closing comment to work around HP C bug. Don't
14412 test backslash-newline in C character constant.
14413
144142002-11-14 Akim Demaille <akim@epita.fr>
14415
14416 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14417 status of the compiler.
14418 Calling `exit 1' is no longer needed.
14419 Reported by Nelson H. F. Beebe.
14420
144212002-11-14 Akim Demaille <akim@epita.fr>
14422
14423 * tests/atlocal.in (CPPFLAGS): We have config.h.
14424 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14425 New.
14426 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14427 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14428 * tests/regression.at, tests/torture.at: Use them for all the
14429 grammars that are to be compiled.
14430 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14431 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14432 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14433
144342002-11-14 Akim Demaille <akim@epita.fr>
14435
14436 * doc/bison.texinfo: Various formatting changes (alignments in
14437 samples, additional @group/@end group, GCS in samples.
14438 Use @deffn instead of simple @table to define the directives,
14439 macros, variables etc.
14440
144412002-11-13 Paul Eggert <eggert@twinsun.com>
14442
14443 Fix some bugs reported by Albert Chin-A-Young in
14444 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
14445
14446 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
14447 -o c"; the HP C compiler chatters during compilation.
14448 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14449 * tests/headers.at (export YYLTYPE): Likewise.
14450
14451 * tests/input.at (Torturing the Scanner): Remove lines containing
14452 solitary backslashes, as they tickle a bug in the HP C compiler.
14453
14454 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14455 comments, since they're not portable. Use GNU coding style.
14456
144572002-11-13 Akim Demaille <akim@epita.fr>
14458
14459 * data/yacc.c: Leave bigger chunks of quoted text.
14460 (YYDSYMPRINTF): New.
14461 Use it to report symbol activities.
14462 * data/glr.c (YYDSYMPRINTF): New.
14463 Use it.
14464
144652002-11-12 Paul Eggert <eggert@twinsun.com>
14466
14467 Version 1.75b.
14468
14469 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14470 (yyglrReduce): Return yyok, not 0.
14471 This should avoid the enumerated-type warnings reported
14472 by Nelson H. F. Beebe in
14473 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
14474
14475 * lib/bbitset.h (BITSET_INLINE): Remove.
14476 * lib/bitset.h [! BITSET_INLINE]: Remove.
14477 (bitset_set, bitset_reset, bitset_test): Rename local vars
14478 to avoid shadowing warnings by GCC.
14479
14480 * data/glr.c (inline): Remove #define. It's the user's
14481 responsibility to #define it away, just like 'const'.
14482 This fixes one of the bugs reported by Nelson H. F. Beebe in
14483 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
14484
14485 * Makefile.maint (po-check): Scan .l and .y files instead of the
14486 .c and the .h files that they generate. This fixes the bug
14487 reported by Tim Van Holder in:
14488 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
14489 Look for N_ as well as for _. Try to avoid matching #define for
14490 N_ and _.
14491 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14492 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14493 * src/scan-gram.l: Revamp regular expressions so that " and '
14494 do not confuse xgettext.
14495
14496 * src/struniq.h (struniq_new): Do not declare the return type
14497 to be 'const'; this violates the C standard.
14498 * src/struniq.c (struniq_new): Likewise.
14499
145002002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14501
14502 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14503 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14504 linker.
14505
145062002-11-12 Akim Demaille <akim@epita.fr>
14507
14508 * Makefile.maint: Sync with Autoconf:
14509 (local_updates): New.
14510
145112002-11-12 Akim Demaille <akim@epita.fr>
14512
14513 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14514
145152002-11-12 Akim Demaille <akim@epita.fr>
14516
14517 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14518 locations.
14519
145202002-11-12 Akim Demaille <akim@epita.fr>
14521
14522 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14523 not yyvalue.
14524
145252002-11-12 Akim Demaille <akim@epita.fr>
14526
14527 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14528 Use it to test the GLR parser.
14529
145302002-11-12 Akim Demaille <akim@epita.fr>
14531
14532 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14533 defines it.
14534 * data/glr.c (yystos): New.
14535 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14536 (YYDSYMPRINT): New.
14537 (yyval): Don't define it, it is handled via M4.
14538 (yyrecoverParseError): Free verbosely the discarded symbols.
14539 * data/yacc.c (yysymprint): Remove, rather...
14540 (b4_yysymprint_generate): invoke.
14541 * data/c.m4 (b4_yysymprint_generate): New.
14542 Accept pointers as arguments, as opposed to the version from
14543 yacc.c.
14544 (b4_yydestruct_generate): Likewise.
14545 * tests/cations.at (Printers and Destructors): Use Bison directives
14546 instead of CPP macros.
14547 Don't rely on internal details.
14548
145492002-11-12 Akim Demaille <akim@epita.fr>
14550
14551 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14552 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14553 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14554 it against YYEMPTY and so forth), work on yytoken (i.e., set
14555 it to YYEMPTY etc.).
14556 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14557 (b4_symbol_actions): Remove.
14558 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14559 for 0, end-of-input.
14560
145612002-11-12 Akim Demaille <akim@epita.fr>
14562
14563 * doc/bison.texinfo (Destructor Decl): New.
14564
145652002-11-12 Akim Demaille <akim@epita.fr>
14566
14567 * src/tables.c (tables_generate): Use free for pointers that
14568 cannot be NULL, not XFREE.
14569 (pack_vector): Use assert, not fatal, for bound violations.
14570 * src/state.c (state_new): Likewise.
14571 * src/reader.c (reader): Likewise.
14572 * src/lalr.c (set_goto_map): Likewise.
14573 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
14574 the file name.
14575
145762002-11-12 Akim Demaille <akim@epita.fr>
14577
14578 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14579 Restore.
14580 * src/scan-gram.l (last_string): Is global to the file, not to
14581 yylex.
14582 * src/parse-gram.y (input): Don't append the epilogue here,
14583 (epilogue.opt): do it here, and free the scanner's obstack.
14584 * src/reader.c (epilogue_set): Rename as...
14585 (epilogue_augment): this.
14586 * data/c.m4 (b4_epilogue): Defaults to empty.
14587
145882002-11-12 Akim Demaille <akim@epita.fr>
14589
14590 * src/getargs.c (long_options): Remove duplicates.
14591 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14592 Remove.
14593 * doc/bison.rnh: Remove.
14594 * doc/bison.texinfo (VMS Invocation): Remove.
14595
145962002-11-12 Akim Demaille <akim@epita.fr>
14597
14598 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14599 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14600
14601 Use struniq for symbols.
14602
14603 * src/symtab.h (symbol_t): The tag member is a struniq.
14604 (symbol_type_set): Adjust.
14605 * src/symtab.c (symbol_new): Takes a struniq.
14606 (symbol_free): Don't free the tag member.
14607 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14608 (hash_compare_symbol, hash_symbol): these.
14609 Use the fact that tags as struniqs.
14610 (symbol_get): Use struniq_new.
14611 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14612 Returns a strniq.
14613 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14614 and type members are struniqs.
14615 * src/reader.c (get_merge_function)
14616 (grammar_current_rule_merge_set): Adjust.
14617 (TYPE, current_type): Are struniq.
14618
14619 Use struniq for file names.
14620
14621 * src/files.h, src/files.c (infile): Split into...
14622 (grammar_file, current_file): these.
14623 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14624 * src/reduce.c (reduce_print): Likewise.
14625 * src/getargs.c (getargs): Likewise.
14626 * src/complain.h, src/complain.c: Likewise.
14627 * src/main.c (main): Call struniqs_new early enough to use it for
14628 file names.
14629 Don't free the input file name.
14630
146312002-11-12 Akim Demaille <akim@epita.fr>
14632
14633 * src/symtab.c (symbol_free): Remove dead deactivated code:
14634 type_name are properly removed.
14635 Don't use XFREE to free items that cannot be NULL.
14636 * src/struniq.h, src/struniq.c: New.
14637 * src/main.c (main): Initialize/free struniqs.
14638 * src/parse-gram.y (%union): Add astruniq member.
14639 (yyprint): Adjust.
14640 * src/scan-gram.l (<{tag}>): Return a struniq.
14641 Free the obstack bit that used to store it.
14642 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14643
146442002-11-11 Paul Eggert <eggert@twinsun.com>
14645
14646 Revamp to fix many (but not all) of the C- and M4-related quoting
14647 problems. Among other things, this fixes the Bison bug reported
14648 by Jan Hubicka when processing the Bash grammar; see:
14649 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
14650
14651 Use new @ escapes consistently. Represent brackets with @{ and @}
14652 rather than @<:@ and @:>@, since this works a bit better with dumb
14653 editors like vi. Represent @ with @@, since @ is now consistently
14654 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14655 __ofile__, to avoid unexpected expansions. Similarly, use @output
14656 rather than #output.
14657
14658 * data/c.m4 (b4_copyright): Omit file name from comment, since
14659 the file name could contain "*/".
14660 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14661 be quoted. All uses changed.
14662
14663 * data/glr.c: Use new @ escapes consistently.
14664 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14665 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14666 Remove, since they couldn't handle arbitrary characters in file
14667 names.
14668 * data/lalr1.cc: Likewise.
14669 * data/yacc.c: Likewise.
14670
14671 * src/files.c (output_infix): Remove; all uses removed.
14672 * src/files.h: Likewise.
14673
14674 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14675 mishandled funny characters in file names, and anyway it isn't
14676 needed any more.
14677 * data/yacc.c: Likewise.
14678 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14679
14680 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14681 * data/yacc.c: Likewise.
14682
14683 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14684 strings now.
14685 (muscle_init): Quote filename as a C string.
14686 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14687 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14688 * src/output.c (escaped_file_name_output): New function.
14689 (prepare_symbols): Quote tokens for M4.
14690 (prepare): Don't insert output_infix, output_prefix,
14691 output_parser_name, output_header_name; this is now down by scan-skel.
14692 Insert skeleton as a C string.
14693
14694 * src/output.c (user_actions_output, symbol_destructors_output,
14695 symbol_printers_output): Quote filenames for C and M4.
14696 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14697
14698 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14699 escapes other than \\ and \'; this simplifies the code.
14700 (<SC_STRING>): Likewise, for \\ and \".
14701 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14702 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14703 Use new escapes @{ and @} for [ and ].
14704
14705 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14706 them with auto vars.
14707 Switch to new escape scheme, where @ is the escape character uniformly.
14708 Abort if a stray escape character is found. Avoid unbounded input
14709 buffer when parsing non-escaped text.
14710
14711 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14712 __oline__, #output, $@, and @{ do not have unintended meanings.
14713
147142002-11-09 Paul Eggert <eggert@twinsun.com>
14715
14716 Fix the test failure due to GCC warnings described in
14717 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
14718 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14719 evaluate to 0 if it's impossible for NINF to be in the respective
14720 table.
14721 (yygetLRActions, yyrecoverParseError): Use them.
14722
14723 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14724 counted in the token inserted at end of file. Now takes
14725 location_t *, not location_t, so that the location can be
14726 adjusted. All uses changed.
14727
14728 * tests/regression.at (Invalid inputs): Adjust wording in
14729 diagnostic to match the new behavior.
14730
14731 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14732 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14733 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14734 abort ();'. This reduces the runtime of the "Many lookaheads"
14735 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14736 GCC 3.2.
14737
147382002-11-07 Paul Eggert <eggert@twinsun.com>
14739
14740 * src/parse-gram.y (CHARACTER): Remove unused token.
14741 All uses removed.
14742
14743 * src/scan-gram.l: Remove stack option. We no longer use the
14744 stack, since the stack was never deeper than 1; instead, use the
14745 new auto var c_context to record the stacked value.
14746
14747 Remove nounput option. At an unexpected end of file, we now unput
14748 the minimal input necessary to end cleanly; this simplifies the
14749 code.
14750
14751 Avoid unbounded token sizes where this is easy.
14752
14753 (unexpected_end_of_file): New function.
14754 Use it to systematize the error message on unexpected EOF.
14755 (last-string): Now auto, not static.
14756 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14757 (scanner_last_string_free): Remove; not used.
14758 (percent_percent_count): Move decl to just before use.
14759 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14760 not the (never otherwised-used) CHARACTER.
14761
147622002-11-07 Akim Demaille <akim@epita.fr>
14763
14764 Let yyerror always receive the msg as last argument, so that
14765 yyerror can be variadic.
14766
14767 * data/yacc.c (b4_yyerror_args): New.
14768 Use it when calling yyerror.
14769 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14770 Use it when calling yyerror.
14771 * doc/bison.texinfo (Error Reporting): Adjust.
14772 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14773 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14774
147752002-11-06 Akim Demaille <akim@epita.fr>
14776
14777 #line should have quoted strings.
14778 Ideally, this should be done by m4_quotearg.
14779
14780 * src/scan-skel.l: Include quotearg.h.
14781 Quote __ofile__.
14782 * src/output.c (symbol_printers_output)
14783 (symbol_destructors_output): Quote the file name.
14784
147852002-11-06 Akim Demaille <akim@epita.fr>
14786
14787 * tests/regression.at (Invalid inputs): Adjust to the recent
14788 messages.
14789
147902002-11-06 Akim Demaille <akim@epita.fr>
14791
14792 Restore --no-lines.
14793 Reported by Jim Kent.
14794
14795 * data/c.m4 (b4_syncline): New.
14796 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14797 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14798 * src/output.c (user_actions_output): Likewise.
14799 (prepare): Define 'b4_synclines_flag'.
14800 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
14801
148022002-11-06 Akim Demaille <akim@epita.fr>
14803
14804 * src/main.c (main): Free `infile'.
14805 * src/scan-gram.l (handle_syncline): New.
14806 Recognize `#line'.
14807 * src/output.c (user_actions_output, symbol_destructors_output)
14808 (symbol_printers_output): Use the location's file name, not
14809 infile.
14810 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14811
148122002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14813
14814 * src/tables.c (matching_state): Don't allow states to match if
14815 either has GLR conflict entries.
14816
148172002-11-05 Paul Eggert <eggert@twinsun.com>
14818
14819 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14820 "integer out of range" rather than "invalid value".
14821 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14822 accordingly.
14823
14824 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14825 Also, remove one static variable in the scanner.
14826
14827 * src/scan-gram.l (braces_level): Now auto, not static.
14828 Initialize to zero if the compiler is being picky.
14829 (INITIAL): Clear braces_level instead of incrementing it.
14830 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14831 as POSIX 1003.1-2001 requires.
14832 * src/system.h (IF_LINT): New macro, taken from coreutils.
14833 * configure.ac: Define "lint" if --enable-gcc-warnings.
14834
148352002-11-05 Akim Demaille <akim@epita.fr>
14836
14837 * src/scan-gram.l: When it starts with `%', complain about the
14838 whole directive, not just that `invalid character: %'.
14839
148402002-11-04 Akim Demaille <akim@epita.fr>
14841
14842 * Makefile.maint: Update from Autoconf.
14843 (update, cvs-update, po-update, do-po-update): New.
14844
148452002-11-04 Akim Demaille <akim@epita.fr>
14846
14847 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14848 and yyerror.
14849 Have yyerror `use' its arguments.
14850 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14851 returns true when location & yacc & pure & parse-param.
14852 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14853
148542002-11-04 Akim Demaille <akim@epita.fr>
14855
14856 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14857 clashes.
14858 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14859 font-lock-mode.
14860 Use complain_at.
14861 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14862 slot 0.
14863
148642002-11-03 Paul Eggert <eggert@twinsun.com>
14865
14866 * src/reader.c (get_merge_function, grammar_current_rule_check):
14867 Use consistent diagnostics for reporting type name clashes.
14868 Quote the types with <>, for consistency with Yacc.
14869 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14870
148712002-11-03 Akim Demaille <akim@epita.fr>
14872
14873 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14874 New.
14875 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14876 (b4_parse_param): Remove.
14877 Use b4_identification.
14878 Propagate b4_pure_args where needed to pass them to yyerror.
14879 * data/glr.m4 (b4_parse_param): Remove.
14880 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14881 (b4_lpure_formals): New.
14882 Use b4_identification.
14883 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14884 b4_user_formals and b4_user_args.
14885 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14886 (yyreportAmbiguity): When using a pure parser, also need
14887 the location, and the parse-params.
14888 Adjust callers.
14889 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14890 When using a pure parser, also need the parse-params.
14891 Adjust callers.
14892 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14893 (%pure-parser + %parse-param) LALR and GLR parsers.
14894 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14895 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14896 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14897 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14898 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14899 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14900 * doc/bison.texinfo: Untabify the whole file.
14901 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14902 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14903 (Error Reporting): Adjust to these new directives.
14904 Document %error-verbose, deprecate YYERROR_VERBOSE.
14905
149062002-11-03 Akim Demaille <akim@epita.fr>
14907
14908 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14909 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14910 command line options.
14911 * tests/cxx-type.at: Formatting changes.
14912
149132002-11-03 Paul Eggert <eggert@twinsun.com>
14914
14915 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14916 to count columns correctly, and to check for invalid inputs.
14917
14918 Use mbsnwidth to count columns correctly. Account for tabs, too.
14919 Include mbswidth.h.
14920 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14921 (extend_location): New function.
14922 (YY_LINES): Remove.
14923
14924 Handle CRLF in C code rather than in Lex code.
14925 (YY_INPUT): New macro.
14926 (no_cr_read): New function.
14927
14928 Scan UCNs, even though we don't fully handle them yet.
14929 (convert_ucn_to_byte): New function.
14930
14931 Handle backslash-newline correctly in C code.
14932 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14933 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14934 all uses changed.
14935 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14936 Use {splice} wherever C allows backslash-newline.
14937 YY_STEP after space, newline, vertical-tab.
14938 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
14939
14940 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14941
14942 ({int}, handle_action_dollar, handle_action_at): Check for integer
14943 overflow.
14944
14945 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14946
14947 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14948 as well as \000. Check for UCHAR_MAX, not 255.
14949 Allow \x with an arbitrary positive number of digits, as in C.
14950 Check for overflow here.
14951 Allow \? and UCNs, for compatibility with C.
14952
14953 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14954 with quote slot used by complain_at.
14955
14956 * tests/input.at: Add tests for backslash-newline, m4 quotes
14957 in symbols, long literals, and funny escapes in strings.
14958
14959 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14960 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14961 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14962 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14963 * m4/mbswidth.m4: New file, from GNU coreutils.
14964
14965 * doc/bison.texinfo (Grammar Outline): Document // comments.
14966 (Symbols): Document that trigraphs have no special meaning in Bison,
14967 nor is backslash-newline allowed.
14968 (Actions): Document that trigraphs have no special meaning.
14969
14970 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14971 no longer used.
14972
149732002-11-02 Paul Eggert <eggert@twinsun.com>
14974
14975 * src/reader.c: Don't include quote.h; not needed.
14976 (get_merge_function): Reword warning to be consistent with
14977 type clash diagnostic in grammar_current_rule_check.
14978
14979 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14980 bug in trigraph handling.
14981
14982 * src/output.c (prepare_symbols): When printing token names,
14983 escape "[" as "@<:@" and likewise for "]".
14984
14985 * src/system.h (errno): Remove declaration, as we are now
14986 assuming C89 or better, and C89 guarantees errno.
14987
149882002-10-30 Paul Eggert <eggert@twinsun.com>
14989
14990 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14991 Check for close failures.
14992 * src/files.h (xfclose): Return void, not int, since it always
14993 returned zero.
14994 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14995 indicates one.
14996 * src/output.c (output_skeleton): Use xfclose rather than fclose
14997 and ferror. xfclose now checks ferror.
14998
14999 * data/glr.c (YYLEFTMOST_STATE): Remove.
15000 (yyreportTree): Use a stack-based leftmost state. This avoids
15001 our continuing battles with bogus warnings about initializers.
15002
150032002-10-30 Akim Demaille <akim@epita.fr>
15004
15005 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
15006 #if.
15007
150082002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15009
15010 * tests/glr-regr1.at: New test for reported regressions.
15011 * tests/testsuite.at: Add glr-regr1.at test.
15012 * tests/Makefile.am: Add glr-regr1.at test.
15013
150142002-10-24 Paul Eggert <eggert@twinsun.com>
15015
15016 Version 1.75a.
15017
15018 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
15019 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
15020 we use malloc. Don't assume 'A' through 'Z' are contiguous.
15021 Don't assume strdup exists; POSIX says its an XSI extension.
15022 Check for buffer overflow on input.
15023
150242002-10-24 Akim Demaille <akim@epita.fr>
15025
15026 * src/output.c (output_skeleton): Don't disable M4sugar comments
15027 too soon: it results in comments being expanded.
15028 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
15029 first output.
15030
150312002-10-24 Akim Demaille <akim@epita.fr>
15032
15033 * data/yacc.c (m4_int_type): New.
15034 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
15035 char' as only yacc.c wants K&R portability.
15036 * data/glr.c (yysigned_char): Remove.
15037 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15038 Reported by Quoc Peyrot.
15039
150402002-10-23 Paul Eggert <eggert@twinsun.com>
15041
15042 * src/main.c (main): With --trace=time, report times even if a
15043 non-fatal error occurs. Formerly, the times were reported in some
15044 such cases but not in others.
15045 * src/reader.c (reader): Just return if a complaint has been issued,
15046 instead of exiting, so that 'main' can report times.
15047
150482002-10-22 Akim Demaille <akim@epita.fr>
15049
15050 * src/system.h: Include sys/types.
15051 Reported by Bert Deknuydt.
15052
150532002-10-23 Paul Eggert <eggert@twinsun.com>
15054
15055 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15056 Suggested by Art Haas.
15057
150582002-10-22 Paul Eggert <eggert@twinsun.com>
15059
15060 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15061 decl; not needed any more.
15062 * src/main.c (main): Use return to exit, undoing yesterday's change.
15063 The last OS that we could find where this wouldn't work is
15064 SunOS 3.5, and that's too old to worry about now.
15065
15066 * data/glr.c (struct yyltype): Define members even when not
15067 doing locations. This is more consistent with yacc.c, and it
15068 works around the following bug reports:
15069 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15070 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
15071
15072 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15073 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15074 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15075
150762002-10-22 Akim Demaille <akim@epita.fr>
15077
15078 * data/README: New.
15079
150802002-10-21 Paul Eggert <eggert@twinsun.com>
15081
15082 Be consistent about 'bool'; the old code used an enum in one
15083 module and an int in another, and this violates the C standard.
15084 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15085 * configure.ac (AC_HEADER_STDBOOL): Add.
15086 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15087 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15088 * src/symtab.c (hash_compare_symbol_t): Likewise.
15089 * src/system.h (bool, false, true): Use a definition consistent
15090 with ../lib/hash.c. All uses changed.
15091
15092 * src/complain.c (warning_issued): Renamed from warn_message_count,
15093 so that we needn't worry about integer overflow (!).
15094 Now of type bool. All uses changed.
15095 (complaint_issued): Renamed from complain_message_count; likewise.
15096
15097 * src/main.c (main): Use exit to exit with failure.
15098
15099 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15100 rather than 1 and 0.
15101 * src/main.c (main): Likewise.
15102 * src/getargs.c (getargs): Likewise.
15103 * src/reader.c (reader): Likewise.
15104
15105 * src/getarg.c (getargs): Remove duplicate code for
15106 "Try `bison --help'".
15107
15108 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15109 What was that "2" for?
15110
15111 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15112 * src/getargs.c (usage): Likewise.
15113
15114 * src/getargs.c (getargs): When there are too few operands, report
15115 the last one. When there are too many, report the first extra
15116 one. This is how diffutils does it.
15117
151182002-10-20 Paul Eggert <eggert@twinsun.com>
15119
15120 Remove K&R vestiges.
15121 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
15122 * src/complain.c (VA_START): Remove. Assume prototypes.
15123 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
15124 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
15125 fatal): Assume prototypes.
15126 * src/complain.h: Assume prototypes.
15127 * src/system.h (PARAMS): Remove.
15128 Include <limits.h> unconditionally, since it's guaranteeed even
15129 for a freestanding C89 compiler.
15130 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
15131 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
15132
151332002-10-20 Akim Demaille <akim@epita.fr>
15134
15135 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
15136 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
15137 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
15138 (yyresolveStates, yyresolveAction, yyresolveStack)
15139 (yyprocessOneStack): Use them.
15140 (yy_reduce_print): New.
15141 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
15142
151432002-10-20 Akim Demaille <akim@epita.fr>
15144
15145 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
15146 arguments and output `void'.
15147 (b4_c_function): Rename as...
15148 (b4_c_function_def): this.
15149 (b4_c_function_decl, b4_c_ansi_function_def)
15150 (b4_c_ansi_function_decl): New.
15151 Change the interpretation of the arguments: before `int, foo', now
15152 `int foo, foo'.
15153 * data/yacc.c (yyparse): Prototype and define thanks to these.
15154 Adjust b4_c_function_def uses.
15155 * data/glr.c (yyparse): Likewise, but ANSI only.
15156
151572002-10-20 Akim Demaille <akim@epita.fr>
15158
15159 * src/output.c (prepare): Move the definition of `tokens_number',
15160 `nterms_number', `undef_token_number', `user_token_number_max'
15161 to...
15162 (prepare_tokens): Here.
15163 (prepare_tokens): Rename as...
15164 (prepare_symbols): this.
15165 (prepare): Move the definition of `rules_number' to...
15166 (prepare_rules): here.
15167 (prepare): Move the definition of `last', `final_state_number',
15168 `states_number' to...
15169 (prepare_states): here.
15170 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
15171
151722002-10-20 Akim Demaille <akim@epita.fr>
15173
15174 * src/tables.h, src/tables.c, src/output.c: Comment changes.
15175
151762002-10-20 Akim Demaille <akim@epita.fr>
15177
15178 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
15179 * data/c.m4: here.
15180
151812002-10-20 Akim Demaille <akim@epita.fr>
15182
15183 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
15184 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
15185 `pair'.
15186 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
15187 `name' to...
15188 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
15189 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
15190 These.
15191
151922002-10-19 Paul Eggert <eggert@twinsun.com>
15193
15194 Do not create a temporary file, as that involves security and
15195 cleanup headaches. Instead, use a pair of pipes.
15196 Derived from a suggestion by Florian Krohm.
15197 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
15198 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
15199 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
15200 (BISON_PREREQ_SUBPIPE): Add.
15201 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
15202 Add subpipe.h, subpipe.c.
15203 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
15204 * po/POTFILES.in: Add lib/subpipe.c.
15205 * src/output.c: Include "subpipe.h".
15206 (m4_invoke): Remove decl.
15207 (scan_skel): New decl.
15208 (output_skeleton): Use pipe rather than temporary file for m4 input.
15209 Check that m4sugar.m4 is readable, to avoid deadlock.
15210 Check for pipe I/O error.
15211 * src/scan-skel.l (readpipe): Remove decl.
15212 (scan_skel): New function, to be used in place of m4_invoke.
15213 Read from stream rather than file.
15214
15215 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
15216 float, as this generates a warning on Solaris 8 + GCC 3.2 with
15217 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
15218 this generates a more-accurate value anyway.
15219
15220 * lib/timevar.c (timervar_accumulate): Rename locals to
15221 avoid confusion with similarly-named more-global.
15222 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
15223
15224 * src/output.c (prepare): Use xstrdup to convert char const *
15225 to char *, to avoid GCC warning.
15226
152272002-10-19 Akim Demaille <akim@epita.fr>
15228
15229 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
15230 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
15231 Use them to have `calc.y' ready for %pure-parser.
15232 * data/yacc.c (YYLEX): Pass a yylex return type to
15233 b4_c_function_call.
15234
152352002-10-19 Akim Demaille <akim@epita.fr>
15236
15237 Prototype support of %lex-param and %parse-param.
15238
15239 * src/parse-gram.y: Add the definition of the %lex-param and
15240 %parse-param tokens, plus their rules.
15241 Drop the `_' version of %glr-parser.
15242 Add the "," token.
15243 * src/scan-gram.l (INITIAL): Scan them.
15244 * src/muscle_tab.c: Comment changes.
15245 (muscle_insert, muscle_find): Rename `pair' as `probe'.
15246 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
15247 (muscle_entry_s): The `value' member is no longer const.
15248 Adjust all dependencies.
15249 * src/muscle_tab.c (muscle_init): Adjust: use
15250 MUSCLE_INSERT_STRING.
15251 Initialize the obstack earlier.
15252 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
15253 (muscle_pair_list_grow): New.
15254 * data/c.m4 (b4_c_function_call, b4_c_args): New.
15255 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
15256 * tests/calc.at: Use %locations, not --locations.
15257 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
15258
152592002-10-19 Akim Demaille <akim@epita.fr>
15260
15261 * src/getargs.c (usage): Take status as argument and exit
15262 accordingly.
15263 Report the traditional `Try ... --help' message when status != 0.
15264 (usage, version): Don't take a FILE * as arg, it is pointless.
15265 (getargs): When there is an incorrect number of arguments, make it
15266 an error, and report it GNUlically thanks to `usage ()'.
15267
152682002-10-18 Paul Eggert <eggert@twinsun.com>
15269
15270 * data/glr.c (yyreportParseError): Don't assume that sprintf
15271 yields the length of the printed string, as this is not true
15272 on SunOS 4.1.4. Reported by Peter Klein.
15273
15274 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15275 * tests/conflicts.at (%nonassoc and eof): Likewise.
15276 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15277
152782002-10-17 Akim Demaille <akim@epita.fr>
15279
15280 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15281 * src/getargs.c (trace_types, trace_args): Adjust.
15282 * src/reader.c (grammar_current_rule_prec_set)
15283 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15284 Standardize error messages.
15285 And s/@prec/%prec/!
15286 (reader): Use trace_flag to enable scanner/parser debugging,
15287 instead of an adhoc scheme.
15288 * src/scan-gram.l: Remove trailing debugging code.
15289
152902002-10-16 Paul Eggert <eggert@twinsun.com>
15291
15292 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15293 MUSCLE_TAB_H.
15294
15295 * NEWS: Officially drop support for building Bison with K&R C,
15296 since it didn't work anyway and it's not worth worrying about.
15297 * Makefile.maint (wget_files): Remove ansi2knr.c.
15298 (ansi2knr.c-url_prefix): Remove.
15299 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15300 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15301 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15302
153032002-10-15 Paul Eggert <eggert@twinsun.com>
15304
15305 Stop using the "enum_" trick for K&R-style function definitions;
15306 it confused me, and I was the author! Instead, assume that people
15307 who want to use K&R C compilers (when using these modules in GCC,
15308 perhaps?) will run ansi2knr.
15309
15310 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15311 All uses of "enum_" changed to "enum ".
15312 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15313 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15314
15315 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15316 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15317 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15318 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15319 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15320 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15321 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15322 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15323 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15324 Use function prototypes; this removes the need for declaring
15325 static functions simply to provide their prototypes.
15326 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15327 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15328 bitset_count_, bitset_create, bitset_dump, bitset_first,
15329 bitset_free, bitset_init, bitset_last, bitset_next,
15330 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15331 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15332 bitset_print, bitset_release_memory, bitset_toggle_,
15333 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15334 debug_bitset): Likewise.
15335 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15336 * lib/bitset_stats.c (bitset_log_histogram_print,
15337 bitset_percent_histogram_print, bitset_stats_and,
15338 bitset_stats_and_cmp, bitset_stats_and_or,
15339 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15340 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15341 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15342 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15343 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15344 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15345 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15346 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15347 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15348 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15349 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15350 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15351 bitset_stats_zero): Likewise.
15352 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15353 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15354 bitsetv_dump, debug_bitsetv): Likewise.
15355 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15356 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15357 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15358 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15359 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15360 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15361 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15362 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15363 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15364 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15365 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15366 Likewise.
15367 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15368 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15369 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15370 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15371 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15372 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15373 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15374 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15375 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15376 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15377 lbitset_xor_cmp, lbitset_zero): Likewise.
15378
153792002-10-14 Akim Demaille <akim@epita.fr>
15380
15381 Version 1.75.
15382
153832002-10-14 Akim Demaille <akim@epita.fr>
15384
15385 * tests/Makefile.am (maintainer-check-posix): New.
15386
153872002-10-14 Akim Demaille <akim@epita.fr>
15388
15389 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15390 member.
15391
153922002-10-14 Akim Demaille <akim@epita.fr>
15393
15394 * src/tables.c (table_ninf_remap): base -> tab.
15395 Reported by Matt Rosing.
15396
153972002-10-14 Paul Eggert <eggert@twinsun.com>
15398
15399 * tests/action.at, tests/calc.at, tests/conflicts.at,
15400 tests/cxx-type.at, tests/headers.at, tests/input.at,
15401 tests/regression.at, tests/synclines.at, tests/torture.at:
15402 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15403 so that the tests still work even if POSIXLY_CORRECT is set.
15404 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
15405
15406 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15407 for portability to K&R hosts. Fix typo: signed char is guaranteed
15408 only to 127, not to 128.
15409 * data/glr.c (yysigned_char): New type.
15410 * data/yacc.c (yysigned_char): Likewise.
15411 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15412
154132002-10-13 Paul Eggert <eggert@twinsun.com>
15414
15415 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15416 true due to limited range of data type" warning from GCC.
15417
15418 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15419 by wrapping enum yytokentype's definition inside #ifndef
15420 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15421
154222002-10-13 Akim Demaille <akim@epita.fr>
15423
15424 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15425 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15426
154272002-10-13 Akim Demaille <akim@epita.fr>
15428
15429 * Makefile.maint: Update from Autoconf 2.54.
15430 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15431
154322002-10-13 Akim Demaille <akim@epita.fr>
15433
15434 * src/print.c (print_state): Separate the list of solved conflicts
15435 from the other items.
15436 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15437
154382002-10-13 Akim Demaille <akim@epita.fr>
15439
15440 Let nondeterministic skeletons be usable with deterministic
15441 tables.
15442
15443 With the patch, GAWK compiled by GCC without -O2 passes its test
15444 suite using a GLR parser driven by LALR tables. It fails with -O2
15445 because `struct stat' gives two different answers on my machine:
15446 88 (definition of an auto var) and later 96 (memset on this var).
15447 Hence the stack is badly corrumpted. The headers inclusion is to
15448 blame: if I move the awk.h inclusion before GLR's system header
15449 inclusion, the two struct stat have the same size.
15450
15451 * src/tables.c (pack_table): Always create conflict_table.
15452 (token_actions): Always create conflict_list.
15453 * data/glr.c (YYFLAG): Remove, unused.
15454
154552002-10-13 Akim Demaille <akim@epita.fr>
15456
15457 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15458 (O0FLAGS): New.
15459 (VALGRIND, GXX): New.
15460 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15461 * tests/bison.in: Run $PREBISON a pre-command.
15462 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15463 (maintainer-check-g++): New.
15464 * Makefile.am (maintainer-check): New.
15465
154662002-10-13 Akim Demaille <akim@epita.fr>
15467
15468 * data/glr.c: Formatting changes.
15469 Tweak some trace messages to match yacc.c's.
15470
154712002-10-13 Akim Demaille <akim@epita.fr>
15472
15473 GLR parsers sometimes raise parse errors instead of performing the
15474 default reduction.
15475 Reported by Charles-Henry de Boysson.
15476
15477 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
15478 check the length of the traces when %glr.
15479 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15480 GLR's traces.
15481 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15482 Test GLR parsers.
15483 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15484 (yyltype): Remove the yy prefix from the member names.
15485 (yytable): Complete its comment.
15486 (yygetLRActions): Map error action number from YYTABLE from
15487 YYTABLE_NINF to 0.
15488 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15489 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15490 not satisfying as we could compare an YYACTION computed from
15491 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15492 only value for error actions.
15493 (yyreportParseError): In verbose parse error messages, don't issue
15494 `error' in the list of expected tokens.
15495 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15496 next action to perform to match glr.c's decoding.
15497 (yytable): Complete its comment.
15498
154992002-10-13 Paul Eggert <eggert@twinsun.com>
15500
15501 Fix problem reported by Henrik Grubbstroem in
15502 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
15503 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15504 because the Bison parser reads the second action before reducing
15505 the first one.
15506 * src/scan-gram.l (rule_length): New static var.
15507 Use it to keep track of the rule length in the scanner, since
15508 we can't expect the parser to be in lock-step sync with the scanner.
15509 (handle_action_dollar, handle_action_at): Use this var.
15510 * tests/actions.at (Exotic Dollars): Test for the problem.
15511
155122002-10-12 Paul Eggert <eggert@twinsun.com>
15513
15514 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15515 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15516 Include <sys/time.h> when checking for clock_t and struct tms.
15517 Use same include order as source.
15518 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
15519 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
15520
15521 * lib/timevar.c: Update copyright date and clarify comments.
15522 (get_time) [IN_GCC]: Keep the GCC version for reference.
15523
15524 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15525 GCC version as of today, then merge Bison's changes.
15526 Change "GCC" to "Bison" in copyright notice. timevar.def's
15527 author is Akim, so change that too.
15528
15529 * src/reader.c (grammar_current_rule_check):
15530 Don't worry about the default action if $$ is untyped.
15531 Prevents bogus warnings reported by Jim Gifford in
15532 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
15533
15534 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15535 * data/glr.c, data/lalr1.cc, data/yacc.c:
15536 Output token definitions before the first part of user declarations.
15537 Fixes compatibility problem reported by Jim Gifford for kbd in
15538 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
15539
155402002-10-11 Paul Eggert <eggert@twinsun.com>
15541
15542 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15543 (yyparse): here. This undoes some of the 2002-07-25 change.
15544 Compatibility problem reported by Ralf S. Engelschall with
15545 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15546
155472002-10-11 Akim Demaille <akim@epita.fr>
15548
15549 * tests/regression.at Characters Escapes): New.
15550 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15551 characters.
15552 Reported by Jan Nieuwenhuizen.
15553
155542002-10-11 Akim Demaille <akim@epita.fr>
15555
15556 * po/id.po: New.
15557
155582002-10-10 Paul Eggert <eggert@twinsun.com>
15559
15560 Portability fixes for bitsets; this also avoids several GCC
15561 warnings.
15562
15563 * lib/abitset.c: Include <stddef.h>, for offsetof.
15564 * lib/lbitset.c: Likewise.
15565
15566 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15567 properly for vectors of objects. Do not assume that adding a
15568 header size to a multiple of a word size yields a value that is
15569 properly aligned for the whole union.
15570 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15571
15572 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15573 unique names for structures.
15574 * lib/ebitset.c (ebitset_bytes): Likewise.
15575 * lib/lbitset.c (lbitset_bytes): Likewise.
15576
15577 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15578 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15579 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15580 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15581 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15582 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15583 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15584 to improve the type-checking that GCC can do.
15585 * lib/bitset.c (bitset_op4_cmp): Likewise.
15586 * lib/bitset_stats.c (bitset_stats_count,
15587 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15588 bitset_stats_copy, bitset_stats_disjoint_p,
15589 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15590 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15591 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15592 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15593 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15594 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15595 bitset_stats_or_and_cmp): Likewise.
15596 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15597 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15598 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15599 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15600
15601 * lib/abitset.h: Include bitset.h, not bbitset.h.
15602 * lib/ebitset.h: Likewise.
15603 * lib/lbitset.h: Likewise.
15604
15605 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15606 All instances of parameters of type enum bitset_opts are now of
15607 type enum_bitset_opts, to conform to the C Standard, and similarly
15608 for enum_bitset_type.
15609 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15610 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15611
15612 Do not use "struct bitset_struct" to mean different things in
15613 different modules. Not only is this confusing, it violates
15614 the C Standard, which requires that structure types in different
15615 modules must be compatible if one is to be passed to the other.
15616 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15617 All instances of "struct bitset_struct *" replaced with "bitset".
15618 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15619 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15620 struct lbitset_struct, struct bitset_stats_struct): New types.
15621 All uses of struct bitset_struct changed to union bitset_union,
15622 etc.
15623 * lib/abitset.c (struct abitset_struct, abitset,
15624 struct bitset_struct): Remove.
15625 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15626 struct bitset_struct): Remove.
15627 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15628 bitset_struct): Remove.
15629 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15630 Likewise.
15631
15632 Do not call a function of type T using a call that assumes the
15633 function is of a different type U. Standard C requires that a
15634 function must be called with a type that is compatible with its
15635 definition.
15636 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15637 New decls.
15638 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15639 New functions.
15640 * lib/ebitset.c (PFV): Remove.
15641 * lib/lbitset.c (PFV): Likewise.
15642 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15643 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15644 decls.
15645 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15646 (ebitset_vtable): Use them.
15647 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15648 lbitset_xor): New functions.
15649 (lbitset_vtable): Use them.
15650
15651 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15652 Declare.
15653
15654 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15655 GCC warning.
15656 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15657 Use offsetof, for simplicity.
15658
156592002-10-06 Paul Eggert <eggert@twinsun.com>
15660
15661 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15662 the same width as int. This reapplies a hunk of the 2002-08-12 patch
15663 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
15664 which was inadvertently undone by the 2002-09-30 patch.
15665 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15666 the same width as int.
15667
156682002-10-04 Paul Eggert <eggert@twinsun.com>
15669
15670 Version 1.50.
15671
15672 * configure.ac (AC_INIT), NEWS: Increment version number.
15673
15674 * doc/bison.texinfo: Minor spelling, grammar, and white space
15675 fixes.
15676 (Symbols): Mention that any negative value returned from yylex
15677 signifies end-of-input. Warn about negative chars. Mention
15678 the portable Standard C character set.
15679
15680 The GNU coding standard says CFLAGS and YFLAGS are reserved
15681 for the installer to set.
15682 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15683 * src/Makefile.am (AM_CFLAGS): Likewise.
15684 (AM_YFLAGS): Renamed from YFLAGS.
15685
15686 Fix some MAX and MIN problems.
15687 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15688 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15689 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15690 * src/reader.c (reader): Use it.
15691
15692 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15693 POSIX 1003.1-2001 has removed fgrep.
15694
156952002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15696
15697 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15698 interpreted as signed.
15699 * lib/ebitset.c (ebitset_list): Fix bug.
15700
157012002-10-01 Paul Eggert <eggert@twinsun.com>
15702
15703 More fixes for 64-bit hosts and large bitsets.
15704
15705 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15706 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15707 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15708 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15709 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15710 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15711 bitset_count_): Likewise.
15712 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15713 bitset_first, bitset_last): Likewise.
15714 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15715 bitset_stats_list_reverse, bitset_stats_size,
15716 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15717 Likewise.
15718 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15719 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15720 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15721 bitsetv_reflexive_transitive_closure): Likewise.
15722 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15723 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15724 Likewise.
15725 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15726 Likewise.
15727
15728 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15729 Use size_t, not unsigned int, to count bytes.
15730 * lib/abitset.h (abitset_bytes): Likewise.
15731 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15732 Likewise.
15733 * lib/bitset.h (bitset_bytes): Likewise.
15734 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15735 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15736 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15737 * lib/ebitset.c (ebitset_bytes): Likewise.
15738 * lib/ebitset.h (ebitset_bytes): Likewise.
15739 * lib/lbitset.c (lbitset_bytes): Likewise.
15740 * lib/lbitset.h (lbitset_bytes): Likewise.
15741
15742 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15743 abitset_subset_p, abitset_disjoint_p, abitset_and,
15744 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15745 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15746 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15747 abitset_or_and, abitset_or_and_cmp):
15748 Use bitset_windex instead of unsigned int.
15749 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15750 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15751 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15752 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15753 Likewise.
15754 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
15755
15756 * lib/bitset.c (bitset_print):
15757 Use proper printf formats for widths of integer types.
15758 * lib/bitset_stats.c (bitset_percent_histogram_print,
15759 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15760 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15761 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15762 * lib/lbitset.c (lbitset_bytes): Likewise.
15763
15764 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15765 BITSET_SIZE_MAX): New macros.
15766 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15767 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15768 to BITSET_WINDEX_MAX.
15769
15770 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15771 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15772 since we now return the bitset_bindex type (not int).
15773
15774 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15775 when computing sizes.
15776 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15777
15778 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15779 and avoid cast to unsigned.
15780
157812002-09-30 Akim Demaille <akim@epita.fr>
15782
15783 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15784 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15785 Updates from Michael Hayes.
15786
157872002-09-30 Art Haas <ahaas@neosoft.com>
15788
15789 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15790 invocations.
15791 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15792 defined.
15793
157942002-09-27 Akim Demaille <akim@epita.fr>
15795
15796 Version 1.49c.
15797
157982002-09-27 Akim Demaille <akim@epita.fr>
15799
15800 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15801 (Because of AC_LIBSOURCE).
15802
158032002-09-27 Akim Demaille <akim@epita.fr>
15804
15805 Playing with Autoscan.
15806
15807 * configure.ac: Remove the old LIBOBJ tweaks.
15808 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15809 * lib/strrchr.c: New.
15810 * lib/strtol.c: New, from the Coreutils 4.5.1.
15811
158122002-09-27 Akim Demaille <akim@epita.fr>
15813
15814 Playing with Autoscan.
15815
15816 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15817 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15818 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15819 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15820 Coreutils 4.5.1.
15821
158222002-09-24 Akim Demaille <akim@epita.fr>
15823
15824 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15825 (Frequently Asked Questions, Parser Stack Overflow): New.
15826
158272002-09-13 Akim Demaille <akim@epita.fr>
15828
15829 Playing with autoscan.
15830
15831 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15832 * src/files.c (skeleton_find): Remove, unused.
15833 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15834 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15835
158362002-09-13 Akim Demaille <akim@epita.fr>
15837
15838 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15839 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15840
158412002-09-13 Akim Demaille <akim@epita.fr>
15842
15843 * configure.ac: Require 2.54.
15844 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15845 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15846 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15847 Remove, provided by Autoconf macros.
15848
158492002-09-12 Akim Demaille <akim@epita.fr>
15850
15851 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15852
158532002-09-12 Akim Demaille <akim@epita.fr>
15854
15855 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15856 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15857 Reported by Martin Mokrejs.
15858
158592002-09-10 Akim Demaille <akim@epita.fr>
15860
15861 * src/parse-gram.y: Associate a human readable string to each
15862 token type.
15863 * tests/regression.at (Invalid inputs): Adjust.
15864
158652002-09-10 Gary V. Vaughan <gary@gnu.org>
15866
15867 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15868 with an Autoconf-2.5x style configure.ac.
15869
158702002-09-06 Paul Eggert <eggert@twinsun.com>
15871
15872 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15873 exception applies only to yacc.c. This is a modification of a
15874 patch originally suggested by Akim Demaille.
15875
158762002-09-06 Akim Demaille <akim@epita.fr>
15877
15878 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15879 here to...
15880 * data/yacc.c: here.
15881
15882 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15883 LocationType.
15884 (b4_ltype): Default to yy::Location from location.hh.
15885
158862002-09-04 Jim Meyering <jim@meyering.net>
15887
15888 * data/yacc.c: Guard the declaration of yytoknum also with
15889 `#ifdef YYPRINT', so it is declared only when used.
15890
158912002-09-04 Akim Demaille <akim@epita.fr>
15892
15893 * configure.in: Rename as...
15894 * configure.ac: this.
15895 Bump to 1.49c.
15896
158972002-09-04 Akim Demaille <akim@epita.fr>
15898
15899 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15900 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15901 translate maintainer only messages.
15902
159032002-08-12 Paul Eggert <eggert@twinsun.com>
15904
15905 Version 1.49b.
15906
15907 * Makefile.am (SUBDIRS): Remove intl.
15908 (DISTCLEANFILES): Remove.
15909 * NEWS: Mention that GNU M4 is now required. Clarify what is
15910 meant by "larger grammars". Mention the pt_BR translation.
15911 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15912 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15913 Bump version from 0.11.2 to 0.11.5.
15914 (BISON_PREREQ_STAGE): Remove.
15915 (AM_GNU_GETTEXT): Use external gettext.
15916 (AC_OUTPUT): Remove intl/Makefile.
15917
15918 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15919
15920 * data/glr.c: Include string.h, for strlen.
15921 (yyreportParseError): Use size_t for yysize.
15922 (yy_yypstack): No longer nested inside yypstates, as nested
15923 functions are not portable. Do not assume size_t is the
15924 same width as int.
15925 (yypstates): Do not assume that ptrdiff_t is the same width
15926 as int, and similarly for yyposn and YYINDEX.
15927
15928 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15929
15930 * lib/Makefile.am (INCLUDES): Do not include from the intl
15931 directory, which has been removed.
15932 * src/Makefile.am (INCLUDES): Likewise.
15933
15934 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15935 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15936 New vars.
15937
15938 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15939 * tests/Makefile.am (EXTRA_DIST): Likewise.
15940
15941 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15942 Do not assume that bitset_windex is the same width as unsigned.
15943
15944 * lib/abitset.c (abitset_unused_clear): Do not assume that
15945 bitset_word is the same width as int.
15946 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15947 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15948 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15949 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15950 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15951
15952 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15953 portability to one's complement hosts!).
15954 * lib/ebitset.c (ebitset_op1): Likewise.
15955 * lib/lbitset.c (lbitset_op1): Likewise.
15956
15957 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15958 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15959 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15960 Sync with fileutils.
15961 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15962 lib/gettext.h: Sync with diffutils.
15963
15964 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15965 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15966
15967 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15968 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15969 check for void *.
15970
15971 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15972 size_t; the old version tried to do this but casted improperly.
15973 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15974 (bitset_test): Now returns int, not unsigned long.
15975
15976 * lib/bitset_stats.c: Include "gettext.h".
15977 (_): New macro.
15978 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15979 name locals "index", as it generates unnecessary warnings on some
15980 hosts that have an "index" function.
15981
15982 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15983 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15984 they need translation.
15985 * src/LR0.c (state_list_append, new_itemsets, get_state,
15986 append_states, generate_states): Likewise.
15987 * src/assoc.c (assoc_to_string): Likewise.
15988 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15989 * src/gram.c (grammar_dump): Likewise.
15990 * src/injections.c (injections_compute): Likewise.
15991 * src/lalr.c (lookaheads_print): Likewise.
15992 * src/relation.c (relation_transpose): Likewise.
15993 * src/scan-gram.l: Likewise.
15994 * src/tables.c (table_grow, pack_vector): Likewise.
15995
15996 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15997 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15998 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15999 * m4/mbstate_t.m4: Sync with fileutils.
16000 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
16001
16002 * po/LINGUAS: Add pt_BR.
16003 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
16004 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
16005 lib/timevar.c.
16006 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
16007 manual recommends.
16008 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
16009
16010 * src/complain.c (strerror_r): Remove decl; not needed.
16011 (strerror): Use same pattern as ../lib/error.c.
16012
16013 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
16014
16015 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
16016
16017 * src/main.c (main): Cast result of bindtextdomain and textdomain
16018 to void, to avoid a GCC warning when --disable-nls is in effect.
16019
16020 * src/scan-gram.l: Use strings rather than escapes when possible,
16021 to minimize the number of warnings from xgettext.
16022 (handle_action_dollar, handle_action_at): Don't use isdigit,
16023 as it mishandles negative chars and it may not work as expected
16024 outside the C locale.
16025
16026 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
16027 this is a GCC extension and is not portable to other compilers.
16028
16029 * src/system.h (alloca): Use same pattern as ../lib/error.c.
16030 Do not include <ctype.h>; no longer needed.
16031 Do not include <malloc.h>; no longer needed (and generates
16032 warnings on OpenBSD 3.0).
16033
16034 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
16035 it's not portable.
16036
16037 * tests/regression.at: Do not use 'cc -c input.c -o input';
16038 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16039
16040 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16041 exit status as failure, not just exit status 1. Sun C exits
16042 with status 2 sometimes.
16043
16044 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16045 Use it for the two large tests.
16046
160472002-08-02 Akim Demaille <akim@epita.fr>
16048
16049 * src/conflicts.c (conflicts_output): Don't output rules never
16050 reduced here, since anyway that computation doesn't work.
16051 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16052 (rule_useless_p, rule_never_reduced_p): New.
16053 (grammar_rules_partial_print): Use a filter instead of a range.
16054 Display the title only if needed.
16055 (grammar_rules_print): Adjust.
16056 (grammar_rules_never_reduced_report): New.
16057 * src/tables.c (action_row): Move the computation of rules never
16058 reduced to...
16059 (token_actions): here.
16060 * src/main.c (main): Make the parser before making the report, so
16061 that rules never reduced are computed.
16062 Call grammar_rules_never_reduced_report.
16063 * src/print.c (print_results): Report rules never reduced.
16064 * tests/conflicts.at, tests/reduce.at: Adjust.
16065
160662002-08-01 Akim Demaille <akim@epita.fr>
16067
16068 Instead of attaching lookaheads and duplicating the rules being
16069 reduced by a state, attach the lookaheads to the reductions.
16070
16071 * src/state.h (state_t): Remove the `lookaheads',
16072 `lookaheads_rule' member.
16073 (reductions_t): Add a `lookaheads' member.
16074 Use a regular array for the `rules'.
16075 * src/state.c (reductions_new): Initialize the lookaheads member
16076 to 0.
16077 (state_rule_lookaheads_print): Adjust.
16078 * src/state.h, src/state.c (state_reductions_find): New.
16079 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16080 (count_rr_conflicts): Adjust.
16081 * src/lalr.c (LArule): Remove.
16082 (add_lookback_edge): Adjust.
16083 (state_lookaheads_count): New.
16084 (states_lookaheads_initialize): Merge into...
16085 (initialize_LA): this.
16086 (lalr_free): Adjust.
16087 * src/main.c (main): Don't free nullable and derives too early: it
16088 is used by --verbose.
16089 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16090
160912002-08-01 Akim Demaille <akim@epita.fr>
16092
16093 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16094 `rule_number_t**'.
16095 (set_derives, free_derives): Rename as...
16096 (derives_compute, derives_free): this.
16097 Adjust all dependencies.
16098 * src/nullable.c (set_nullable, free_nullable): Rename as...
16099 (nullable_compute, nullable_free): these.
16100 (rule_list_t): Store rule_t *, not rule_number_t.
16101 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16102 pointers, instead of their numbers.
16103 * src/main.c (main): Call nullable_free, and derives_free earlier,
16104 as they were lo longer used.
16105
161062002-08-01 Akim Demaille <akim@epita.fr>
16107
16108 * lib/timevar.c (get_time): Include children time.
16109 * src/lalr.h (LA, LArule): Don't export them: used with the
16110 state_t.
16111 * src/lalr.c (LA, LArule): Static.
16112 * src/lalr.h, src/lalr.c (lalr_free): New.
16113 * src/main.c (main): Call it.
16114 * src/tables.c (pack_vector): Check whether loc is >= to the
16115 table_size, not >.
16116 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16117 (tables_generate): do it, since that's also it which allocates
16118 them.
16119 Don't free LA and LArule, main does.
16120
161212002-07-31 Akim Demaille <akim@epita.fr>
16122
16123 Separate parser tables computation and output.
16124
16125 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
16126 (conflict_list, conflict_list_cnt, table, check, table_ninf)
16127 (yydefgoto, yydefact, high): Move to...
16128 * src/tables.h, src/tables.c: here.
16129 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16130 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16131 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
16132 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
16133 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
16134 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
16135 (action_row, save_row, token_actions, save_column, default_goto)
16136 (goto_actions, sort_actions, matching_state, pack_vector)
16137 (table_ninf_remap, pack_table, prepare_actions): Move to...
16138 * src/tables.c: here.
16139 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
16140 * src/output.c (token_actions, output_base, output_conflicts)
16141 (output_check): Merge into...
16142 (prepare_actions): this.
16143 (actions_output): Rename as...
16144 (user_actions_output): this.
16145 * src/main.c (main): Call tables_generate and tables_free.
16146
161472002-07-31 Akim Demaille <akim@epita.fr>
16148
16149 Steal GCC's --time-report support.
16150
16151 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
16152 stolen/adjusted from GCC.
16153 * m4/stage.m4: Remove time related checks.
16154 * m4/timevar.m4: New.
16155 * configure.in: Adjust.
16156 * src/system.h: Adjust to using timevar.h.
16157 * src/getargs.h, src/getargs.c: Support trace_time for
16158 --trace=time.
16159 * src/main.c (stage): Remove.
16160 (main): Replace `stage' invocations with timevar calls.
16161 * src/output.c: Insert pertinent timevar calls.
16162
161632002-07-31 Akim Demaille <akim@epita.fr>
16164
16165 Let --trace have arguments.
16166
16167 * src/getargs.h (enum trace_e): New.
16168 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
16169 (long_options, short_options): --trace/-T takes an optional
16170 argument.
16171 Change all the uses of trace_flag to reflect the new flags.
16172 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
16173
16174 Strengthen `stage' portability.
16175
16176 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
16177 * configure.in: Use it.
16178 Don't check for malloc.h and sys/times.h.
16179 * src/system.h: Include them when appropriate.
16180 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
16181 times and struct tms are available.
16182
161832002-07-30 Akim Demaille <akim@epita.fr>
16184
16185 In verbose parse error message, don't report `error' as an
16186 expected token.
16187 * tests/actions.at (Printers and Destructors): Adjust.
16188 * tests/calc.at (Calculator $1): Adjust.
16189 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
16190 error message, do not report the parser accepts the error token in
16191 that state.
16192
161932002-07-30 Akim Demaille <akim@epita.fr>
16194
16195 Normalize conflict related messages.
16196
16197 * src/complain.h, src/complain.c (warn, complain): New.
16198 * src/conflicts.c (conflicts_print): Use them.
16199 (conflict_report_yacc): New, extracted from...
16200 (conflicts_print): here.
16201 * tests/conflicts.at, tests/existing.at: Adjust.
16202
162032002-07-30 Akim Demaille <akim@epita.fr>
16204
16205 Report rules which are never reduced by the parser: those hidden
16206 by conflicts.
16207
16208 * src/LR0.c (save_reductions): Don't make the final state too
16209 different: save its reduction (accept) instead of having a state
16210 without any action (no shift or goto, no reduce).
16211 Note: the final state is now a ``regular'' state, i.e., the
16212 parsers now contain `reduce 0' as default reduction.
16213 Nevertheless, since they decide to `accept' when yystate =
16214 final_state, they still will not reduce rule 0.
16215 * src/print.c (print_actions, print_reduction): Adjust.
16216 * src/output.c (action_row): Track reduced rules.
16217 (token_actions): Report rules never reduced.
16218 * tests/conflicts.at, tests/regression.at: Adjust.
16219
162202002-07-30 Akim Demaille <akim@epita.fr>
16221
16222 `stage' was accidently included in a previous patch.
16223 Initiate its autoconfiscation.
16224
16225 * configure.in: Look for malloc.h and sys/times.h.
16226 * src/main.c (stage): Adjust.
16227 Report only when trace_flag.
16228
162292002-07-29 Akim Demaille <akim@epita.fr>
16230
16231 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
16232 state_number_t.
16233 (errs_t): symbol_t*, not symbol_number_t.
16234 (reductions_t): rule_t*, not rule_number_t.
16235 (FOR_EACH_SHIFT): New.
16236 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
16237 * src/print.c, src/print_graph.c: Adjust.
16238
162392002-07-29 Akim Demaille <akim@epita.fr>
16240
16241 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
16242
16243 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
16244 (endtoken, accept): these.
16245 * src/reader.c (reader): Set endtoken's default tag to "$end".
16246 Set undeftoken's tag to "$undefined" instead of "$undefined.".
16247 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
16248 Adjust.
16249
162502002-07-29 Akim Demaille <akim@epita.fr>
16251
16252 * src/reduce.c (reduce_grammar): When the language is empty,
16253 complain about the start symbol, not the axiom.
16254 Use its location.
16255 * tests/reduce.at (Empty Language): New.
16256
162572002-07-26 Akim Demaille <akim@epita.fr>
16258
16259 * src/reader.h, src/reader.c (gram_error): ... can't get
16260 yycontrol without making too strong assumptions on the parser
16261 itself.
16262 * src/output.c (prepare_tokens): Use the real 0th value of
16263 token_translations instead of `0'.
16264 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
16265 visible here.
16266 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
16267 for the time being: %locations ought to provide it to yyerror.
16268
162692002-07-25 Akim Demaille <akim@epita.fr>
16270
16271 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16272 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16273 * tests/regression.at (Web2c Actions): Adjust.
16274
162752002-07-25 Akim Demaille <akim@epita.fr>
16276
16277 Stop storing rules from 1 to nrules + 1.
16278
16279 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16280 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16281 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16282 Iterate from 0 to nrules.
16283 Use rule_number_as_item_number and item_number_as_rule_number.
16284 Adjust to `derive' now containing possibly 0.
16285 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16286 Handle the `- 1' part in rule numbers from/to item numbers.
16287 * src/conflicts.c (log_resolution): Fix the message which reversed
16288 shift and reduce.
16289 * src/output.c (action_row): Initialize default_rule to -1.
16290 (token_actions): Adjust.
16291 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16292 expected output.
16293 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16294
162952002-07-25 Akim Demaille <akim@epita.fr>
16296
16297 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16298 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16299 (b4_c_knr_arg_decl): New.
16300 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16301 yyreport_parse_error.
16302
163032002-07-25 Akim Demaille <akim@epita.fr>
16304
16305 * data/yacc.c (yyreport_parse_error): New, extracted from...
16306 (yyparse): here.
16307 (yydestruct, yysymprint): Move above yyparse.
16308 Be K&R compliant.
16309
163102002-07-25 Akim Demaille <akim@epita.fr>
16311
16312 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16313 replace...
16314 (b4_sint_type, b4_uint_type): these.
16315 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16316 * tests/regression.at (Web2c Actions): Adjust.
16317
163182002-07-25 Akim Demaille <akim@epita.fr>
16319
16320 * src/gram.h (TIEM_NUMBER_MAX): New.
16321 (item_number_of_rule_number, rule_number_of_item_number): Rename
16322 as...
16323 (rule_number_as_item_number, item_number_as_rule_number): these.
16324 Adjust dependencies.
16325 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16326 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16327 (symbol_number_to_vector_number): New.
16328 (order): Of vector_number_t* type.
16329 (base_t, BASE_MAX, BASE_MIN): New.
16330 (froms, tos, width, pos, check): Of base_t type.
16331 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16332 (actrow): Of action_number_t type.
16333 (conflrow): Of unsigned int type.
16334 (table_ninf, base_ninf): New.
16335 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16336 (muscle_insert_int_table, muscle_insert_base_table)
16337 (muscle_insert_rule_number_table): New.
16338 (prepare_tokens): Output `toknum' as int_table.
16339 (action_row): Returns a rule_number_t.
16340 Use ACTION_MIN, not SHRT_MIN.
16341 (token_actions): yydefact is rule_number_t*.
16342 (table_ninf_remap): New.
16343 (pack_table): Use it for `base' and `table'.
16344 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16345 replaced with...
16346 (YYPACT_NINF, YYTABLE_NINF): these.
16347 (yypact, yytable): Compute their types instead of hard-coded
16348 `short'.
16349 * tests/regression.at (Web2c Actions): Adjust.
16350
163512002-07-19 Akim Demaille <akim@epita.fr>
16352
16353 * src/scan-gram.l (id): Can start with an underscore.
16354
163552002-07-16 Akim Demaille <akim@epita.fr>
16356
16357 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16358 Adjust all former `associativity' dependencies.
16359 * src/symtab.c (symbol_new): Default associativity is `undef', not
16360 `right'.
16361 (symbol_check_alias_consistence): Adjust.
16362
163632002-07-09 Akim Demaille <akim@epita.fr>
16364
16365 * doc/bison.texinfo: Properly set the ``header'' part.
16366 Use @dircategory ``GNU programming tools'' as per Texinfo's
16367 documentation.
16368 Use @copying.
16369
163702002-07-09 Akim Demaille <akim@epita.fr>
16371
16372 * lib/quotearg.h: Protect against multiple inclusions.
16373 * src/location.h (location_t): Add a `file' member.
16374 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16375 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16376 `error_one_per_line' support.
16377
163782002-07-09 Akim Demaille <akim@epita.fr>
16379
16380 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16381 * src/reader.c (lineno): Remove.
16382 Adjust all dependencies.
16383 (get_merge_function): Take a location and use complain_at.
16384 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16385 * tests/regression.at (Invalid inputs, Mixing %token styles):
16386 Adjust.
16387
163882002-07-09 Akim Demaille <akim@epita.fr>
16389
16390 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16391 recovery rule, and forbid extensions when --yacc.
16392 (gram_error): Use complain_at.
16393 * src/reader.c (reader): Exit if there were parse errors.
16394
163952002-07-09 Akim Demaille <akim@epita.fr>
16396
16397 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16398 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16399 Reported by R Blake <blakers@mac.com>.
16400
164012002-07-09 Akim Demaille <akim@epita.fr>
16402
16403 * data/yacc.c: Output the copyright notive in the header.
16404
164052002-07-03 Akim Demaille <akim@epita.fr>
16406
16407 * src/output.c (froms, tos): Are state_number_t.
16408 (save_column): sp, sp1, and sp2 are state_number_t.
16409 (prepare): Rename `final' as `final_state_number', `nnts' as
16410 `nterms_number', `nrules' as `rules_number', `nstates' as
16411 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16412 unused.
16413 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16414 * data/lalr1.cc (nsym_): Remove, unused.
16415
164162002-07-03 Akim Demaille <akim@epita.fr>
16417
16418 * src/lalr.h, src/lalr.c (goto_number_t): New.
16419 * src/lalr.c (goto_list_t): New.
16420 Propagate them.
16421 * src/nullable.c (rule_list_t): New.
16422 Propagate.
16423 * src/types.h: Remove.
16424
164252002-07-03 Akim Demaille <akim@epita.fr>
16426
16427 * src/closure.c (print_fderives): Use rule_rhs_print.
16428 * src/derives.c (print_derives): Use rule_rhs_print.
16429 (rule_list_t): New, replaces `shorts'.
16430 (set_derives): Add comments.
16431 * tests/sets.at (Nullable, Firsts): Adjust.
16432
164332002-07-03 Akim Demaille <akim@epita.fr>
16434
16435 * src/output.c (prepare_actions): Free `tally' and `width'.
16436 (prepare_actions): Allocate and free `order'.
16437 * src/symtab.c (symbols_free): Free `symbols'.
16438 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16439 * src/output.c (m4_invoke): Move to...
16440 * src/scan-skel.l: here.
16441 (<<EOF>>): Close yyout, and free its name.
16442
164432002-07-03 Akim Demaille <akim@epita.fr>
16444
16445 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16446
16447 * src/LR0.c (new_state): Merge into...
16448 (state_list_append): this.
16449 (new_states): Merge into...
16450 (generate_states): here.
16451 (set_states): Don't ensure a proper `errs' state member here, do it...
16452 * src/conflicts.c (conflicts_solve): here.
16453 * src/state.h, src/state.c: Comment changes.
16454 (state_t): Rename member `shifts' as `transitions'.
16455 Adjust all dependencies.
16456 (errs_new): For consistency, also take the values as argument.
16457 (errs_dup): Remove.
16458 (state_errs_set): New.
16459 (state_reductions_set, state_transitions_set): Assert that no
16460 previous value was assigned.
16461 (state_free): New.
16462 (states_free): Use it.
16463 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16464 temporary storage: use `errs' and `nerrs' as elsewhere.
16465 (set_conflicts): Allocate and free this `errs'.
16466
164672002-07-02 Akim Demaille <akim@epita.fr>
16468
16469 * lib/libiberty.h: New.
16470 * lib: Update the bitset implementation from upstream.
16471 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16472 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16473 * src/main.c: Adjust bitset stats calls.
16474
164752002-07-01 Paul Eggert <eggert@twinsun.com>
16476
16477 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16478 char, so that negative chars don't collide with $.
16479
164802002-06-30 Akim Demaille <akim@epita.fr>
16481
16482 Have the GLR tests be `warning' checked, and fix the warnings.
16483
16484 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16485 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16486 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16487 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16488 (yyaddDeferredAction): static.
16489 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16490 (yyreportParseError): yyprefix is const.
16491 yytokenp is used only when verbose.
16492 (yy__GNUC__): Replace with __GNUC__.
16493 (yypdumpstack): yyi is size_t.
16494 (yypreference): Un-yy local variables and arguments, to avoid
16495 clashes with `yyr1'. Anyway, we are not in the user name space.
16496 (yytname_size): be an int, as is compared with ints.
16497 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16498 Use them.
16499 * tests/cxx-gram.at: Use quotation to protect $1.
16500 Use AT_COMPILE to enable warnings hunts.
16501 Prototype yylex and yyerror.
16502 `Use' argc.
16503 Include `string.h', not `strings.h'.
16504 Produce and prototype stmtMerge only when used.
16505 yylex takes a location.
16506
165072002-06-30 Akim Demaille <akim@epita.fr>
16508
16509 We spend a lot of time in quotearg, in particular when --verbose.
16510
16511 * src/symtab.c (symbol_get): Store a quoted version of the key.
16512 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16513 Adjust all callers.
16514
165152002-06-30 Akim Demaille <akim@epita.fr>
16516
16517 * src/state.h (reductions_t): Rename member `nreds' as num.
16518 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16519 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16520
165212002-06-30 Akim Demaille <akim@epita.fr>
16522
16523 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16524 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16525 (shifts_to): Rename as...
16526 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16527 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16528 (TRANSITION_IS_DISABLED, transitions_to): these.
16529
165302002-06-30 Akim Demaille <akim@epita.fr>
16531
16532 * src/print.c (print_shifts, print_gotos): Merge into...
16533 (print_transitions): this.
16534 (print_transitions, print_errs, print_reductions): Align the
16535 lookaheads columns.
16536 (print_core, print_transitions, print_errs, print_state,
16537 print_grammar): Output empty lines separator before, not after.
16538 (state_default_rule_compute): Rename as...
16539 (state_default_rule): this.
16540 * tests/conflicts.at (Defaulted Conflicted Reduction),
16541 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16542 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16543
165442002-06-30 Akim Demaille <akim@epita.fr>
16545
16546 Display items as we display rules.
16547
16548 * src/gram.h, src/gram.c (rule_lhs_print): New.
16549 * src/gram.c (grammar_rules_partial_print): Use it.
16550 * src/print.c (print_core): Likewise.
16551 * tests/conflicts.at (Defaulted Conflicted Reduction),
16552 (Unresolved SR Conflicts): Adjust.
16553 (Unresolved SR Conflicts): Adjust and rename as...
16554 (Resolved SR Conflicts): this, as was meant.
16555 * tests/regression.at (Web2c Report): Adjust.
16556
165572002-06-30 Akim Demaille <akim@epita.fr>
16558
16559 * src/print.c (state_default_rule_compute): New, extracted from...
16560 (print_reductions): here.
16561 Pessimize, but clarify the code.
16562 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16563
165642002-06-30 Akim Demaille <akim@epita.fr>
16565
16566 * src/output.c (action_row): Let default_rule be always a rule
16567 number.
16568
165692002-06-30 Akim Demaille <akim@epita.fr>
16570
16571 * src/closure.c (print_firsts, print_fderives, closure):
16572 Use BITSET_EXECUTE.
16573 * src/lalr.c (lookaheads_print): Likewise.
16574 * src/state.c (state_rule_lookaheads_print): Likewise.
16575 * src/print_graph.c (print_core): Likewise.
16576 * src/print.c (print_reductions): Likewise.
16577 * src/output.c (action_row): Likewise.
16578 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16579
165802002-06-30 Akim Demaille <akim@epita.fr>
16581
16582 * src/print_graph.c: Use report_flag.
16583
165842002-06-30 Akim Demaille <akim@epita.fr>
16585
16586 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16587 to...
16588 * src/relation.h, src/relation.c (traverse, relation_digraph)
16589 (relation_print, relation_transpose): New.
16590
165912002-06-30 Akim Demaille <akim@epita.fr>
16592
16593 * src/state.h, src/state.c (shifts_to): New.
16594 * src/lalr.c (build_relations): Use it.
16595
165962002-06-30 Akim Demaille <akim@epita.fr>
16597
16598 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16599 (item_number_of_rule_number, rule_number_of_item_number): New.
16600 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16601 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16602 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16603 Propagate their use.
16604 Much remains to be done, in particular wrt `shorts' from types.h.
16605
166062002-06-30 Akim Demaille <akim@epita.fr>
16607
16608 * src/symtab.c (symbol_new): Initialize the `printer' member.
16609
166102002-06-30 Akim Demaille <akim@epita.fr>
16611
16612 * src/LR0.c (save_reductions): Remove, replaced by...
16613 * src/state.h, src/state.c (state_reductions_set): New.
16614 (reductions, errs): Rename as...
16615 (reductions_t, errs_t): these.
16616 Adjust all dependencies.
16617
166182002-06-30 Akim Demaille <akim@epita.fr>
16619
16620 * src/LR0.c (state_list_t, state_list_append): New.
16621 (first_state, last_state): Now symbol_list_t.
16622 (this_state): Remove.
16623 (new_itemsets, append_states, save_reductions): Take a state_t as
16624 argument.
16625 (set_states, generate_states): Adjust.
16626 (save_shifts): Remove, replaced by...
16627 * src/state.h, src/state.c (state_shifts_set): New.
16628 (shifts): Rename as...
16629 (shifts_t): this.
16630 Adjust all dependencies.
16631 * src/state.h (state_t): Remove the `next' member.
16632
166332002-06-30 Akim Demaille <akim@epita.fr>
16634
16635 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16636 escaped in slot 0.
16637
166382002-06-30 Akim Demaille <akim@epita.fr>
16639
16640 Use hash.h for the state hash table.
16641
16642 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16643 (allocate_storage): Use state_hash_new.
16644 (free_storage): Use state_hash_free.
16645 (new_state, get_state): Adjust.
16646 * src/lalr.h, src/lalr.c (states): Move to...
16647 * src/states.h (state_t): Remove the `link' member, no longer
16648 used.
16649 * src/states.h, src/states.c: here.
16650 (state_hash_new, state_hash_free, state_hash_lookup)
16651 (state_hash_insert, states_free): New.
16652 * src/states.c (state_table, state_compare, state_hash): New.
16653 * src/output.c (output_actions): Do not free states now, since we
16654 still need to know the final_state number in `prepare', called
16655 afterwards. Do it...
16656 * src/main.c (main): here: call states_free after `output'.
16657
166582002-06-30 Akim Demaille <akim@epita.fr>
16659
16660 * src/state.h, src/state.c (state_new): New, extracted from...
16661 * src/LR0.c (new_state): here.
16662 * src/state.h (STATE_ALLOC): Move to...
16663 * src/state.c: here.
16664 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16665 * src/state.h, src/state.c: here.
16666
166672002-06-30 Akim Demaille <akim@epita.fr>
16668
16669 * src/reader.c (gensym): Rename as...
16670 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16671 (getsym): Rename as...
16672 (symbol_get): this.
16673
166742002-06-30 Akim Demaille <akim@epita.fr>
16675
16676 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16677 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16678 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16679 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16680
166812002-06-30 Akim Demaille <akim@epita.fr>
16682
16683 Make the test suite pass with warnings checked.
16684
16685 * tests/actions.at (Printers and Destructors): Improve.
16686 Avoid unsigned vs. signed issues.
16687 * tests/calc.at: Don't exercise the scanner here, do it...
16688 * tests/input.at (Torturing the Scanner): here.
16689
166902002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16691
16692 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
16693 reorganize first lines parallel to yacc.c.
16694
166952002-06-28 Akim Demaille <akim@epita.fr>
16696
16697 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16698 (b4_token_enum, b4_token_defines): New, factored from...
16699 * data/lalr1.cc, data/yacc.c, glr.c: here.
16700
167012002-06-28 Akim Demaille <akim@epita.fr>
16702
16703 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16704 unused variables.
16705 * src/output.c (merger_output): static.
16706
167072002-06-28 Akim Demaille <akim@epita.fr>
16708
16709 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
16710 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16711 pacify GCC.
16712 * src/output.c (save_row): Initialize all the variables to pacify GCC.
16713
167142002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16715
16716 Accumulated changelog for new GLR parsing features.
16717
16718 * src/conflicts.c (count_total_conflicts): Change name to
16719 conflicts_total_count.
16720 * src/conflicts.h: Ditto.
16721 * src/output.c (token_actions): Use the new name.
16722 (output_conflicts): Change conflp => conflict_list_heads, and
16723 confl => conflict_list for better readability.
16724 * data/glr.c: Use the new names.
16725 * NEWS: Add self to GLR announcement.
16726
16727 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16728
16729 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16730 Akim Demaille.
16731
16732 * data/bison.glr: Change name to glr.c
16733 * data/glr.c: Renamed from bison.glr.
16734 * data/Makefile.am: Add glr.c
16735
16736 * src/getargs.c:
16737
16738 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
16739 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
16740
16741 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16742
16743 * data/bison.glr: Be sure to restore the
16744 current #line when returning to the skeleton contents after having
16745 exposed the input file's #line.
16746
16747 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16748
16749 * data/bison.glr: Bring up to date with changes to bison.simple.
16750
16751 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16752
16753 * data/bison.glr: Correct definitions that use b4_prefix.
16754 Various reformatting.
16755 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16756 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16757 yytokenp argument; now part of stack.
16758 (yychar): Define to behave as documented.
16759 (yyclearin): Ditto.
16760
16761 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16762
16763 * src/reader.h: Add declaration for free_merger_functions.
16764
16765 * src/reader.c (merge_functions): New variable.
16766 (get_merge_function): New function.
16767 (free_merger_functions): New function.
16768 (readgram): Check for %prec that is not followed by a symbol.
16769 Handle %dprec and %merge declarations.
16770 (packgram): Initialize dprec and merger fields in rules array.
16771
16772 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16773 conflict_list_cnt, conflict_list_free): New variables.
16774 (table_grow): Also grow conflict_table.
16775 (prepare_rules): Output dprec and merger tables.
16776 (conflict_row): New function.
16777 (action_row): Output conflict lists for GLR parser. Don't use
16778 default reduction in conflicted states for GLR parser so that there
16779 are spaces for the conflict lists.
16780 (save_row): Also save conflict information.
16781 (token_actions): Allocate conflict list.
16782 (merger_output): New function.
16783 (pack_vector): Pack conflict table, too.
16784 (output_conflicts): New function to output yyconflp and yyconfl.
16785 (output_check): Allocate conflict_tos.
16786 (output_actions): Output conflict tables, also.
16787 (output_skeleton): Output b4_mergers definition.
16788 (prepare): Output b4_max_rhs_length definition.
16789 Use 'bison.glr' as default skeleton for GLR parsers.
16790
16791 * src/gram.c (glr_parser): New flag.
16792 (grammar_free): Call free_merger_functions.
16793
16794 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16795 all pairs of conflicting reductions, rather than just all tokens
16796 causing conflicts. Needed to size conflict tables.
16797 (conflicts_output): Modify call to count_rr_conflicts for new
16798 interface.
16799 (conflicts_print): Ditto.
16800 (count_total_conflicts): New function.
16801
16802 * src/reader.h (merger_list): New type.
16803 (merge_functions): New variable.
16804
16805 * src/lex.h (tok_dprec, tok_merge): New token types.
16806
16807 * src/gram.h (rule_s): Add dprec and merger fields.
16808 (glr_parser): New flag.
16809
16810 * src/conflicts.h (count_total_conflicts): New function.
16811
16812 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16813
16814 * doc/bison.texinfo (Generalized LR Parsing): New section.
16815 (GLR Parsers): New section.
16816 (Language and Grammar): Mention GLR parsing.
16817 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16818 Correct typo ("tge" -> "the").
16819
16820 * data/bison.glr: New skeleton for GLR parsing.
16821
16822 * tests/cxx-gram.at: New tests for GLR parsing.
16823
16824 * tests/testsuite.at: Include cxx-gram.at.
16825
16826 * tests/Makefile.am: Add cxx-gram.at.
16827
16828 * src/parse-gram.y:
16829
16830 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16831
16832 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
16833
168342002-06-27 Akim Demaille <akim@epita.fr>
16835
16836 * src/options.h, src/options.c: Remove.
16837 * src/getargs.c (short_options, long_options): New.
16838
168392002-06-27 Akim Demaille <akim@epita.fr>
16840
16841 * data/bison.simple, data/bison.c++: Rename as...
16842 * data/yacc.c, data/lalr1.cc: these.
16843 * doc/bison.texinfo (Environment Variables): Remove.
16844
168452002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16846
16847 * src/getargs.c (report_argmatch): Initialize strtok().
16848
168492002-06-20 Akim Demaille <akim@epita.fr>
16850
16851 * data/bison.simple (b4_symbol_actions): New, replaces...
16852 (b4_symbol_destructor, b4_symbol_printer): these.
16853 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16854 user token numbers.
16855
168562002-06-20 Akim Demaille <akim@epita.fr>
16857
16858 * data/bison.simple (yydestructor): Rename as...
16859 (yydestruct): this.
16860
168612002-06-20 Akim Demaille <akim@epita.fr>
16862
16863 * src/symtab.h, src/symtab.c (symbol_type_set)
16864 (symbol_destructor_set, symbol_precedence_set): The location is
16865 the last argument.
16866 Adjust all callers.
16867
168682002-06-20 Akim Demaille <akim@epita.fr>
16869
16870 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16871 internals.
16872 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16873 Takes a location.
16874 * src/symtab.h, src/symtab.c (symbol_class_set)
16875 (symbol_user_token_number_set): Likewise.
16876 Adjust all callers.
16877 Promote complain_at.
16878 * tests/input.at (Type Clashes): Adjust.
16879
168802002-06-20 Akim Demaille <akim@epita.fr>
16881
16882 * data/bison.simple (YYLEX): Fix the declaration when
16883 %pure-parser.
16884
168852002-06-20 Akim Demaille <akim@epita.fr>
16886
16887 * data/bison.simple (yysymprint): Don't print the token number,
16888 just its name.
16889 * tests/actions.at (Destructors): Rename as...
16890 (Printers and Destructors): this.
16891 Also exercise %printer.
16892
168932002-06-20 Akim Demaille <akim@epita.fr>
16894
16895 * data/bison.simple (YYDSYMPRINT): New.
16896 Use it to remove many of the #if YYDEBUG/if (yydebug).
16897
168982002-06-20 Akim Demaille <akim@epita.fr>
16899
16900 * src/symtab.h, src/symtab.c (symbol_t): printer and
16901 printer_location are new members.
16902 (symbol_printer_set): New.
16903 * src/parse-gram.y (PERCENT_PRINTER): New token.
16904 Handle its associated rule.
16905 * src/scan-gram.l: Adjust.
16906 (handle_destructor_at, handle_destructor_dollar): Rename as...
16907 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16908 * src/output.c (symbol_printers_output): New.
16909 (output_skeleton): Call it.
16910 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16911 since there are already many grammar files with a user `yyprint'.
16912 Replace the calls to YYPRINT to calls to yysymprint.
16913 * tests/calc.at: Adjust.
16914 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16915 taking advantage of parser very internal details (stack size!).
16916
169172002-06-20 Akim Demaille <akim@epita.fr>
16918
16919 * src/scan-gram.l: Complete the scanner with the missing patterns
16920 to pacify Flex.
16921 Use `quote' and `symbol_tag_get' where appropriate.
16922
169232002-06-19 Akim Demaille <akim@epita.fr>
16924
16925 * tests/actions.at (Destructors): Augment to test locations.
16926 * data/bison.simple (yydestructor): Pass it the current location
16927 if locations are enabled.
16928 Prototype only when __STDC__ or C++.
16929 Change the argument names to move into the yy name space: there is
16930 user code here.
16931
169322002-06-19 Akim Demaille <akim@epita.fr>
16933
16934 * data/bison.simple (b4_pure_if): New.
16935 Use it instead of #ifdef YYPURE.
16936
169372002-06-19 Akim Demaille <akim@epita.fr>
16938
16939 * data/bison.simple (b4_location_if): New.
16940 Use it instead of #ifdef YYLSP_NEEDED.
16941
169422002-06-19 Akim Demaille <akim@epita.fr>
16943
16944 Prepare @$ in %destructor, but currently don't bind it in the
16945 skeleton, as %location use is not cleaned up yet.
16946
16947 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16948 (handle_action_at): New.
16949 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16950 a braced_code_t and a location as additional arguments.
16951 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16952 unquote one when outputting `b4_dollar_dollar'.
16953 Adjust callers.
16954 * data/bison.simple (b4_eval): Remove.
16955 (b4_symbol_destructor): Adjust.
16956 * tests/input.at (Invalid @n): Adjust.
16957
169582002-06-19 Zack Weinberg <zack@codesourcery.com>
16959
16960 * doc/bison.texinfo: Document ability to have multiple
16961 prologue sections.
16962
169632002-06-18 Akim Demaille <akim@epita.fr>
16964
16965 * src/files.c (compute_base_names): When computing the output file
16966 names from the input file name, strip the directory part.
16967
169682002-06-18 Akim Demaille <akim@epita.fr>
16969
16970 * data/bison.simple.new: Comment changes.
16971 Reported by Andreas Schwab.
16972
169732002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16974
16975 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16976 there are no `label `yyoverflowlab' defined but not used' warnings
16977 when yyoverflow is defined.
16978
169792002-06-18 Akim Demaille <akim@epita.fr>
16980
16981 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16982 new member.
16983 (symbol_destructor_set): Adjust.
16984 * src/output.c (symbol_destructors_output): Output the destructor
16985 locations.
16986 Output the symbol name.
16987 * data/bison.simple (b4_symbol_destructor): Adjust.
16988
169892002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16990 and Akim Demaille <akim@epita.fr>
16991
16992 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16993 what's left on the stack when the error recovery hits EOF.
16994 * tests/actions.at (Destructors): Complete to exercise this case.
16995
169962002-06-17 Akim Demaille <akim@epita.fr>
16997
16998 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16999 arguments is really empty, not only equal to `[]'.
17000 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
17001 member.
17002 (symbol_destructor_set): New.
17003 * src/output.c (symbol_destructors_output): New.
17004 * src/reader.h (brace_code_t, current_braced_code): New.
17005 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
17006 (handle_dollar): Rename as...
17007 (handle_action_dollar): this.
17008 (handle_destructor_dollar): New.
17009 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
17010 (grammar_declaration): Use it.
17011 * data/bison.simple (yystos): Is always defined.
17012 (yydestructor): New.
17013 * tests/actions.at (Destructors): New.
17014 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
17015
170162002-06-17 Akim Demaille <akim@epita.fr>
17017
17018 * src/symlist.h, src/symlist.c (symbol_list_length): New.
17019 * src/scan-gram.l (handle_dollar, handle_at): Compute the
17020 rule_length only when needed.
17021 * src/output.c (actions_output, token_definitions_output): Output
17022 the full M4 block.
17023 * src/symtab.c: Don't access directly to the symbol tag, use
17024 symbol_tag_get.
17025 * src/parse-gram.y: Use symbol_list_free.
17026
170272002-06-17 Akim Demaille <akim@epita.fr>
17028
17029 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
17030 (symbol_list_prepend, get_type_name): Move to...
17031 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
17032 (symbol_list_prepend, symbol_list_n_type_name_get): here.
17033 Adjust all callers.
17034 (symbol_list_free): New.
17035 * src/scan-gram.l (handle_dollar): Takes a location.
17036 * tests/input.at (Invalid $n): Adjust.
17037
170382002-06-17 Akim Demaille <akim@epita.fr>
17039
17040 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17041 (symbol_list_prepend): New.
17042 * src/parse-gram.y (%union): `list' is a new member.
17043 (symbols.1): New, replaces...
17044 (terms_to_prec.1, nterms_to_type.1): these.
17045 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17046 Take a location as additional argument.
17047 Adjust all callers.
17048
170492002-06-15 Akim Demaille <akim@epita.fr>
17050
17051 * src/parse-gram.y: Move %token in the declaration section so that
17052 we don't depend upon CVS Bison.
17053
170542002-06-15 Akim Demaille <akim@epita.fr>
17055
17056 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17057 * src/print.c (print_core): Use it.
17058
170592002-06-15 Akim Demaille <akim@epita.fr>
17060
17061 * src/conflicts.c (log_resolution): Accept the rule involved in
17062 the sr conflicts instead of the lookahead number that points to
17063 that rule.
17064 (flush_reduce): Accept the current lookahead vector as argument,
17065 instead of the index in LA.
17066 (resolve_sr_conflict): Accept the current number of lookahead
17067 bitset to consider for the STATE, instead of the index in LA.
17068 (set_conflicts): Adjust.
17069 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17070
170712002-06-15 Akim Demaille <akim@epita.fr>
17072
17073 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17074 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17075 Adjust all dependencies.
17076 * src/lalr.c (initialize_lookaheads): Split into...
17077 (states_lookaheads_count, states_lookaheads_initialize): these.
17078 (lalr): Adjust.
17079
170802002-06-15 Akim Demaille <akim@epita.fr>
17081
17082 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17083 out of...
17084 (grammar_rules_print): here.
17085 * src/reduce.c (reduce_output): Use it.
17086 * tests/reduce.at (Useless Rules, Reduced Automaton)
17087 (Underivable Rules): Adjust.
17088
170892002-06-15 Akim Demaille <akim@epita.fr>
17090
17091 Copy BYacc's nice way to report the grammar.
17092
17093 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17094 New.
17095 Don't print the rules' location, it is confusing and useless.
17096 (rule_print): Use grammar_rhs_print.
17097 * src/print.c (print_grammar): Use grammar_rules_print.
17098
170992002-06-15 Akim Demaille <akim@epita.fr>
17100
17101 Complete and rationalize `useless thing' warnings.
17102
17103 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17104 (symbol_tag_print): New.
17105 Use them everywhere in place of accessing directly the tag member.
17106 * src/gram.h, src/gram.c (rule_print): New.
17107 Use it where a rule used to be printed `by hand'.
17108 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17109 (reduce_grammar_tables): Report the useless rules.
17110 (reduce_print): Useless things are a warning, not an error.
17111 Report it as such.
17112 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17113 (Reduced Automaton, Underivable Rules): Adjust.
17114 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17115 * tests/conflicts.at (Unresolved SR Conflicts)
17116 (Solved SR Conflicts): Adjust.
17117
171182002-06-15 Akim Demaille <akim@epita.fr>
17119
17120 Let symbols have a location.
17121
17122 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
17123 (getsym): Adjust.
17124 Adjust all callers.
17125 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
17126 Use location_t, not int.
17127 * src/symtab.c (symbol_check_defined): Take advantage of the
17128 location.
17129 * tests/regression.at (Invalid inputs): Adjust.
17130
171312002-06-15 Akim Demaille <akim@epita.fr>
17132
17133 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
17134 (input): Don't try to initialize yylloc here, do it in the
17135 scanner.
17136 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
17137 * src/gram.h (rule_t): Change line and action_line into location
17138 and action_location, of location_t type.
17139 Adjust all dependencies.
17140 * src/location.h, src/location.c (empty_location): New.
17141 * src/reader.h, src/reader.c (grammar_start_symbol_set)
17142 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
17143 (grammar_current_rule_symbol_append)
17144 (grammar_current_rule_action_append): Expect a location as argument.
17145 * src/reader.c (grammar_midrule_action): Adjust to attach an
17146 action's location as dummy symbol location.
17147 * src/symtab.h, src/symtab.c (startsymbol_location): New.
17148 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
17149 the line numbers.
17150
171512002-06-14 Akim Demaille <akim@epita.fr>
17152
17153 Grammar declarations may be found in the grammar section.
17154
17155 * src/parse-gram.y (rules_or_grammar_declaration): New.
17156 (declarations): Each declaration may end with a semicolon, not
17157 just...
17158 (grammar_declaration): `"%union"'.
17159 (grammar): Branch to rules_or_grammar_declaration.
17160
171612002-06-14 Akim Demaille <akim@epita.fr>
17162
17163 * src/main.c (main): Invoke scanner_free.
17164
171652002-06-14 Akim Demaille <akim@epita.fr>
17166
17167 * src/output.c (m4_invoke): Extracted from...
17168 (output_skeleton): here.
17169 Free tempfile.
17170
171712002-06-14 Akim Demaille <akim@epita.fr>
17172
17173 * src/parse-gram.y (directives, directive, gram)
17174 (grammar_directives, precedence_directives, precedence_directive):
17175 Rename as...
17176 (declarations, declaration, grammar, grammar_declaration)
17177 (precedence_declaration, precedence_declarator): these.
17178 (symbol_declaration): New.
17179
171802002-06-14 Akim Demaille <akim@epita.fr>
17181
17182 * src/files.c (action_obstack): Remove, unused.
17183 (output_obstack): Remove it, and all its dependencies, as it is no
17184 longer needed.
17185 * src/reader.c (epilogue_set): Build the epilogue in the
17186 muscle_obstack.
17187 * src/output.h, src/output.c (muscle_obstack): Move to...
17188 * src/muscle_tab.h, src/muscle_tab.h: here.
17189 (muscle_init): Initialize muscle_obstack.
17190 (muscle_free): New.
17191 * src/main.c (main): Call it.
17192
171932002-06-14 Akim Demaille <akim@epita.fr>
17194
17195 * src/location.h: New, extracted from...
17196 * src/reader.h: here.
17197 * src/Makefile.am (noinst_HEADERS): Merge into
17198 (bison_SOURCES): this.
17199 Add location.h.
17200 * src/parse-gram.y: Use location_t instead of Bison's.
17201 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
17202 Use location_t instead of ints.
17203
172042002-06-14 Akim Demaille <akim@epita.fr>
17205
17206 * data/bison.simple, data/bison.c++: Be sure to restore the
17207 current #line when returning to the skeleton contents after having
17208 exposed the input file's #line.
17209
172102002-06-12 Akim Demaille <akim@epita.fr>
17211
17212 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
17213 eager.
17214 * tests/actions.at (Exotic Dollars): New.
17215
172162002-06-12 Akim Demaille <akim@epita.fr>
17217
17218 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
17219 ['"/] too eagerly.
17220 * tests/input.at (Torturing the Scanner): New.
17221
172222002-06-11 Akim Demaille <akim@epita.fr>
17223
17224 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
17225 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
17226 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
17227 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
17228 * src/reader.c (reader): Use it.
17229
172302002-06-11 Akim Demaille <akim@epita.fr>
17231
17232 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
17233 Adjust all callers.
17234 (scanner_last_string_free): New.
17235
172362002-06-11 Akim Demaille <akim@epita.fr>
17237
17238 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
17239 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
17240 (last_string, YY_OBS_FREE): New.
17241 Use them when returning an ID.
17242
172432002-06-11 Akim Demaille <akim@epita.fr>
17244
17245 Have Bison grammars parsed by a Bison grammar.
17246
17247 * src/reader.c, src/reader.h (prologue_augment): New.
17248 * src/reader.c (copy_definition): Remove.
17249
17250 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
17251 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
17252 (grammar_current_rule_prec_set, grammar_current_rule_check)
17253 (grammar_current_rule_symbol_append)
17254 (grammar_current_rule_action_append): Export.
17255 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
17256 (symbol_list_action_append): Remove.
17257 Hook the routines from reader.
17258 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17259 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
17260
17261 * src/reader.c (read_declarations): Remove, unused.
17262
17263 * src/parse-gram.y: Handle the epilogue.
17264 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
17265 (grammar_start_symbol_set): this.
17266 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
17267 * src/reader.c (readgram): Remove, unused.
17268 (reader): Adjust to insert eoftoken and axiom where appropriate.
17269
17270 * src/reader.c (copy_dollar): Replace with...
17271 * src/scan-gram.h (handle_dollar): this.
17272 * src/parse-gram.y: Remove `%thong'.
17273
17274 * src/reader.c (copy_at): Replace with...
17275 * src/scan-gram.h (handle_at): this.
17276
17277 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17278 New.
17279
17280 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17281 time being.
17282
17283 * src/reader.h, src/reader.c (grammar_rule_end): New.
17284
17285 * src/parse.y (current_type, current_class): New.
17286 Implement `%nterm', `%token' support.
17287 Merge `%term' into `%token'.
17288 (string_as_id): New.
17289 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17290 type name.
17291
17292 * src/parse-gram.y: Be sure to handle properly the beginning of
17293 rules.
17294
17295 * src/parse-gram.y: Handle %type.
17296 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17297
17298 * src/parse-gram.y: More directives support.
17299 * src/options.c: No longer handle source directives.
17300
17301 * src/parse-gram.y: Fix %output.
17302
17303 * src/parse-gram.y: Handle %union.
17304 Use the prologue locations.
17305 * src/reader.c (parse_union_decl): Remove.
17306
17307 * src/reader.h, src/reader.c (epilogue_set): New.
17308 * src/parse-gram.y: Use it.
17309
17310 * data/bison.simple, data/bison.c++: b4_stype is now either not
17311 defined, then default to int, or to the contents of %union,
17312 without `union' itself.
17313 Adjust.
17314 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17315
17316 * src/output.c (actions_output): Don't output braces, as they are
17317 already handled by the scanner.
17318
17319 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17320 characters to themselves.
17321
17322 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17323 that the epilogue has a proper #line.
17324
17325 * src/parse-gram.y: Handle precedence/associativity.
17326
17327 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17328 a terminal.
17329 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17330 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17331 at all to define terminals that cannot be emitted.
17332
17333 * src/scan-gram.l: Escape M4 characters.
17334
17335 * src/scan-gram.l: Working properly with escapes in user
17336 strings/characters.
17337
17338 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17339 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17340 grammar.
17341 Use more modest sizes, as for the time being the parser does not
17342 release memory, and therefore the process swallows a huge amount
17343 of memory.
17344
17345 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17346 stricter %token grammar.
17347
17348 * src/symtab.h (associativity): Add `undef_assoc'.
17349 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17350 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17351
17352 * tests/regression.at (Invalid %directive): Remove, as it is now
17353 meaningless.
17354 (Invalid inputs): Adjust to the new error messages.
17355 (Token definitions): The new grammar doesn't allow too many
17356 eccentricities.
17357
17358 * src/lex.h, src/lex.c: Remove.
17359 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17360 (copy_character, copy_string2, copy_string, copy_identifier)
17361 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17362 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17363 (parse_action): Remove.
17364 * po/POTFILES.in: Adjust.
17365
173662002-06-11 Akim Demaille <akim@epita.fr>
17367
17368 * src/reader.c (parse_action): Don't store directly into the
17369 rule's action member: return the action as a string.
17370 Don't require `rule_length' as an argument: compute it.
17371 (grammar_current_rule_symbol_append)
17372 (grammar_current_rule_action_append): New, eved out from
17373 (readgram): here.
17374 Remove `action_flag', `rulelength', unused now.
17375
173762002-06-11 Akim Demaille <akim@epita.fr>
17377
17378 * src/reader.c (grammar_current_rule_prec_set).
17379 (grammar_current_rule_check): New, eved out from...
17380 (readgram): here.
17381 Remove `xaction', `first_rhs': useless.
17382 * tests/input.at (Type clashes): New.
17383 * tests/existing.at (GNU Cim Grammar): Adjust.
17384
173852002-06-11 Akim Demaille <akim@epita.fr>
17386
17387 * src/reader.c (grammar_midrule_action): New, Eved out from
17388 (readgram): here.
17389
173902002-06-11 Akim Demaille <akim@epita.fr>
17391
17392 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17393 New.
17394 (readgram): Use them as replacement of inlined code, crule and
17395 crule1.
17396
173972002-06-11 Akim Demaille <akim@epita.fr>
17398
17399 * src/reader.c (grammar_end, grammar_symbol_append): New.
17400 (readgram): Use them.
17401 Make the use of `p' as local as possible.
17402
174032002-06-10 Akim Demaille <akim@epita.fr>
17404
17405 GCJ's parser requires the tokens to be defined before the prologue.
17406
17407 * data/bison.simple: Output the token definition before the user's
17408 prologue.
17409 * tests/regression.at (Braces parsing, Duplicate string)
17410 (Mixing %token styles): Check the output from bison.
17411 (Early token definitions): New.
17412
174132002-06-10 Akim Demaille <akim@epita.fr>
17414
17415 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17416 assigning twice the same user number to a token, so that we can
17417 use it in...
17418 * src/lex.c (lex): here.
17419 Also use `symbol_class_set' instead of hand written code.
17420 * src/reader.c (parse_assoc_decl): Likewise.
17421
174222002-06-10 Akim Demaille <akim@epita.fr>
17423
17424 * src/symtab.c, src/symtab.c (symbol_class_set)
17425 (symbol_user_token_number_set): New.
17426 * src/reader.c (parse_token_decl): Use them.
17427 Use a switch instead of ifs.
17428 Use a single argument.
17429
174302002-06-10 Akim Demaille <akim@epita.fr>
17431
17432 Remove `%thong' support as it is undocumented, unused, duplicates
17433 `%token's job, and creates useless e-mail traffic with people who
17434 want to know what it is, why it is undocumented, unused, and
17435 duplicates `%token's job.
17436
17437 * src/reader.c (parse_thong_decl): Remove.
17438 * src/options.c (option_table): Remove "thong".
17439 * src/lex.h (tok_thong): Remove.
17440
174412002-06-10 Akim Demaille <akim@epita.fr>
17442
17443 * src/symtab.c, src/symtab.c (symbol_type_set)
17444 (symbol_precedence_set): New.
17445 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17446 (value_components_used): Remove, unused.
17447
174482002-06-09 Akim Demaille <akim@epita.fr>
17449
17450 Move symbols handling code out of the reader.
17451
17452 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17453 (axiom): Move to...
17454 * src/symtab.h, src/symtab.c: here.
17455
17456 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17457 * src/reader.c (startval): Rename as...
17458 * src/symtab.h, src/symtab.c (startsymbol): this.
17459 * src/reader.c: Adjust.
17460
17461 * src/reader.c (symbol_check_defined, symbol_make_alias)
17462 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17463 (token_translations_init)
17464 Move to...
17465 * src/symtab.c: here.
17466 * src/reader.c (packsymbols): Move to...
17467 * src/symtab.h, src/symtab.c (symbols_pack): here.
17468 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17469 argument.
17470
174712002-06-03 Akim Demaille <akim@epita.fr>
17472
17473 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17474 then statements.
17475
174762002-06-03 Akim Demaille <akim@epita.fr>
17477
17478 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17479 structs with non literals.
17480 * src/scan-skel.l: never-interactive.
17481 * src/conflicts.c (enum conflict_resolution_e): No trailing
17482 comma.
17483 * src/getargs.c (usage): Split long literal strings.
17484 Reported by Hans Aberg.
17485
174862002-05-28 Akim Demaille <akim@epita.fr>
17487
17488 * data/bison.c++: Use C++ ostreams.
17489 (cdebug_): New member.
17490
174912002-05-28 Akim Demaille <akim@epita.fr>
17492
17493 * src/output.c (output_skeleton): Be sure to allocate enough room
17494 for `/' _and_ for `\0' in full_skeleton.
17495
174962002-05-28 Akim Demaille <akim@epita.fr>
17497
17498 * data/bison.c++: Catch up with bison.simple:
17499 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17500 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17501 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17502 and popping traces.
17503
175042002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17505
17506 * src/output.c (output_skeleton): Put an explicit path in front of
17507 the skeleton file name, rather than relying on the -I directory,
17508 to partially alleviate effects of having a skeleton file lying around
17509 in the current directory.
17510
175112002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17512
17513 * src/conflicts.c (log_resolution): Correct typo:
17514 obstack_printf should be obstack_fgrow1.
17515
175162002-05-26 Akim Demaille <akim@epita.fr>
17517
17518 * src/state.h (state_t): `solved_conflicts' is a new member.
17519 * src/LR0.c (new_state): Set it to 0.
17520 * src/conflicts.h, src/conflicts.c (print_conflicts)
17521 (free_conflicts, solve_conflicts): Rename as...
17522 (conflicts_print, conflicts_free, conflicts_solve): these.
17523 Adjust callers.
17524 * src/conflicts.c (enum conflict_resolution_e)
17525 (solved_conflicts_obstack): New, used by...
17526 (log_resolution): this.
17527 Adjust to attach the conflict resolution to each state.
17528 Complete the description with the precedence/associativity
17529 information.
17530 (resolve_sr_conflict): Adjust.
17531 * src/print.c (print_state): Output its solved_conflicts.
17532 * tests/conflicts.at (Unresolved SR Conflicts)
17533 (Solved SR Conflicts): Exercise --report=all.
17534
175352002-05-26 Akim Demaille <akim@epita.fr>
17536
17537 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17538 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17539 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17540 (token_number_t, item_number_as_token_number)
17541 (token_number_as_item_number, muscle_insert_token_number_table):
17542 Rename as...
17543 (symbol_number_t, item_number_as_symbol_number)
17544 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17545 these, since it is more appropriate.
17546
175472002-05-26 Akim Demaille <akim@epita.fr>
17548
17549 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17550 `Error:' lines.
17551 * data/bison.simple (yystos) [YYDEBUG]: New.
17552 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17553 error recovery.
17554 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17555
175562002-05-25 Akim Demaille <akim@epita.fr>
17557
17558 * doc/bison.texinfo (Debugging): Split into...
17559 (Tracing): this new section, its former contents, and...
17560 (Understanding): this new section.
17561 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17562 by...
17563 (report_flag): this.
17564 Adjust all dependencies.
17565 (report_args, report_types, report_argmatch): New.
17566 (usage, getargs): Report/support -r, --report.
17567 * src/options.h
17568 (struct option_table_struct): Rename as..,
17569 (struct option_table_s): this.
17570 Rename the `set_flag' member to `flag' to match with getopt_long's
17571 struct.
17572 * src/options.c (option_table): Split verbose into an entry for
17573 %verbose, and another for --verbose.
17574 Support --report/-r, so remove -r from the obsolete --raw.
17575 * src/print.c: Attach full item sets and lookaheads reports to
17576 report_flag instead of trace_flag.
17577 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17578
175792002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17580 and Paul Eggert <eggert@twinsun.com>
17581
17582 * data/bison.simple (yyparse): Correct error handling to conform to
17583 POSIX and yacc. Specifically, after syntax error is discovered,
17584 do not reduce further before shifting the error token.
17585 Clean up the code a bit by removing the labels yyerrdefault,
17586 yyerrhandle, yyerrpop.
17587 * NEWS: Document the above.
17588
175892002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17590
17591 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17592 type; it isn't always big enough, since it doesn't necessarily
17593 include non-terminals.
17594 (yytranslate): Expand definition of yy_token_number_type, so that
17595 the latter can be removed.
17596 (yy_token_number_type): Remove, only one use.
17597 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17598 don't use TokenNumberType as element type.
17599
17600 * tests/regression.at: Modify expected output to agree with change
17601 to yyr1 and yytranslate.
17602
176032002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17604
17605 * src/reader.c (parse_action): Use copy_character instead of
17606 obstack_1grow.
17607
176082002-05-13 Akim Demaille <akim@epita.fr>
17609
17610 * tests/regression.at (Token definitions): Prototype yylex and
17611 yyerror.
17612
176132002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17614
17615 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
17616 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17617 32-bit arithmetic.
17618 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17619
176202002-05-07 Akim Demaille <akim@epita.fr>
17621
17622 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17623 avoid GCC warnings.
17624
176252002-05-07 Akim Demaille <akim@epita.fr>
17626
17627 Kill GCC warnings.
17628
17629 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17630 over the RHS of each rule.
17631 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17632 * src/state.h (state_t): Member `nitems' is unsigned short.
17633 * src/LR0.c (get_state): Adjust.
17634 * src/reader.c (packgram): Likewise.
17635 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17636 `Type'.
17637 (muscle_insert_int_table): Remove, unused.
17638 (prepare_rules): Remove `max'.
17639
176402002-05-06 Akim Demaille <akim@epita.fr>
17641
17642 * src/closure.c (print_firsts): Display of the symbol tags.
17643 (bitmatrix_print): Move to...
17644 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17645 here.
17646 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17647
176482002-05-06 Akim Demaille <akim@epita.fr>
17649
17650 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17651 hash_do_for_each.
17652
176532002-05-06 Akim Demaille <akim@epita.fr>
17654
17655 * src/LR0.c (new_state, get_state): Instead of using the global
17656 `kernel_size' and `kernel_base', have two new arguments:
17657 `core_size' and `core'.
17658 Adjust callers.
17659
176602002-05-06 Akim Demaille <akim@epita.fr>
17661
17662 * src/reader.c (packgram): No longer end `ritem' with a 0
17663 sentinel: it is not used.
17664
176652002-05-05 Akim Demaille <akim@epita.fr>
17666
17667 New experimental feature: display the lookaheads in the report and
17668 graph.
17669
17670 * src/print (print_core): When --trace-flag, display the rules
17671 lookaheads.
17672 * src/print_graph.c (print_core): Likewise.
17673 Swap the arguments.
17674 Adjust caller.
17675
176762002-05-05 Akim Demaille <akim@epita.fr>
17677
17678 * tests/torture.at (Many lookaheads): New test.
17679
176802002-05-05 Akim Demaille <akim@epita.fr>
17681
17682 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17683 (GENERATE_MUSCLE_INSERT_TABLE): this.
17684 (output_int_table, output_unsigned_int_table, output_short_table)
17685 (output_token_number_table, output_item_number_table): Replace with...
17686 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17687 (muscle_insert_short_table, muscle_insert_token_number_table)
17688 (muscle_insert_item_number_table): these.
17689 Adjust all callers.
17690 (prepare_tokens): Don't free `translations', since...
17691 * src/reader.h, src/reader.c (grammar_free): do it.
17692 Move to...
17693 * src/gram.h, src/gram.c (grammar_free): here.
17694 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17695 b4_translate_max.
17696
176972002-05-05 Akim Demaille <akim@epita.fr>
17698
17699 * src/output.c (output_unsigned_int_table): New.
17700 (prepare_rules): `i' is unsigned.
17701 `prhs', `rline', `r2' are unsigned int.
17702 Rename muscle `rhs_number_max' as `rhs_max'.
17703 Output muscles `prhs_max', `rline_max', and `r2_max'.
17704 Free rline and r1.
17705 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17706 to compute types instead of constant types.
17707 * tests/regression.at (Web2c Actions): Adjust.
17708
177092002-05-04 Akim Demaille <akim@epita.fr>
17710
17711 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17712 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17713 Adjust dependencies.
17714 * src/output.c (token_definitions_output): Be sure not to output a
17715 `#define 'a'' when fed with `%token 'a' "a"'.
17716 * tests/regression.at (Token definitions): New.
17717
177182002-05-03 Paul Eggert <eggert@twinsun.com>
17719
17720 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17721 for K&R C.
17722
177232002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17724
17725 * Makefile.am (SUBDIRS): Remove intl.
17726 (EXTRA_DIST): Add config/config.rpath.
17727
177282002-05-03 Akim Demaille <akim@epita.fr>
17729
17730 * data/bison.simple (m4_if): Don't output empty enums.
17731 And actually, output valid enum definitions :(.
17732
177332002-05-03 Akim Demaille <akim@epita.fr>
17734
17735 * configure.bat: Remove, completely obsolete.
17736 * Makefile.am (EXTRA_DIST): Adjust.
17737 Don't distribute config.rpath...
17738 * config/Makefile.am (EXTRA_DIST): Do it.
17739
177402002-05-03 Akim Demaille <akim@epita.fr>
17741
17742 * configure.in (GETTEXT_VERSION): New.
17743 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17744
177452002-05-03 Akim Demaille <akim@epita.fr>
17746
17747 * data/bison.simple (b4_token_enum): New.
17748 (b4_token_defines): Use it to output tokens both as #define and
17749 enums.
17750 Suggested by Paul Eggert.
17751 * src/output.c (token_definitions_output): Don't output spurious
17752 white spaces.
17753
177542002-05-03 Akim Demaille <akim@epita.fr>
17755
17756 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17757
177582002-05-02 Robert Anisko <robert@lrde.epita.fr>
17759
17760 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17761 Update the stack class, give a try to deque as the default container.
17762
177632002-05-02 Akim Demaille <akim@epita.fr>
17764
17765 * data/bison.simple (yyparse): Do not implement @$ = @1.
17766 (YYLLOC_DEFAULT): Adjust to do it.
17767 * doc/bison.texinfo (Location Default Action): Fix.
17768
177692002-05-02 Akim Demaille <akim@epita.fr>
17770
17771 * src/reader.c (parse_braces): Merge into...
17772 (parse_action): this.
17773
177742002-05-02 Akim Demaille <akim@epita.fr>
17775
17776 * configure.in (ALL_LINGUAS): Remove.
17777 * po/LINGUAS, hr.po: New.
17778
177792002-05-02 Akim Demaille <akim@epita.fr>
17780
17781 Remove the so called hairy (semantic) parsers.
17782
17783 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17784 * src/gram.h, src/gram.c (semantic_parser): Remove.
17785 (rule_t): Remove the guard and guard_line members.
17786 * src/lex.h (token_t): remove tok_guard.
17787 * src/options.c (option_table): Remove %guard and %semantic_parser
17788 support.
17789 * src/output.c, src/output.h (guards_output): Remove.
17790 (prepare): Adjust.
17791 (token_definitions_output): Don't output the `T'
17792 tokens (???).
17793 (output_skeleton): Don't output the guards.
17794 * src/files.c, src/files.c (attrsfile): Remove.
17795 * src/reader.c (symbol_list): Remove the guard and guard_line
17796 members.
17797 Adjust dependencies.
17798 (parse_guard): Remove.
17799 * data/bison.hairy: Remove.
17800 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17801 BISON_HAIRY.
17802
178032002-05-02 Akim Demaille <akim@epita.fr>
17804
17805 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17806 (parse_guard): Rename the formal argument `stack_offset' as
17807 `rule_length', which is more readable.
17808 Adjust callers.
17809 (copy_at, copy_dollar): Instead of outputting the hard coded
17810 values of $$, $n and so forth, output invocation to b4_lhs_value,
17811 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
17812 Note: this patch partially drops `semantic-parser' support: it
17813 always does `rule_length - n', where semantic parsers ought to
17814 always use `-n'.
17815 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17816 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17817
178182002-05-02 Akim Demaille <akim@epita.fr>
17819
17820 * configure.in (AC_INIT): Bump to 1.49b.
17821 (AM_INIT_AUTOMAKE): Short invocation.
17822
178232002-05-02 Akim Demaille <akim@epita.fr>
17824
17825 Version 1.49a.
17826
178272002-05-01 Akim Demaille <akim@epita.fr>
17828
17829 * src/skeleton.h: Remove.
17830
178312002-05-01 Akim Demaille <akim@epita.fr>
17832
17833 * src/skeleton.h: Fix the #endif.
17834 Reported by Magnus Fromreide.
17835
178362002-04-26 Paul Eggert <eggert@twinsun.com>
17837
17838 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17839 Define if we define YYSTYPE and YYLTYPE, respectively.
17840 (YYCOPY): Fix [] quoting problem in the non-GCC case.
17841
178422002-04-25 Robert Anisko <robert@lrde.epita.fr>
17843
17844 * src/scan-skel.l: Postprocess quadrigraphs.
17845
17846 * src/reader.c (copy_character): New function, used to output
17847 single characters while replacing `[' and `]' with quadrigraphs, to
17848 avoid troubles with M4 quotes.
17849 (copy_comment): Output characters with copy_character.
17850 (read_additionnal_code): Likewise.
17851 (copy_string2): Likewise.
17852 (copy_definition): Likewise.
17853
17854 * tests/calc.at: Exercise M4 quoting.
17855
178562002-04-25 Akim Demaille <akim@epita.fr>
17857
17858 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17859 between `!' and the command.
17860 Reported by Paul Eggert.
17861
178622002-04-24 Robert Anisko <robert@lrde.epita.fr>
17863
17864 * tests/calc.at: Exercise prologue splitting.
17865
17866 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17867 `b4_post_prologue' instead of `b4_prologue'.
17868
17869 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17870 muscles.
17871 (output): Free pre_prologue_obstack and post_prologue_obstack.
17872 * src/files.h, src/files.c (attrs_obstack): Remove.
17873 (pre_prologue_obstack, post_prologue_obstack): New.
17874 * src/reader.c (copy_definition): Add a parameter to specify the
17875 obstack to fill, instead of using attrs_obstack unconditionally.
17876 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17877 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17878
178792002-04-23 Paul Eggert <eggert@twinsun.com>
17880
17881 * data/bison.simple: Remove unnecessary commentary and white
17882 space differences from 1_29-branch.
17883 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17884
17885 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17886 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17887 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17888 constructors or destructors.
17889
17890 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17891
178922002-04-23 Akim Demaille <akim@epita.fr>
17893
17894 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17895 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17896 location with columns.
17897 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17898 All reported by Paul Eggert.
17899
179002002-04-22 Akim Demaille <akim@epita.fr>
17901
17902 * src/reduce.c (dump_grammar): Move to...
17903 * src/gram.h, src/gram.c (grammar_dump): here.
17904 Be sure to separate long item numbers.
17905 Don't read the members of a rule's prec if its nil.
17906
179072002-04-22 Akim Demaille <akim@epita.fr>
17908
17909 * src/output.c (table_size, table_grow): New.
17910 (MAXTABLE): Remove, replace uses with table_size.
17911 (pack_vector): Instead of dying when the table is too big, grow it.
17912
179132002-04-22 Akim Demaille <akim@epita.fr>
17914
17915 * data/bison.simple (yyr1): Its type is that of a token number.
17916 * data/bison.c++ (r1_): Likewise.
17917 * tests/regression.at (Web2c Actions): Adjust.
17918
179192002-04-22 Akim Demaille <akim@epita.fr>
17920
17921 * src/reader.c (token_translations_init): 256 is now the default
17922 value for the error token, i.e., it will be assigned another
17923 number if the user assigned 256 to one of her tokens.
17924 (reader): Don't force 256 to error.
17925 * doc/bison.texinfo (Symbols): Adjust.
17926 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17927 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17928 etc. instead of 10, 20, 30 (which was used to `jump' over error
17929 (256) and undefined (2)).
17930
179312002-04-22 Akim Demaille <akim@epita.fr>
17932
17933 Propagate more token_number_t.
17934
17935 * src/gram.h (token_number_as_item_number)
17936 (item_number_as_token_number): New.
17937 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17938 Use it to create output_item_number_table and
17939 output_token_number_table.
17940 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17941 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17942 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17943 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17944
179452002-04-22 Akim Demaille <akim@epita.fr>
17946
17947 * src/output.h, src/output.c (get_lines_number): Remove.
17948
179492002-04-19 Akim Demaille <akim@epita.fr>
17950
17951 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17952 as Lex/Flex'.
17953 (Debugging): More details about enabling the debugging features.
17954 (Table of Symbols): Describe $$, $n, @$, and @n.
17955 Suggested by Tim Josling.
17956
179572002-04-19 Akim Demaille <akim@epita.fr>
17958
17959 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17960
179612002-04-10 Akim Demaille <akim@epita.fr>
17962
17963 * src/system.h: Rely on HAVE_LIMITS_H.
17964 Suggested by Paul Eggert.
17965
179662002-04-09 Akim Demaille <akim@epita.fr>
17967
17968 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17969 full stderr, and strip it according to the bison options, instead
17970 of composing the error message from different bits.
17971 This makes it easier to check for several error messages.
17972 Adjust all the invocations.
17973 Add an invocation exercising the error token.
17974 Add an invocation demonstrating a stupid error message.
17975 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17976 Adjust the tests.
17977 Error message are for stderr, not stdout.
17978
179792002-04-09 Akim Demaille <akim@epita.fr>
17980
17981 * src/gram.h, src/gram.c (error_token_number): Remove, use
17982 errtoken->number.
17983 * src/reader.c (reader): Don't specify the user token number (2)
17984 for $undefined, as it uselessly prevents using it.
17985 * src/gram.h (token_number_t): Move to...
17986 * src/symtab.h: here.
17987 (state_t.number): Is a token_number_t.
17988 * src/print.c, src/reader.c: Use undeftoken->number instead of
17989 hard coded 2.
17990 (Even though this 2 is not the same as above: the number of the
17991 undeftoken remains being 2, it is its user token number which
17992 might not be 2).
17993 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17994 `user_token_number_max'.
17995 Output `undef_token_number'.
17996 * data/bison.simple, data/bison.c++: Use them.
17997 Be sure to map invalid yylex return values to
17998 `undef_token_number'. This saves us from gratuitous SEGV.
17999
18000 * tests/conflicts.at (Solved SR Conflicts)
18001 (Unresolved SR Conflicts): Adjust.
18002 * tests/regression.at (Web2c Actions): Adjust.
18003
180042002-04-08 Akim Demaille <akim@epita.fr>
18005
18006 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
18007 Adding #line.
18008 Remove the duplicate `typedefs'.
18009 (RhsNumberType): Fix the declaration and various other typos.
18010 Use __ofile__.
18011 * data/bison.simple: Use __ofile__.
18012 * src/scan-skel.l: Handle __ofile__.
18013
180142002-04-08 Akim Demaille <akim@epita.fr>
18015
18016 * src/gram.h (item_number_t): New, the type of item numbers in
18017 RITEM. Note that it must be able to code symbol numbers as
18018 positive number, and the negation of rule numbers as negative
18019 numbers.
18020 Adjust all dependencies (pretty many).
18021 * src/reduce.c (rule): Remove this `short *' pointer: use
18022 item_number_t.
18023 * src/system.h (MINSHORT, MAXSHORT): Remove.
18024 Include `limits.h'.
18025 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
18026 (shortcpy): Remove.
18027 (MAXTABLE): Move to...
18028 * src/output.c (MAXTABLE): here.
18029 (prepare_rules): Use output_int_table to output rhs.
18030 * data/bison.simple, data/bison.c++: Adjust.
18031 * tests/torture.at (Big triangle): Move the limit from 254 to
18032 500.
18033 * tests/regression.at (Web2c Actions): Ajust.
18034
18035 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
18036 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18037 passes, but produces negative #line number, once fixed, GCC is
18038 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18039 C), it passes.
18040 * src/state.h (state_h): Code input lines on ints, not shorts.
18041
180422002-04-08 Akim Demaille <akim@epita.fr>
18043
18044 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18045 and then the grammar.
18046
180472002-04-08 Akim Demaille <akim@epita.fr>
18048
18049 * src/system.h: No longer using strndup.
18050
180512002-04-07 Akim Demaille <akim@epita.fr>
18052
18053 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18054 * src/output.c (output_table_data): Return the longest number.
18055 (prepare_tokens): Output `token_number_max').
18056 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18057 New.
18058 Use them to define yy_token_number_type/TokenNumberType.
18059 Use this type for yytranslate.
18060 * tests/torture.at (Big triangle): Push the limit from 124 to
18061 253.
18062 * tests/regression.at (Web2c Actions): Adjust.
18063
180642002-04-07 Akim Demaille <akim@epita.fr>
18065
18066 * tests/torture.at (Big triangle): New.
18067 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18068 * tests/existing.at: here.
18069
180702002-04-07 Akim Demaille <akim@epita.fr>
18071
18072 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18073 nritems.
18074 Adjust dependencies.
18075
180762002-04-07 Akim Demaille <akim@epita.fr>
18077
18078 * src/reader.c: Normalize increments to prefix form.
18079
180802002-04-07 Akim Demaille <akim@epita.fr>
18081
18082 * src/reader.c, symtab.c: Remove debugging code.
18083
180842002-04-07 Akim Demaille <akim@epita.fr>
18085
18086 Rename all the `bucket's as `symbol_t'.
18087
18088 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18089 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18090 * src/symtab.c, src/symtab.h (bucket): Rename as...
18091 (symbol_t): this.
18092 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18093 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18094 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18095 (buckets_new, buckets_free, buckets_do): Rename as...
18096 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18097 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18098 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18099 (symbols_new, symbols_free, symbols_do): these.
18100
181012002-04-07 Akim Demaille <akim@epita.fr>
18102
18103 Use lib/hash for the symbol table.
18104
18105 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18106 EOF.
18107 * src/lex.c (lex): Set the `number' member of new terminals.
18108 * src/reader.c (bucket_check_defined, bucket_make_alias)
18109 (bucket_check_alias_consistence, bucket_translation): New.
18110 (reader, grammar_free, readgram, token_translations_init)
18111 (packsymbols): Adjust.
18112 (reader): Number the predefined tokens.
18113 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18114 for predefined tokens.
18115 * src/symtab.h (bucket): Remove all the hash table related
18116 members.
18117 * src/symtab.c (symtab): Replace by...
18118 (bucket_table): this.
18119 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18120 (buckets_new, buckets_do): New.
18121
181222002-04-07 Akim Demaille <akim@epita.fr>
18123
18124 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
18125 (start_symbol, max_user_token_number, semantic_parser)
18126 (error_token_number): Initialize.
18127 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
18128 Initialize.
18129 (reader): Don't.
18130 (errtoken, eoftoken, undeftoken, axiom): Extern.
18131
181322002-04-07 Akim Demaille <akim@epita.fr>
18133
18134 * src/gram.h (rule_s): prec and precsym are now pointers
18135 to the bucket giving the priority/associativity.
18136 Member `associativity' removed: useless.
18137 * src/reduce.c, src/conflicts.c: Adjust.
18138
181392002-04-07 Akim Demaille <akim@epita.fr>
18140
18141 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
18142 Properly escape the symbols' TAG when outputting them.
18143
181442002-04-07 Akim Demaille <akim@epita.fr>
18145
18146 * src/lalr.h (LA): Is a bitsetv, not bitset*.
18147
181482002-04-07 Akim Demaille <akim@epita.fr>
18149
18150 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
18151 (LArule): this, which is an array to rule_t*.
18152 * src/print.c, src/conflicts.c: Adjust.
18153
181542002-04-07 Akim Demaille <akim@epita.fr>
18155
18156 * src/gram.h (rule_t): Rename `number' as `user_number'.
18157 `number' is a new member.
18158 Adjust dependencies.
18159 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
18160
181612002-04-07 Akim Demaille <akim@epita.fr>
18162
18163 As a result of the previous patch, it is no longer needed
18164 to reorder ritem itself.
18165
18166 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
18167
181682002-04-07 Akim Demaille <akim@epita.fr>
18169
18170 Be sure never to walk through RITEMS, but use only data related to
18171 the rules themselves. RITEMS should be banished.
18172
18173 * src/output.c (output_token_translations): Rename as...
18174 (prepare_tokens): this.
18175 In addition to `translate', prepare the muscles `tname' and
18176 `toknum', which were handled by...
18177 (output_rule_data): this.
18178 Remove, and move the remainder of its outputs into...
18179 (prepare_rules): this new routines, which also merges content from
18180 (output_gram): this.
18181 (prepare_rules): Be sure never to walk through RITEMS.
18182 (output_stos): Rename as...
18183 (prepare_stos): this.
18184 (output): Always invoke prepare_states, after all, just don't use it
18185 in the output if you don't need it.
18186
181872002-04-07 Akim Demaille <akim@epita.fr>
18188
18189 * src/LR0.c (new_state): Display `nstates' as the name of the
18190 newly created state.
18191 Adjust to initialize first_state and last_state if needed.
18192 Be sure to distinguish the initial from the final state.
18193 (new_states): Create the itemset of the initial state, and use
18194 new_state.
18195 * src/closure.c (closure): Now that the initial state has its
18196 items properly set, there is no need for a special case when
18197 creating `ruleset'.
18198
18199 As a result, now the rule 0, reducing to $axiom, is visible in the
18200 outputs. Adjust the test suite.
18201
18202 * tests/conflicts.at (Solved SR Conflicts)
18203 (Unresolved SR Conflicts): Adjust.
18204 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
18205 * tests/conflicts.at (S/R in initial): New.
18206
182072002-04-07 Akim Demaille <akim@epita.fr>
18208
18209 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
18210 the RHS of the rules.
18211 * src/output.c (output_gram): Likewise.
18212
182132002-04-07 Akim Demaille <akim@epita.fr>
18214
18215 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
18216 bucket.
18217 Adjust all dependencies.
18218 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
18219 `number' of the buckets too.
18220 * src/gram.h: Include `symtab.h'.
18221 (associativity): Move to...
18222 * src/symtab.h: here.
18223 No longer include `gram.h'.
18224
182252002-04-07 Akim Demaille <akim@epita.fr>
18226
18227 * src/gram.h, src/gram.c (rules_rhs_length): New.
18228 (ritem_longest_rhs): Use it.
18229 * src/gram.h (rule_t): `number' is a new member.
18230 * src/reader.c (packgram): Set it.
18231 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
18232 the end of `rules', and count them out of `nrules'.
18233 (reduce_output, dump_grammar): Adjust.
18234 * src/print.c (print_grammar): It is no longer needed to check for
18235 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
18236 * tests/reduce.at (Reduced Automaton): New test.
18237
182382002-04-07 Akim Demaille <akim@epita.fr>
18239
18240 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
18241 lacking `+ 1' to nrules, Bison reported as useless a token if it
18242 was used solely to set the precedence of the last rule...
18243
182442002-04-07 Akim Demaille <akim@epita.fr>
18245
18246 * data/bison.c++, data/bison.simple: Don't output the current file
18247 name in #line, to avoid useless diffs between two identical
18248 outputs under different names.
18249
182502002-04-07 Akim Demaille <akim@epita.fr>
18251
18252 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
18253 Normalize loops to using `< nrules + 1', not `<= nrules'.
18254
182552002-04-07 Akim Demaille <akim@epita.fr>
18256
18257 * TODO: Update.
18258
182592002-04-07 Akim Demaille <akim@epita.fr>
18260
18261 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
18262 bucket.value as bucket.number.
18263
182642002-04-07 Akim Demaille <akim@epita.fr>
18265
18266 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
18267 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18268 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
18269 RHS, instead of being an index in RITEMS.
18270
182712002-04-04 Paul Eggert <eggert@twinsun.com>
18272
18273 * doc/bison.texinfo: Update copyright date.
18274 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18275 (Symbols): Warn about running Bison in one character set,
18276 but compiling and/or running in an incompatible one.
18277 Warn about character code 256, too.
18278
182792002-04-03 Paul Eggert <eggert@twinsun.com>
18280
18281 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18282 YYERROR_VERBOSE is nonzero, not whether it is defined.
18283
18284 Merge changes from bison-1_29-branch.
18285
182862002-03-20 Paul Eggert <eggert@twinsun.com>
18287
18288 Merge fixes from Debian bison_1.34-1.diff.
18289
18290 * configure.in (AC_PREREQ): 2.53.
18291
182922002-03-20 Akim Demaille <akim@epita.fr>
18293
18294 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18295
182962002-03-19 Paul Eggert <eggert@twinsun.com>
18297
18298 * src/bison.simple (YYCOPY): New macro.
18299 (YYSTACK_RELOCATE): Use it.
18300 Remove Type arg; no longer needed. All callers changed.
18301 (yymemcpy): Remove; no longer needed.
18302
18303 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18304 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18305
183062002-03-19 Akim Demaille <akim@epita.fr>
18307
18308 Test and fix the #line outputs.
18309
18310 * tests/atlocal.at (GCC): New.
18311 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
18312 (Prologue synch line, %union synch line, Postprologue synch line)
18313 (Action synch line, Epilogue synch line): New tests.
18314 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18315 * data/bison.simple, data/bison.c++: Use it.
18316
183172002-03-19 Akim Demaille <akim@epita.fr>
18318
18319 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18320 (Solved SR Conflicts, %expect not enough, %expect right)
18321 (%expect too much): Move to...
18322 * tests/conflicts.at: this new file.
18323
183242002-03-19 Akim Demaille <akim@epita.fr>
18325
18326 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18327 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18328 that we can move to enums for instance.
18329 * src/output.c (token_definitions_output): Output a list of
18330 `token-name, token-number' instead of the #define.
18331 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18332
183332002-03-14 Akim Demaille <akim@epita.fr>
18334
18335 Use Gettext 0.11.1.
18336
183372002-03-09 Robert Anisko <robert@lrde.epita.fr>
18338
18339 * data/bison.c++: Make the user able to add members to the generated
18340 parser by subclassing.
18341
183422002-03-05 Robert Anisko <robert@lrde.epita.fr>
18343
18344 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18345 a character.
18346 Reported by Nicolas Tisserand and Nicolas Burrus.
18347
183482002-03-04 Robert Anisko <robert@lrde.epita.fr>
18349
18350 * src/reader.c: Warn about lacking semi-colons, do not complain.
18351
183522002-03-04 Robert Anisko <robert@lrde.epita.fr>
18353
18354 * data/bison.c++: Remove a debug line.
18355
183562002-03-04 Robert Anisko <robert@lrde.epita.fr>
18357
18358 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18359 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18360 provide a default implementation.
18361
183622002-03-04 Akim Demaille <akim@epita.fr>
18363
18364 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18365 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18366 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18367 * tests/semantic.at (Parsing Guards): Similarly.
18368 * src/reader.at (readgram): Complain if the last rule is not ended
18369 with a semi-colon.
18370
183712002-03-04 Akim Demaille <akim@epita.fr>
18372
18373 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18374 * src/closure.c: here.
18375 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18376 RTC.
18377 * src/warshall.h, src/warshall.c: Remove.
18378 * tests/sets.at (Broken Closure): Adjust.
18379
183802002-03-04 Akim Demaille <akim@epita.fr>
18381
18382 * src/output.c (output_skeleton): tempdir is const.
18383 bytes_read is unused.
18384
183852002-03-04 Akim Demaille <akim@epita.fr>
18386
18387 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18388 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18389 Update.
18390 From Michael Hayes.
18391
183922002-03-04 Akim Demaille <akim@epita.fr>
18393
18394 * src/closure.c (closure): `r' is unused.
18395
183962002-03-04 Akim Demaille <akim@epita.fr>
18397
18398 * tests/sets.at (Broken Closure): Add the ending `;'.
18399 * src/reader.at (readgram): Complain if a rule is not ended with a
18400 semi-colon.
18401
184022002-03-04 Akim Demaille <akim@epita.fr>
18403
18404 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18405 (count_sr_conflicts): Use bitset_count.
18406 * src/reduce.c (inaccessable_symbols): Ditto.
18407 (bits_size): Remove.
18408 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18409
184102002-03-04 Akim Demaille <akim@epita.fr>
18411
18412 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18413 * src/reduce.c: Remove the `bitset_zero's following the
18414 `bitset_create's, as now it is performed by the latter.
18415
184162002-03-04 Akim Demaille <akim@epita.fr>
18417
18418 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18419 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18420 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18421 latest sources from Michael.
18422
184232002-03-04 Akim Demaille <akim@epita.fr>
18424
18425 * src/output.c (output): Don't free the grammar.
18426 * src/reader.c (grammar_free): New.
18427 * src/main.c (main): Call it and don't free symtab here.
18428
184292002-03-04 Akim Demaille <akim@epita.fr>
18430
18431 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18432 before returning.
18433 Reported by Benoit Perrot.
18434
184352002-03-04 Akim Demaille <akim@epita.fr>
18436
18437 Use bitset operations when possible, not loops over bits.
18438
18439 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18440 bitset_or.
18441 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18442 * src/reduce.c (useless_nonterminals): Formatting changes.
18443 * src/warshall.c (TC): Use bitset_or.
18444
184452002-03-04 Akim Demaille <akim@epita.fr>
18446
18447 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18448 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18449 Ditto.
18450
184512002-03-04 Akim Demaille <akim@epita.fr>
18452
18453 * src/lalr.c (F): Now a bitset*.
18454 Adjust all dependencies.
18455
184562002-03-04 Akim Demaille <akim@epita.fr>
18457
18458 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18459 Adjust all dependencies.
18460
184612002-03-04 Akim Demaille <akim@epita.fr>
18462
18463 * src/L0.c, src/LR0.h (nstates): Be size_t.
18464 Adjust comparisons (signed vs unsigned).
18465 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18466 bitset*.
18467 Adjust all dependencies.
18468
184692002-03-04 Akim Demaille <akim@epita.fr>
18470
18471 * src/closure.c (firsts): Now, also a bitset.
18472 Adjust all dependencies.
18473 (varsetsize): Remove, now unused.
18474 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18475
184762002-03-04 Akim Demaille <akim@epita.fr>
18477
18478 * src/print.c: Convert to use bitset.h, not hand coded iterations
18479 over ints.
18480
184812002-03-04 Akim Demaille <akim@epita.fr>
18482
18483 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18484
184852002-03-04 Akim Demaille <akim@epita.fr>
18486
18487 * src/closure.c (ruleset): Be a bitset.
18488 (rulesetsize): Remove.
18489
184902002-03-04 Akim Demaille <akim@epita.fr>
18491
18492 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18493 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18494 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18495 * src/closure.c (fderives): Be an array of bitsets.
18496
184972002-02-28 Robert Anisko <robert@lrde.epita.fr>
18498
18499 * data/bison.c++: Merge the two generated headers. Insert a copyright
18500 notice in each output file.
18501
185022002-02-28 Akim Demaille <akim@epita.fr>
18503
18504 * data/bison.c++: Copy the prologue of bison.simple to fetch
18505 useful M4 definitions, such as b4_header_guard.
18506
185072002-02-25 Akim Demaille <akim@epita.fr>
18508
18509 * src/getargs.c (version): Give the name of the authors, and use a
18510 translator friendly scheme for the bgr
18511 copyright notice.
18512
185132002-02-25 Akim Demaille <akim@epita.fr>
18514
18515 * src/output.c (header_output): Remove, now handled completely via
18516 M4.
18517
185182002-02-25 Akim Demaille <akim@epita.fr>
18519
18520 * m4/m4.m4: New, from CVS Autoconf.
18521 * configure.in: Invoke it.
18522 * src/output.c (output_skeleton): Use its result instead of the
18523 hard coded name.
18524
185252002-02-25 Akim Demaille <akim@epita.fr>
18526
18527 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18528 Fileutils 4.1.5.
18529 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18530 * src/output.c (output_skeleton): Use mkstemp to create a real
18531 temporary file.
18532 Move the filling of `skeleton' and its muscle to...
18533 (prepare): here.
18534 (output): Move the definition of the prologue muscle to...
18535 (prepare): here.
18536 * src/system.h (DEFAULT_TMPDIR): New.
18537
185382002-02-14 Paul Eggert <eggert@twinsun.com>
18539
18540 Remove the support for C++ namespace cleanliness; it was
18541 causing more problems than it was curing, since it didn't work
18542 properly on some nonstandard C++ compilers. This can wait
18543 for a proper C++ parser.
18544
18545 * NEWS: Document this.
18546 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18547 of C++, as it's treated like C now.
18548 * src/bison.simple (YYSTD): Remove.
18549 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18550 Treat C++ just like Standard C instead of trying to support
18551 namespace cleanliness.
18552
185532002-02-14 Akim Demaille <akim@epita.fr>
18554
18555 * tests/regression.at (else): Adjust to Andreas' change.
18556
185572002-02-14 Akim Demaille <akim@epita.fr>
18558
18559 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18560
185612002-02-13 Andreas Schwab <schwab@suse.de>
18562
18563 * src/output.c (output_rule_data): Don't output NULL, it might
18564 not be defined yet.
18565
185662002-02-11 Robert Anisko <robert@lrde.epita.fr>
18567
18568 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18569 (Copyright notice): Update.
18570
185712002-02-11 Akim Demaille <akim@epita.fr>
18572
18573 * tests/regression.at (%nonassoc and eof): Don't include
18574 nonportable headers.
18575
185762002-02-08 Robert Anisko <robert@lrde.epita.fr>
18577
18578 * data/bison.c++: Correct error recovery. Make the user able to
18579 initialize the starting location.
18580
185812002-02-07 Akim Demaille <akim@epita.fr>
18582
18583 * tests/input.at: New.
18584
185852002-02-07 Robert Anisko <robert@lrde.epita.fr>
18586
18587 * data/bison.c++: Replace some direct m4 expansions by constants. Be
18588 more consistent when naming methods and variables. Put preprocessor
18589 directives around tables only needed for debugging.
18590
185912002-02-07 Robert Anisko <robert@lrde.epita.fr>
18592
18593 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18594 C++ parsers.
18595 (yy::b4_name::parse): Use print_.
18596
185972002-02-07 Robert Anisko <robert@lrde.epita.fr>
18598
18599 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18600
186012002-02-07 Robert Anisko <robert@lrde.epita.fr>
18602
18603 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18604 C++ parsers.
18605 (yy::b4_name::parse): Build verbose error messages, and use error_.
18606
186072002-02-06 Robert Anisko <robert@lrde.epita.fr>
18608
18609 * data/bison.c++: Fix m4 quoting in comments.
18610
186112002-02-06 Robert Anisko <robert@lrde.epita.fr>
18612
18613 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18614 not expanded by m4.
18615
186162002-02-05 Akim Demaille <akim@epita.fr>
18617
18618 * data/bison.c++: Adjust to the M4 back end.
18619 More is certainly needed.
18620
186212002-02-05 Akim Demaille <akim@epita.fr>
18622
18623 Give a try to M4 as a back end.
18624
18625 * lib/readpipe.c: New, from wdiff.
18626 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18627 BISON_HAIRY.
18628 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18629 specific values. Now it is m4 that performs the lookup.
18630 * src/parse-skel.y: Remove.
18631 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18632 * src/output.c (actions_output, guards_output)
18633 (token_definitions_output): No longer keeps track of the output
18634 line number, hence remove the second argument.
18635 (guards_output): Check against the guard member of a rule, not the
18636 action member.
18637 Adjust callers.
18638 (output_skeleton): Don't look for the skeleton location, let m4 do
18639 that.
18640 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18641 file will be used.
18642 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18643 (prepare): Given that for the time being changesyntax is not
18644 usable in M4, rename the muscles using `-' to `_'.
18645 Define `defines_flag', `output_parser_name' and `output_header_name'.
18646 * src/output.h (actions_output, guards_output)
18647 (token_definitions_output): Adjust prototypes.
18648 * src/scan-skel.l: Instead of scanning the skeletons, it now
18649 processes the output of m4: `__oline__' and `#output'.
18650 * data/bison.simple: Adjust to be used by M4(sugar).
18651 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18652 to date.
18653 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18654 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18655 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18656 shamelessly stolen from CVS Autoconf.
18657
186582002-02-05 Akim Demaille <akim@epita.fr>
18659
18660 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18661 * configure.in: Check for the declarations of free and malloc.
18662 * src/muscle_tab.c: Adjust.
18663
186642002-02-05 Akim Demaille <akim@epita.fr>
18665
18666 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18667 which have no values.
18668
186692002-02-05 Akim Demaille <akim@epita.fr>
18670
18671 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18672 * data/: here.
18673
186742002-01-29 Paul Eggert <eggert@twinsun.com>
18675
18676 * src/bison.simple (YYSIZE_T): Do not define merely because
18677 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18678 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18679
186802002-01-27 Akim Demaille <akim@epita.fr>
18681
18682 Fix `%nonassoc and eof'.
18683
18684 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18685 which were not properly copied! Replace
18686 memcpy (res->errs, src->errs, src->nerrs);
18687 with
18688 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18689 !!!
18690 * tests/regression.at (%nonassoc and eof): Adjust to newest
18691 Autotest: `.' is not in the PATH.
18692
186932002-01-27 Akim Demaille <akim@epita.fr>
18694
18695 * tests/sets.at (AT_EXTRACT_SETS): New.
18696 (Nullable): Use it.
18697 (Firsts): New.
18698
186992002-01-26 Akim Demaille <akim@epita.fr>
18700
18701 * tests/actions.at, tests/calc.at, tests/headers.at,
18702 * tests/torture.at: Adjust to the newest Autotest which no longer
18703 forces `.' in the PATH.
18704
187052002-01-25 Akim Demaille <akim@epita.fr>
18706
18707 * tests/regression.at (%nonassoc and eof): New.
18708 Suggested by Robert Anisko.
18709
187102002-01-24 Akim Demaille <akim@epita.fr>
18711
18712 Bison dumps core when trying to complain about broken input files.
18713 Reported by Cris van Pelt.
18714
18715 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18716 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18717 into...
18718 (Invalid inputs): Strengthen: exercise parse_percent_token.
18719
187202002-01-24 Robert Anisko <robert.anisko@epita.fr>
18721
18722 * src/Makefile.am: Add bison.c++.
18723 * src/bison.c++: New skeleton.
18724
187252002-01-21 Paolo Bonzini <bonzini@gnu.org>
18726
18727 * po/it.po: New.
18728
187292002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18730
18731 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18732
187332002-01-20 Marc Autret <marc@gnu.org>
18734
18735 * src/files.c (compute_output_file_names): Fix
18736
187372002-01-20 Marc Autret <marc@gnu.org>
18738
18739 * tests/output.at: New test.
18740 * src/files.c (compute_base_names): Don't map extensions when
18741 the YACC flag is set, use defaults.
18742 Reported by Evgeny Stambulchik.
18743
187442002-01-20 Marc Autret <marc@gnu.org>
18745
18746 * src/system.h: Need to define __attribute__ away for non-GCC
18747 compilers as well (i.e., the vendor C compiler).
18748 Suggested by Albert Chin-A-Young.
18749
187502002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18751
18752 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18753 canonical definition.
18754 * src/system.h: Use the canonical definition for PARAMS (avoids
18755 a conflict with the macro from lib/hash.h).
18756
187572002-01-11 Akim Demaille <akim@epita.fr>
18758
18759 * configure.in: Use AC_FUNC_STRNLEN.
18760 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
18761
187622002-01-09 Akim Demaille <akim@epita.fr>
18763
18764 * src/files.c, src/files.h (output_infix): New.
18765 (tab_extension): Remove.
18766 (compute_base_names): Compute the former, drop the latter.
18767 * src/output.c (prepare): Insert the muscles `output-infix', and
18768 `output-suffix'.
18769 * src/parse-skel.y (string, string.1): New.
18770 (section.header): Use it.
18771 (section.yacc): Remove.
18772 (prefix): Remove too.
18773 * src/scan-skel.l: Adjust.
18774 * src/bison.simple, src/bison.hairy: Adjust.
18775
187762002-01-09 Akim Demaille <akim@epita.fr>
18777
18778 * configure.in (WERROR_CFLAGS): Compute it.
18779 * src/Makefile.am (CFLAGS): Pass it.
18780 * tests/atlocal.in (CFLAGS): Idem.
18781 * src/files.c: Fix a few warnings.
18782 (get_extension_index): Remove, unused.
18783
187842002-01-08 Akim Demaille <akim@epita.fr>
18785
18786 * src/getargs.c (AS_FILE_NAME): New.
18787 (getargs): Use it to convert DOSish file names.
18788 * src/files.c (base_name): Rename as full_base_name to avoid
18789 clashes with `base_name ()'.
18790 (filename_split): New.
18791 (compute_base_names): N-th rewrite, using filename_split.
18792
187932002-01-08 Akim Demaille <akim@epita.fr>
18794
18795 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18796 New, stolen from the Fileutils 4.1.
18797 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18798 * configure.in: Check for the presence of memrchr, and of its
18799 prototype.
18800
188012002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18802
18803 * lib/hash.h (__P): Added definition for this macro.
18804 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18805 BUILT_SOURCES, to ensure they are generated first.
18806 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18807 %error-verbose to allow bootstrapping with bison 1.30x.
18808
188092002-01-06 Akim Demaille <akim@epita.fr>
18810
18811 * src/reader.c (parse_braces): Don't fetch the next char, the
18812 convention is to fetch on entry.
18813 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18814 'switch' without a following semicolon.
18815 * tests/regression.at (braces parsing): New.
18816
188172002-01-06 Akim Demaille <akim@epita.fr>
18818
18819 Bison is dead wrong in its RR conflict reports.
18820
18821 * tests/torture.at (GNU Cim Grammar): New.
18822 * src/conflicts.c (count_rr_conflicts): Fix.
18823
188242002-01-06 Akim Demaille <akim@epita.fr>
18825
18826 Creating package.m4 from configure.ac causes too many problems.
18827
18828 * tests/Makefile.am (package.m4): Create it by hand,
18829 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18830
188312002-01-06 Akim Demaille <akim@epita.fr>
18832
18833 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18834 skeleton.h.
18835
188362002-01-04 Paul Eggert <eggert@twinsun.com>
18837
18838 * doc/bison.texinfo (Debugging):
18839 Remove YYSTDERR; it's no longer defined or used.
18840 Also, s/cstdio.h/cstdio/.
18841
188422002-01-03 Akim Demaille <akim@epita.fr>
18843
18844 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18845
188462002-01-03 Akim Demaille <akim@epita.fr>
18847
18848 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18849 tracing code to --trace, wait for a better --trace option, with
18850 args.
18851
188522002-01-03 Akim Demaille <akim@epita.fr>
18853
18854 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18855 The ISO C++ standard is extremely clear about it: stderr is
18856 considered a macro, not a regular symbol (see table 94 `Header
18857 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18858 Therefore std:: does not apply to it. It still does with fprintf.
18859 Also, s/cstdio.h/cstdio/.
18860
188612002-01-03 Akim Demaille <akim@epita.fr>
18862
18863 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18864 for non system headers.
18865
188662002-01-02 Akim Demaille <akim@epita.fr>
18867
18868 Equip the skeleton chain with location tracking, runtime trace,
18869 pure parser and scanner.
18870
18871 * src/parse-skel.y: Request a pure parser, locations, and prefix
18872 renaming.
18873 (%union): Having several members with the same type does not help
18874 type mismatches, simplify.
18875 (YYPRINT, yyprint): New.
18876 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18877 (skel_error): this.
18878 Handle locations.
18879 * src/scan-skel.l: Adjust to these changes.
18880 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18881 (LOCATION_PRINT, skel_control_t): New.
18882
188832001-12-30 Akim Demaille <akim@epita.fr>
18884
18885 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18886 replace `gb' with BLANKS.
18887 * src/scan-skel.l: Adjust.
18888
188892001-12-30 Akim Demaille <akim@epita.fr>
18890
18891 * src/system.h: We don't need nor want bcopy.
18892 Throw away MS-DOS crap: we don't need getpid.
18893 * configure.in: We don't need strndup. It was even causing
18894 problems: because Flex includes the headers *before* us,
18895 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18896 not visible.
18897 * lib/xstrndup.c: New.
18898 * src/scan-skel.l: Use it.
18899 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18900 * src/parse-skel.y: Use %directives instead of #defines.
18901
189022001-12-30 Akim Demaille <akim@epita.fr>
18903
18904 * src/skeleton.h: New.
18905 * src/output.c (output_parser, output_master_parser): Remove, dead
18906 code.
18907 * src/output.h (get_lines_number, actions_output, guards_output)
18908 (token_definitions_output): Prototype them.
18909 * src/parse-skel.y: Add the license notice.
18910 Include output.h and skeleton.h.
18911 (process_skeleton): Returns void, and takes a single parameter.
18912 * src/scan-skel.l: Add the license notice.
18913 Include skeleton.h.
18914 Don't use %option yylineno: it seems that then Flex imagines
18915 REJECT has been used, and therefore it won't reallocate its
18916 buffers (which makes no other sense to me than a bug). It results
18917 in warnings for `unused: yy_flex_realloc'.
18918
189192001-12-30 Robert Anisko <robert.anisko@epita.fr>
18920
18921 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18922 (MUSCLE_INSERT_PREFIX): ...to there.
18923 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18924 (MUSCLE_INSERT_PREFIX): Move from here...
18925
18926 * src/bison.hairy: Add a section directive. Put braces around muscle
18927 names. This parser skeleton is still broken, but Bison should not
18928 choke on a bad muscle 'syntax'.
18929 * src/bison.simple: Add a section directive. Put braces around muscle
18930 names.
18931
18932 * src/files.h (strsuffix, stringappend): Add declarations.
18933 (tab_extension): Add declaration.
18934 (short_base_name): Add declaration.
18935
18936 * src/files.c (strsuffix, stringappend): No longer static. These
18937 functions are used in the skeleton parser.
18938 (tab_extension): New.
18939 (compute_base_names): Use the computations done in this function
18940 to guess if the generated parsers should have '.tab' in their
18941 names.
18942 (short_base_name): No longer static.
18943
18944 * src/output.c (output_skeleton): New.
18945 (output): Disable call to output_master_parser, and give a try to
18946 a new skeleton handling system.
18947 (guards_output, actions_output): No longer static.
18948 (token_definitions_output, get_lines_number): No longer static.
18949
18950 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18951
18952 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
18953 parse-skel.y.
18954
18955 * src/parse-skel.y: New file.
18956 * src/scan-skel.l: New file.
18957
189582001-12-29 Akim Demaille <akim@epita.fr>
18959
18960 %name-prefix is broken.
18961
18962 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18963 Adjust all dependencies.
18964 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18965 %name-prefix.
18966
18967 Renaming yylval but not yylloc is not consistent. Now we do.
18968
18969 * src/bison.simple: Prefix yylloc if used.
18970 * doc/bison.texinfo (Decl Summary): Document that.
18971
189722001-12-29 Akim Demaille <akim@epita.fr>
18973
18974 * doc/bison.texinfo: Promote `%long-directive' over
18975 `%long_directive'.
18976 Remove all references to fixed-output-files, yacc is enough.
18977
189782001-12-29 Akim Demaille <akim@epita.fr>
18979
18980 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18981 user prologue. These are defaults.
18982 * tests/actions.at (Mid-rule actions): Make sure the user can
18983 define YYDEBUG and YYERROR_VERBOSE.
18984
189852001-12-29 Akim Demaille <akim@epita.fr>
18986
18987 * src/output.c (header_output): Don't forget to export YYLTYPE and
18988 yylloc.
18989 * tests/headers.at (export YYLTYPE): New, make sure it does.
18990 * tests/regression.at (%union and --defines, Invalid CPP headers):
18991 Move to...
18992 * tests/headers.at: here.
18993
189942001-12-29 Akim Demaille <akim@epita.fr>
18995
18996 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18997
189982001-12-29 Akim Demaille <akim@epita.fr>
18999
19000 * tests/actions.at (Mid-rule actions): Output on a single line
19001 instead of several.
19002
190032001-12-29 Akim Demaille <akim@epita.fr>
19004
19005 * doc/bison.texinfo: Formatting changes.
19006
190072001-12-29 Akim Demaille <akim@epita.fr>
19008
19009 Don't store the token defs in a muscle, just be ready to output it
19010 on command. Now possible via `symbols'. Fixes a memory leak.
19011
19012 * src/output.c (token_definitions_output): New.
19013 (output_parser, header_output): Use it.
19014 * src/reader.c (symbols_save): Remove.
19015
190162001-12-29 Akim Demaille <akim@epita.fr>
19017
19018 * src/bison.simple: Do not provide a default for YYSTYPE and
19019 YYLTYPE before the user's prologue. Otherwise it's hardly... a
19020 default.
19021
190222001-12-29 Akim Demaille <akim@epita.fr>
19023
19024 Mid-rule actions are simply... ignored!
19025
19026 * src/reader.c (readgram): Be sure to attach mid-rule actions to
19027 the empty-rule associated to the dummy symbol, not to the host
19028 rule.
19029 * tests/actions.at (Mid-rule actions): New.
19030
190312001-12-29 Akim Demaille <akim@epita.fr>
19032
19033 Memory leak.
19034
19035 * src/reader.c (reader): Free grammar.
19036
190372001-12-29 Akim Demaille <akim@epita.fr>
19038
19039 Memory leak.
19040
19041 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19042 since it allocates it for each state, although only one is needed.
19043 (allocate_storage): Do it here.
19044
190452001-12-29 Akim Demaille <akim@epita.fr>
19046
19047 * src/options.h, src/options.c (create_long_option_table): Rename
19048 as...
19049 (long_option_table_new): this, with a clearer prototype.
19050 (percent_table): Remove, unused,
19051 * src/getargs.c (getargs): Adjust.
19052
190532001-12-29 Akim Demaille <akim@epita.fr>
19054
19055 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19056 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19057 as states.
19058
190592001-12-29 Akim Demaille <akim@epita.fr>
19060
19061 * src/lalr.c (build_relations): Rename `states' as `states1'.
19062 Sorry, I don't understand exactly what it is, no better name...
19063
190642001-12-29 Akim Demaille <akim@epita.fr>
19065
19066 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19067 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19068 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19069 as rules.
19070
190712001-12-29 Akim Demaille <akim@epita.fr>
19072
19073 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19074 ago.
19075
190762001-12-29 Akim Demaille <akim@epita.fr>
19077
19078 * src/reader.c, src/reader.h (user_toknums): Remove.
19079 Adjust all users to use symbols[i]->user_token_number.
19080
190812001-12-29 Akim Demaille <akim@epita.fr>
19082
19083 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19084 Adjust all users to use symbols[i]->prec or ->assoc.
19085
190862001-12-29 Akim Demaille <akim@epita.fr>
19087
19088 * src/reader.c, src/reader.h (tags): Remove.
19089 Adjust all users to use symbols[i]->tag.
19090
190912001-12-29 Akim Demaille <akim@epita.fr>
19092
19093 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19094 and rule_table.
19095 * src/reader.c (packsymbols): Fill this table.
19096 Drop sprec.
19097 * src/conflicts.c (resolve_sr_conflict): Adjust.
19098 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19099 single table.
19100 Use symbols[i]->tag instead of tags[i].
19101
191022001-12-29 Akim Demaille <akim@epita.fr>
19103
19104 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19105 In addition, put a comment in there, to replace...
19106 * tests/regression.at (%union and C comments): Remove.
19107
191082001-12-29 Akim Demaille <akim@epita.fr>
19109
19110 * tests/regression.at (Web2c Actions): Blindly move the actual
19111 output as expected output. The contents *seem* right to me, but I
19112 can't pretend reading perfectly parser tables... Nonetheless, all
19113 the other tests pass correctly, the table look OK, even though the
19114 presence of `$axiom' is to be noted: AFAICS it is useless (but
19115 harmless).
19116
191172001-12-29 Akim Demaille <akim@epita.fr>
19118
19119 * src/reader.c (readgram): Don't add the rule 0 if there were no
19120 rules read. In other words, add it _after_ having performed
19121 grammar sanity checks.
19122 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
19123
191242001-12-29 Akim Demaille <akim@epita.fr>
19125
19126 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
19127 visible, and some states have now a different number.
19128
191292001-12-29 Akim Demaille <akim@epita.fr>
19130
19131 * src/reader.c (readgram): Bind the initial rule's lineno to that
19132 of the first rule.
19133 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
19134 (Solved SR Conflicts): Adjust rule 0's line number.
19135
191362001-12-29 Akim Demaille <akim@epita.fr>
19137
19138 Fix the `GAWK Grammar' failure.
19139
19140 * src/LR0.c (final_state): Initialize to -1 so that we do compute
19141 the reductions of the first state which was mistakenly confused
19142 with the final state because precisely final_state was initialized
19143 to 0.
19144 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
19145 now noticed by Bison.
19146 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
19147 have a reduction on $default.
19148
191492001-12-29 Akim Demaille <akim@epita.fr>
19150
19151 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
19152 rule line numbers.
19153 * src/closure.c (print_closure): Likewise.
19154 * src/derives.c (print_derives): Likewise.
19155 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
19156 now.
19157
191582001-12-29 Akim Demaille <akim@epita.fr>
19159
19160 * src/lalr.c (lookaheads_print): New.
19161 (lalr): Call it when --trace-flag.
19162 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
19163 are dumped.
19164
191652001-12-29 Akim Demaille <akim@epita.fr>
19166
19167 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
19168 when walking through ritem, even via rule->rhs.
19169 * src/reduce.c (dump_grammar, useful_production, reduce_output)
19170 (useful_production, useless_nonterminals): Likewise.
19171 (reduce_grammar_tables): Likewise, plus update nritems.
19172 * src/nullable.c (set_nullable): Likewise.
19173 * src/lalr.c (build_relations): Likewise.
19174 * tests/sets.at (Nullable): Adjust.
19175 Fortunately, now, the $axiom is no longer nullable.
19176
191772001-12-29 Akim Demaille <akim@epita.fr>
19178
19179 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
19180 the 0-sentinel.
19181 * src/gram.c (ritem_longest_rhs): Likewise.
19182 * src/reduce.c (nonterminals_reduce): Likewise.
19183 * src/print_graph.c (print_graph): Likewise.
19184 * src/output.c (output_rule_data): Likewise.
19185 * src/nullable.c (set_nullable): Likewise.
19186
191872001-12-29 Akim Demaille <akim@epita.fr>
19188
19189 * src/output.c: Comment changes.
19190
191912001-12-27 Paul Eggert <eggert@twinsun.com>
19192
19193 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
19194 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
19195 Sparc, as they were causing more porting problems than the
19196 (minor) performance improvement was worth.
19197
19198 Also, catch up with 1.31's YYSTD.
19199
192002001-12-27 Akim Demaille <akim@epita.fr>
19201
19202 * src/output.c (output_gram): Rely on nritems, not the
19203 0-sentinel. See below.
19204 Use -1 as separator, not 0.
19205 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
19206 Rely on -1 as separator in yyrhs, instead of 0.
19207 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
19208 twice `Now at end of input', therefore there are two lines less to
19209 expect.
19210
192112001-12-27 Akim Demaille <akim@epita.fr>
19212
19213 * tests/regression.at (Unresolved SR Conflicts):
19214 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
19215 below.
19216
192172001-12-27 Akim Demaille <akim@epita.fr>
19218
19219 * src/LR0.c (new_state): Recognize the final state by the fact it
19220 is reached by eoftoken.
19221 (insert_start_shifting_state, insert_eof_shifting_state)
19222 (insert_accepting_state, augment_automaton): Remove, since now
19223 these states are automatically computed from the initial state.
19224 (generate_states): Adjust.
19225 * src/print.c: When reporting a rule number to the user, substract
19226 1, so that the axiom rule is rule 0, and the first user rule is 1.
19227 * src/reduce.c: Likewise.
19228 * src/print_graph.c (print_core): For the time being, just as for
19229 the report, depend upon --trace-flags to dump the full set of
19230 items.
19231 * src/reader.c (readgram): Once the grammar read, insert the rule
19232 0: `$axiom: START-SYMBOL $'.
19233 * tests/set.at: Adjust: rule 0 is now displayed, and since the
19234 number of the states has changed (the final state is no longer
19235 necessarily the last), catch up.
19236
192372001-12-27 Akim Demaille <akim@epita.fr>
19238
19239 Try to make the use of the eoftoken valid. Given that its value
19240 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
19241 is used instead of > 0 where appropriate, (ii), depend upon nritems
19242 instead of the 0-sentinel.
19243
19244 * src/gram.h, src/gram.c (nritems): New.
19245 Expected to be duplication of nitems, but for the time being...
19246 * src/reader.c (packgram): Assert nritems and nitems are equal.
19247 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
19248 * src/closure.c (print_closure, print_fderives): Likewise.
19249 * src/gram.c (ritem_print): Likewise.
19250 * src/print.c (print_core, print_grammar): Likewise.
19251 * src/print_graph.c: Likewise.
19252
192532001-12-27 Akim Demaille <akim@epita.fr>
19254
19255 * src/main.c (main): If there are complains after grammar
19256 reductions, then output the report anyway if requested, then die.
19257 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
19258 * src/reader.c (eoftoken): New.
19259 (parse_token_decl): If the token being defined has value `0', it
19260 is the eoftoken.
19261 (packsymbols): No longer hack `tags' to insert `$' by hand.
19262 Be sure to preserve the value of the eoftoken.
19263 (reader): Make sure eoftoken is defined.
19264 Initialize nsyms to 0: now eoftoken is created just like the others.
19265 * src/print.c (print_grammar): Don't special case the eof token.
19266 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
19267 lie anyway, albeit pleasant.
19268 * tests/calc.at: Exercise error messages with eoftoken.
19269 Change the grammar so that empty input is invalid.
19270 Adjust expectations.
19271 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19272
192732001-12-27 Akim Demaille <akim@epita.fr>
19274
19275 * configure.in: Check the protos of strchr ans strspn.
19276 Replace strchr if needed.
19277 * src/system.h: Provide the protos of strchr, strspn and memchr if
19278 missing.
19279 * lib/strchr.c: New.
19280 * src/reader.c (symbols_save): Use strchr.
19281
192822001-12-27 Akim Demaille <akim@epita.fr>
19283
19284 * src/print.c, src/print_graph.c (escape): New.
19285 Use it to quote the TAGS outputs.
19286 * src/print_graph.c (print_state): Now errors are in red, and
19287 reductions in green.
19288 Prefer high to wide: output the state number on a line of its own.
19289
192902001-12-27 Akim Demaille <akim@epita.fr>
19291
19292 * src/state.h, src/state.c (reductions_new): New.
19293 * src/LR0.c (set_state_table): Let all the states have a
19294 `reductions', even if reduced to 0.
19295 (save_reductions): Adjust.
19296 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19297 * src/print.c (print_reductions, print_actions): Adjust.
19298 * src/output.c (action_row): Adjust.
19299
193002001-12-27 Akim Demaille <akim@epita.fr>
19301
19302 * src/state.h, src/state.c (errs_new, errs_dup): New.
19303 * src/LR0.c (set_state_table): Let all the states have an errs,
19304 even if reduced to 0.
19305 * src/print.c (print_errs, print_reductions): Adjust.
19306 * src/output.c (output_actions, action_row): Adjust.
19307 * src/conflicts.c (resolve_sr_conflict): Adjust.
19308
193092001-12-27 Akim Demaille <akim@epita.fr>
19310
19311 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19312
193132001-12-27 Akim Demaille <akim@epita.fr>
19314
19315 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19316 * src/print.c: here.
19317 (lookaheadset, shiftset): New, used as additional storage by
19318 print_reductions.
19319 (print_results): Adjust.
19320 (print_shifts, print_gotos, print_errs): New, extracted from...
19321 (print_actions): here.
19322 * src/print_graph.c (print_actions): Remove dead code.
19323
193242001-12-27 Akim Demaille <akim@epita.fr>
19325
19326 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19327 `$n' and `@n'.
19328
193292001-12-27 Akim Demaille <akim@epita.fr>
19330
19331 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19332 (build_relations): Adjust.
19333
193342001-12-27 Akim Demaille <akim@epita.fr>
19335
19336 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19337 duplication.
19338
193392001-12-27 Akim Demaille <akim@epita.fr>
19340
19341 * src/reader.c (packgram): Catch nitems overflows.
19342
193432001-12-27 Akim Demaille <akim@epita.fr>
19344
19345 * src/files.c, src/files.h (guard_obstack): Remove.
19346 * src/output.c (output): Adjust.
19347 * src/reader.c (parse_braces): New, factoring...
19348 (copy_action, copy_guard): these two which are renamed as...
19349 (parse_action, parse_guard): these.
19350 As a voluntary consequence, using braces around guards is now
19351 mandatory.
19352
193532001-12-27 Akim Demaille <akim@epita.fr>
19354
19355 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19356 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19357 members.
19358 (symbol_list_new): Adjust.
19359 (copy_action): action_line is the first line, not the last.
19360 (copy_guard): Just as for actions, store the `action' only, not
19361 the switch/case/break flesh.
19362 Don't parse the user action that might follow the guard, let...
19363 (readgram): do it, i.e., now, there can be an action after a
19364 guard.
19365 In other words the guard is just explicitly optional.
19366 (packgram): Adjust.
19367 * src/output.c (guards_output): New.
19368 (output_parser): Call it when needed.
19369 (output): Also free the guard and attrs obstacks.
19370 * src/files.c, src/files.h (obstack_save): Remove.
19371 (output_files): Remove.
19372 As a result, if one needs the former `.act' file, using an
19373 appropriate skeleton which requires actions and guards is now
19374 required.
19375 * src/main.c (main): Adjust.
19376 * tests/semantic.at: New.
19377 * tests/regression.at: Use `input.y' as input file name.
19378 Avoid 8+3 problems by requiring input.c when the test needs the
19379 parser.
19380
193812001-12-27 Akim Demaille <akim@epita.fr>
19382
19383 * src/reader.c (symbol_list_new): Be sure to initialize all the
19384 fields.
19385
193862001-12-27 Akim Demaille <akim@epita.fr>
19387
19388 All the hacks using a final pseudo state are now useless.
19389
19390 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19391 * src/lalr.c (nLA): New.
19392 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19393 instead of lookaheadsp from the pseudo state (nstate + 1).
19394
193952001-12-27 Akim Demaille <akim@epita.fr>
19396
19397 * src/output.c (action_row, token_actions): Use a state_t instead
19398 of a integer, and nlookaheads instead of the following state's
19399 lookaheadsp.
19400
194012001-12-27 Akim Demaille <akim@epita.fr>
19402
19403 * src/conflicts.c (log_resolution, flush_shift)
19404 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19405 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19406 (conflicts_print, print_reductions): Use a state_t instead of an
19407 integer when referring to a state.
19408 As much as possible, depend upon nlookaheads, instead of the
19409 `lookaheadsp' member of the following state (since lookaheads of
19410 successive states are successive, the difference between state n + 1
19411 and n served as the number of lookaheads for state n).
19412 * src/lalr.c (add_lookback_edge): Likewise.
19413 * src/print.c (print_core, print_actions, print_state)
19414 (print_results): Likewise.
19415 * src/print_graph.c (print_core, print_actions, print_state)
19416 (print_graph): Likewise.
19417 * src/conflicts.h: Adjust.
19418
194192001-12-27 Akim Demaille <akim@epita.fr>
19420
19421 * src/bison.hairy: Formatting/comment changes.
19422 ANSIfy.
19423 Remove `register' indications.
19424 Add plenty of `static'.
19425
194262001-12-27 Akim Demaille <akim@epita.fr>
19427
19428 * src/output.c (prepare): Drop the muscle `ntbase' which
19429 duplicates ntokens.
19430 * src/bison.simple: Formatting/comment changes.
19431 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19432 is an undocumented synonym.
19433
194342001-12-22 Akim Demaille <akim@epita.fr>
19435
19436 * src/output.c (output_table_data): Change the prototype to use
19437 `int' for array ranges: some invocations do pass an int, not a
19438 short.
19439 Reported by Wayne Green.
19440
194412001-12-22 Akim Demaille <akim@epita.fr>
19442
19443 Some actions of web2c.y are improperly triggered.
19444 Reported by Mike Castle.
19445
19446 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19447 * tests/regression.at (Web2c): Rename as...
19448 (Web2c Report): this.
19449 (Web2c Actions): New.
19450
194512001-12-22 Akim Demaille <akim@epita.fr>
19452
19453 Reductions in web2c.y are improperly reported.
19454 Reported by Mike Castle.
19455
19456 * src/conflicts.c (print_reductions): Fix.
19457 * tests/regression.at (Web2c): New.
19458
194592001-12-18 Akim Demaille <akim@epita.fr>
19460
19461 Some host fail on `assert (!"foo")', which expands to
19462 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19463 Reported by Nelson Beebee.
19464
19465 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19466 `#define it_succeeded 0' and `assert (it_succeeded)'.
19467
194682001-12-17 Marc Autret <autret_m@epita.fr>
19469
19470 * src/bison.simple: Don't hard code the skeleton line and filename.
19471 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19472 New line counter 'skeleton_line' (skeleton-line muscle).
19473
194742001-12-17 Paul Eggert <eggert@twinsun.com>
19475
19476 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19477 YYDEBUG must be defined to a nonzero value.
19478
19479 * src/bison.simple (yytname): Do not assume that the user defines
19480 YYDEBUG to a properly parenthesized expression.
19481
194822001-12-17 Akim Demaille <akim@epita.fr>
19483
19484 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19485 nlookaheads is a new member.
19486 Adjust all users.
19487 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19488 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19489 state.
19490
194912001-12-17 Akim Demaille <akim@epita.fr>
19492
19493 * src/files.h, src/files.c (open_files, close_files): Remove.
19494 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19495 let...
19496 * src/reader.c (reader): Do it.
19497
194982001-12-17 Akim Demaille <akim@epita.fr>
19499
19500 * src/conflicts.c (print_reductions): Formatting changes.
19501
195022001-12-17 Akim Demaille <akim@epita.fr>
19503
19504 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19505 (flush_reduce): New.
19506 (resolve_sr_conflict): Adjust.
19507
195082001-12-17 Akim Demaille <akim@epita.fr>
19509
19510 * src/output.c (output_obstack): Be static and rename as...
19511 (format_obstack): this, to avoid any confusion with files.c's
19512 output_obstack.
19513 * src/reader.h (muscle_obstack): Move to...
19514 * src/output.h: here, since it's defined in output.c.
19515
195162001-12-17 Akim Demaille <akim@epita.fr>
19517
19518 * src/output.c (action_row, save_column, default_goto)
19519 (sort_actions, matching_state, pack_vector): Better variable
19520 locality.
19521
195222001-12-17 Akim Demaille <akim@epita.fr>
19523
19524 * src/output.c: Various formatting changes.
19525
195262001-12-17 Akim Demaille <akim@epita.fr>
19527
19528 * src/files.c (output_files): Free the output_obstack.
19529 * src/main.c (main): Call print and print_graph conditionally.
19530 * src/print.c (print): Work unconditionally.
19531 * src/print_graph.c (print_graph): Work unconditionally.
19532 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19533
195342001-12-16 Marc Autret <autret_m@epita.fr>
19535
19536 * src/output.c (actions_output): Fix. When we use %no-lines,
19537 there is one less line per action.
19538
195392001-12-16 Marc Autret <autret_m@epita.fr>
19540
19541 * src/bison.simple: Remove a useless #line directive.
19542 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19543 * src/output.c (get_lines_number): New.
19544 (output_parser): Adjust, now takes care about the lines of a
19545 output muscles.
19546 Fix line numbering.
19547 (actions_output): Computes the number of lines taken by actions.
19548 (output_master_parser): Insert new skeleton which is the name of
19549 the output parser file name.
19550
195512001-12-15 Marc Autret <autret_m@epita.fr>
19552
19553 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19554
195552001-12-15 Marc Autret <autret_m@epita.fr>
19556
19557 * src/output.c (output_gram): Keep track of the hairy one.
19558
195592001-12-15 Akim Demaille <akim@epita.fr>
19560
19561 Make `make distcheck' work.
19562
19563 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19564 system.h which uses libgettext.h.
19565
195662001-12-15 Akim Demaille <akim@epita.fr>
19567
19568 * src/nullable.c (set_nullable): Useless rules must be skipped,
19569 otherwise, since we range over their symbols, we might look at a
19570 nonterminal which no longer ``exists'', i.e., it is not counted in
19571 `nvars', hence we overflow our arrays.
19572
195732001-12-15 Akim Demaille <akim@epita.fr>
19574
19575 The header can also be produced directly, without any obstack!
19576 Yahoo!
19577
19578 * src/files.c, src/files.h (defines_obstack): Remove.
19579 (compute_header_macro): Global.
19580 (defines_obstack_save): Remove.
19581 * src/reader.c (parse_union_decl): No longer output to
19582 defines_obstack: its content can be found in the `stype' muscle
19583 anyway.
19584 (output_token_translations): Merge into...
19585 (symbols_output): this.
19586 Rename as...
19587 (symbols_save): this.
19588 (reader): Adjust.
19589 * src/output.c (header_output): New.
19590 (output): Call it.
19591
195922001-12-15 Akim Demaille <akim@epita.fr>
19593
19594 * src/reader.c (parse_union_decl): Instead of handling two obstack
19595 simultaneously, use one to define the `stype' muscle, and use the
19596 value of the latter to fill defines_obstack.
19597 (copy_comment): Remove.
19598 (copy_comment2): Work for a single obstack.
19599 Rename as...
19600 (copy_comment): this.
19601
196022001-12-15 Akim Demaille <akim@epita.fr>
19603
19604 * src/lex.c, src/lex.h (xgetc): No longer static.
19605 * src/reader.c (parse_union_decl): Revamp.
19606
196072001-12-15 Akim Demaille <akim@epita.fr>
19608
19609 Still making progress in separating Bison into (i) input, (ii)
19610 process, (iii) output: now we can directly output the parser file
19611 without using table_obstack at all.
19612
19613 * src/files.c, src/files.h (table_obstack): Bye bye.
19614 (parser_file_name): New.
19615 * src/files.c (compute_output_file_names): Compute it.
19616 * src/output.c (actions_output, output_parser)
19617 (output_master_parser): To a file instead of an obstack.
19618
196192001-12-15 Akim Demaille <akim@epita.fr>
19620
19621 Attach actions to rules, instead of pre-outputting them to
19622 actions_obstack.
19623
19624 * src/gram.h (rule_t): action and action_line are new members.
19625 * src/reader.c (symbol_list): Likewise.
19626 (copy_action): Save the actions within the rule.
19627 (packgram): Save them in rule_table.
19628 * src/output.c (actions_output): New.
19629 (output_parser): Use it on `%%actions'.
19630 (output_rule_data): Don't free rule_table.
19631 (output): Do it.
19632 (prepare): Don't save the `action' muscle.
19633 * src/bison.simple: s/%%action/%%actions/.
19634
196352001-12-15 Akim Demaille <akim@epita.fr>
19636
19637 * src/reader.c (copy_action): When --yacc, don't append a `;'
19638 to the user action: let it fail if lacking.
19639 Suggested by Arnold Robbins and Tom Tromey.
19640
196412001-12-14 Akim Demaille <akim@epita.fr>
19642
19643 * src/lex.c (literalchar): Simply return the char you decoded, non
19644 longer mess around with obstacks and int pointers.
19645 Adjust all callers.
19646
196472001-12-14 Akim Demaille <akim@epita.fr>
19648
19649 * src/lex.c (literalchar): Don't escape the special characters,
19650 just decode them, and keep them as char (before, eol was output as
19651 the 2 char string `\n' etc.).
19652 * src/output.c (output_rule_data): Use quotearg to output the
19653 token strings.
19654
196552001-12-13 Paul Eggert <eggert@twinsun.com>
19656
19657 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19658 Do not infringe on the global user namespace when using C++.
19659 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19660 All uses of `fprintf' and `stderr' changed.
19661
19662 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19663
196642001-12-13 Akim Demaille <akim@epita.fr>
19665
19666 The computation of nullable is broken: it doesn't handle empty
19667 RHS's properly.
19668
19669 * tests/torture.at (GNU AWK Grammar): New.
19670 * tests/sets.at (Nullable): New.
19671 * src/nullable.c (set_nullable): Instead of blindly looping over
19672 `ritems', loop over the rules, and then over their rhs's.
19673
19674 Work around Autotest bugs.
19675
19676 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19677 frame, because Autotest understand lines starting with a `+' as
19678 traces from the shell. Then, they are not processed properly.
19679 Admittedly an Autotest bug, but we don't have time to wait for
19680 Autotest to catch up.
19681 * tests/regression.at (Broken Closure): Adjust to the new table
19682 frames.
19683 Move to...
19684 * tests/sets.at: here.
19685
196862001-12-13 Akim Demaille <akim@epita.fr>
19687
19688 * src/closure.c (closure): Use nrules instead of playing tricks
19689 with BITS_PER_WORD.
19690
196912001-12-13 Akim Demaille <akim@epita.fr>
19692
19693 * src/print.c (print_actions): Output the handling of `$' as the
19694 traces do: shifting the token EOF. Before EOF was treated as a
19695 nonterminal.
19696 * tests/regression.at: Adjust some tests.
19697 * src/print_graph.c (print_core): Complete the set of items via
19698 closure. The next-to-final and final states are still unsatisfying,
19699 but that's to be addressed elsewhere.
19700 No longer output the rule numbers, but do output the state number.
19701 A single loop for the shifts + gotos is enough, but picked a
19702 distinct color for each.
19703 (print_graph): Initialize and finalize closure.
19704
197052001-12-13 Akim Demaille <akim@epita.fr>
19706
19707 * src/reader.c (readgram): Remove dead code, an strip useless
19708 braces.
19709 (get_type): Remove, unused.
19710
197112001-12-12 Akim Demaille <akim@epita.fr>
19712
19713 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19714 on that of lib/error.c.
19715
197162001-12-12 Akim Demaille <akim@epita.fr>
19717
19718 Some hosts don't like `/' in includes.
19719
19720 * src/system.h: Include libgettext.h without qualifying the path.
19721 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19722 $(top_srcdir).
19723
197242001-12-11 Marc Autret <autret_m@epita.fr>
19725
19726 * src/output.c (output_parser): Remove useless muscle.
19727
197282001-12-11 Marc Autret <autret_m@epita.fr>
19729
19730 * src/bison.simple: Remove #line just before %%epilogue. It
19731 is now handled in ...
19732 * src/reader.c (read_additionnal_code): Add the output of a
19733 #line for the epilogue.
19734
197352001-12-10 Marc Autret <autret_m@epita.fr>
19736
19737 * src/reader.c (copy_definition): Re-use CPP-outed code which
19738 replace precedent remove.
19739 * src/bison.simple: Remove #line before %%prologue because
19740 %%input-line is wrong at this time.
19741
197422001-12-10 Marc Autret <autret_m@epita.fr>
19743
19744 * src/reader.c (symbols_output): Clean up.
19745 * src/output.c (output_gram, output): Clean up.
19746
197472001-12-10 Akim Demaille <akim@epita.fr>
19748
19749 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19750 * src/LR0.c (set_state_table): here.
19751 * src/lalr.c (lalr): Call it.
19752
197532001-12-10 Akim Demaille <akim@epita.fr>
19754
19755 * src/state.h (shifts): Remove the `number' member: shifts are
19756 attached to state, hence no longer need to be labelled with a
19757 state number.
19758
197592001-12-10 Akim Demaille <akim@epita.fr>
19760
19761 Now that states have a complete set of members, the linked list of
19762 shifts is useless: just fill directly the state's shifts member.
19763
19764 * src/state.h (shifts): Remove the `next' member.
19765 * src/LR0.c (first_state, last_state): Remove.
19766 Adjust the callers.
19767 (augment_automaton): Don't look for the shifts that must be added
19768 a shift on EOF: it is those of the state we looked for! But now,
19769 since shifts are attached, it is no longer needed to looking
19770 merely by its id: its number.
19771
197722001-12-10 Akim Demaille <akim@epita.fr>
19773
19774 * src/LR0.c (augment_automaton): Better variable locality.
19775 Remove an impossible branch: if there is a state corresponding to
19776 the start symbol being shifted, then there is shift for the start
19777 symbol from the initial state.
19778
197792001-12-10 Akim Demaille <akim@epita.fr>
19780
19781 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19782 only when appropriate: when insert_start_shifting_state' is not
19783 invoked.
19784 * tests/regression.at (Rule Line Numbers): Adjust.
19785
197862001-12-10 Akim Demaille <akim@epita.fr>
19787
19788 * src/LR0.c (augment_automaton): Now that all states have shifts,
19789 merge the two cases addition shifts to the initial state.
19790
197912001-12-10 Akim Demaille <akim@epita.fr>
19792
19793 * src/lalr.c (set_state_table): Move to...
19794 * src/LR0.c: here.
19795 * src/lalr.c (lalr): Don't call it...
19796 * src/LR0.c (generate_states): do it.
19797 * src/LR0.h (first_state): Remove, only the table is used.
19798
197992001-12-10 Akim Demaille <akim@epita.fr>
19800
19801 * src/LR0.h (first_shift, first_reduction): Remove.
19802 * src/lalr.c: Don't use first_shift: find shifts through the
19803 states.
19804
198052001-12-10 Akim Demaille <akim@epita.fr>
19806
19807 * src/LR0.c: Attach shifts to states as soon as they are
19808 computed.
19809 * src/lalr.c (set_state_table): Instead of assigning shifts to
19810 state, just assert that the mapping was properly done.
19811
198122001-12-10 Akim Demaille <akim@epita.fr>
19813
19814 * src/LR0.c (insert_start_shift): Rename as...
19815 (insert_start_shifting_state): this.
19816 (insert_eof_shifting_state, insert_accepting_state): New.
19817 (augment_automaton): Adjust.
19818 Better locality of the variables.
19819 When looking if the start_symbol is shifted from the initial
19820 state, using `while (... symbol != start_symbol ...)' sounds
19821 better than `while (... symbol < start_symbol ...)': If fail
19822 to see how the order between symbols could be relevant!
19823
198242001-12-10 Akim Demaille <akim@epita.fr>
19825
19826 * src/getargs.h: Don't declare `spec_name_prefix' and
19827 `spec_file_prefix', declared by src/files.h.
19828 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19829 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19830 * src/output.c (prepare): Adjust.
19831 * src/reader.c (symbols_output): Likewise.
19832 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19833
198342001-12-10 Akim Demaille <akim@epita.fr>
19835
19836 * src/muscle_tab.c (muscle_init): NULL is a better default than
19837 `"0"'.
19838
198392001-12-10 Akim Demaille <akim@epita.fr>
19840
19841 * src/reader.c (reader): Calling symbols_output once is enough.
19842
198432001-12-10 Akim Demaille <akim@epita.fr>
19844
19845 Now that states have a complete set of members, the linked list of
19846 reductions is useless: just fill directly the state's reductions
19847 member.
19848
19849 * src/state.h (struct reductions): Remove member `number' and
19850 `next'.
19851 * src/LR0.c (first_reduction, last_reduction): Remove.
19852 (save_reductions): Don't link the new reductions, store them in
19853 this_state.
19854 * src/lalr.c (set_state_table): No need to attach reductions to
19855 states, it's already done.
19856 * src/output.c (output_actions): No longer free the shifts, then
19857 the reductions, then the states: free all the states and their
19858 members.
19859
198602001-12-10 Akim Demaille <akim@epita.fr>
19861
19862 * src/options.c (OPTN, DRTV, BOTH): New.
19863 (option_table): Use them.
19864
19865 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19866 the job of system.h.
19867 * src/options.c: Don't include stdio.h and xalloc.h for the same
19868 reasons.
19869
198702001-12-10 Akim Demaille <akim@epita.fr>
19871
19872 * src/output.c (output, prepare): Make sure the values of the
19873 muscles `action' and `prologue' are 0-terminated.
19874
198752001-12-10 Akim Demaille <akim@epita.fr>
19876
19877 Clean up GCC warnings.
19878
19879 * src/reader.c (copy_action): `buf' is not used.
19880 (parse_skel_decl): Be static.
19881 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19882 * src/options.h (create_long_option_table): Have a real prototype.
19883 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19884 (hash_delete_at): Return const void *.
19885 Adjust casts to preserve the const.
19886
198872001-12-10 Akim Demaille <akim@epita.fr>
19888
19889 * configure.in: Require 2.52g.
19890 M4 is not needed, but AUTOM4TE is.
19891 * m4/m4.m4: Remove.
19892 * tests/Makefile.am: Adjust.
19893
198942001-12-10 Akim Demaille <akim@epita.fr>
19895
19896 One structure for states is enough, even though theoretically
19897 there are LR(0) states and LALR(1) states.
19898
19899 * src/lalr.h (state_t): Remove.
19900 (state_table): Be state_t **, not state_t *.
19901 * src/state.h (core, CORE_ALLOC): Rename as...
19902 (state_t, STATE_ALLOC): this.
19903 Add the LALR(1) members: shifts, reductions, errs.
19904 * src/LR0.c (state_table): Rename as...
19905 (state_hash): this, to avoid name clashes with the global
19906 `state_table'.
19907 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19908 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19909
199102001-12-10 Akim Demaille <akim@epita.fr>
19911
19912 Bison dumps core on bash.y.
19913 Reported by Pascal Bart.
19914
19915 * src/warshall.c (bitmatrix_print): New.
19916 (TC): Use it.
19917 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
19918 j must be the outer loop.
19919 * tests/regression.at (Broken Closure): New.
19920
199212001-12-05 Akim Demaille <akim@epita.fr>
19922
19923 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19924 its argument.
19925 Reported by Peter Hamorsky.
19926
199272001-12-05 Akim Demaille <akim@epita.fr>
19928
19929 * src/conflicts.c (err_table): Remove.
19930 (resolve_sr_conflict): Adjust.
19931 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19932 Rename as...
19933 (state_t.reductions, state_t.shifts): this.
19934
199352001-12-05 Akim Demaille <akim@epita.fr>
19936
19937 * src/reduce.c (reduce_grammar_tables): No longer disable the
19938 removal of useless rules via CPP but via `if (0)', so that the
19939 compiler still check the code is valid.
19940 For instance, it should have noticed `rline' no longer exists: use
19941 the `line' member of rule_t.
19942 * src/gram.c (dummy, rline): Remove, unused.
19943
199442001-12-05 Akim Demaille <akim@epita.fr>
19945
19946 * src/output.c (pack_vector): Use assert, not berror.
19947 * src/main.c (berror): Remove, unused.
19948
199492001-12-05 Akim Demaille <akim@epita.fr>
19950
19951 New experimental feature: if --verbose --trace output all the
19952 items of a state, not only its kernel.
19953
19954 * src/print.c (print_core): If `trace_flag', then invoke closure
19955 before outputting the items of the state (print_core is no longer
19956 a correct name them).
19957 (print_results): Invoke new_closure/free_closure if needed.
19958
199592001-12-05 Akim Demaille <akim@epita.fr>
19960
19961 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19962 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19963 (nitemset): for consistency with the rest of the project.
19964
199652001-12-05 Akim Demaille <akim@epita.fr>
19966
19967 * src/closure.c (print_closure): Improve.
19968 (closure): Use it for printing input and output.
19969
199702001-12-05 Akim Demaille <akim@epita.fr>
19971
19972 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19973 indexed by nonterminals.
19974
199752001-12-05 Akim Demaille <akim@epita.fr>
19976
19977 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19978 what it was!).
19979 * src/warshall.h: Remove accidental duplication of the content.
19980
199812001-12-05 Akim Demaille <akim@epita.fr>
19982
19983 * src/closure.c (set_fderives): De-obfuscate.
19984
199852001-12-05 Akim Demaille <akim@epita.fr>
19986
19987 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19988
199892001-12-05 Akim Demaille <akim@epita.fr>
19990
19991 * src/closure.c (set_firsts): De-obfuscate.
19992
199932001-12-05 Akim Demaille <akim@epita.fr>
19994
19995 * src/output.c (action_row): De-obfuscate
19996 using the good o' techniques: arrays not pointers, variable
19997 locality, BITISSET, RESETBIT etc.
19998
199992001-12-05 Akim Demaille <akim@epita.fr>
20000
20001 Pessimize the code to simplify it: from now on, all the states
20002 have a valid SHIFTS, which NSHIFTS is possibly 0.
20003
20004 * src/LR0.c (shifts_new): Be global and move to..
20005 * src/state.c, src/state.h: here.
20006 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
20007 * src/print_graph: Adjust.
20008
200092001-12-05 Akim Demaille <akim@epita.fr>
20010
20011 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
20012 * src/conflicts.c: Use it.
20013 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
20014 incorrectly ``simplified''.
20015
200162001-12-05 Akim Demaille <akim@epita.fr>
20017
20018 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
20019 using the good o' techniques: arrays not pointers, variable
20020 locality, BITISSET, RESETBIT etc.
20021
200222001-12-05 Akim Demaille <akim@epita.fr>
20023
20024 * src/state.h (SHIFT_SYMBOL): New.
20025 * src/conflicts.c: Use it to deobfuscate.
20026
200272001-12-05 Akim Demaille <akim@epita.fr>
20028
20029 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
20030 (print_reductions): De-obfuscate using the good o' techniques:
20031 arrays not pointers, variable locality, BITISSET.
20032
200332001-12-05 Akim Demaille <akim@epita.fr>
20034
20035 * src/conflicts.c (print_reductions): Arrays, not pointers.
20036 Use BITISSET.
20037
200382001-12-05 Akim Demaille <akim@epita.fr>
20039
20040 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20041
200422001-12-05 Akim Demaille <akim@epita.fr>
20043
20044 * src/conflicts.c (print_reductions): Improve variable locality.
20045
200462001-12-05 Akim Demaille <akim@epita.fr>
20047
20048 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20049
200502001-12-05 Akim Demaille <akim@epita.fr>
20051
20052 * src/conflicts.c (print_reductions): Improve variable locality.
20053
200542001-12-05 Akim Demaille <akim@epita.fr>
20055
20056 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20057 * src/lalr.c: Use them.
20058
200592001-12-05 Akim Demaille <akim@epita.fr>
20060
20061 * src/LR0.c (augment_automaton): Formatting changes.
20062 Better variable locality.
20063
200642001-12-05 Akim Demaille <akim@epita.fr>
20065
20066 * src/lalr.c (matrix_print): New.
20067 (transpose): Use it.
20068 Use arrays instead of pointers.
20069
200702001-12-05 Akim Demaille <akim@epita.fr>
20071
20072 * src/lalr.c (maxrhs): Move to...
20073 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20074 * src/lalr.c (build_relations): Adjust.
20075
200762001-12-05 Akim Demaille <akim@epita.fr>
20077
20078 * src/lalr.c (transpose): Free the memory allocated to the
20079 argument, as it is replaced by the results by the unique caller.
20080 (build_relations): Merely invoke transpose: it handles the memory
20081 deallocation.
20082 Improve variable locality.
20083 Avoid variables used as mere abbreviations.
20084 (compute_lookaheads): Use arrays instead of pointers.
20085
200862001-12-05 Akim Demaille <akim@epita.fr>
20087
20088 * src/lalr.c (initialize_F): Improve variable locality.
20089 Avoid variables used as mere abbreviations.
20090
200912001-12-05 Akim Demaille <akim@epita.fr>
20092
20093 * src/derives.c (print_derives): Display the ruleno.
20094 * src/lalr.c (initialize_F, transpose): Better variable locality
20095 to improve readability.
20096 Avoid variables used as mere abbreviations.
20097
200982001-12-05 Akim Demaille <akim@epita.fr>
20099
20100 * src/lalr.c (traverse): Use arrays instead of pointers.
20101
201022001-12-05 Akim Demaille <akim@epita.fr>
20103
20104 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20105 the handling of squeue.
20106 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20107
201082001-12-05 Akim Demaille <akim@epita.fr>
20109
20110 Because useless nonterminals are now kept alive (instead of being
20111 `destroyed'), we now sometimes examine them, and store information
20112 related to them. Hence we need to know their number, and adjust
20113 memory allocations.
20114
20115 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20116 static.
20117 * src/LR0.c (allocate_itemsets): The memory allocated to
20118 `symbol_count' was used for two different purpose: once to count
20119 the number of occurrences of each symbol, and later reassigned to
20120 `shift_symbol', containing the symbol that can be shifted from a
20121 given state.
20122 Deobfuscate, i.e., allocate, use and free `symbol_count' here
20123 only, and...
20124 (new_itemsets): Allocate `shift_symbol' here.
20125 (allocate_itemsets): symbol_count includes useless nonterminals.
20126 Make room for them.
20127 (free_storage): Use `free', not `XFREE', for pointers that cannot
20128 be null.
20129
201302001-12-05 Akim Demaille <akim@epita.fr>
20131
20132 * src/nullable.c (set_nullable): Deobfuscate the handling of
20133 ritem.
20134 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20135
201362001-12-05 Akim Demaille <akim@epita.fr>
20137
20138 * src/gram.c, src/gram.h (ritem_print): New.
20139 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
20140 (This useless function was defined only to work around VMS linkers
20141 that can't handle compilation units with variables only).
20142 * src/reduce.c (dump_grammar): Use it to trace the construction of
20143 ritem.
20144
201452001-12-04 Paul Eggert <eggert@twinsun.com>
20146
20147 * src/bison.simple (union yyalloc): Change member names
20148 to be the same as the stack names.
20149 (yyparse): yyptr is now union yyalloc *, not char *.
20150 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
20151 and may generate better code on some machines.
20152 (yystpcpy): Use prototype if __STDC__ is defined, not just
20153 if __cplusplus is defined.
20154
201552001-11-30 Akim Demaille <akim@epita.fr>
20156
20157 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
20158 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
20159 Gettext doesn't compile cleanly, and dies with -Werror.
20160 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
20161 Include WARNING_CFLAGS here.
20162 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
20163 before being defined.
20164
201652001-11-27 Paul Eggert <eggert@twinsun.com>
20166
20167 * lib/quotearg.h (quotearg_n, quotearg_n_style):
20168 First arg is int, not unsigned.
20169 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
20170 (SIZE_MAX, UINT_MAX): New macros.
20171 (quotearg_n_options): Abort if N is negative.
20172 Avoid overflow check on hosts where size_t is 64 bits and int
20173 is 32 bits, as overflow is impossible there.
20174 Fix off-by-one typo that caused unnecessary reallocation.
20175
201762001-11-29 Paul Eggert <eggert@twinsun.com>
20177
20178 Name space cleanup in generated parser.
20179
20180 * doc/bison.texinfo (Bison Parser): Discuss system headers
20181 and their effect on the user name space.
20182
20183 * src/bison.simple:
20184 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
20185 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
20186 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
20187
20188 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
20189 on user names when possible.
20190
20191 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
20192 Simplify test for whather <alloca.h> exists.
20193
20194 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
20195
20196 (<stdio.h>): Include if YYDEBUG.
20197
20198 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
20199 ! defined (yyoverflow) && ! defined (yymemcpy).
20200
20201 (yymemcpy, yyparse): Rename local variables as needed so that
20202 they all begin with 'yy'.
20203
20204 (yystrlen, yystpcpy): New functions.
20205
20206 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
20207 All uses changed.
20208
20209 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
20210 instead of relying on string.h functions. Use YYSTACK_ALLOC
20211 and YYSTACK_FREE instead of malloc and free.
20212
202132001-11-30 Akim Demaille <akim@epita.fr>
20214
20215 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
20216 before their first uses.
20217 (YYBISON, YYPURE): Move to the top of the output.
20218
202192001-11-30 Akim Demaille <akim@epita.fr>
20220
20221 * tests/reduce.at (Useless Nonterminals): Fix.
20222
202232001-11-30 Akim Demaille <akim@epita.fr>
20224
20225 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
20226 if body instead of `;' to pacify GCC's warnings.
20227
202282001-11-30 Akim Demaille <akim@epita.fr>
20229
20230 Instead of mapping the LHS of unused rules to -1, keep the LHS
20231 valid, but flag the rules as invalid.
20232
20233 * src/gram.h (rule_t): `useful' is a new member.
20234 * src/print.c (print_grammar): Adjust.
20235 * src/derives.c (set_derives): Likewise.
20236 * src/reader.c (packgram, reduce_output): Likewise.
20237 * src/reduce.c (reduce_grammar_tables): Likewise.
20238 * tests/reduce.at (Underivable Rules, Useless Rules): New.
20239
202402001-11-30 Akim Demaille <akim@epita.fr>
20241
20242 * src/reduce.c (reduce_output): Formatting changes.
20243 * src/print.c (print_results, print_grammar): Likewise.
20244 * tests/regression.at (Rule Line Numbers)
20245 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
20246
202472001-11-30 Akim Demaille <akim@epita.fr>
20248
20249 * src/reduce.c (nonterminals_reduce): Instead of throwing away
20250 useless nonterminals, move them at the end of the symbol arrays.
20251 (reduce_output): Adjust.
20252 * tests/reduce.at (Useless Nonterminals): Adjust.
20253
202542001-11-30 Akim Demaille <akim@epita.fr>
20255
20256 * src/reduce.c: Various comment/formatting changes.
20257 (nonterminals_reduce): New, extracted from...
20258 (reduce_grammar_tables): here.
20259 (reduce_grammar): Call nonterminals_reduce.
20260
202612001-11-29 Paul Eggert <eggert@twinsun.com>
20262
20263 * src/bison.simple (YYSTACK_REALLOC): Remove.
20264 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
20265 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
20266 New macros.
20267 (union yyalloc): New type.
20268 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
20269 an arbitrary restriction on hosts where size_t is wider than int.
20270
20271 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20272 a parser stack overflow. Allocate just one block of memory for all
20273 three stacks, instead of allocating three blocks; this typically is
20274 faster and reduces fragmentation.
20275
20276 Do not limit the number of items in the stack to a value that fits
20277 in 'int', as this is an arbitrary limit on hosts with 64-bit
20278 size_t and 32-bit int.
20279
202802001-11-29 Marc Autret <autret_m@epita.fr>
20281
20282 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20283 of defining YYERROR_VERBOSE.
20284 [AT_DATA]: $4 is now out of C declarations in the prologue.
20285
202862001-11-28 Marc Autret <autret_m@epita.fr>
20287
20288 * src/reader.c (parse_dquoted_param): New.
20289 (parse_skel_decl): Use it.
20290 * src/lex.h: Add its prototype.
20291 * src/lex.c (literalchar): Become not static.
20292
202932001-11-28 Marc Autret <autret_m@epita.fr>
20294
20295 * src/output.h: And put its extern declaration here.
20296 * src/output.c (error_verbose): Define here.
20297 (prepare): Echo name modification.
20298 * src/getargs.h: Clean its extern declaration.
20299 * src/getargs.c (error_verbose_flag): Remove.
20300 (getargs): Remove case 'e'.
20301 * src/options.c (option_table): 'error-verbose' is now seen as simple
20302 percent option.
20303 Include output.h.
20304
20305 * src/reader.c (read_declarations): Remove case tok_include.
20306 (parse_include_decl): Remove.
20307 * src/lex.h (token_t): Remove tok_include.
20308 * src/options.c (option_table): 'include' is now a simple command line
20309 option.
20310
203112001-11-28 Marc Autret <autret_m@epita.fr>
20312
20313 * src/bison.simple: Adjust muscle names.
20314 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20315 * src/output.c (prepare): s/_/-/ for the muscles names.
20316 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20317
203182001-11-28 Marc Autret <autret_m@epita.fr>
20319
20320 * src/bison.simple: Fix debug.
20321 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20322
203232001-11-28 Akim Demaille <akim@epita.fr>
20324
20325 * src/LR0.c (shifts_new): New.
20326 (save_shifts, insert_start_shift, augment_automaton): Use it.
20327
203282001-11-28 Akim Demaille <akim@epita.fr>
20329
20330 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20331 keep ruleno only.
20332
203332001-11-28 Akim Demaille <akim@epita.fr>
20334
20335 * src/closure.c (closure): Instead of looping over word in array
20336 then bits in words, loop over bits in array.
20337
203382001-11-28 Akim Demaille <akim@epita.fr>
20339
20340 * src/closure.c (closure): No longer optimize the special case
20341 where all the bits of `ruleset[r]' are set to 0, to make the code
20342 clearer.
20343
203442001-11-28 Akim Demaille <akim@epita.fr>
20345
20346 * src/closure.c (closure): `r' and `c' are new variables, used to
20347 de-obfuscate accesses to RULESET and CORE.
20348
203492001-11-28 Akim Demaille <akim@epita.fr>
20350
20351 * src/reduce.c (reduce_print): Use ngettext.
20352 (dump_grammar): Improve the trace accuracy.
20353
203542001-11-28 Akim Demaille <akim@epita.fr>
20355
20356 * src/reduce.c (dump_grammar): Don't translate trace messages.
20357
203582001-11-28 Akim Demaille <akim@epita.fr>
20359
20360 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20361 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20362 as all tags are free'ed afterwards.
20363 From Enrico Scholz.
20364
203652001-11-27 Paul Eggert <eggert@twinsun.com>
20366
20367 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20368 use alloca when we didn't want to, and vice versa.
20369
203702001-11-27 Marc Autret <autret_m@epita.fr>
20371
20372 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20373 initialization.
20374 * src/output.c (prepare): Remove its update.
20375
203762001-11-27 Marc Autret <autret_m@epita.fr>
20377
20378 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20379 Use %error-verbose.
20380
203812001-11-27 Marc Autret <autret_m@epita.fr>
20382
20383 * src/bison.simple: Remove YYERROR_VERBOSE using.
20384 Use %%error_verbose.
20385 (yyparse): Likewise.
20386 * src/output.c (prepare): Give its final value.
20387 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20388 * src/getargs.h: Add its extern declaration.
20389 * src/getargs.c (error_verbose_flag): New int.
20390 (getargs): Update to catch new case.
20391 * src/options.c (option_table): 'error-verbose' is a new option.
20392 (shortopts): Update.
20393
203942001-11-27 Akim Demaille <akim@epita.fr>
20395
20396 * src/system.h: Use intl/libgettext.h.
20397 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20398
203992001-11-27 Akim Demaille <akim@epita.fr>
20400
20401 * tests/torture.at (Exploding the Stack Size with Malloc):
20402 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20403
204042001-11-27 Akim Demaille <akim@epita.fr>
20405
20406 * src/files.c: Include error.h.
20407 Reported by Hans Aberg.
20408
204092001-11-26 Marc Autret <autret_m@epita.fr>
20410
20411 * src/reader.c (parse_include_decl): New, not yet implemented.
20412 (read_declarations): Add case tok_include.
20413 * src/getargs.h (include): Add its extern definition.
20414 * src/getargs.c (include): New const char *.
20415 (getargs): Add case '-I'.
20416 * src/options.c (option_table): Add include as command line and
20417 percent option.
20418 * src/lex.h (token_t): Add tok_include.
20419
204202001-11-26 Akim Demaille <akim@epita.fr>
20421
20422 * src/reader.c (readgram): Make sure rules for mid-rule actions
20423 have a lineno equal to that of their host rule.
20424 Reported by Hans Aberg.
20425 * tests/regression.at (Rule Line Numbers): New.
20426
204272001-11-26 Akim Demaille <akim@epita.fr>
20428
20429 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20430 size_ts.
20431
204322001-11-26 Akim Demaille <akim@epita.fr>
20433
20434 * src/complain.c, src/complain.h (error): Remove, provided by
20435 lib/error.[ch].
20436
204372001-11-26 Akim Demaille <akim@epita.fr>
20438
20439 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20440 issue an error message.
20441 * tests/regression.at (Invalid %directive): New.
20442 Reported by Hans Aberg.
20443
204442001-11-26 Akim Demaille <akim@epita.fr>
20445
20446 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20447 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20448
204492001-11-26 Akim Demaille <akim@epita.fr>
20450
20451 * src/conflicts.c (conflicts_print): Don't complain at all when
20452 there are no reduce/reduce conflicts, and as many shift/reduce
20453 conflicts as expected.
20454 * tests/regression.at (%expect right): Adjust.
20455
204562001-11-23 Akim Demaille <akim@epita.fr>
20457
20458 * lib/alloca.c: Update, from fileutils.
20459
204602001-11-23 Akim Demaille <akim@epita.fr>
20461
20462 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20463
204642001-11-23 Akim Demaille <akim@epita.fr>
20465
20466 * src/system.h: Include alloca.h.
20467 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20468
204692001-11-23 Akim Demaille <akim@epita.fr>
20470
20471 * src/print_graph.c (print_actions): Remove `rule', unused.
20472 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20473 pacify GCC's signed < unsigned warnings.
20474 * src/closure.c (itemsetsize): Likewise.
20475 * src/reader.c (symbol_list_new): Static.
20476
204772001-11-23 Akim Demaille <akim@epita.fr>
20478
20479 Attaching lineno to buckets is stupid, since only one copy of each
20480 symbol is kept, only the line of the first occurrence is kept too.
20481
20482 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20483 * src/reader.c (rline_allocated): Remove, unused.
20484 (symbol_list): Have a `line' member.
20485 (symbol_list_new): New.
20486 (readgram): Use it.
20487 * src/print.c (print_grammar): Output the rule line numbers.
20488 * tests/regression.at (Solved SR Conflicts)
20489 (Unresolved SR Conflicts): Adjust.
20490 Reported by Hans Aberg.
20491
204922001-11-22 Marc Autret <autret_m@epita.fr>
20493
20494 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20495
204962001-11-22 Marc Autret <autret_m@epita.fr>
20497
20498 * src/muscle_tab.c (muscle_init): Remove initialization of
20499 skeleton muscle.
20500 * src/output.c (output_master_parser): Do it here.
20501
205022001-11-20 Akim Demaille <akim@epita.fr>
20503
20504 * po/sv.po: New.
20505 * configure.in (ALL_LINGUAS): Adjust.
20506 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20507 longer contains strings to translate.
20508
205092001-11-19 Akim Demaille <akim@epita.fr>
20510
20511 * src/conflicts.c (conflicts_print): Add a missing \n.
20512
205132001-11-19 Akim Demaille <akim@epita.fr>
20514
20515 * src/nullable.c (nullable_print): New.
20516 (set_nullable): Call it when tracing.
20517 Better locality of variables.
20518
205192001-11-19 Akim Demaille <akim@epita.fr>
20520
20521 * src/print.c (print_actions): Better locality of variables.
20522
205232001-11-19 Akim Demaille <akim@epita.fr>
20524
20525 * src/derives.c (print_derives): Fix and enrich.
20526 * src/closure.c (print_fderives): Likewise.
20527
205282001-11-19 Akim Demaille <akim@epita.fr>
20529
20530 * src/closure.c (itemsetend): Remove, replaced with...
20531 (itemsetsize): new.
20532
205332001-11-19 Akim Demaille <akim@epita.fr>
20534
20535 * src/LR0.c (kernel_end): Remove, replaced with...
20536 (kernel_size): new.
20537
205382001-11-19 Akim Demaille <akim@epita.fr>
20539
20540 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20541 to clarify.
20542
205432001-11-19 Akim Demaille <akim@epita.fr>
20544
20545 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20546
205472001-11-19 Akim Demaille <akim@epita.fr>
20548
20549 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20550 trace messages.
20551 * src/LR0.c: Likewise.
20552 (allocate_itemsets): Use arrays instead of pointers to clarify.
20553
205542001-11-19 Akim Demaille <akim@epita.fr>
20555
20556 * src/getargs.c (statistics_flag): Replace with...
20557 (trace_flag): New.
20558 (longopts): Accept --trace instead of --statistics.
20559 * src/getargs.h, src/options.c: Adjust.
20560 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20561 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20562
205632001-11-19 Akim Demaille <akim@epita.fr>
20564
20565 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
20566 pointers to clarify the code.
20567 (save_reductions, save_shifts): Factor common parts of alternatives.
20568
205692001-11-19 Akim Demaille <akim@epita.fr>
20570
20571 * src/LR0.c (new_state, get_state): Complete TRACE code.
20572 * src/closure.c: Include `reader.h' to get `tags', needed by the
20573 trace code.
20574 Rename the conditional DEBUG as TRACE.
20575 Output consistently TRACEs to stderr, not stdout.
20576 * src/derives.c: Likewise.
20577 * src/reduce.c: (inaccessable_symbols): Using if is better style
20578 than goto.
20579 Use `#if TRACE' instead of `#if 0' for tracing code.
20580
205812001-11-19 Akim Demaille <akim@epita.fr>
20582
20583 * src/system.h (LIST_FREE, shortcpy): New.
20584 * src/LR0.c: Use them.
20585 * src/output.c (free_itemsets, free_reductions, free_shifts):
20586 Remove, replaced by LIST_FREE.
20587
205882001-11-19 Akim Demaille <akim@epita.fr>
20589
20590 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20591 (REDUCTIONS_ALLOC): New.
20592 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20593 allocation.
20594
205952001-11-19 Akim Demaille <akim@epita.fr>
20596
20597 * src/LR0.c (new_state): Complete trace code.
20598 * src/nullable.c (set_nullable): Don't translate traces.
20599
206002001-11-19 Akim Demaille <akim@epita.fr>
20601
20602 * src/print_graph.c (print_core): Better locality of variables.
20603 * src/print.c (print_core): Likewise.
20604
206052001-11-19 Akim Demaille <akim@epita.fr>
20606
20607 * src/vcg.c: You do the output, so you are responsible of the
20608 handling of VCG syntax, in particular: use quotearg.
20609 * src/print_graph.c: Don't.
20610 (print_actions): Don't output the actions as part of the nodes,
20611 since that's the job of the edges.
20612 (print_state): Don't output by hand: fill the node description,
20613 and ask for its output.
20614
206152001-11-19 Akim Demaille <akim@epita.fr>
20616
20617 * src/bison.simple (yyparse): When verbosely reporting an error,
20618 no longer put additional quotes around token names.
20619 * tests/calc.at: Adjust.
20620
206212001-11-19 Akim Demaille <akim@epita.fr>
20622
20623 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20624 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20625 * src/output.c: Adjust.
20626
206272001-11-19 Akim Demaille <akim@epita.fr>
20628
20629 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20630 (rule_t): this.
20631 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20632
206332001-11-19 Akim Demaille <akim@epita.fr>
20634
20635 * src/gram.h (rule_t): New.
20636 (rule_table): New.
20637 (rrhs, rlhs): Remove, part of state_t.
20638 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20639 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20640 * src/reader.c, src/reduce.c: Adjust.
20641
206422001-11-19 Akim Demaille <akim@epita.fr>
20643
20644 * src/reader.c (symbols_output): New, extracted from...
20645 (packsymbols): Here.
20646 (reader): Call it.
20647
206482001-11-19 Akim Demaille <akim@epita.fr>
20649
20650 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20651 (maxrhs): this new function.
20652
206532001-11-19 Akim Demaille <akim@epita.fr>
20654
20655 * src/lalr.c (F): New macro to access the variable F.
20656 Adjust.
20657
206582001-11-19 Akim Demaille <akim@epita.fr>
20659
20660 * src/lalr.h (LA): New macro to access the variable LA.
20661 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20662 * src/lalr.c: Adjust.
20663
206642001-11-19 Akim Demaille <akim@epita.fr>
20665
20666 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20667 (set_state_table): handle the `lookaheads' members.
20668
206692001-11-19 Akim Demaille <akim@epita.fr>
20670
20671 * src/lalr.h (lookaheads): Removed array, whose contents is now
20672 a member of...
20673 (state_t): this structure.
20674 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20675 Adjust.
20676
206772001-11-19 Akim Demaille <akim@epita.fr>
20678
20679 * src/lalr.h (consistent): Removed array, whose contents is now
20680 a member of...
20681 (state_t): this structure.
20682 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20683 Adjust.
20684
206852001-11-19 Akim Demaille <akim@epita.fr>
20686
20687 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20688 contents are now members of...
20689 (state_t): this structure.
20690 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20691 Adjust.
20692
206932001-11-19 Akim Demaille <akim@epita.fr>
20694
20695 * src/lalr.h (state_t): New.
20696 (state_table): Be a state_t * instead of a core **.
20697 (accessing_symbol): Remove, part of state_t.
20698 * src/lalr.c: Adjust.
20699 (set_accessing_symbol): Merge into...
20700 (set_state_table): this.
20701 * src/print_graph.c, src/conflicts.c: Adjust.
20702
207032001-11-14 Akim Demaille <akim@epita.fr>
20704
20705 * tests/calc.at, tests/output.at, tests/regression.at,
20706 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20707 now the tests are run in private dirs, therefore AC_CLEANUP and
20708 family can be simplified to 0-ary.
20709 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20710 use abs. path to find config.h.
20711 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20712 stderr, there can be way too much random noise.
20713 Instead pass -Werror to GCC and rely on the exit status.
20714 Reported by Wolfram Wagner.
20715
207162001-11-14 Akim Demaille <akim@epita.fr>
20717
20718 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20719 defined only if yyoverflow is defined, to avoid `warning: unused
20720 variable `yyvs1''.
20721 Reported by The Test Suite.
20722
207232001-11-14 Akim Demaille <akim@epita.fr>
20724
20725 * src/print.c: Include reduce.h.
20726 Reported by Hans Aberg.
20727
207282001-11-14 Akim Demaille <akim@epita.fr>
20729
20730 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20731 Revert a previous patch: these are really const.
20732 * src/conflicts.c (conflict_report): Additional useless pair of
20733 braces to pacify GCC's warnings for `if () if () {} else {}'.
20734 * src/lex.c (parse_percent_token): Replace equal_offset with
20735 arg_offset.
20736 arg is const.
20737 Be sure to strdup `arg' when used, since there is no reason for
20738 token_buffer not to change.
20739
207402001-11-14 Akim Demaille <akim@epita.fr>
20741
20742 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20743 definition.
20744 * src/main.c (main): Use them.
20745 Suggested by Hans Aberg.
20746
207472001-11-12 Akim Demaille <akim@epita.fr>
20748
20749 * src/system.h (ngettext): Now that we use ngettext, be sure to
20750 provide a default definition when NLS are not used.
20751
207522001-11-12 Akim Demaille <akim@epita.fr>
20753
20754 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20755 Use @kbd to denote user input.
20756 (Language and Grammar): ANSIfy the example.
20757 Adjust its layout for info/notinfo.
20758 (Location Tracking Calc): Output error messages to stderr.
20759 Output locations in a more GNUtically correct way.
20760 Fix a couple of Englishos.
20761 Adjust @group/@end group pairs.
20762
207632001-11-12 Akim Demaille <akim@epita.fr>
20764
20765 %expect was not functioning at all.
20766
20767 * src/conflicts.c (expected_conflicts): Set to -1.
20768 (conflict_report): Use ngettext.
20769 (conflicts_print): Check %expect and make its violation an error.
20770 * doc/bison.texinfo (Expect Decl): Adjust.
20771 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20772 * tests/regression.at (%expect not enough, %expect right)
20773 (%expect too much): New.
20774
207752001-11-12 Akim Demaille <akim@epita.fr>
20776
20777 * tests/regression.at (Conflicts): Rename as...
20778 (Unresolved SR Conflicts): this.
20779 (Solved SR Conflicts): New.
20780
207812001-11-12 Akim Demaille <akim@epita.fr>
20782
20783 * src/reduce.c (print_results): Rename as...
20784 (reduce_output): This.
20785 Output to OUT, passed as argument, instead of output_obstack.
20786 (dump_grammar): Likewise.
20787 (reduce_free): New.
20788 Also free V1.
20789 (reduce_grammar): No longer call reduce_output, since...
20790 * src/print.c (print_results): do it.
20791 * src/main.c (main): Call reduce_free;
20792
207932001-11-12 Akim Demaille <akim@epita.fr>
20794
20795 * src/conflicts.c (print_reductions): Accept OUT as argument.
20796 Output to it, not to output_obstack.
20797 * src/print.c (print_actions): Adjust.
20798
207992001-11-12 Akim Demaille <akim@epita.fr>
20800
20801 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20802 the result instead of using...
20803 (src_total, rrc_total, src_count, rrc_count): Remove.
20804 (any_conflicts): Remove.
20805 (print_conflicts): Split into...
20806 (conflicts_print, conflicts_output): New.
20807 * src/conflicts.h: Adjust.
20808 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
20809 * src/print.c (print_grammar): Issue `\n' between two rules.
20810 * tests/regression.at (Conflicts): New.
20811 Reported by Tom Lane.
20812
208132001-11-12 Akim Demaille <akim@epita.fr>
20814
20815 * tests/regression.at (Invalid input): Remove, duplicate with
20816 ``Invalid input: 1''.
20817
208182001-11-12 Akim Demaille <akim@epita.fr>
20819
20820 * tests/torture.at (AT_DATA_STACK_TORTURE)
20821 (Exploding the Stack Size with Alloca)
20822 (Exploding the Stack Size with Malloc): New.
20823
208242001-11-12 Akim Demaille <akim@epita.fr>
20825
20826 * src/bison.simple (YYSTACK_REALLOC): New.
20827 (yyparse) [!yyoverflow]: Use it and free the old stack.
20828 Reported by Per Allansson.
20829
208302001-11-12 Pascal Bart <pascal.bart@epita.fr>
20831
20832 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20833 define CPP macro, which substitute YYSTYPE by yystype.
20834 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20835 with yyltype/YYLTYPE. This allows inclusion of the generated
20836 header within the parser if the compiler, such as GGC, accepts
20837 multiple equivalent #defines.
20838 From Akim.
20839
208402001-11-05 Akim Demaille <akim@epita.fr>
20841
20842 * src/reader.c (symbols_output): New, extracted from...
20843 (packsymbols): here.
20844 (reader): Adjust.
20845
208462001-11-05 Akim Demaille <akim@epita.fr>
20847
20848 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20849
208502001-11-05 Akim Demaille <akim@epita.fr>
20851
20852 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20853 pattern.
20854
208552001-11-05 Akim Demaille <akim@epita.fr>
20856
20857 * src/options.h (struct option_table_struct): set_flags is void*.
20858 * src/options.c (longopts): Support `--output' and `%output'.
20859 (usage): Adjust.
20860 * src/lex.h (tok_setopt): Remove, replaced with...
20861 (tok_intopt, tok_stropt): these new guys.
20862 * src/lex.c (getopt.h): Not needed.
20863 (token_buffer, unlexed_token_buffer): Not const.
20864 (percent_table): Promote `-' over `_' in directive names.
20865 Active `%name-prefix', `file-prefix', and `output'.
20866 (parse_percent_token): Accept possible arguments to directives.
20867 Promote `-' over `_' in directive names.
20868
208692001-11-04 Akim Demaille <akim@epita.fr>
20870
20871 * doc/bison.texinfo (Decl Summary): Split the list into
20872 `directives for grammars' and `directives for bison'.
20873 Sort'em.
20874 Add description of `%name-prefix', `file-prefix', and `output'.
20875 Promote `-' over `_' in directive names.
20876 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20877 Simplify the description of `--name-prefix'.
20878 Promote `-' over `_' in directive names.
20879 Promote `--output' over `--output-file'.
20880 Fix the description of `--defines'.
20881 * tests/output.at: Exercise %file-prefix and %output.
20882
208832001-11-02 Akim Demaille <akim@epita.fr>
20884
20885 * doc/refcard.tex: Update.
20886
208872001-11-02 Akim Demaille <akim@epita.fr>
20888
20889 * src/symtab.h (SUNDEF): New.
20890 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20891 stand for `uninitialized', instead of 0.
20892 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20893 * src/lex.c (lex): Adjust.
20894
20895 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20896 Number it 0.
20897 Let yylex return it instead of a plain 0.
20898 Reported by Dick Streefland.
20899
209002001-11-02 Akim Demaille <akim@epita.fr>
20901
20902 * tests/regression.at (Mixing %token styles): New test.
20903
209042001-11-02 Akim Demaille <akim@epita.fr>
20905
20906 * src/reader.c (parse_thong_decl): Formatting changes.
20907 (token_translations_init): New, extracted from...
20908 (packsymbols): Here.
20909 Adjust.
20910
209112001-11-01 Akim Demaille <akim@epita.fr>
20912
20913 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20914 Check that `9foo.y' produces correct cpp guards.
20915 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20916 guards.
20917 Reported by Wwp.
20918
209192001-11-01 Akim Demaille <akim@epita.fr>
20920
20921 * tests/regression.at (Invalid input: 2): New.
20922 * src/lex.c (unlexed_token_buffer): New.
20923 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20924 too.
20925 Reported by Wwp.
20926
209272001-11-01 Akim Demaille <akim@epita.fr>
20928
20929 * tests/calc.at: Catch up with 1.30.
20930 * configure.in: Bump to 1.49a.
20931 Adjust to newer Autotest.
20932
209332001-10-19 Pascal Bart <pascal.bart@epita.fr>
20934
20935 * src/conflicts.c: Move global variables rrc_total and src_total ...
20936 (print_conflicts): here.
20937 * src/output.c (output): Free global variable user_toknums.
20938 * src/lex.c (token_obstack): Become static.
20939
209402001-10-18 Akim Demaille <akim@epita.fr>
20941
20942 * tests/atlocal.in (GCC): Add.
20943 * tests/calc.at: s/m4_match/m4_bmatch/.
20944 s/m4_patsubst/m4_bpatsubst/.
20945 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20946 * configure.in: AC_SUBST(GCC).
20947
209482001-10-14 Marc Autret <autret_m@epita.fr>
20949
20950 * src/options.c (create_long_option_table): Fix.
20951
209522001-10-10 Akim Demaille <akim@epita.fr>
20953
20954 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20955
209562001-10-04 Akim Demaille <akim@epita.fr>
20957
20958 * src/reader.c (parse_union_decl): Push the caracters in
20959 union_obstack, not attrs_obstack.
20960
209612001-10-04 Akim Demaille <akim@epita.fr>
20962
20963 Merge in the branch 1.29.
20964
20965 * src/reader.c (packsymbols): Use a temporary obstack for
20966 `%%tokendef', since output_stack is already used elsewhere.
20967
20968 2001-10-02 Akim Demaille <akim@epita.fr>
20969
20970 Bump 1.29d.
20971
20972 2001-10-02 Akim Demaille <akim@epita.fr>
20973
20974 Version 1.29c.
20975
20976 2001-10-02 Akim Demaille <akim@epita.fr>
20977
20978 * tests/regression.at (Invalid CPP headers): New.
20979 From Alexander Belopolsky.
20980 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20981
20982 2001-10-02 Akim Demaille <akim@epita.fr>
20983
20984 * tests/regression.at (Invalid input): New.
20985 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20986 Reported by Shura.
20987
20988 2001-10-02 Akim Demaille <akim@epita.fr>
20989
20990 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20991
20992 2001-10-02 Akim Demaille <akim@epita.fr>
20993
20994 * src/output.c (output_parser): Assert `skeleton'.
20995 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20996 systems.
20997 From Shura.
20998
20999 2001-10-01 Marc Autret <autret_m@epita.fr>
21000
21001 * src/lex.h: Echo modifications.
21002 * src/lex.c (unlex): Parameter is now token_t.
21003 From Hans Aberg.
21004
21005 2001-10-01 Marc Autret <autret_m@epita.fr>
21006
21007 * src/main.c: Include lex.h.
21008 From Hans Aberg.
21009
21010 2001-09-29 Akim Demaille <akim@epita.fr>
21011
21012 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
21013
21014 2001-09-28 Akim Demaille <akim@epita.fr>
21015
21016 * tests/testsuite.at: Update to newer Autotest.
21017 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
21018
21019 2001-09-27 Akim Demaille <akim@epita.fr>
21020
21021 Position independent wrapper.
21022
21023 * tests/bison: Remove.
21024 * tests/bison.in: New.
21025 * configure.in: Adjust.
21026
21027 2001-09-27 Paul Eggert <eggert@twinsun.com>
21028
21029 Port quotearg fixes from tar 1.13.24.
21030
21031 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
21032 tm to be declared.
21033 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
21034 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
21035
21036 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21037 * m4/mbrtowc.m4: New file.
21038 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21039 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21040
21041 2001-09-27 Akim Demaille <akim@epita.fr>
21042
21043 Bump to 1.29c.
21044
21045 2001-09-27 Akim Demaille <akim@epita.fr>
21046
21047 Version 1.29b.
21048
21049 2001-09-25 Akim Demaille <akim@epita.fr>
21050
21051 * src/system.h: Include `xalloc.h'.
21052 Remove it from the C files.
21053 * src/files.c (output_files): Free the obstacks.
21054 * src/lex.c (init_lex): Rename as...
21055 (lex_init): this.
21056 (lex_free): New.
21057 * src/main.c (main): Use it.
21058
21059 2001-09-24 Marc Autret <autret_m@epita.fr>
21060
21061 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21062 to output informations in fout (FILE*).
21063 (open_graph, close_graph): Likewise.
21064 (output_graph, output_edge, output_node): Likewise.
21065 * src/vcg.h: Update function prototypes.
21066 * src/print_graph.c (print_graph): Open output graph file.
21067 (print_actions): Adjust.
21068 * src/files.h: Remove extern declaration.
21069 * src/files.c: Remove graph_obstack declaration.
21070 (open_files): Remove graph_obstack initialization.
21071 (output_files): Remove graph_obstack saving.
21072
21073 2001-09-24 Marc Autret <autret_m@epita.fr>
21074
21075 * src/files.c (compute_output_file_names): Fix.
21076
21077 2001-09-24 Marc Autret <autret_m@epita.fr>,
21078 Akim Demaille <akim@epita.fr>
21079
21080 * src/reader.c (reader): Remove call to free_symtab ().
21081 * src/main.c (main): Call it here.
21082 Include symtab.h.
21083 * src/conflicts.c (initialize_conflicts): Rename as...
21084 (solve_conflicts): this.
21085 * src/print.c (print_core, print_actions, print_state)
21086 (print_grammar): Dump to a file instead a `output_obstack'.
21087 (print_results): Dump `output_obstack', and then proceed with the
21088 FILE *.
21089 * src/files.c (compute_output_file_names, close_files): New.
21090 (output_files): Adjust.
21091 * src/main.c (main): Adjust.
21092
21093 2001-09-23 Marc Autret <autret_m@epita.fr>
21094
21095 * src/files.c (compute_header_macro): Computes header macro name
21096 from spec_defines_file when given.
21097
21098 2001-09-23 Marc Autret <autret_m@epita.fr>
21099
21100 * src/files.c (output_files): Add default extensions.
21101
21102 2001-09-22 Akim Demaille <akim@epita.fr>
21103
21104 * src/conflicts.c (finalize_conflicts): Rename as...
21105 (free_conflicts): this.
21106
21107 2001-09-22 Akim Demaille <akim@epita.fr>
21108
21109 * src/gram.c (gram_free): Rename back as...
21110 (dummy): this.
21111 (output_token_translations): Free `token_translations'.
21112 * src/symtab.c (free_symtab): Free the tag field.
21113
21114 2001-09-22 Akim Demaille <akim@epita.fr>
21115
21116 Remove `translations' as it is always set to true.
21117
21118 * src/gram.h: Adjust.
21119 * src/reader.c (packsymbols, parse_token_decl): Adjust
21120 * src/print.c (print_grammar): Adjust.
21121 * src/output.c (output_token_translations): Adjust.
21122 * src/lex.c (lex): Adjust.
21123 * src/gram.c: Be sure the set pointers to NULL.
21124 (dummy): Rename as...
21125 (gram_free): this.
21126
21127 2001-09-22 Akim Demaille <akim@epita.fr>
21128
21129 * configure.in: Invoke AM_LIB_DMALLOC.
21130 * src/system.h: Use dmalloc.
21131 * src/LR0.c: Be sure to have pointers initialized to NULL.
21132 (allocate_itemsets): Allocate kernel_items only if needed.
21133
21134 2001-09-22 Akim Demaille <akim@epita.fr>
21135
21136 * configure.in: Bump to 1.29b.
21137 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
21138 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
21139 need xmalloc.c in calc.y.
21140 From Pascal Bart.
21141
21142 2001-09-21 Akim Demaille <akim@epita.fr>
21143
21144 Version 1.29a.
21145 * Makefile.maint, config/config.guess, config/config.sub,
21146 * config/missing: Update from masters.
21147 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
21148 upon package.m4.
21149 * configure.in (ALL_LINGUAS): Add `tr'.
21150
21151 2001-09-21 Akim Demaille <akim@epita.fr>
21152
21153 * tests/Makefile.am (package.m4): Move to...
21154 ($(srcdir)/$(TESTSUITE)): here.
21155
21156 2001-09-20 Akim Demaille <akim@epita.fr>
21157
21158 * src/complain.c: No longer try to be standalone: use system.h.
21159 Don't assume __STDC__ is defined to 1. Just test if it is defined.
21160 * src/complain.h: Likewise.
21161 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
21162 Remove the unused variable `n'.
21163 From Albert Chin-A-Young.
21164
21165 2001-09-18 Marc Autret <autret_m@epita.fr>
21166
21167 * doc/bison.1: Update.
21168 * doc/bison.texinfo (Bison Options): Update --defines and --graph
21169 descriptions.
21170 (Option Cross Key): Update.
21171 Add --graph.
21172
21173 2001-09-18 Marc Autret <autret_m@epita.fr>
21174
21175 * tests/regression.at: New test (comment in %union).
21176
21177 2001-09-18 Marc Autret <autret_m@epita.fr>
21178
21179 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
21180 do that.
21181 Reported by Keith Browne.
21182
21183 2001-09-18 Marc Autret <autret_m@epita.fr>
21184
21185 * tests/output.at: Add tests for --defines and --graph.
21186
21187 2001-09-18 Marc Autret <autret_m@epita.fr>
21188
21189 * tests/output.at: Removes tests of %{header,src}_extension features.
21190
21191 2001-09-18 Akim Demaille <akim@epita.fr>
21192
21193 * tests/Makefile.am (package.m4): New.
21194 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
21195 (_AT_CHECK_CALC_ERROR): Likewise.
21196 Factor the `, ' part of verbose error messages.
21197
21198 2001-09-18 Marc Autret <autret_m@epita.fr>
21199
21200 * src/getargs.c (longopts): Declare --defines and --graph as options
21201 with optional arguments.
21202 * src/files.h: Add extern declarations.
21203 * src/files.c (spec_graph_file, spec_defines_file): New.
21204 (output_files): Update.
21205 Remove CPP-outed code.
21206
21207 2001-09-18 Marc Autret <autret_m@epita.fr>
21208
21209 Turn off %{source,header}_extension feature.
21210
21211 * src/files.c (compute_exts_from_gf): Update.
21212 (compute_exts_from_src): Update.
21213 (output_files): CPP-out useless code.
21214 * src/files.h: Remove {header,source}_extension extern declarations.
21215 * src/reader.c (parse_dquoted_param): CPP-out.
21216 (parse_header_extension_decl): Remove.
21217 (parse_source_extension_decl): Remove.
21218 (read_declarations): Remove cases tok_{hdrext,srcext}.
21219 * src/lex.c (percent_table): Remove {header,source}_extension entries.
21220 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
21221
21222 2001-09-10 Akim Demaille <akim@epita.fr>
21223
21224 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
21225 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
21226 (AT_CHECK_OUTPUT): this.
21227 Merely check ls' exit status, its output is useless.
21228
21229 2001-09-10 Akim Demaille <akim@epita.fr>
21230
21231 * tests/calc.at: Use m4_match.
21232 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
21233
21234 2001-09-10 Marc Autret <autret_m@epita.fr>,
21235 Akim Demaille <akim@epita.fr>
21236
21237 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
21238 enum color_e.
21239 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
21240 to `normal'.
21241 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
21242 * src/lex.h: Adjust prototype.
21243 (token_t): Add `tok_undef'.
21244 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
21245 (parse_percent_token): Now returns token_t.
21246 Add default statement in switch.
21247 (lex): Separate `c' as an input variable, from the token_t result
21248 part.
21249 (unlexed): Is a token_t.
21250
21251 2001-09-10 Akim Demaille <akim@epita.fr>
21252
21253 * configure.in: Bump to 1.29a.
21254
21255 2001-09-07 Akim Demaille <akim@epita.fr>
21256
21257 Version 1.29.
21258
21259 2001-08-30 Akim Demaille <akim@epita.fr>
21260
21261 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
21262 * m4/atconfig.m4: Remove.
21263 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
21264 * tests/bison: New.
21265 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
21266 m4_if, m4_patsubst, and m4_regexp.
21267 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
21268 `input' file instead of echo.
21269
21270 2001-08-29 Akim Demaille <akim@epita.fr>
21271
21272 Bump to 1.28e.
21273
21274 2001-08-29 Akim Demaille <akim@epita.fr>
21275
21276 Version 1.28d.
21277
21278 2001-08-29 Paul Eggert <eggert@twinsun.com>
21279
21280 * src/bison.simple (yyparse): Don't take the address of an
21281 item before the start of an array, as that doesn't conform to
21282 the C Standard.
21283
21284 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21285
21286 * doc/bison.texinfo (Location Tracking Calc): New node.
21287
21288 2001-08-29 Paul Eggert <eggert@twinsun.com>
21289
21290 * src/output.c (output): Do not define const, as this now
21291 causes more problems than it cures.
21292
21293 2001-08-29 Akim Demaille <akim@epita.fr>
21294
21295 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21296 the nodes.
21297 Be sure to tag the `detailmenu'.
21298
21299 2001-08-29 Akim Demaille <akim@epita.fr>
21300
21301 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21302 download in a tmp dir.
21303
21304 2001-08-28 Marc Autret <autret_m@epita.fr>
21305
21306 * config/depcomp: New file.
21307
21308 2001-08-28 Marc Autret <autret_m@epita.fr>
21309
21310 * doc/bison.1 (mandoc): Adjust.
21311 From Juan Manuel Guerrero.
21312
21313 2001-08-28 Marc Autret <autret_m@epita.fr>
21314
21315 * src/print_graph.c (print_state): Fix.
21316
21317 2001-08-27 Marc Autret <autret_m@epita.fr>
21318
21319 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21320 char * members.
21321 Echo modifications to the functions prototypes.
21322 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21323
21324 2001-08-27 Marc Autret <autret_m@epita.fr>
21325
21326 * src/vcg.c: Include `xalloc.h'.
21327 (add_colorentry): New.
21328 (add_classname): New.
21329 (add_infoname): New.
21330 * src/vcg.h: Add new prototypes.
21331
21332 2001-08-27 Akim Demaille <akim@epita.fr>
21333
21334 * Makefile.maint: Sync. again with CVS Autoconf.
21335
21336 2001-08-27 Akim Demaille <akim@epita.fr>
21337
21338 * Makefile.maint: Formatting changes.
21339 (po-update, cvs-update, update): New targets.
21340 (AMTAR): Remove.
21341
21342 2001-08-27 Akim Demaille <akim@epita.fr>
21343
21344 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21345 * Makefile.maint: Sync. with CVS Autoconf.
21346
21347 2001-08-27 Marc Autret <autret_m@epita.fr>
21348
21349 * src/vcg.h (struct infoname_s): New.
21350 (struct colorentry_s): New.
21351 (graph_s): New fields {vertical,horizontal}_order in structure.
21352 Add `infoname' field.
21353 Add `colorentry' field;
21354 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21355 (G_HORIZONTAL_ORDER): New.
21356 (G_INFONAME): New.
21357 (G_COLORENTRY): New.
21358 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21359 Add output of `infoname'.
21360 Add output of `colorentry'.
21361
21362 2001-08-27 Marc Autret <autret_m@epita.fr>
21363
21364 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21365 This one shadowed a global parameter.
21366
21367 2001-08-24 Marc Autret <autret_m@epita.fr>
21368
21369 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21370 instead of `unsigned'.
21371 (print_state): Do not call obstack_object_size () in obstack_grow ()
21372 to avoid macro variables shadowing.
21373
21374 2001-08-23 Marc Autret <autret_m@epita.fr>
21375
21376 * src/lex.c (percent_table): Typo: s/naem/name/.
21377 Add graph option.
21378 Normalize new options declarations.
21379
21380 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21381
21382 * tests/suite.at: Exercise %header_extension and %source_extension.
21383
21384 2001-08-16 Marc Autret <autret_m@epita.fr>
21385
21386 * src/reader.c (parse_dquoted_param): New.
21387 (parse_header_extension_decl): Use it.
21388 (parse_source_extension_decl): Likewise.
21389
21390 2001-08-16 Marc Autret <autret_m@epita.fr>
21391
21392 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21393 (get_xxxx_str): Use assert () instead of complain ().
21394 Remove return invokations in default cases.
21395 (get_decision_str): Modify default behaviour. Remove second argument.
21396 Echo modifications on calls.
21397 (output_graph): Fix.
21398
21399 2001-08-16 Marc Autret <autret_m@epita.fr>
21400
21401 * src/getargs.c (usage): Update with ``-g, --graph''.
21402
21403 2001-08-16 Marc Autret <autret_m@epita.fr>
21404
21405 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21406 (Option Cross Key): Likewise.
21407 * doc/bison.1: Update.
21408
214092001-09-25 Pascal Bart <pascal.bart@epita.fr>
21410
21411 * src/output.c (output_master_parser): Don't finish action_obstack.
21412 (output_parser): Don't care about the muscle action, here.
21413 (prepare): Copy the action_obstack in the action muscle.
21414 (output): Free action_obstack.
21415
214162001-09-23 Pascal Bart <pascal.bart@epita.fr>
21417
21418 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21419 will contain `%union' declaration.
21420 (parse_union_decl): Delete #line directive output.
21421 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21422 informations about %union.
21423 (parse_union_decl): Copy the union_obstack in the muscle stype.
21424 * src/bison.simple: Add new #line directive.
21425 Add typdef %%stype YYSTYPE.
21426
214272001-09-23 Pascal Bart <pascal.bart@epita.fr>
21428
21429 * src/bison.simple: Add new `#line' directive.
21430
214312001-09-22 Pascal Bart <pascal.bart@epita.fr>
21432
21433 * src/bison.simple: New `#line' directive.
21434 * src/output.c (output_parser): Support new dynamic muscle input_line.
21435
214362001-09-22 Marc Autret <autret_m@epita.fr>
21437
21438 * src/output.c (output_master_parser): New.
21439 (output_parser): Be more re-entrant.
21440
214412001-09-21 Marc Autret <autret_m@epita.fr>
21442
21443 * src/reader.c (copy_definition, parse_union_decl): Update and use
21444 `linef' muscle.
21445 (copy_action): Likewise.
21446 Use obstack_1grow ().
21447 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21448
214492001-09-21 Marc Autret <autret_m@epita.fr>
21450
21451 * src/options.c (option_table): Adjust.
21452 * src/lex.c (parse_percent_token): Fix.
21453
214542001-09-20 Pascal Bart <pascal.bart@epita.fr>
21455
21456 * src/options.c (symtab.h): Include it, need by lex.h.
21457
214582001-09-20 Pascal Bart <pascal.bart@epita.fr>
21459
21460 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21461 is now an option_table_struct*.
21462 (option_strcmp): New function option_strcmp.
21463 (parse_percent_token): Call option_strcmp.
21464 * src/getargs.c (xalloc.h, options.h): Include it.
21465 (getargs): Call create_long_option_table.
21466 (getargs): Free longopts at the end of the function.
21467 (shortopts): Move in options.c.
21468 * src/options.c (create_long_option_table): New function. Convert
21469 information from option_table to option structure.
21470 * src/reader.c (options.h): Include it.
21471
21472 * src/Makefile.am: Adjust.
21473 * src/options.c (option_table): Create from longopts and percent_table.
21474 * src/getargs.c (longopts): Delete.
21475 * src/lex.c (struct percent_table_struct): Delete.
21476 (percent_table): Delete.
21477 (options.h): Include it.
21478 * src/options.c: Create.
21479 * src/options.h: Create.
21480 Declare enum opt_access_e.
21481 Define struct option_table_struct.
21482
214832001-09-20 Marc Autret <autret_m@epita.fr>
21484
21485 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21486 sections of Bison.
21487
214882001-09-19 Pascal Bart <pascal.bart@epita.fr>
21489
21490 * src/bison.simple: s/%%filename/%%skeleton.
21491 * src/muscle_tab.c (getargs.h): Include it.
21492 (muscle_init): Insert new muscle skeleton.
21493
214942001-09-18 Pascal Bart <pascal.bart@epita.fr>
21495
21496 * src/output.c (output_parser): Delete unused variable actions_dumped.
21497
214982001-09-07 Pascal Bart <pascal.bart@epita.fr>
21499
21500 * src/output.c (output): Delete call to reader_output_yylsp.
21501 * src/reader.c (reader): Likewise.
21502 * src/reader.h: Delete declaration of reader_output_yylsp.
21503
215042001-09-02 Marc Autret <autret_m@epita.fr>
21505
21506 * src/reader.c: Include muscle_tab.h.
21507 (parse_union_decl): Update.
21508 (parse_macro_decl): Rename parse_muscle_decl.
21509 Update to use renamed functions and variable.
21510 (read_declarations, copy_action, read_additionnal_code, : Updated
21511 with correct variables and functions names.
21512 (packsymbols, reader): Likewise.
21513
21514 * src/reader.h (muscle_obstack): Extern declaration update.
21515
21516 * src/output.c: Include muscle_tab.h
21517 In all functions using macro_insert, change by using muscle_insert ().
21518 (macro_obstack): Rename muscle_obstack.
21519 Echo modifications in the whole file.
21520 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21521 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21522 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21523
21524 * src/muscle_tab.h: Update double inclusion macros.
21525 (macro_entry_s): Rename muscle_entry_s.
21526 Update prototypes.
21527
21528 * src/muscle_tab.c: Include muscle_tab.h.
21529 Rename macro_tabble to muscle_table.
21530 (mhash1, mhash2, mcmp): Use muscle_entry.
21531 (macro_init): Rename muscle_init. Update.
21532 (macro_insert): Rename muscle_insert. Update.
21533 (macro_find): Rename muscle_find. Update.
21534
21535 * src/main.c: Include muscle_tab.h.
21536 (main): Call muscle_init ().
21537 * src/Makefile.am (bison_SOURCES): Echo modifications.
21538
215392001-09-02 Marc Autret <autret_m@epita.fr>
21540
21541 Now the files macro_tab.[ch] are named muscle_tab.[ch].
21542
21543 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21544
215452001-09-02 Marc Autret <autret_m@epita.fr>
21546
21547 * src/macrotab.c, src/macrotab.h: Remove.
21548
215492001-09-01 Pascal Bart <pascal.bart@epita.fr>
21550
21551 * src/reader.c (copy_guard): Use muscle to specify the `#line'
21552 filename.
21553
215542001-09-01 Marc Autret <autret_m@epita.fr>
21555
21556 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21557 to an explicit value to activate the feature. We do it here.
21558
215592001-08-31 Pascal Bart <pascal.bart@epita.fr>
21560
21561 * src/output.c (prepare): Delete the `filename' muscule insertion.
21562 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21563 (parse_union_decl): Likewise.
21564 * src/macrotab.c (macro_init): Initialize filename by infile.
21565
215662001-08-31 Marc Autret <autret_m@epita.fr>
21567
21568 * src/bison.simple (YYLSP_NEEDED): New definition.
21569 * src/output.c (prepare): Add macro insertion of `locations_flag'
21570
215712001-08-31 Pascal Bart <pascal.bart@epita.fr>
21572
21573 * src/output.c (prepare): Delete insertion of previous muscles,
21574 and insert the `prefix' muscles.
21575 * src/macrotab.c (macro_init): Likewise.
21576 (macro_init): Initialization prefix directive by `yy'.
21577 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
21578 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21579 yylval, yydebug, yyerror, yynerrs and yyparse.
21580 New directive `#define' to substitute yydebug, ... with option
21581 name_prefix.
21582
215832001-08-31 Pascal Bart <pascal.bart@epita.fr>
21584
21585 * src/main.c (main): Standardize.
21586 * src/output.c (output_table_data, output_parser): Likewise.
21587 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21588
215892001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21590
21591 * src/reader.c (read_additionnal_code): Rename %%user_code to
21592 %%epilogue.
21593 * src/output.c (output): Rename %%declarations to %%prologue.
21594 * src/bison.simple: Echo modifications.
21595
215962001-08-31 Marc Autret <autret_m@epita.fr>
21597
21598 * src/reader.c (readgram): CleanUp.
21599 (output_token_defines): Likewise.
21600 (packsymbols): Likewise.
21601 (reader): Likewise.
21602 * src/output.c (output): CPP-out useless code.
21603
216042001-08-31 Pascal Bart <pascal.bart@epita.fr>
21605
21606 * src/reader.c (reader): Delete obsolete call to function
21607 output_trailers and output_headers.
21608 * src/output.h: Remove obsolete functions prototypes of output_headers
21609 and output_trailers.
21610
216112001-08-30 Pascal Bart <pascal.bart@epita.fr>
21612
21613 * src/main.c: Include macrotab.h.
21614 * src/macrotab.h (macro_entry_s): Constify fields.
21615 Adjust functions prototypes.
21616 * src/macrotab.c (macro_insert): Constify key and value.
21617 (macro_find): Constify key.
21618 (macro_insert): Include 'xalloc.h'
21619 (macro_insert): Use XMALLOC.
21620 (macro_find): Constify return value.
21621 * src/output.c (output_table_data): Rename table to table_data.
21622 (output_parser): Constify macro_key, macro_value.
21623
216242001-08-30 Marc Autret <autret_m@epita.fr>
21625
21626 * src/reader.c (parse_skel_decl): New.
21627 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
21628 * src/lex.h (token_t): New token `tok_skel'.
21629 * src/lex.c (percent_table): Add skeleton option entry.
21630 Standardize.
21631
216322001-08-29 Marc Autret <autret_m@epita.fr>
21633
21634 * src/bison.simple: Add %%user_code directive at the end.
21635 * src/reader.c (read_additionnal_code): New.
21636 (reader): Use it.
21637 * src/output.c (output_program): Remove.
21638 (output): Update.
21639
216402001-08-28 Marc Autret <autret_m@epita.fr>
21641
21642 * src/output.c (output_actions): Clean up.
21643 (output_gram): CPP-out useless code.
21644 * src/reader.c (reader): Clean up, CPP-out useless code.
21645
216462001-08-28 Pascal Bart <pascal.bart@epita.fr>
21647
21648 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
21649 directive.
21650 * src/bison.simple: Add `%%definitions'.
21651
216522001-08-28 Marc Autret <autret_m@epita.fr>
21653
21654 * config/depcomp: New file.
21655
216562001-08-27 Paul Eggert <eggert@twinsun.com>
21657
21658 * src/bison.simple (yyparse): Don't take the address of an
21659 item before the start of an array, as that doesn't conform to
21660 the C Standard.
21661
216622001-08-27 Robert Anisko <robert.anisko@epita.fr>
21663
21664 * src/output.c (output): Remove the initialization of the macro
21665 obstack. It was done too late here.
21666
21667 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21668 completely wrong.
21669 (reader): Initialize the macro obstack here, since we need it to grow
21670 '%define' directives.
21671
21672 * src/reader.h: Declare the macro obstack as extern.
21673
216742001-08-27 Robert Anisko <robert.anisko@epita.fr>
21675
21676 * src/output.c (output_parser): Fix. Store single '%' characters in
21677 the output obstack instead of throwing them away.
21678
216792001-08-27 Akim Demaille <akim@epita.fr>
21680
21681 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21682
216832001-08-25 Robert Anisko <robert.anisko@epita.fr>
21684
21685 * lib/Makefile.am: Adjust.
21686
216872001-08-25 Robert Anisko <robert.anisko@epita.fr>
21688
21689 * src/bison.simple: Update and add '%%' directives.
21690
216912001-08-25 Robert Anisko <robert.anisko@epita.fr>
21692
21693 * src/reader.c (reader): Remove calls to 'output_headers' and
21694 'output_trailers'. Remove some C output.
21695 (readgram): Disable a piece of code that was writing a default
21696 definition for 'YYSTYPE'.
21697 (reader_output_yylsp): Remove.
21698 (packsymbols): Output token defintions to a macro.
21699 (copy_definition): Disable C output.
21700
21701 * src/reader.c (parse_macro_decl): New function used to parse macro
21702 declarations.
21703 (copy_string2): Put the body of copy_string into this new function.
21704 Add a parameter to let the caller choose whether he wants to copy the
21705 string delimiters or not.
21706 (copy_string): Be a simple call to copy_string2 with the last argument
21707 bound to true.
21708 (read_declarations): Add case for macro definition.
21709 (copy_identifier): New.
21710 (parse_macro_decl): Read macro identifiers using copy_identifier
21711 rather than lex.
21712
217132001-08-25 Robert Anisko <robert.anisko@epita.fr>
21714
21715 * src/output.c (prepare): Add prefixed names.
21716 (output_parser): Output semantic actions.
21717 (output_parser): Fix bug on '%%line' directives.
21718
21719 * src/output.c (output_headers): Remove. The C code printed by this
21720 function should now be in the skeletons.
21721 (output_trailers): Remove.
21722 (output): Disable call to 'reader_output_yylsp'.
21723 (output_rule_data): Do not output tables to the table obstack.
21724
21725 * src/output.c: Remove some C dedicated output.
21726 Improve the use of macro and output obstacks.
21727 (output_defines): Remove.
21728
21729 * src/output.c (output_token_translations): Associate 'translate'
21730 table with a macro. No output to the table obstack.
21731 (output_gram): Same for 'rhs' and 'prhs'.
21732 (output_stos): Same for 'stos'.
21733 (output_rule_data): Same for 'r1' and 'r2'.
21734 (token_actions): Same for 'defact'.
21735 (goto_actions): Same for 'defgoto'.
21736 (output_base): Same for 'pact' and 'pgoto'.
21737 (output_table): Same for 'table'.
21738 (output_check): Same for 'check'.
21739
21740 * src/output.c (output_table_data): New function.
21741 (output_short_table): Remove.
21742 (output_short_or_char_table): Remove.
21743
21744 * src/output.c (output_parser): Replace most of the skeleton copy code
21745 with something new. Skeletons are now processed character by character
21746 rather than line by line, and Bison looks for '%%' macros. This is the
21747 first step in making Bison's output process (a lot) more flexible.
21748 (output_parser): Use the macro table.
21749
217502001-08-25 Robert Anisko <robert.anisko@epita.fr>
21751
21752 * src/main.c (main): Initialize the macro table.
21753
217542001-08-25 Robert Anisko <robert.anisko@epita.fr>
21755
21756 * src/lex.c (percent_table): Add tok_define.
21757 * src/lex.h: Add tok_define.
21758
217592001-08-25 Robert Anisko <robert.anisko@epita.fr>
21760
21761 * src/macrotab.c: New file.
21762 * src/macrotab.h: New file.
21763 * src/Makefile.am: Update.
21764
217652001-08-25 Robert Anisko <robert.anisko@epita.fr>
21766
21767 * lib/hash.c: New file.
21768 * lib/hash.h: New file.
21769 * lib/Makefile.am: Update.
21770
217712001-08-15 Akim Demaille <akim@epita.fr>
21772
21773 Version 1.28c.
21774
217752001-08-15 Marc Autret <autret_m@epita.fr>
21776
21777 * src/reader.c (readgram): Indent output macro YYSTYPE.
21778 (packsymbols): Likewise.
21779 (output_token_defines): Likewise.
21780 * src/files.c: Standardize.
21781 (compute_header_macro): New.
21782 (defines_obstack_save): New. Use compute_header_macro.
21783 (output_files): Update. Use defines_obstack_save.
21784
217852001-08-15 Akim Demaille <akim@epita.fr>
21786
21787 * doc/bison.texinfo (Table of Symbols): Document
21788 YYSTACK_USE_ALLOCA.
21789
217902001-08-15 Akim Demaille <akim@epita.fr>
21791
21792 * missing: Update from CVS Automake.
21793 * config/config.guess, config/config.sub, config/texinfo.tex:
21794 Update from gnu.org.
21795
217962001-08-15 Akim Demaille <akim@epita.fr>
21797
21798 * Makefile.maint: Sync with CVS Autoconf.
21799
218002001-08-14 Pascal Bart <pascal.bart@epita.fr>
21801
21802 * doc/bison.texinfo: Include GNU Free Documentation License from
21803 `fdl.texi'.
21804 * doc/fdl.texi: Add to package.
21805
218062001-08-14 Marc Autret <autret_m@epita.fr>
21807
21808 Turn on %{source,header}_extension features.
21809
21810 * src/lex.c (percent_table): Un-CPP out header_extension and
21811 source_extension.
21812 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
21813 (compute_exts_from_src): Remove conditions. It restores priorities
21814 between options.
21815
218162001-08-14 Marc Autret <autret_m@epita.fr>
21817
21818 * src/files.c (compute_base_names): Add extensions computing when
21819 `--file-prefix' used.
21820 Standardize function calls.
21821
218222001-08-13 Marc Autret <autret_m@epita.fr>
21823
21824 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
21825 defining it (defined but null disables alloca).
21826
218272001-08-13 Marc Autret <autret_m@epita.fr>
21828
21829 * src/bison.simple (_yy_memcpy): CPP reformat.
21830
218312001-08-13 Pascal Bart <pascal.bart@epita.fr>
21832
21833 * tests/atconfig.in (CPPFLAGS): Fix.
21834
218352001-08-10 Pascal Bart <pascal.bart@epita.fr>
21836
21837 * doc/bison.texinfo: Include GNU General Public License from
21838 `gpl.texi'.
21839 * doc/gpl.texi: Add to package.
21840
218412001-08-10 Marc Autret <autret_m@epita.fr>
21842
21843 * src/print_graph.h: Fix.
21844 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21845
218462001-08-10 Akim Demaille <akim@epita.fr>
21847
21848 * src/system.h: Provide default declarations for stpcpy, strndup,
21849 and strnlen.
21850
218512001-08-10 Robert Anisko <anisko_r@epita.fr>
21852
21853 * doc/bison.texinfo (Locations): Update @$ stuff.
21854
218552001-08-09 Robert Anisko <anisko_r@epita.fr>
21856
21857 * src/bison.simple (YYLLOC_DEFAULT): Update.
21858 (yyparse): Adjust.
21859
218602001-08-08 Marc Autret <autret_m@epita.fr>
21861
21862 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
21863 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21864 Reported by Fabrice Bauzac.
21865
218662001-08-08 Marc Autret <autret_m@epita.fr>
21867
21868 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21869 * src/vcg.c (output_node): Fix.
21870 * src/vcg.h: Cleanup.
21871 * src/print_graph.c: Add comments.
21872 (node_output_size): New global variable. Simplify the formatting of
21873 the VCG graph output.
21874 (print_actions): Unused code is now used. It notifies the final state
21875 and no action states in the VCG graph. It also give the reduce actions.
21876 The `shift and goto' edges are red and the `go to state' edges are
21877 blue.
21878 Get the current node name and node_obstack by argument.
21879 (node_obstack): New variable.
21880 (print_state): Manage node_obstack.
21881 (print_core): Use node_obstack given by argument.
21882 A node is not only computed here but in print_actions also.
21883 (print_graph): CPP out useless code instead of commenting it.
21884
218852001-08-07 Pascal Bart <pascal.bart@epita.fr>
21886
21887 * tests/atconfig.in (CPPFLAGS): Fix.
21888
218892001-08-07 Akim Demaille <akim@epita.fr>
21890
21891 * src/print_graph.c (quote): New.
21892 (print_core): Use it.
21893
218942001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
21895
21896 * src/vcg.c (complain.h): Include it.
21897 Unepitaize `return' invocations.
21898 [NDEBUG] (main): Remove.
21899 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
21900 * src/files.c (open_files): Initialize graph_obstack.
21901 * src/print_graph.c (print_actions): CPP out useless code.
21902 (print_core): Don't output the last `\n' in labels.
21903 Use `quote'.
21904 * src/files.c (output_files): Output the VCG file.
21905 * src/main.c (main): Invoke print_graph ();
21906
219072001-08-06 Marc Autret <autret_m@epita.fr>
21908
21909 Automaton VCG graph output.
21910 Using option ``-g'' or long option ``--graph'', you can generate
21911 a gram_filename.vcg file containing a VCG description of the LALR (1)
21912 automaton of your grammar.
21913
21914 * src/main.c: Call to print_graph() function.
21915 * src/getargs.h: Update.
21916 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21917 (graph_flag): New flag.
21918 (longopts): Update.
21919 (getargs): Add case `g'.
21920 * src/files.c (graph_obstack): New obstack struct.
21921 (open_files): Initialize new obstack.
21922 (output_files): Saves graph_obstack if required.
21923 * src/files.h (graph_obstack): New extern declaration.
21924 * src/Makefile.am: Add new source files.
21925
219262001-08-06 Marc Autret <autret_m@epita.fr>
21927
21928 * src/print_graph.c, src/print_graph.h (graph): New.
21929 * src/vcg.h: New file.
21930 * src/vcg.c: New file, VCG graph handling.
21931
219322001-08-06 Marc Autret <autret_m@epita.fr>
21933
21934 Add of %source_extension and %header_extension which specify
21935 the source or/and the header output file extension.
21936
21937 * src/files.c (compute_base_names): Remove initialisation of
21938 src_extension and header_extension.
21939 (compute_exts_from_gf): Update.
21940 (compute_exts_from_src): Update.
21941 (output_files): Update.
21942 * src/reader.c (parse_header_extension_decl): New.
21943 (parse_source_extension_decl): New.
21944 (read_declarations): New case statements for the new tokens.
21945 * src/lex.c (percent_table): Add entries for %source_extension
21946 and %header_extension.
21947 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21948
219492001-08-06 Marc Autret <autret_m@epita.fr>
21950
21951 * configure.in: Bump to 1.28c.
21952 * doc/bison.texinfo: Texinfo thingies.
21953
219542001-08-04 Pascal Bart <pascal.bart@epita.fr>
21955
21956 * tests/atconfig.in (CPPFLAGS): Add.
21957 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21958
219592001-08-03 Akim Demaille <akim@epita.fr>
21960
21961 Version 1.28b.
21962
219632001-08-03 Akim Demaille <akim@epita.fr>
21964
21965 * tests/Makefile.am (check-local): Ship testsuite.
21966 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21967 Include `string.h'.
21968
219692001-08-03 Akim Demaille <akim@epita.fr>
21970
21971 * configure.in: Try using -Wformat when compiling.
21972
219732001-08-03 Akim Demaille <akim@epita.fr>
21974
21975 * configure.in: Bump to 1.28b.
21976
219772001-08-03 Akim Demaille <akim@epita.fr>
21978
21979 * src/complain.c: Adjust strerror_r portability issues.
21980
219812001-08-03 Akim Demaille <akim@epita.fr>
21982
21983 Version 1.28a.
21984
219852001-08-03 Akim Demaille <akim@epita.fr>
21986
21987 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21988 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21989 * src/getargs.c: Include complain.h.
21990 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21991 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21992
219932001-08-03 Akim Demaille <akim@epita.fr>
21994
21995 * src/reader.c (readgram): Display hidden chars in error messages.
21996
219972001-08-03 Akim Demaille <akim@epita.fr>
21998
21999 Update to gettext 0.10.39.
22000
220012001-08-03 Akim Demaille <akim@epita.fr>
22002
22003 * lib/strspn.c: New.
22004
220052001-08-01 Marc Autret <autret_m@epita.fr>
22006
22007 * doc/bison.texinfo: Update.
22008 * doc/bison.1 (mandoc): Update.
22009 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
22010 * src/files.c: Support output files extensions computing.
22011 (src_extension): New static variable.
22012 (header_extension): New static variable.
22013 (tr): New function.
22014 (get_extension_index): New function, gets the index of an extension
22015 filename in a string.
22016 (compute_exts_from_gf): New function, computes extensions from the
22017 grammar file extension.
22018 (compute_exts_from_src): New functions, computes extensions from the
22019 C source file extension, file given by ``-o'' option.
22020 (compute_base_names): Update.
22021 (output_files): Update.
22022
220232001-08-01 Robert Anisko <anisko_r@epita.fr>
22024
22025 * doc/bison.texi: Document @$.
22026 (Locations): New section.
22027
220282001-07-18 Akim Demaille <akim@epita.fr>
22029
22030 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
22031 * config/prev-version.txt, config/move-if-change: New.
22032 * Makefile.am: Adjust.
22033
220342001-07-08 Pascal Bart <pascal.bart@epita.fr>
22035
22036 * src/bison.simple (yyparse): Suppress warning `comparaison
22037 between signed and unsigned'.
22038
220392001-07-05 Pascal Bart <pascal.bart@epita.fr>
22040
22041 * src/getargs.h (raw_flag): Remove.
22042 * src/getargs.c: Die on `-r'/`--raw'.
22043 * src/lex.c (parse_percent_token): Die on `%raw'.
22044 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22045 * tests/calc.at: Suppress test with option `--raw'.
22046
220472001-07-14 Akim Demaille <akim@epita.fr>
22048
22049 * config/: New.
22050 * configure.in: Require Autoconf 2.50.
22051 Update to gettext 0.10.38.
22052
220532001-03-16 Akim Demaille <akim@epita.fr>
22054
22055 * doc/bison.texinfo: ANSIfy the examples.
22056
220572001-03-16 Akim Demaille <akim@epita.fr>
22058
22059 * getargs.c (skeleton): New variable.
22060 (longopts): --skeleton is a new option.
22061 (shortopts, getargs): -S is a new option.
22062 * getargs.h: Declare skeleton.
22063 * output.c (output_parser): Use it.
22064
220652001-03-16 Akim Demaille <akim@epita.fr>
22066
22067 * m4/strerror_r.m4: New.
22068 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22069 * lib/error.h, lib/error.c: Update.
22070
220712001-03-16 Akim Demaille <akim@epita.fr>
22072
22073 * src/getargs.c (longopts): Clean up.
22074
220752001-02-21 Akim Demaille <akim@epita.fr>
22076
22077 * src/reader.c (gensym): `gensym_count' is your own.
22078 Use a static buf to create the symbol name, as token_buffer is no
22079 longer a buffer.
22080
220812001-02-08 Akim Demaille <akim@epita.fr>
22082
22083 * src/conflicts.c (conflict_report): Be sure not to append to res
22084 between two calls, which could happen if both first sprintf were
22085 skipped, but not the first cp += strlen.
22086
220872001-02-08 Akim Demaille <akim@epita.fr>
22088
22089 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22090 New, from fileutils 4.0.37.
22091 * configure.in: Require Autoconf 2.49c. I took some time before
22092 making this decision. This is the only way out for portability
22093 issues in Bison, it would mean way too much duplicate effort to
22094 import in Bison features implemented in 2.49c since 2.13.
22095 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22096
220972001-02-02 Akim Demaille <akim@epita.fr>
22098
22099 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
22100 * lib/xalloc.h, lib/xmalloc.c: Update.
22101
221022001-01-19 Akim Demaille <akim@epita.fr>
22103
22104 Get rid of the ad hoc handling of token_buffer in the scanner: use
22105 the obstacks.
22106
22107 * src/lex.c (token_obstack): New.
22108 (init_lex): Initialize it. No longer call...
22109 (grow_token_buffer): this. Remove it.
22110 Adjust all the places which used it to use the obstack.
22111
221122001-01-19 Akim Demaille <akim@epita.fr>
22113
22114 * src/lex.h: Rename all the tokens:
22115 s/\bENDFILE\b/tok_eof/g;
22116 s/\bIDENTIFIER\b/tok_identifier/g;
22117 etc.
22118 Let them be enums, not #define, to ease debugging.
22119 Adjust all the code.
22120
221212001-01-18 Akim Demaille <akim@epita.fr>
22122
22123 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
22124 * src/lex.c (maxtoken, grow_token_buffer): Static.
22125
221262001-01-18 Akim Demaille <akim@epita.fr>
22127
22128 Since we now use obstacks, more % directives can be enabled.
22129
22130 * src/lex.c (percent_table): Also accept `%yacc',
22131 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
22132 `%debug'.
22133 Handle the actions for `%semantic_parser' and `%pure_parser' here,
22134 instead of returning a token.
22135 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
22136 * src/reader.c (read_declarations): Adjust.
22137 * src/files.c (open_files): Don't call `compute_base_names', don't
22138 compute `attrsfile' since they depend upon data which might be
22139 *in* the input file now.
22140 (output_files): Do it here.
22141 * src/output.c (output_headers): Document the fact that this patch
22142 introduces a guaranteed SEGV for semantic parsers.
22143 * doc/bison.texinfo: Document them.
22144 * tests/suite.at: Exercise these %options.
22145
221462000-12-20 Akim Demaille <akim@epita.fr>
22147
22148 Also handle the output file (--verbose) with obstacks.
22149
22150 * files.c (foutput): Remove.
22151 (output_obstack): New.
22152 Adjust all dependencies.
22153 * src/conflicts.c: Return a string.
22154 * src/system.h (obstack_grow_string): Rename as...
22155 (obstack_sgrow): this. Be ready to work with non literals.
22156 (obstack_fgrow4): New.
22157
221582000-12-20 Akim Demaille <akim@epita.fr>
22159
22160 * src/files.c (open_files): Fix the computation of short_base_name
22161 in the case of `-o foo.tab.c'.
22162
221632000-12-20 Akim Demaille <akim@epita.fr>
22164
22165 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
22166 (copy_dollar): Now that everything uses obstacks, get rid of the
22167 FILE * parameters.
22168
221692000-12-20 Akim Demaille <akim@epita.fr>
22170
22171 * src/files.c (open_files): Actually the `.output' file is based
22172 on the short_base_name, not base_name.
22173 * tests/suite.at (Checking output file names): Adjust.
22174
221752000-12-20 Akim Demaille <akim@epita.fr>
22176
22177 * src/bison.s1: Remove, we now use directly...
22178 * src/bison.simple: this.
22179 * src/Makefile.am: Use pkgdata instead of data.
22180
221812000-12-20 Akim Demaille <akim@epita.fr>
22182
22183 * src/files.c (guard_obstack): New.
22184 (open_files): Initialize it.
22185 (output_files): Dump it...
22186 * src/files.h: Export it.
22187 * src/reader.c (copy_guard): Use it.
22188
221892000-12-19 Akim Demaille <akim@epita.fr>
22190
22191 * src/files.c (outfile, defsfile, actfile): Removed as global
22192 vars.
22193 (open_files): Don't compute them.
22194 (output_files): Adjust.
22195 (base_name, short_base_name): Be global.
22196 Adjust dependencies.
22197
221982000-12-19 Akim Demaille <akim@epita.fr>
22199
22200 * src/files.c (strsuffix): New.
22201 (stringappend): Be just like strcat but allocate.
22202 (base_names): Eve out from open_files.
22203 Try to simplify the rather hairy computation of base_name and
22204 short_base_name.
22205 (open_files): Use it.
22206 * tests/suite.at (Checking output file names): New test.
22207
222082000-12-19 Akim Demaille <akim@epita.fr>
22209
22210 * src/system.h (obstack_grow_literal_string): Rename as...
22211 (obstack_grow_string): this.
22212 * src/output.c (output_parser): Recognize `%% actions' instead of
22213 `$'.
22214 * src/bison.s1: s/$/%% actions/.
22215 * src/bison.hairy: Likewise.
22216
222172000-12-19 Akim Demaille <akim@epita.fr>
22218
22219 * src/output.c (output_parser): Compute the `#line' lines when
22220 there are.
22221 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
22222 Suggested by Hans Aberg.
22223
222242000-12-19 Akim Demaille <akim@epita.fr>
22225
22226 Let the handling of the skeleton files be local to the procedures
22227 that use it.
22228
22229 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
22230 longer static.
22231 (fparser, open_extra_files): Remove.
22232 (open_files, output_files): Don't take care of fparser.
22233 * src/files.h: Adjust.
22234 * src/output.c (output_parser): Open and close the file to the
22235 skeleton.
22236 * src/reader.c (read_declarations): When %semantic_parser, open
22237 fguard.
22238
222392000-12-19 Akim Demaille <akim@epita.fr>
22240
22241 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
22242 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
22243
222442000-12-19 Akim Demaille <akim@epita.fr>
22245
22246 * src/files.c (open_files): Yipee! We no longer need all the code
22247 looking for `/tmp' since we have no tmp file.
22248
222492000-12-19 Akim Demaille <akim@epita.fr>
22250
22251 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
22252 New macros.
22253 * src/files.c (open_files): Less dependency on MSDOS etc.
22254
222552000-12-14 Akim Demaille <akim@epita.fr>
22256
22257 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
22258 Provide a default definition.
22259 Use it when executing the default @ action.
22260 * src/reader.c (reader_output_yylsp): No longer include
22261 `timestamp' and `text' in the default YYLTYPE.
22262
222632000-12-12 Akim Demaille <akim@epita.fr>
22264
22265 * src/reader.c (copy_definition, parse_union_decl, copy_action)
22266 (copy_guard): Quote the file names.
22267 Reported by Laurent Mascherpa.
22268
222692000-12-12 Akim Demaille <akim@epita.fr>
22270
22271 * src/output.c (output_headers, output_program, output): Be sure
22272 to escape special characters when outputting filenames.
22273 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22274 (output_headers): Don't depend on them, Use ACTSTR.
22275
222762000-11-17 Akim Demaille <akim@epita.fr>
22277
22278 * lib/obstack.h: Formatting changes.
22279 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22280 prevents type checking.
22281 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22282 cast the value to (void *): assigning a `foo *' to a `void *'
22283 variable is valid.
22284 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22285 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22286 append characters.
22287
222882000-11-17 Akim Demaille <akim@epita.fr>
22289
22290 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22291 as...
22292 (suite.m4, regression.m4, calc.m4): these.
22293 * tests/atgeneral.m4: Update from CVS Autoconf.
22294
222952000-11-17 Akim Demaille <akim@epita.fr>
22296
22297 * tests/regression.m4 (%union and --defines): New test,
22298 demonstrating a current bug in the obstack implementation.
22299
223002000-11-17 Akim Demaille <akim@epita.fr>
22301
22302 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22303 macros.
22304 Use them to declare the variables which are global or local to
22305 `yyparse'.
22306
223072000-11-17 Akim Demaille <akim@epita.fr>
22308
22309 * acconfig.h: Remove, no longer used.
22310
223112000-11-07 Akim Demaille <akim@epita.fr>
22312
22313 * src: s/Copyright (C)/Copyright/g.
22314
223152000-11-07 Akim Demaille <akim@epita.fr>
22316
22317 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22318 defining.
22319 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22320
223212000-11-07 Akim Demaille <akim@epita.fr>
22322
22323 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22324 Merge in a single CPP if/else.
22325
223262000-11-07 Akim Demaille <akim@epita.fr>
22327
22328 * src/output.c (output): Remove useless variables.
22329 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22330 argument `data' for consistency with the prototypes.
22331 Qualify it `const'.
22332 (obstack_copy, obstack_copy0): Rename the second argument as
22333 `address' for consistency. Qualify it `const'.
22334 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22335 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22336 `const' their input argument (`data' or `address').
22337 Adjust the corresponding macros to include `const' in casts.
22338
223392000-11-03 Akim Demaille <akim@epita.fr>
22340
22341 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22342 s/PFILE1/BISON_HAIRY/.
22343 Adjust dependencies.
22344
223452000-11-03 Akim Demaille <akim@epita.fr>
22346
22347 For some reason, this was not applied.
22348
22349 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22350 `unlink': it's no longer used.
22351
223522000-11-03 Akim Demaille <akim@epita.fr>
22353
22354 * src/files.c (skeleton_find): New function, eved out of...
22355 (open_files, open_extra_files): here.
22356
223572000-11-03 Akim Demaille <akim@epita.fr>
22358
22359 Don't use `atexit'.
22360
22361 * src/files.c (obstack_save): New function.
22362 (done): Rename as...
22363 (output_files): this.
22364 Use `obstack_save'.
22365 * src/main.c (main): Don't use `atexit' to register `done', since
22366 it no longer has to remove tmp files, just call `output_files'
22367 when there are no errors.
22368
223692000-11-02 Akim Demaille <akim@epita.fr>
22370
22371 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22372 `unlink': it's no longer used.
22373 * src/files.h: Formatting changes.
22374
223752000-11-02 Akim Demaille <akim@epita.fr>
22376
22377 Remove the last uses of mktemp and unlink/delete.
22378
22379 * src/files.c (fdefines, ftable): Removed.
22380 (defines_ostack, table_obstack): New.
22381 Adjust dependencies of the former into uses of the latter.
22382 * src/output.c (output_short_or_char_table, output_short_table):
22383 Convert to using obstacks.
22384 * src/reader.c (copy_comment2): Accept one FILE * and two
22385 obstacks.
22386 (output_token_defines, reader_output_yylsp): Use obstacks.
22387 * src/system.h (obstack_fgrow3): New.
22388 * po/POTFILES.in: Adjust.
22389
223902000-11-01 Akim Demaille <akim@epita.fr>
22391
22392 Change each use of `fattrs' into a use of `attrs_obstack'.
22393
22394 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22395 * src/files.c (fattrs): Remove.
22396 (attrs_obstack): New.
22397 Adjust all dependencies.
22398 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22399
224002000-11-01 Akim Demaille <akim@epita.fr>
22401
22402 Introduce obstacks.
22403 Change each use of `faction' into a use of `action_obstack'.
22404
22405 * lib/obstack.h, lib/obstack.c: New files.
22406 * src/files.c (faction): Remove.
22407 (action_obstack): New.
22408 Adjust all dependencies.
22409
224102000-10-20 Akim Demaille <akim@epita.fr>
22411
22412 * lib/quote.h (PARAMS): New macro. Use it.
22413
224142000-10-16 Akim Demaille <akim@epita.fr>
22415
22416 * src/output.c (output_short_or_char_table): New function.
22417 (output_short_table, output_token_translations): Use it.
22418 (goto_actions): Use output_short_table.
22419
224202000-10-16 Akim Demaille <akim@epita.fr>
22421
22422 * src/symtab.c (bucket_new): New function.
22423 (getsym): Use it.
22424
22425 * src/output.c (output_short_table): New argument to display the
22426 comment associated with the table.
22427 Adjust dependencies.
22428 (output_gram): Use it.
22429 (output_rule_data): Nicer output layout for YYTNAME.
22430
224312000-10-16 Akim Demaille <akim@epita.fr>
22432
22433 * src/lex.c (read_typename): New function.
22434 (lex): Use it.
22435 * src/reader.c (copy_dollar): Likewise.
22436
224372000-10-16 Akim Demaille <akim@epita.fr>
22438
22439 * src/reader.c (copy_comment2): Expect the input stream to be on
22440 the `/' which is suspected to open a comment, instead of being
22441 called after `//' or `/*' was read.
22442 (copy_comment, copy_definition, parse_union_decl, copy_action)
22443 (copy_guard): Adjust.
22444
224452000-10-16 Akim Demaille <akim@epita.fr>
22446
22447 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22448 `read_signed_integer'.
22449
224502000-10-16 Akim Demaille <akim@epita.fr>
22451
22452 * src/reader.c (copy_dollar): New function.
22453 (copy_guard, copy_action): Use it.
22454
224552000-10-16 Akim Demaille <akim@epita.fr>
22456
22457 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22458 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22459 New files, from Fileutils 4.0.27.
22460 * src/main.c (printable_version): Remove.
22461 * src/lex.c, src/reader.c: Use `quote'.
22462
224632000-10-04 Akim Demaille <akim@epita.fr>
22464
22465 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22466
224672000-10-04 Akim Demaille <akim@epita.fr>
22468
22469 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22470
224712000-10-04 Akim Demaille <akim@epita.fr>
22472
22473 When a literal string is used to define two different tokens,
22474 `bison -v' segfaults.
22475 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22476
22477 * tests/regression.m4: New file.
22478 Include the core of the sample provided by Piotr Gackiewicz.
22479 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22480 properly.
22481
224822000-10-04 Akim Demaille <akim@epita.fr>
22483
22484 * src/reader.c (parse_expect_decl): Keep `count' within the size
22485 of `buffer'.
22486 From Neil Booth.
22487
224882000-10-02 Paul Eggert <eggert@twinsun.com>
22489
22490 * bison.s1 (yyparse): Assign the default value
22491 unconditionally, to avoid a GCC warning and make the parser a
22492 tad smaller.
22493
224942000-10-02 Akim Demaille <akim@epita.fr>
22495
22496 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22497 options.
22498
224992000-10-02 Akim Demaille <akim@epita.fr>
22500
22501 * src/derives.c, src/print.c, src/reduce.c: To ease the
22502 translation, move some `\n' out of the translated strings.
22503
225042000-10-02 Akim Demaille <akim@epita.fr>
22505
22506 The location tracking mechanism is precious for parse error
22507 messages. Nevertheless, it is enabled only when `@n' is used in
22508 the grammar, which is a different issue (you can use it in error
22509 message, but not in the grammar per se). Therefore, there should
22510 be another means to enable it.
22511
22512 * src/getargs.c (getargs): Support `--locations'.
22513 (usage): Report it.
22514 * src/getargs.h (locationsflag): Export it.
22515 * src/lex.c (percent_table): Support `%locations'.
22516 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22517 with `locationsflag'.
22518 * doc/bison.texinfo: Document `--locations' and `%locations'.
22519 Sort the options.
22520 * tests/calc.m4: Test it.
22521
22522 For regularity of the names, replace each
22523 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22524 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22525 In addition replace each `flag' with `_flag'.
22526
225272000-10-02 Akim Demaille <akim@epita.fr>
22528
22529 Also test parse error messages, including with YYERROR_VERBOSE.
22530
22531 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22532 associative).
22533 Use it to check the computations.
22534 Use it to check `nonassoc' is honored.
22535 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22536 `--yyerror-verbose'.
22537 (_AT_CHECK_CALC): Adjust to this option.
22538 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22539
225402000-10-02 Akim Demaille <akim@epita.fr>
22541
22542 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22543 the latter demonstrates a flaw in the handling of non debugging
22544 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22545 was used in order to simplify:
22546
22547 #if YYDEBUG
22548 if (yydebug)
22549 {
22550 ...
22551 }
22552 #endif
22553
22554 into
22555
22556 if (yydebug)
22557 {
22558 ...
22559 }
22560
22561 unfortunately this leads to a CPP conflict when
22562 `--name-prefix=foo' is used since it produces `#define yydebug
22563 foodebug'.
22564
22565 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22566 (YYDPRINTF): New macro.
22567 Spread its use.
22568 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22569 the bison options.
22570 Also test `--verbose', `--defines' and `--name-prefix'.
22571
225722000-10-02 Akim Demaille <akim@epita.fr>
22573
22574 Improve the readability of the produced parsers.
22575
22576 * src/bison.s1: Formatting changes.
22577 Improve the comment related to the `$' mark.
22578 (yydefault): Don't fall through to `yyresume': `goto' there.
22579 * src/output.c (output_parser): When the `$' is met, skip the end
22580 of its line.
22581 New variable, `number_of_dollar_signs', to check there's exactly
22582 one `$' in the parser skeleton.
22583
225842000-10-02 Akim Demaille <akim@epita.fr>
22585
22586 * lib/xstrdup.c: New file, from the fileutils.
22587 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22588 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22589 instead of strlen + xmalloc + strcpy.
22590 * src/symtab.c (copys): Remove, use xstrdup instead.
22591
225922000-10-02 Akim Demaille <akim@epita.fr>
22593
22594 * src/gram.h (associativity): New enum type which replaces the
22595 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22596 `right_assoc', `left_assoc' and `non_assoc'.
22597 Adjust all dependencies.
22598 * src/reader.c: Formatting changes.
22599 (LTYPESTR): Don't define it, use it as a literal in
22600 `reader_output_yylsp'.
22601 * src/symtab.h (symbol_class): New enum type which replaces the
22602 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22603 `sunknown', `stoken and `snterm'.
22604
226052000-10-02 Akim Demaille <akim@epita.fr>
22606
22607 * src/getargs.c (fixed_outfiles): Rename as...
22608 (yaccflag): for consistency and accuracy.
22609 Adjust dependencies.
22610
226112000-10-02 Akim Demaille <akim@epita.fr>
22612
22613 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22614 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22615 difficult and introduced a lot of core dump. It turns out that
22616 Bison used an implementation of `xmalloc' based on `calloc', and
22617 at various places it does depend upon the initialization to 0. I
22618 have not tried to isolate the pertinent places, and all the former
22619 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22620 someone should address this issue.
22621
22622 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22623 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22624 files.
22625 Adjust dependencies.
22626 * src/warshall.h: New file.
22627 Propagate.
22628
226292000-10-02 Akim Demaille <akim@epita.fr>
22630
22631 Various anti-`extern in *.c' changes.
22632
22633 * src/system.h: Include `assert.h'.
22634
226352000-10-02 Akim Demaille <akim@epita.fr>
22636
22637 * src/state.h (nstates, final_state, first_state, first_shift)
22638 (first_reduction): Move their exportation from here...
22639 * src/LR0.h: to here.
22640 Adjust dependencies.
22641 * src/getargs.c (statisticsflag): New variable.
22642 Add support for `--statistics'.
22643 Adjust dependencies.
22644
22645 Remove a lot of now useless `extern' statements in most files.
22646
226472000-10-02 Akim Demaille <akim@epita.fr>
22648
22649 * src/LR0.h: New file.
22650 Propagate its use.
22651
226522000-10-02 Akim Demaille <akim@epita.fr>
22653
22654 * src/print.h: New file.
22655 Propagate its use.
22656 * src/print.c: Formatting and ordering changes.
22657 (verbose, terse): Replace with...
22658 (print_results): this new function.
22659 Adjust dependencies.
22660
226612000-10-02 Akim Demaille <akim@epita.fr>
22662
22663 * src/conflicts.c (conflict_report): New function.
22664 (conflict_log, verbose_conflict_log): Replace with...
22665 (print_conflicts): this function.
22666 Adjust dependencies.
22667 * src/conflicts.h: New file.
22668 Propagate its inclusion.
22669
226702000-10-02 Akim Demaille <akim@epita.fr>
22671
22672 * src/nullable.h: New file.
22673 Propagate its inclusion.
22674 * src/nullable.c: Formatting changes.
22675
226762000-10-02 Akim Demaille <akim@epita.fr>
22677
22678 * src/reduce.h: New file.
22679 Propagate its inclusion.
22680 * src/reduce.c: Topological sort and other formatting changes.
22681 (bool, TRUE, FALSE): Move their definition to...
22682 * src/system.h: here.
22683
226842000-10-02 Akim Demaille <akim@epita.fr>
22685
22686 * src/files.c: Formatting changes.
22687 (tryopen, tryclose, openfiles): Rename as...
22688 (xfopen, xfclose, open_files): this.
22689 (stringappend): static.
22690 * src/files.h: Complete the list of exported symbols.
22691 Propagate its use.
22692
226932000-10-02 Akim Demaille <akim@epita.fr>
22694
22695 * src/reader.h: New file.
22696 Propagate its use instead of tedious list of `extern' and
22697 prototypes.
22698 * src/reader.c: Formatting changes, topological sort,
22699 s/register//.
22700
227012000-10-02 Akim Demaille <akim@epita.fr>
22702
22703 * src/lex.h: Prototype `lex.c' exported functions.
22704 * src/reader.c: Adjust.
22705 * src/lex.c: Formatting changes.
22706 (safegetc): Rename as...
22707 (xgetc): this.
22708
227092000-10-02 Akim Demaille <akim@epita.fr>
22710
22711 * src/lalr.h: New file.
22712 Propagate its inclusion instead of prototypes and `extern'.
22713 * src/lalr.c: Formatting changes, topological sorting etc.
22714
227152000-10-02 Akim Demaille <akim@epita.fr>
22716
22717 * src/output.c (token_actions): Introduce a temporary array,
22718 YYDEFACT, that makes it possible for this function to use
22719 output_short_table.
22720
227212000-10-02 Akim Demaille <akim@epita.fr>
22722
22723 `user_toknums' is output as a `short[]' in `output.c', while it is
22724 defined as a `int[]' in `reader.c'. For consistency with the
22725 other output tables, `user_toknums' is now defined as a table of
22726 shorts.
22727
22728 * src/reader.c (user_toknums): Be a short table instead of an int
22729 table.
22730 Adjust dependencies.
22731
22732 Factor the short table outputs.
22733
22734 * src/output.c (output_short_table): New function.
22735 * src/output.c (output_gram, output_stos, output_rule_data)
22736 (output_base, output_table, output_check): Use it.
22737
227382000-10-02 Akim Demaille <akim@epita.fr>
22739
22740 * src/output.c (output): Topological sort of the functions, in
22741 order to get rid of the `static' prototypes.
22742 No longer use `register'.
22743 * src/output.h: New file.
22744 Propagate its inclusion in files explicitly prototyping functions
22745 from output.c.
22746
227472000-09-21 Akim Demaille <akim@epita.fr>
22748
22749 * src/atgeneral.m4: Update from Autoconf.
22750
227512000-09-21 Akim Demaille <akim@epita.fr>
22752
22753 * src/closure.h: New file.
22754 * src/closure.c: Formatting changes, topological sort over the
22755 functions, use of closure.h.
22756 (initialize_closure, finalize_closure): Rename as...
22757 (new_closure, free_closure): these. Adjust dependencies.
22758 * src/LR0.c: Formatting changes, topological sort, use of
22759 cloture.h.
22760 (initialize_states): Rename as...
22761 (new_states): this.
22762 * src/Makefile.am (noinst_HEADERS): Adjust.
22763
227642000-09-20 Akim Demaille <akim@epita.fr>
22765
22766 * src/acconfig.h: Don't protect config.h against multiple
22767 inclusion.
22768 Don't define PARAMS.
22769 * src/system.h: Define PARAMS.
22770 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22771 purpose of config.h. system.h must not try to fix wrong
22772 definitions in config.h.
22773
227742000-09-20 Akim Demaille <akim@epita.fr>
22775
22776 * src/derives.h: New file.
22777 * src/main.c, src/derives.h: Use it.
22778 Formatting changes.
22779 * src/Makefile.am (noinst_HEADERS): Adjust.
22780
227812000-09-20 Akim Demaille <akim@epita.fr>
22782
22783 * tests/atgeneral.m4: Update from Autoconf.
22784 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22785 (AT_CHECK_CALC): New macros.
22786 Use these macros to test bison with options `', `--raw',
22787 `--debug', `--yacc', `--yacc --debug'.
22788
227892000-09-19 Akim Demaille <akim@epita.fr>
22790
22791 * src/output.c: Formatting changes.
22792 * src/machine.h: Remove, leaving its contents in...
22793 * src/system.h: here.
22794 Include stdio.h.
22795 Adjust all dependencies on stdio.h and machine.h.
22796 * src/getargs.h: New file.
22797 Let all `extern' declarations about getargs.c be replaced with
22798 inclusion of `getargs.h'.
22799 * src/Makefile.am (noinst_HEADERS): Adjust.
22800
22801 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22802 scope.
22803 (yyerror): Returns void, not int.
22804 * doc/bison.texinfo: Formatting changes.
22805
228062000-09-19 Akim Demaille <akim@epita.fr>
22807
22808 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22809 portable.
22810
228112000-09-18 Akim Demaille <akim@epita.fr>
22812
22813 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22814 * src/Makefile.am (INCLUDES): Don't.
22815 Be ready to fetch headers in lib/.
22816
228172000-09-18 Akim Demaille <akim@epita.fr>
22818
22819 * doc/bison.texinfo: Update the copyright.
22820 ANSIfy and GNUify the examples.
22821 Remove the old menu.
22822
228232000-09-18 Akim Demaille <akim@epita.fr>
22824
22825 First set of tests: use the `calc' example from the documentation.
22826
22827 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22828 is defined only when YYDEBUG is.
22829 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22830 * src/files.c (tryopen, tryclose): Formatting changes.
22831 Move to the top and be static.
22832 * src/reader.c (read_signed_integer): Likewise.
22833 * tests/calc.m4: New file.
22834 * Makefile.am, suite.m4: Adjust.
22835 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22836
228372000-09-18 Akim Demaille <akim@epita.fr>
22838
22839 Add support for an Autotest test suite for Bison.
22840
22841 * m4/m4.m4, m4/atconfig.m4: New files.
22842 * m4/Makefile.am (EXTRA_DIST): Adjust.
22843 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22844 files.
22845 * src/getargs.c: Display a more standard --version message.
22846 * src/reader.c (reader): Formatting changes.
22847 No longer depend upon VERSION_STRING.
22848 * configure.in: No longer use `dnl'.
22849 Set up the test suite and the new directory `tests/.
22850 (VERSION_STRING): Remove.
22851
228522000-04-14 Akim Demaille <akim@epita.fr>
22853
22854 * src/reader.c (copy_comment2): New function, same as former
22855 `copy_comment', but outputs into two FILE *.
22856 (copy_comment): Use it.
22857 (parse_union_decl): Use it.
22858 (get_type, parse_start_decl): Use the same `invalid' message.
22859 (parse_start_decl, parse_union_decl): Use the same `multiple'
22860 message.
22861 (parse_union_decl, copy_guard, copy_action): Use the same
22862 `unmatched' message.
22863 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22864
228652000-03-31 Akim Demaille <akim@epita.fr>
22866
22867 * src/files.c (tryopen, tryclose): Move to the top.
22868 Be static.
22869
228702000-03-31 Akim Demaille <akim@epita.fr>
22871
22872 * src/main.c (main): Don't call `done', exit does it.
22873
228742000-03-31 Akim Demaille <akim@epita.fr>
22875
22876 * allocate.c: s/return (foo)/return foo/.
22877 * lalr.c: Likewise.
22878 * LR0.c: Likewise.
22879 * output.c: Likewise.
22880 * reader.c: Likewise.
22881 * symtab.c: Likewise.
22882 * vmsgetargs.c: Likewise.
22883
228842000-03-31 Akim Demaille <akim@epita.fr>
22885
22886 Clean up the error reporting functions.
22887
22888 * src/report.c: New file.
22889 * src/report.h: Likewise.
22890 * src/Makefile.am: Adjust.
22891 * m4/error.m4: New file.
22892 * m4/Makefile.am: Adjust.
22893 * configure.in (jm_PREREQ_ERROR): Call it.
22894 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22895 Remove.
22896 (fatal, fatals): Remove. All callers use complain.c::fatal.
22897 (warn, warni, warns, warnss, warnss): Remove. All callers use
22898 complain.c::complain.
22899 (toomany): Remove, use fatal instead.
22900 * src/files.c (done): No argument, use complain_message_count.
22901 * src/main.c (main): Register `done' to `atexit'.
22902
22903 * src/getargs.c (usage): More `fputs', less `fprintf'.
22904
229052000-03-28 Akim Demaille <akim@epita.fr>
22906
22907 * lib/: New directory.
22908 * Makefile.am (SUBDIRS): Adjust.
22909 * configure.in: Adjust.
22910 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22911 useless.
22912 * src/alloca.c: Moved to lib/.
22913 * src/getopt.c: Likewise.
22914 * src/getopt1.c: Likewise.
22915 * src/getopt.h: Likewise.
22916 * src/ansi2knr.c: Likewise.
22917 * src/ansi2knr.1: Likewise.
22918 * src/Makefile.am: Adjust.
22919 * lib/Makefile.am: New file.
22920
229212000-03-28 Akim Demaille <akim@epita.fr>
22922
22923 * src/getargs.c (usage): Refresh the help message.
22924
229252000-03-17 Akim Demaille <akim@epita.fr>
22926
22927 * src/getopt1.c: Updated from textutils 2.0e
22928 * src/getopt.c: Likewise.
22929 * src/getopt.h: Likewise.
22930
229312000-03-17 Akim Demaille <akim@epita.fr>
22932
22933 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22934 the file name, not the whole `#line LINE FILE'.
22935
229362000-03-17 Akim Demaille <akim@epita.fr>
22937
22938 On syntax errors, report the token on which we choked.
22939
22940 * src/bison.s1 (yyparse): In the label yyerrlab, when
22941 YYERROR_VERBOSE, add yychar in msg.
22942
229432000-03-17 Akim Demaille <akim@epita.fr>
22944
22945 * src/reader.c (copy_at): New function.
22946 (copy_guard): Use it.
22947 (copy_action): Use it.
22948
229492000-03-17 Akim Demaille <akim@epita.fr>
22950
22951 Be kind to translators, save some useless translations.
22952
22953 * src/main.c (banner): New function.
22954 (fatal_banner): Use it.
22955 (warn_banner): Use it.
22956
229572000-03-17 Akim Demaille <akim@epita.fr>
22958
22959 * src/reader.c (copy_definition): Use copy_string and
22960 copy_comment. Removed now unused `match', `ended',
22961 `cplus_comment'.
22962 (copy_comment, copy_string): Moved, to be visible from
22963 copy_definition.
22964
229652000-03-17 Akim Demaille <akim@epita.fr>
22966
22967 * src/reader.c (copy_string): Declare `static inline'. No
22968 problems with inline, since it is checked by configure.
22969 (copy_comment): Likewise.
22970
229712000-03-17 Akim Demaille <akim@epita.fr>
22972
22973 * src/reader.c (packsymbols): Formatting changes.
22974
229752000-03-17 Akim Demaille <akim@epita.fr>
22976
22977 * src/reader.c (copy_comment): New function, factored out from:
22978 (copy_action): Use it. Removed now unused `match', `ended',
22979 `cplus_comment'.
22980 (copy_guard): Likewise.
22981
229822000-03-17 Akim Demaille <akim@epita.fr>
22983
22984 * src/reader.c (copy_string): New function, factored out from:
22985 (copy_action): Use it.
22986 (copy_guard): Likewise.
22987
229882000-03-17 Akim Demaille <akim@epita.fr>
22989
22990 Change the handling of @s so that they behave exactly like $s.
22991 There is now a pseudo variable @$ (readble and writable), location
22992 of the lhs of the rule (by default ranging from the location of
22993 the first symbol of the rhs, to the location of the last symbol,
22994 or, if the rhs is empty, YYLLOC).
22995
22996 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22997 yyval.
22998 (yyparse): When providing a default semantic action, provide a
22999 default location action.
23000 (after the $): No longer change `*YYLSP', just stack YYLOC the
23001 same way you stack YYVAL.
23002 * src/reader.c (read_declarations): Use warns.
23003 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
23004 (copy_action, case '@'): Likewise.
23005 Use a standard error message, to save useless work from
23006 translators.
23007
230082000-03-17 Akim Demaille <akim@epita.fr>
23009
23010 * src/bison.s1: Formatting and cosmetics changes.
23011 * src/reader.c: Likewise.
23012 Update the Copyright notice.
23013
230142000-03-17 Akim Demaille <akim@epita.fr>
23015
23016 * src/bison.s1 (#line): All set to `#line' only, since the
23017 Makefile now handles them.
23018
230192000-03-16 Akim Demaille <akim@epita.fr>
23020
23021 * src/output.c (output_rule_data): Output the documentation of
23022 some of the tables.
23023 (Copyright notice): Update.
23024 Formatting changes.
23025
230262000-03-16 Akim Demaille <akim@epita.fr>
23027
23028 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
23029 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
23030 One `#if YYDEBUG' remains, since it uses variables which are
23031 defined only if `YYDEBUG != 0'.
23032
230332000-03-16 Akim Demaille <akim@epita.fr>
23034
23035 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
23036 and related variables so that the similarities are highlighted.
23037
230382000-03-16 Akim Demaille <akim@epita.fr>
23039
23040 * src/bison.s1: Properly indent CPP directives.
23041
230422000-03-16 Akim Demaille <akim@epita.fr>
23043
23044 * src/bison.s1: Properly indent the `alloca' CPP section.
23045
230462000-03-16 Akim Demaille <akim@epita.fr>
23047
23048 Do not hard code values of directories in `configure.in'.
23049 Update the `configure' tool chain.
23050
23051 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23052 src/makefile.am.
23053 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23054 (AC_OUTPUT): Add m4/Makefile.
23055 Bump to bison 1.28a, 1.29 has never been released.
23056 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23057 handled via src/Makefile.am.
23058 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23059 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23060 autoheader.
23061 * Makefile.am (SUBDIRS): Add m4.
23062 (ACLOCAL_AM_FLAGS): New variable.
23063 (AUTOMAKE_OPTIONS): Add check-news.
23064 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23065 the proper line number and file name.
23066 (DEFS): Propagate the location of bison library files and of the
23067 locale files.
23068 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23069 builddir.
23070 * acinclude.m4: Remove, replaced by the directory m4.
23071 * m4/Makefile.am (EXTRA_DIST): New variable.
23072 * m4/gettext.m4: New file, from the fileutils.
23073 * m4/lcmessage.m4: Likewise
23074 * m4/progtest.m4: Likewise.
23075 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23076
230772000-03-10 Akim Demaille <akim@epita.fr>
23078
23079 * src/closure.c:
23080 Formatting changes of various comments.
23081 Respect the GNU coding standards at various places.
23082 Don't use `_()' when no translation is needed.
23083
230841999-12-13 Jesse Thilo <jthilo@gnu.org>
23085
23086 * src/files.c:
23087 OS/2 honors TMPDIR environment variable.
23088
230891999-12-13 Jesse Thilo <jthilo@gnu.org>
23090
23091 * doc/bison.texinfo: Tweaked spelling and grammar.
23092 Updated ISBN.
23093 Removed reference to price of printed copy.
23094 Mention BISON_SIMPLE and BISON_HAIRY.
23095
230961999-12-13 Jesse Thilo <jthilo@gnu.org>
23097
23098 * configure.in, NEWS:
23099 Bison 1.29 released.
23100
231011999-10-27 Jesse Thilo <jthilo@gnu.org>
23102
23103 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23104 Added reference card.
23105
231061999-07-26 Jesse Thilo <jthilo@gnu.org>
23107
23108 * po/ru.po: Added Russian translation.
23109
231101999-07-26 Jesse Thilo <jthilo@gnu.org>
23111
23112 * configure.in: Added Russian translation.
23113
231141999-07-06 Jesse Thilo <jthilo@gnu.org>
23115
23116 * configure.in, NEWS, README:
23117 Released version 1.28.
23118
231191999-06-14 Jesse Thilo <jthilo@gnu.org>
23120
23121 * src/system.h:
23122 Squashed redefinition warning on some systems.
23123
23124 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
23125 Have configure build version string instead of relying on ANSI string
23126 concatentation.
23127
231281999-06-14 Jesse Thilo <jthilo@gnu.org>
23129
23130 * po/POTFILES.in: Got rid of version.c.
23131
231321999-06-14 Jesse Thilo <jthilo@gnu.org>
23133
23134 * acconfig.h, configure.in:
23135 Have configure build version string instead of relying on ANSI string
23136 concatentation.
23137
231381999-06-08 Jesse Thilo <jthilo@gnu.org>
23139
23140 * doc/bison.1:
23141 Dropped mention of `+' for long-named options.
23142
231431999-05-30 Jesse Thilo <jthilo@gnu.org>
23144
23145 * src/files.c: Added <unistd.h> for unlink().
23146
23147 * src/Makefile.am, src/system.h:
23148 I18n fixes.
23149
231501999-05-30 Jesse Thilo <jthilo@gnu.org>
23151
23152 * README: Added a FAQ list.
23153
23154 * configure.in, acconfig.h:
23155 I18n fixes.
23156
231571999-05-30 Jesse Thilo <jthilo@gnu.org>
23158
23159 * doc/FAQ, doc/Makefile.am:
23160 Added a FAQ list.
23161
231621999-05-19 Jesse Thilo <jthilo@gnu.org>
23163
23164 * src/alloc.h, src/symtab.h, src/version.c:
23165 Protected inclusion of "config.h" with HAVE_CONFIG_H.
23166
231671999-04-18 Jesse Thilo <jthilo@gnu.org>
23168
23169 * src/.cvsignore, src/Makefile.am:
23170 Reorganized: sources in `src', documentation in `doc'.
23171
23172 * src/lex.c (literalchar):
23173 fixed the code for escaping double quotes (thanks
23174 Jonathan Czisny.)
23175
231761999-04-18 Jesse Thilo <jthilo@gnu.org>
23177
23178 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
23179 Adjusted paths to reflect directory reorganization.
23180
231811999-04-18 Jesse Thilo <jthilo@gnu.org>
23182
23183 * doc/.cvsignore, doc/Makefile.am:
23184 Reorganized: sources in `src', documentation in `doc'.
23185
231861999-04-18 Jesse Thilo <jthilo@gnu.org>
23187
23188 * configure.in:
23189 Updated AC_INIT file to reflect directory reorganization.
23190
23191 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
23192 Reorganized: sources in `src', documentation in `doc'.
23193
231941999-04-13 Jesse Thilo <jthilo@gnu.org>
23195
23196 * src/allocate.c:
23197 Don't declare calloc() and realloc() if not necessary.
23198
231991999-04-13 Jesse Thilo <jthilo@gnu.org>
23200
23201 * configure.in, acconfig.h, acinclude.m4:
23202 Don't declare calloc() and realloc() if not necessary.
23203
232041999-03-23 Jesse Thilo <jthilo@gnu.org>
23205
23206 * po/.cvsignore: Added i18n support.
23207
232081999-03-23 Jesse Thilo <jthilo@gnu.org>
23209
23210 * acconfig.h, configure.in, Makefile.am:
23211 Added i18n support.
23212
232131999-03-22 Jesse Thilo <jthilo@gnu.org>
23214
23215 * src/bison.s1: Fixed #line numbers.
23216
232171999-03-15 Jesse Thilo <jthilo@gnu.org>
23218
23219 * po/es.po, po/fr.po, po/nl.po, po/de.po:
23220 Added PO files from Translation Project.
23221
232221999-03-03 Jesse Thilo <jthilo@gnu.org>
23223
23224 * Makefile.am:
23225 Added support for non-ANSI compilers (ansi2knr).
23226
232271999-02-16 Jesse Thilo <jthilo@gnu.org>
23228
23229 * configure.in: Bumped version number to 1.27.
23230
23231 * Makefile.am:
23232 Added `bison.simple' to list of files removed by `make distclean'.
23233
232341999-02-12 Jesse Thilo <jthilo@gnu.org>
23235
23236 * src/files.c, src/files.h:
23237 Defined locations of parser files in config.h instead of Makefile.
23238
232391999-02-12 Jesse Thilo <jthilo@gnu.org>
23240
23241 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
23242 Defined locations of parser files in config.h instead of Makefile.
23243
232441999-02-09 Jesse Thilo <jthilo@gnu.org>
23245
23246 * Makefile.am:
23247 Removed inappropriate use of $< macro.
23248
232491999-02-05 Jesse Thilo <jthilo@gnu.org>
23250
23251 * po/Makefile.in.in, po/POTFILES.in:
23252 Add `po' directory skeleton.
23253
232541999-01-27 Jesse Thilo <jthilo@gnu.org>
23255
23256 * README: Document help-bison list.
23257
23258 * configure.in: Add check for mkstemp().
23259
232601999-01-20 Jesse Thilo <jthilo@gnu.org>
23261
23262 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
23263 Hush a few compiler warnings.
23264
23265 * src/files.c:
23266 Add tryclose(), which verifies that fclose was successful.
23267 Hush a couple of compiler warnings.
23268
232691999-01-20 Jesse Thilo <jthilo@gnu.org>
23270
23271 * Makefile.am, OChangeLog:
23272 ChangeLog is now automatically generated. Include the old version as
23273 OChangeLog.
23274
232751999-01-14 Jesse Thilo <jthilo@gnu.org>
23276
23277 * 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:
23278 Update FSF address.
23279
232801999-01-14 Jesse Thilo <jthilo@gnu.org>
23281
23282 * doc/bison.texinfo: Fix formatting glitch.
23283
23284 * doc/bison.texinfo: Update FSF address.
23285
232861999-01-14 Jesse Thilo <jthilo@gnu.org>
23287
23288 * acconfig.h: Update FSF address.
23289
232901999-01-08 Jesse Thilo <jthilo@gnu.org>
23291
23292 * src/system.h:
23293 Don't define PACKAGE here, since config.h defines it.
23294
232951998-12-30 Jesse Thilo <jthilo@gnu.org>
23296
23297 * src/reader.c: Update copyright date.
23298
23299 * src/main.c:
23300 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23301 favor of output directly to stderr (avoids buffer overruns).
23302
23303 * src/reader.c: Some checks for premature EOF.
23304
23305 * 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:
23306 Use prototypes if the compiler understands them.
23307
23308 * src/files.c: Honor TMPDIR on Unix hosts.
23309 Use prototypes if the compiler understands them.
23310
23311 * src/reader.c:
23312 Fix a couple of buffer overrun bugs.
23313 Use prototypes if the compiler understands them.
23314
23315 * src/system.h: Include unistd.h and ctype.h.
23316 Use #ifdef instead of #if for NLS symbols.
23317
233181998-12-30 Jesse Thilo <jthilo@gnu.org>
23319
23320 * doc/bison.texinfo:
23321 Delete comment "consider using @set for edition number, etc..." since
23322 we now are doing so.
23323
233241998-12-30 Jesse Thilo <jthilo@gnu.org>
23325
23326 * configure.in:
23327 Use prototypes if the compiler understands them.
23328
23329 * NEWS: Document 1.26 highlights.
23330
23331 * Makefile.am: Require Automake 1.3 or later.
23332
23333 * acconfig.h:
23334 Use prototypes if the compiler understands them.
23335
233361998-12-29 Jesse Thilo <jthilo@gnu.org>
23337
23338 * src/version.c:
23339 Use VERSION symbol from automake for version number.
23340
233411998-12-29 Jesse Thilo <jthilo@gnu.org>
23342
23343 * acconfig.h, configure.in, version.cin:
23344 Use VERSION symbol from automake for version number.
23345
233461998-11-28 Jesse Thilo <jthilo@gnu.org>
23347
23348 * Makefile.am:
23349 Distribute original version of simple parser (bison.s1), not built
23350 version (bison.simple).
23351
233521998-11-28 Jesse Thilo <jthilo@gnu.org>
23353
23354 * doc/bison.texinfo: Add info dir entry.
23355
23356 * doc/bison.texinfo:
23357 Let automake put version number into documentation.
23358
233591998-11-26 Jesse Thilo <jthilo@gnu.org>
23360
23361 * src/bison.cld, src/build.com, src/vmshlp.mar:
23362 Add non-RCS files from /gd/gnu/bison.
23363
233641998-11-26 Jesse Thilo <jthilo@gnu.org>
23365
23366 * doc/bison.1:
23367 Document the BISON_HAIRY and BISON_SIMPLE variables.
23368
233691998-11-25 Jesse Thilo <jthilo@gnu.org>
23370
23371 * src/version.c: Build version.c automatically.
23372
23373 * src/reader.c:
23374 Fix token numbering (used to start at 258, not 257).
23375
23376 * src/system.h: Include config.h.
23377
23378 * src/getargs.c: Update bug report address.
23379
23380 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23381 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23382
233831998-11-25 Jesse Thilo <jthilo@gnu.org>
23384
23385 * Makefile.am:
23386 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23387
23388 * configure.in, version.cin:
23389 Build version.c automatically.
23390
23391 * AUTHORS: Add AUTHORS file.
23392
23393 * README: Update bug report address.
23394
23395 * bison.simple:
23396 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23397
23398 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23399 Add automake stuff.
23400
234011998-11-25 Jesse Thilo <jthilo@gnu.org>
23402
23403 * doc/bison.texinfo: Clean up some formatting.
23404
234051998-05-05 Richard Stallman <rms@gnu.org>
23406
23407 * doc/bison.texinfo:
23408 Explain better why to make a pure parser.
23409
234101998-01-05 Richard Stallman <rms@gnu.org>
23411
23412 * src/files.c (openfiles):
23413 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23414 find a temporary directory, if possible. Do not unlink files while
23415 they are open.
23416
234171997-08-25 Richard Stallman <rms@gnu.org>
23418
23419 * src/reader.c (stack_offset;):
23420 Change some warni to warns.
23421
23422 * src/lex.c (literalchar): Use warns, not warni.
23423
234241997-06-28 Richard Stallman <rms@gnu.org>
23425
23426 * src/bison.s1: Add a Bison version comment.
23427
23428 * src/main.c (fatal, warn, berror):
23429 Use program_name.
23430
234311997-06-28 Richard Stallman <rms@gnu.org>
23432
23433 * Makefile.in (bison_version): New variable.
23434 (dist): Use that variable.
23435 (bison.s1): Substitute the Bison version into bison.simple.
23436
23437 * bison.simple: Add a Bison version comment.
23438
234391997-06-18 Richard Stallman <rms@gnu.org>
23440
23441 * src/main.c (fatal, warn, berror):
23442 Make error messages standard.
23443 (toomany): Improve error message text.
23444
23445 * 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:
23446 new.h renamed to alloc.h.
23447
234481997-06-18 Richard Stallman <rms@gnu.org>
23449
23450 * Makefile.in: new.h renamed to alloc.h.
23451
234521997-05-24 Richard Stallman <rms@gnu.org>
23453
23454 * src/lex.c (literalchar):
23455 Fix the code for escaping \, " and '.
23456
23457 (lex): Avoid trouble when there are many chars
23458 to discard in a char literal with just several chars in it.
23459
234601997-05-17 Richard Stallman <rms@gnu.org>
23461
23462 * src/bison.s1:
23463 Use malloc, if using alloca is troublesome.
23464 (YYSTACK_USE_ALLOCA): New flag macro.
23465 Define it for some systems and compilers.
23466 (YYSTACK_ALLOC): New macro.
23467 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23468 If it was malloc'd, free it.
23469
234701997-05-17 Richard Stallman <rms@gnu.org>
23471
23472 * bison.simple:
23473 Use malloc, if using alloca is troublesome.
23474 (YYSTACK_USE_ALLOCA): New flag macro.
23475 Define it for some systems and compilers.
23476 (YYSTACK_ALLOC): New macro.
23477 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23478 If it was malloc'd, free it.
23479
234801997-04-23 Richard Stallman <rms@gnu.org>
23481
23482 * src/bison.s1:
23483 (alloca) [__hpux]: Always define as __builtin_alloca.
23484
234851997-04-23 Richard Stallman <rms@gnu.org>
23486
23487 * bison.simple:
23488 (alloca) [__hpux]: Always define as __builtin_alloca.
23489
234901997-04-22 Richard Stallman <rms@gnu.org>
23491
23492 * src/bison.s1:
23493 [__hpux]: Include alloca.h (right for HPUX 10)
23494 instead of declaring alloca (right for HPUX 9).
23495
23496 * src/bison.s1 (__yy_memcpy):
23497 Declare arg `count' as unsigned int.
23498 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23499
235001997-04-22 Richard Stallman <rms@gnu.org>
23501
23502 * bison.simple:
23503 [__hpux]: Include alloca.h (right for HPUX 10)
23504 instead of declaring alloca (right for HPUX 9).
23505
23506 * bison.simple (__yy_memcpy):
23507 Declare arg `count' as unsigned int.
23508 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23509
235101997-01-03 Richard Stallman <rms@gnu.org>
23511
23512 * src/allocate.c: [__STDC__ or _MSC_VER]:
23513 Declare calloc and realloc to return void *.
23514
235151997-01-02 Richard Stallman <rms@gnu.org>
23516
23517 * src/system.h:
23518 [_MSC_VER]: Include stdlib.h and process.h.
23519 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23520
23521 * src/main.c (main): Return FAILURE as a value.
23522 (printable_version): Declare arg as int, not char.
23523
235241997-01-02 Richard Stallman <rms@gnu.org>
23525
23526 * Makefile.in (dist):
23527 Explicitly check for symlinks, and copy them.
23528
235291996-12-19 Richard Stallman <rms@gnu.org>
23530
23531 * src/files.c:
23532 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23533
235341996-12-18 Paul Eggert <eggert@gnu.org>
23535
23536 * src/bison.s1 (yyparse):
23537 If __GNUC__ and YYPARSE_PARAM are both defined,
23538 declare yyparse to have a void * argument.
23539
235401996-12-18 Paul Eggert <eggert@gnu.org>
23541
23542 * bison.simple (yyparse):
23543 If __GNUC__ and YYPARSE_PARAM are both defined,
23544 declare yyparse to have a void * argument.
23545
235461996-12-17 Richard Stallman <rms@gnu.org>
23547
23548 * src/reduce.c (nbits): Add some casts.
23549
235501996-08-12 Richard Stallman <rms@gnu.org>
23551
23552 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23553
235541996-08-12 Richard Stallman <rms@gnu.org>
23555
23556 * bison.simple: Test _MSDOS as well as _MSDOS_.
23557
235581996-07-31 Richard Stallman <rms@gnu.org>
23559
23560 * src/bison.s1:
23561 [__sun && __i386]: Include alloca.h.
23562
235631996-07-31 Richard Stallman <rms@gnu.org>
23564
23565 * bison.simple:
23566 [__sun && __i386]: Include alloca.h.
23567
235681996-07-30 Richard Stallman <rms@gnu.org>
23569
23570 * src/bison.s1: Comment change.
23571
23572 * src/bison.s1: Test _MSDOS_, not MSDOS.
23573
235741996-07-30 Richard Stallman <rms@gnu.org>
23575
23576 * bison.simple: Comment change.
23577
23578 * bison.simple: Test _MSDOS_, not MSDOS.
23579
235801996-06-01 Richard Stallman <rms@gnu.org>
23581
23582 * 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:
23583 Insert `_' macro around many string constants.
23584
23585 * src/main.c:
23586 Insert `_' macro around many string constants.
23587
23588 (main): Call setlocale, bindtextdomain and textdomain.
23589
23590 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23591 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23592 [ENABLE_NLS]: Include libintl.h.
23593 [ENABLE_NLS] (gettext): Define.
23594 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23595 (N_, PACKAGE, LOCALEDIR): New macros.
23596
235971996-06-01 Richard Stallman <rms@gnu.org>
23598
23599 * POTFILES.in: New file.
23600
23601 * Makefile.in (allocate.o):
23602 Define target explicitly.
23603
23604 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23605 (LDFLAGS): Set to @LDFLAGS@.
23606 (configure): Run autoconf only if preceding `cd' succeeds.
23607 (bison.s1): Redirect output to temporary file then move the
23608 temporary to the target, rather than redirecting directly to bison.s1.
23609 (clean): Remove config.status and config.log.
23610 (distclean): Don't remove config.status here.
23611
236121996-05-12 Richard Stallman <rms@gnu.org>
23613
23614 * src/bison.s1:
23615 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23616
236171996-05-12 Richard Stallman <rms@gnu.org>
23618
23619 * bison.simple:
23620 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23621
236221996-05-11 Richard Stallman <rms@gnu.org>
23623
23624 * src/bison.s1 (__yy_memcpy):
23625 Really reorder the args, as was supposedly done on Feb 14 1995.
23626 (yyparse): Calls changed accordingly.
23627
236281996-05-11 Richard Stallman <rms@gnu.org>
23629
23630 * Makefile.in (dist): Don't use $(srcdir).
23631
23632 * bison.simple (__yy_memcpy):
23633 Really reorder the args, as was supposedly done on Feb 14 1995.
23634 (yyparse): Calls changed accordingly.
23635
236361996-01-27 Richard Stallman <rms@gnu.org>
23637
23638 * src/output.c (output_rule_data):
23639 Test YYERROR_VERBOSE in the conditional
23640 around the definition of ttyname.
23641
236421995-12-29 Richard Stallman <rms@gnu.org>
23643
23644 * src/bison.s1:
23645 Fix line numbers in #line commands.
23646
236471995-12-29 Richard Stallman <rms@gnu.org>
23648
23649 * bison.simple:
23650 Fix line numbers in #line commands.
23651
236521995-12-27 Richard Stallman <rms@gnu.org>
23653
23654 * src/bison.s1 (YYPARSE_PARAM_DECL):
23655 In C++, make it always null.
23656 (YYPARSE_PARAM_ARG): New macro.
23657 (yyparse): Use YYPARSE_PARAM_ARG.
23658
236591995-12-27 Richard Stallman <rms@gnu.org>
23660
23661 * bison.simple (YYPARSE_PARAM_DECL):
23662 In C++, make it always null.
23663 (YYPARSE_PARAM_ARG): New macro.
23664 (yyparse): Use YYPARSE_PARAM_ARG.
23665
236661995-11-29 Richard Stallman <rms@gnu.org>
23667
23668 * doc/bison.texinfo:
23669 Describe literal string tokens, %raw, %no_lines, %token_table.
23670
236711995-11-29 Daniel Hagerty <hag@gnu.org>
23672
23673 * doc/bison.texinfo: Fixed update date
23674
236751995-10-16 Richard Stallman <rms@gnu.org>
23676
23677 * src/version.c: Version 1.25.
23678
236791995-10-16 Richard Stallman <rms@gnu.org>
23680
23681 * NEWS: *** empty log message ***
23682
236831995-10-16 Richard Stallman <rms@gnu.org>
23684
23685 * doc/bison.1, doc/bison.rnh:
23686 Add new options.
23687
236881995-10-15 Richard Stallman <rms@gnu.org>
23689
23690 * src/vmsgetargs.c, src/getargs.c:
23691 Added -n, -k, and -raw switches.
23692 (noparserflag, toknumflag, rawtoknumflag): New variables.
23693
23694 * src/symtab.h (SALIAS):
23695 New #define for adding aliases to %token.
23696 (struct bucket): Added `alias' field.
23697
23698 * src/reduce.c (reduce_grammar):
23699 Revise error message.
23700 (print_notices): Remove final `.' from error message.
23701
23702 * src/reader.c (reader_output_yylsp):
23703 New function.
23704 (readgram): Use `#if 0' around code that accepted %command
23705 inside grammar rules: The documentation doesn't allow it,
23706 and it will fail since the %command processors scan for the next %.
23707 (parse_token_decl): Extended the %token
23708 declaration to allow a multi-character symbol as an alias.
23709 (parse_thong_decl): New function.
23710 (read_declarations): Added %thong declarations.
23711 (read_declarations): Handle NOOP to deal with allowing
23712 % declarations as another means to specify the flags.
23713 (readgram): Allow %prec prior to semantics embedded in a rule.
23714 (skip_to_char, read_declarations, copy_definition)
23715 (parse_token_decl, parse_start_decl, parse_type_decl)
23716 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23717 (get_type_name, copy_guard, copy_action, readgram)
23718 (get_type, packsymbols): Revised most error messages.
23719 Changed `fatal' to `warnxxx' to avoid aborting for error.
23720 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23721 (read_declarations): Improve the error message for
23722 an invalid character. Do not abort.
23723 (read_declarations, copy_guard, copy_action): Use
23724 printable_version to avoid unprintable characters in printed output.
23725 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23726 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23727 Allow the type of a non-terminal can be given
23728 more than once, as long as all specifications give the same type.
23729
23730 * src/output.c:
23731 (output_headers, output_trailers, output, output_gram)
23732 (output_rule_data): Implement noparserflag variable.
23733 Implement toknumflag variable.
23734 (output): Call reader_output_yylsp to output LTYPESTR.
23735
23736 * src/main.c (main):
23737 If reader sees an error, don't process the grammar.
23738 (fatals): Updated to not use VARARGS1.
23739 (printable_version, int_to_string, warn, warni, warns, warnss)
23740 (warnsss): New error reporting functions. Avoid abort for error.
23741
23742 * src/lex.h:
23743 Added THONG and NOOP for alias processing.
23744 Added SETOPT for the new code that allows setting options with %flags.
23745
23746 * src/lex.c:
23747 Include getopt.h. Add some extern decls.
23748 (safegetc): New function to deal with EOF gracefully.
23749 (literalchar); new function to deal with reading \ escapes.
23750 (lex): Use literalchar.
23751 (lex): Implemented "..." tokens.
23752 (literalchar, lex, parse_percent_token): Made tokenbuffer
23753 always contain the token. This includes growing the token
23754 buffer while reading an integer.
23755 (parse_percent_token): Replaced if-else statement with percent_table.
23756 (parse_percent_token): Added % declarations as another
23757 way to specify the flags -n, -l, and -r. Also added hooks for
23758 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23759 major changes to files.c.
23760 (lex) Retain in the incoming stream a character following
23761 an incorrect '/'.
23762 (skip_white_space, lex): Revised most error messages
23763 and changed fatal to warn to avoid aborting.
23764 (percent_table): Added %thong declarations.
23765
23766 * src/gram.h: Comment changes.
23767
23768 * src/files.c (openfiles, open_extra_files, done):
23769 Add faction flag
23770 and actfile file. Handle noparserflag. Both for -n switch.
23771
23772 * src/conflicts.c (resolve_sr_conflict):
23773 Remove use of alloca.
23774
237751995-06-01 Jim Meyering <meyering@gnu.org>
23776
23777 * doc/bison.texinfo: *** empty log message ***
23778
237791995-05-06 Richard Stallman <rms@gnu.org>
23780
23781 * src/bison.s1: Comment change.
23782
237831995-05-06 Richard Stallman <rms@gnu.org>
23784
23785 * bison.simple: Comment change.
23786
237871995-05-03 Richard Stallman <rms@gnu.org>
23788
23789 * src/version.c: Version now 1.24.
23790
23791 * src/bison.s1: Change distribution terms.
23792
23793 * src/version.c: Version now 1.23.
23794
237951995-05-03 Richard Stallman <rms@gnu.org>
23796
23797 * doc/bison.texinfo:
23798 Rewrite "Conditions for Using Bison".
23799 Update version to 1.24.
23800
238011995-05-03 Richard Stallman <rms@gnu.org>
23802
23803 * bison.simple: Change distribution terms.
23804
238051995-02-23 Richard Stallman <rms@gnu.org>
23806
23807 * src/files.c: Test __VMS_POSIX as well as VMS.
23808
238091995-02-14 Jim Meyering <meyering@gnu.org>
23810
23811 * src/bison.s1 (__yy_memcpy):
23812 Renamed from __yy_bcopy to avoid
23813 confusion. Reverse FROM and TO arguments to be consistent with
23814 those of memcpy.
23815
238161995-02-14 Jim Meyering <meyering@gnu.org>
23817
23818 * bison.simple (__yy_memcpy):
23819 Renamed from __yy_bcopy to avoid
23820 confusion. Reverse FROM and TO arguments to be consistent with
23821 those of memcpy.
23822
238231994-11-10 David J. MacKenzie <djm@gnu.org>
23824
23825 * NEWS: reformat
23826
23827 * NEWS: New file.
23828
23829 * Makefile.in (DISTFILES): Include NEWS.
23830
23831 * Makefile.in (DISTFILES):
23832 Include install-sh, not install.sh.
23833
23834 * configure.in: Update to Autoconf v2 macro names.
23835
238361994-10-05 David J. MacKenzie <djm@gnu.org>
23837
23838 * Makefile.in: fix typo
23839
23840 * Makefile.in (prefix, exec_prefix):
23841 Let configure set them.
23842
238431994-09-28 David J. MacKenzie <djm@gnu.org>
23844
23845 * Makefile.in: Set datadir to $(prefix)/share.
23846
238471994-09-15 Richard Stallman <rms@gnu.org>
23848
23849 * src/bison.s1:
23850 Update copyright notice and GPL version.
23851
238521994-09-15 Richard Stallman <rms@gnu.org>
23853
23854 * bison.simple:
23855 Update copyright notice and GPL version.
23856
238571994-07-12 Richard Stallman <rms@gnu.org>
23858
23859 * src/reduce.c, src/reader.c:
23860 entered into RCS
23861
238621994-05-05 David J. MacKenzie <djm@gnu.org>
23863
23864 * Makefile.in: entered into RCS
23865
238661994-03-26 Richard Stallman <rms@gnu.org>
23867
23868 * src/bison.s1: entered into RCS
23869
238701994-03-26 Richard Stallman <rms@gnu.org>
23871
23872 * bison.simple: entered into RCS
23873
238741994-03-25 Richard Stallman <rms@gnu.org>
23875
23876 * src/main.c: entered into RCS
23877
238781994-03-24 Richard Stallman <rms@gnu.org>
23879
23880 * src/conflicts.c: entered into RCS
23881
238821994-01-02 Richard Stallman <rms@gnu.org>
23883
23884 * Makefile.in: *** empty log message ***
23885
238861993-11-21 Richard Stallman <rms@gnu.org>
23887
23888 * src/bison.s1: *** empty log message ***
23889
238901993-11-21 Richard Stallman <rms@gnu.org>
23891
23892 * doc/bison.texinfo: entered into RCS
23893
23894 * doc/bison.texinfo: *** empty log message ***
23895
238961993-11-21 Richard Stallman <rms@gnu.org>
23897
23898 * bison.simple: *** empty log message ***
23899
239001993-10-25 David J. MacKenzie <djm@gnu.org>
23901
23902 * doc/bison.texinfo: *** empty log message ***
23903
239041993-10-19 Richard Stallman <rms@gnu.org>
23905
23906 * src/bison.s1: *** empty log message ***
23907
239081993-10-19 Richard Stallman <rms@gnu.org>
23909
23910 * bison.simple: *** empty log message ***
23911
239121993-10-14 Richard Stallman <rms@gnu.org>
23913
23914 * src/bison.s1: *** empty log message ***
23915
239161993-10-14 Richard Stallman <rms@gnu.org>
23917
23918 * bison.simple: *** empty log message ***
23919
239201993-09-14 David J. MacKenzie <djm@gnu.org>
23921
23922 * doc/bison.texinfo: *** empty log message ***
23923
239241993-09-13 Noah Friedman <friedman@gnu.org>
23925
23926 * Makefile.in: *** empty log message ***
23927
239281993-09-10 Richard Stallman <rms@gnu.org>
23929
23930 * src/conflicts.c: *** empty log message ***
23931
23932 * src/system.h: entered into RCS
23933
239341993-09-10 Richard Stallman <rms@gnu.org>
23935
23936 * doc/bison.1: entered into RCS
23937
239381993-09-06 Noah Friedman <friedman@gnu.org>
23939
23940 * src/version.c: entered into RCS
23941
239421993-09-06 Noah Friedman <friedman@gnu.org>
23943
23944 * Makefile.in: *** empty log message ***
23945
239461993-07-30 David J. MacKenzie <djm@gnu.org>
23947
23948 * Makefile.in: *** empty log message ***
23949
239501993-07-24 Richard Stallman <rms@gnu.org>
23951
23952 * src/bison.s1: *** empty log message ***
23953
239541993-07-24 Richard Stallman <rms@gnu.org>
23955
23956 * bison.simple: *** empty log message ***
23957
239581993-07-08 David J. MacKenzie <djm@gnu.org>
23959
23960 * Makefile.in: *** empty log message ***
23961
239621993-07-04 Richard Stallman <rms@gnu.org>
23963
23964 * src/bison.s1: *** empty log message ***
23965
239661993-07-04 Richard Stallman <rms@gnu.org>
23967
23968 * bison.simple: *** empty log message ***
23969
239701993-06-26 David J. MacKenzie <djm@gnu.org>
23971
23972 * src/getargs.c: entered into RCS
23973
239741993-06-26 David J. MacKenzie <djm@gnu.org>
23975
23976 * doc/bison.texinfo: *** empty log message ***
23977
23978 * doc/bison.1: New file.
23979
239801993-06-25 Richard Stallman <rms@gnu.org>
23981
23982 * src/getargs.c: New file.
23983
239841993-06-16 Richard Stallman <rms@gnu.org>
23985
23986 * src/bison.s1: *** empty log message ***
23987
239881993-06-16 Richard Stallman <rms@gnu.org>
23989
23990 * bison.simple: *** empty log message ***
23991
239921993-06-03 Richard Stallman <rms@gnu.org>
23993
23994 * src/bison.s1: New file.
23995
239961993-06-03 Richard Stallman <rms@gnu.org>
23997
23998 * doc/bison.texinfo: *** empty log message ***
23999
240001993-06-03 Richard Stallman <rms@gnu.org>
24001
24002 * bison.simple: New file.
24003
240041993-05-19 Richard Stallman <rms@gnu.org>
24005
24006 * doc/bison.texinfo: New file.
24007
240081993-05-07 Noah Friedman <friedman@gnu.org>
24009
24010 * Makefile.in: *** empty log message ***
24011
240121993-04-28 Noah Friedman <friedman@gnu.org>
24013
24014 * src/reader.c: *** empty log message ***
24015
240161993-04-23 Noah Friedman <friedman@gnu.org>
24017
24018 * src/alloc.h: entered into RCS
24019
240201993-04-20 David J. MacKenzie <djm@gnu.org>
24021
24022 * src/version.c: *** empty log message ***
24023
24024 * src/files.c, src/allocate.c:
24025 entered into RCS
24026
24027 * src/reader.c: *** empty log message ***
24028
24029 * src/lex.c: entered into RCS
24030
24031 * src/conflicts.c: New file.
24032
24033 * src/symtab.c: entered into RCS
24034
24035 * src/alloc.h: New file.
24036
24037 * src/LR0.c: entered into RCS
24038
240391993-04-18 Noah Friedman <friedman@gnu.org>
24040
24041 * src/reader.c: New file.
24042
24043 * src/version.c: *** empty log message ***
24044
240451993-04-18 Noah Friedman <friedman@gnu.org>
24046
24047 * Makefile.in: *** empty log message ***
24048
240491993-04-17 Noah Friedman <friedman@gnu.org>
24050
24051 * Makefile.in: *** empty log message ***
24052
240531993-04-15 Richard Stallman <rms@gnu.org>
24054
24055 * src/main.c, src/files.c:
24056 New file.
24057
240581993-04-15 Noah Friedman <friedman@gnu.org>
24059
24060 * configure.in: entered into RCS
24061
24062 * configure.in: *** empty log message ***
24063
24064 * configure.in: New file.
24065
240661993-04-14 Richard Stallman <rms@gnu.org>
24067
24068 * Makefile.in: New file.
24069
240701993-04-13 Richard Stallman <rms@gnu.org>
24071
24072 * src/version.c: New file.
24073
240741993-03-25 Richard Stallman <rms@gnu.org>
24075
24076 * src/output.c: entered into RCS
24077
240781992-09-25 Richard Stallman <rms@gnu.org>
24079
24080 * configure.bat: entered into RCS
24081
240821992-06-22 Richard Stallman <rms@gnu.org>
24083
24084 * src/vmsgetargs.c: entered into RCS
24085
240861992-06-22 Richard Stallman <rms@gnu.org>
24087
24088 * doc/bison.rnh: entered into RCS
24089
240901992-04-20 David J. MacKenzie <djm@gnu.org>
24091
24092 * README: entered into RCS
24093
240941992-01-22 Richard Stallman <rms@gnu.org>
24095
24096 * src/machine.h: entered into RCS
24097
240981991-12-21 Richard Stallman <rms@gnu.org>
24099
24100 * src/lalr.c, src/closure.c:
24101 entered into RCS
24102
241031991-12-20 Richard Stallman <rms@gnu.org>
24104
24105 * src/state.h: entered into RCS
24106
241071991-12-18 Richard Stallman <rms@gnu.org>
24108
24109 * src/print.c, src/nullable.c, src/derives.c:
24110 entered into RCS
24111
241121991-11-03 David J. MacKenzie <djm@gnu.org>
24113
24114 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24115 entered into RCS
24116
241171988-09-09 Richard Stallman <rms@gnu.org>
24118
24119 * src/bison.hairy: entered into RCS
24120
241211987-12-16 Richard Stallman <rms@gnu.org>
24122
24123 * REFERENCES: entered into RCS
24124
24125
24126 -----
24127
24128 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
24129 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
24130 2008, 2009 Free Software Foundation, Inc.
24131
24132 Copying and distribution of this file, with or without
24133 modification, are permitted provided the copyright notice and this
24134 notice are preserved.