]> git.saurik.com Git - bison.git/blob - ChangeLog
maint: automate b4_copyright updates.
[bison.git] / ChangeLog
1 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
2
3 maint: automate b4_copyright updates.
4 * Makefile.am (update-b4-copyright): New target rule.
5 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
6 * build-aux/update-b4-copyright: New.
7 * data/yacc.c: Remove stray characters around b4_copyright
8 invocations.
9
10 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
11
12 maint: automate annual package-wide copyright-year update.
13 * .x-update-copyright: New.
14 * Makefile.am (EXTRA_DIST): Remove maint.mk.
15 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
16 update-copyright. Remove gnumakefile, which is implied by
17 maintainer-makefile.
18 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
19 * gnulib: Update.
20 * maint.mk: Remove, now copied from gnulib.
21 * examples/extexi: Add missing "(C)" in copyright statement so
22 update-copyright can recognize it.
23 * src/LR0.h: Likewise.
24 * src/print.h: Likewise.
25 * src/print_graph.h: Likewise.
26 * src/gram.c: Add missing comma in copyright statement.
27 * src/gram.h: Likewise.
28
29 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
30
31 Fix "make distcheck".
32 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
33 of just calc.stamp.
34
35 2009-08-01 Joel E. Denny <jdenny@clemson.edu>
36
37 Pacify "gcc -Wunused" for the input function from Flex.
38 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
39 and later.
40 * src/scan-code.l: Add "%option noinput", which I cannot find in
41 the Flex manual, but which Flex has supported since at least as
42 far back as 2.5.4. However, if any of our developers still use
43 Flex 2.5.4, they'll need to stop configuring with
44 --enable-gcc-warnings because "%option noinput" didn't work
45 correctly until Flex 2.5.6.
46 * src/scan-gram.l: Likewise.
47 * src/scan-skel.l: Likewise.
48
49 2009-07-31 Alex Rozenman <rozenman@gmail.com>
50
51 Fix --enable-gcc-warnings problems.
52 * src/reader.c: Adjust variable names.
53 * src/scan-code.l: Fix prototypes and adjust names.
54 * src/named-ref.c: Remove redundant "if".
55
56 2009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
57
58 Fix a --enable-gcc-warnings problem.
59 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
60 variable.
61
62 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
63
64 Warn about character literals not of length one.
65 * NEWS (2.5): Document.
66 * src/scan-gram.l (INITIAL): Remove comment that we don't check
67 the length.
68 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
69 * tests/input.at (Bad character literals): New test group.
70
71 2009-07-24 Alex Rozenman <rozenman@gmail.com>
72
73 Fix some memory leaks.
74 * src/named-ref.c: Add a pointer check (named_ref_free).
75 * src/scan-code.l: New function (variant_table_free). Called in
76 code_scanner_free.
77 * src/symlist.c: Call to named_ref_free (symbol_list_free).
78
79 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
80
81 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
82
83 2009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
84
85 Some M4 cleanup in the testsuite.
86 Suggested by Eric Blake at
87 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
88 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
89 complicate the code by distinguishing between a missing value
90 and an empty string value for an optional argument. This fix is
91 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
92 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
93 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
94 arguments are not needed because of the following changes.
95 Fix stale comments.
96 Bison developers should use GNU M4 and should not use
97 POSIXLY_CORRECT when building the test suite, so do not
98 complicate the code by avoiding $10 and above.
99 Do not quote an empty string value for an optional argument, and
100 do not distinguish between a missing value and an empty string
101 value.
102
103 2009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
104
105 Revert unnecessary column realignment in --help output.
106 Reported by Akim Demaille at
107 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
108 * src/getargs.c (usage): Here.
109
110 2009-07-04 Alex Rozenman <rozenman@gmail.com>
111
112 Alphabetical order in src/local.mk.
113 * src/local.mk: Adjust.
114
115 2009-07-04 Alex Rozenman <rozenman@gmail.com>
116
117 Style changes and factoring.
118 * src/named-ref.h: Add comments.
119 * src/parse-gram.y: Readability and style changes.
120 * src/reader.c: Factoring: assign_named_ref function.
121 * src/scan-code.l: Factoring and style changes. Rename
122 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
123 Use "unsigned" type for variant index. Improve readablity.
124 * src/scan-gram.l: Change error messages and add comments.
125 * src/symlist.h: symbol_list_null: New function decl.
126 * src/symlist.c: symbol_list_null: Implement here.
127 * tests/named-refs.at: Adjust for new error messages.
128
129 2009-06-29 Eric Blake <ebb9@byu.net>
130
131 scan-code: avoid compiler warnings
132 * src/scan-code.l (parse_named_ref): Use correct specifiers.
133
134 2009-06-29 Akim Demaille <demaille@gostai.com>
135
136 build: avoid concurrent extraction of calc++.
137 * examples/calc++/Makefile.am (calc.stamp): New.
138 Depend on it to create the sources of calc++ so that concurrent
139 builds don't launch several "extexi" in parallel.
140 Not only this is inefficient, this also builds incorrect sources
141 with several extractions mixed together.
142
143 2009-06-29 Akim Demaille <demaille@gostai.com>
144
145 parse.error: fix.
146 * data/bison.m4: Move code related to specific variables after the
147 definition of the variable-maintaining macros so that we don't
148 "invoke" b4_percent_define_check_values before it is defined.
149
150 2009-06-29 Akim Demaille <demaille@gostai.com>
151
152 variables: parse.error
153
154 Implement, document, and test the replacement of %error-verbose
155 by %define parse.error "verbose".
156 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
157 values of the parse.error variable.
158 Make "simple" its default value.
159 Check the valid values.
160 * src/parse-gram.y: Use %define parse.error.
161 (PERCENT_ERROR_VERBOSE): New token.
162 Support it.
163 * src/scan-gram.l: Support %error-verbose.
164
165 * doc/bison.texinfo (Decl Summary): Replace the documentation of
166 %define error-verbose by that of %define parse.error.
167 * NEWS: Document it.
168
169 * tests/actions.at, tests/calc.at: Use parse.error instead of
170 %error-verbose.
171
172 2009-06-27 Alex Rozenman <rozenman@gmail.com>
173
174 Implement support for named symbol references.
175 * src/parse-gram.y: Add new syntax (named_ref.opt).
176 * src/reader.c: Store named refs in symbol lists.
177 * src/reader.h: New argument for symbol_append and
178 action_append functions.
179 * src/scan-code.h: Add new field (named_ref) into
180 code_props data structure. Keeps named ref of midrule
181 actions.
182 * src/scan-code.l: Support for named refs in semantic
183 action code. New function 'parse_named_ref'.
184 * src/scan-gram.l: Support bracketed id.
185 * src/symlist.c: Store named refs in symbol lists.
186 * src/symlist.h: New field in symbol list: named_ref.
187 * src/named-ref.h: New file, a struct for named_ref.
188 * src/named-ref.cp: New file, named_ref_new function.
189 * src/local.mk: Add two new files.
190 * tests/testsuite.at: Include new test group:
191 * tests/named-refs.at: this new file.
192
193 2009-06-25 Akim Demaille <demaille@gostai.com>
194
195 hash: check insertion for memory exhaustion.
196 * src/uniqstr.c (uniqstr_new): New.
197
198 2009-06-24 Akim Demaille <demaille@gostai.com>
199
200 variables: rename namespace as api.namespace.
201 Discussed in
202 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
203
204 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
205 New.
206 (b4_percent_define_use): New.
207 Use it where applicable.
208 * data/c++.m4: Replace uses of the variable "namespace" by
209 "api.namespace".
210 Default the latter to the former.
211 * doc/bison.texinfo (Decl Summary): Document "namespace" as
212 obsolete.
213 Document api.namespace.
214 Use @samp to document %define uses, keep @code for identifiers.
215 * NEWS: Likewise.
216 * tests/c++.at, tests/input.at: Test api.namespace instead of
217 namespace. (The tests passed with namespace.)
218
219 2009-06-11 Akim Demaille <demaille@gostai.com>
220
221 style changes.
222 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
223 * src/print-xml.c: Style changes.
224 * tests/conflicts.at: Comment changes.
225
226 2009-06-11 Akim Demaille <demaille@gostai.com>
227
228 xml: beware of user strings used to give a %prec to rules.
229 * tests/conflicts.at (%prec with user strings): New.
230 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
231 XML output.
232
233 2009-06-11 Akim Demaille <demaille@gostai.com>
234
235 hash: check insertion for memory exhaustion.
236 * src/muscle-tab.c (muscle_insert, muscle_grow)
237 * src/state.c (state_hash_insert): Check the return value of
238 hash_insert.
239
240 2009-06-11 Akim Demaille <demaille@gostai.com>
241
242 tests: honor TESTSUITEFLAGS in every check target.
243 * tests/local.mk (RUN_TESTSUITE): New.
244 (check-local, installcheck-local, maintainer-check-g++)
245 (maintainer-check-posix, maintainer-check-valgrind): Use it.
246
247 2009-06-10 Akim Demaille <demaille@gostai.com>
248
249 deterministic test suite.
250 Some consistency checks on symbols are performed after all the
251 symbols were read, by an iteration over the symbol table. This
252 traversal is nondeterministic, which can be a problem for test
253 cases.
254 Avoid this.
255 Addresses another form of nondeterminism reported by Joel E. Denny.
256 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
257
258 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
259 test in two.
260 Use different file names for the three tests to make the
261 maintenance easier.
262
263 2009-06-10 Akim Demaille <demaille@gostai.com>
264
265 gnulib: update.
266 * gnulib: Update to latest.
267 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
268 * m4/.gitignore: Regen.
269 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
270 Call xalloc_die on hash_insert failures.
271 Requested by the new __warn_unused_result__ attribute of
272 hash_insert.
273
274 2009-06-10 Akim Demaille <demaille@gostai.com>
275
276 deterministic user-token-number redeclaration errors.
277 Address nondeterminism reported by Joel E. Denny.
278 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
279
280 * src/uniqstr.h: Comment changes.
281 * src/location.h (boundary_cmp, location_cmp): New.
282 * src/symtab.c (user_token_number_redeclaration): New.
283 (symbol_translation): Use it.
284 * tests/input.at (Numbered tokens): Adjust the expected output.
285
286 2009-05-25 Akim Demaille <demaille@gostai.com>
287
288 build: avoid ignored errors.
289 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
290 errors, they pollute the output.
291
292 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
293
294 Convert multiple variable definition warnings to complaints.
295 * NEWS (2.5): Add a new entry for that change.
296 * doc/bison.texinfo (Decl Summary): Update %define entry.
297 (Bison Options): Update -D/--define/-F/--force-define entry.
298 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
299 * src/muscle-tab.h (muscle_percent_define_insert): Update
300 comments.
301 * tests/input.at (`%define errors'): Update.
302 (`%define, --define, --force-define'): Update.
303
304 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
305
306 -F/--force-define and relative %define/-D/--define priorities.
307 * NEWS (2.5): Add documentation to -D/--define entry.
308 * build-aux/cross-options.pl: Hard-code association of
309 --force-define with %define.
310 * doc/bison.texinfo (Decl Summary): In %define entry,
311 cross-reference command-line options.
312 (Bison Options): Add documentation to -D/--define entry.
313 (Option Cross Key): Widen column for --force-define row.
314 * src/getargs.c (usage): Document -F/--force-define. Realign
315 options in output.
316 (short_options, long_options, getargs): Parse -F/--force-define,
317 and update muscle_percent_define_insert invocations.
318 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
319 (muscle_percent_define_insert): Add argument with that type.
320 * src/muscle-tab.c (muscle_percent_define_insert): Implement
321 -F/--force-define behavior and priorities.
322 (muscle_percent_define_ensure): Update
323 muscle_percent_define_insert invocation.
324 * src/parse-gram.y (prologue_declaration): Update
325 muscle_percent_define_insert invocations.
326 * tests/input.at (`%define, --define'): Rename to...
327 (`%define, --define, --force-define'): ... this and extend.
328
329 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
330
331 Update some comments to make sense for -D.
332 * data/bison.m4 (b4_check_user_names): In header comments, say
333 "user occurrence" instead of "grammar occurrence".
334 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
335 (muscle_percent_code_grow): Likewise just for consistency.
336
337 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
338
339 * data/c++.m4 (b4_namespace_close): Simplify slightly.
340
341 2009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
342
343 Handle a trailing `:' in a user-supplied C++ namespace better.
344 * data/c++.m4 (b4_namespace_close): Don't let it be printed
345 among the closing braces here. This fix might make the
346 generated code easier to debug, but otherwise it should be
347 insignificant because a trailing `:' is a C++ error already.
348
349 2009-05-19 Akim Demaille <demaille@gostai.com>
350
351 remove useless variable.
352 * src/getargs.c (skeleton_arg): Remove now useless variable.
353 Should help the compiler see that this printf-like call is sane.
354
355 2009-05-15 Akim Demaille <demaille@gostai.com>
356
357 Rename token.prefix as api.tokens.prefix.
358 Discussed here.
359 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
360
361 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
362 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
363 (token.prefix): Rename as...
364 (api.tokens.prefix): this.
365
366 2009-05-11 Akim Demaille <demaille@gostai.com>
367
368 doc: use C++ headers.
369 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
370 headers.
371
372 2009-05-11 Akim Demaille <demaille@gostai.com>
373
374 doc: token.prefix
375 * doc/bison.simple (Decl Summary): Document token.prefix.
376 (Calc++ Parser): Various fixes.
377 Formatting changes.
378 Use token.prefix.
379 Introduce a macro TOKEN to shorten the code and make it more
380 readable.
381 (Calc++ Scanner): Adjust.
382 * NEWS (Variable token.prefix): New.
383
384 2009-05-04 Akim Demaille <demaille@gostai.com>
385
386 bison: catch bad symbol names.
387 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
388 * tests/input.at: Adjust.
389
390 2009-05-04 Akim Demaille <demaille@gostai.com>
391
392 identifiers: dashes are letters.
393 Dashes can now start identifiers (symbols and directives).
394
395 * src/scan-gram.l ({letter}): Add dash.
396 ({id}): Remove it.
397 * tests/input.at (Symbols): Adjust.
398 Remove stray comment.
399 * tests/regression.at (Invalid inputs): Adjust error message.
400 * doc/bison.texinfo (Symbols): Update.
401
402 2009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
403
404 Declare %code to be a permanent feature.
405 * NEWS (2.4.2): Here.
406 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
407 experimental.
408 (Decl Summary): Likewise.
409
410 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
411
412 Convert underscores to dashes in some %define variable names.
413 For now, just api.push-pull and lr.keep-unreachable-states.
414 Maintain old names for backward compatibility.
415 * NEWS (2.5): Document.
416 * data/c.m4 (b4_identification): Update comment.
417 * data/yacc.c: Update access.
418 * doc/bison.texinfo: Update.
419 * etc/bench.pl.in (bench_push_parser): Update use.
420 * src/files.c (tr): Move to...
421 * src/getargs.c, src/getargs.h (tr): ... here because I can't
422 think of a better place to expose it. My logic is that, for all
423 uses of tr so far, command-line arguments can be involved, and
424 getargs.h is already included.
425 * src/main.c (main): Update access.
426 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
427 variable names to new variable names before assigning value.
428 * src/reader.c (reader): Update setting default.
429 * tests/calc.at: Update uses.
430 * tests/conflicts.at (Unreachable States After Conflict
431 Resolution): Update use.
432 * tests/input.at (%define enum variables): Update use.
433 (%define backward compatibility): New test group.
434 * tests/push.at: Update uses.
435 * tests/reduce.at: Update uses.
436 * tests/torture.at: Update uses.
437
438 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
439
440 Set all front-end %define defaults in one place.
441 * src/main.c (main): Move lr.keep_unreachable_states default...
442 * src/reader.c (reader): ... to here.
443
444 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
445
446 Rename lr.default_reductions to lr.default-reductions.
447 * NEWS (2.5): Here.
448 * doc/bison.texinfo: Here.
449 * src/lalr.c (initialize_LA): Here.
450 * src/print.c (print_reductions): Here.
451 * src/reader.c (reader): Here.
452 * src/tables.c (action_row): Here.
453 * tests/input.at (%define enum variables): Here.
454 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
455
456 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
457
458 Pacify ./configure --enable-gcc-warnings.
459 * tests/input.at (Symbols): Prototype yyerror and yylex.
460
461 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
462
463 Document how `%define "var" "value"' is not M4-friendly.
464 * src/parse-gram.y (variable): In comments here.
465
466 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
467
468 Clean up recent patches a little.
469 Reported by Akim Demaille.
470 * doc/bison.texinfo (Understanding): Fix typos.
471 * src/print.c (print_reductions): Don't use negated variable.
472
473 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
474
475 List accepted values for a %define enum variable with an invalid value.
476 Suggested by Akim Demaille at
477 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
478 * data/bison.m4 (_b4_percent_define_check_values): Implement.
479 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
480 * tests/input.at (%define lr.default_reductions invalid values): Merge
481 into...
482 (%define enum variables): ... here, and update output.
483
484 2009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
485
486 Rename "default rule" to "default reduction".
487 This includes changing variable names in code, changing
488 comments, and renaming %define lr.default_rules to %define
489 lr.default_reductions.
490 * NEWS (2.5): Update IELR documentation.
491 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
492 documentation.
493 * data/glr.c, data/lalr1.java: Sync copyright dates.
494 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
495 and lr.type documentation. Make some other wording
496 improvements.
497 (Glossary): Adjust cross-references and Default Reduction
498 definition.
499 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
500 Remove a confusing comment pointed out by Akim Demaille.
501 (initialize_LA): Adjust code.
502 * src/print-xml.c (print_reductions): Adjust code.
503 * src/print.c (print_reductions): Adjust code.
504 * src/reader.c (reader): Adjust code.
505 * src/tables.c (action_row): Adjust code.
506 (token_actions): Adjust code.
507 * src/tables.h: Adjust YYDEFACT documentation.
508 * tests/input.at (%define lr.default_rules invalid values):
509 Rename test group to...
510 (%define lr.default_reductions invalid values): ... this, and
511 update grammar file and expected output.
512 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
513 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
514
515 2009-04-21 Akim Demaille <demaille@gostai.com>
516
517 tests: check the use of dashes and periods in symbols.
518 * tests/input.at (Symbol): New test group.
519
520 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
521
522 Document %define lr.type and lr.default_rules.
523 * NEWS (2.5): Add an entry.
524 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
525 besides just LALR(1) and GLR(1).
526 * doc/bison.texinfo (Introduction): Likewise.
527 (Language and Grammar): Bison is no longer limited to LALR(1)
528 restrictions.
529 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
530 when trying to distinguish from GLR. Talk about LR(1) grammars
531 rather than LALR(1) grammars.
532 (Decl Summary): In %define api.push_pull entry, say it applies
533 to deterministic parsers in C rather than LALR(1) parsers in C.
534 Add lr.default_rules entry.
535 Add lr.type entry.
536 (Mystery Conflicts): Bison is no longer limited to LALR(1)
537 restrictions.
538 (Generalized LR Parsing): Same changes as for the previous GLR
539 section.
540 (Memory Management): Say deterministic rather than LALR(1).
541 (Understanding): Correct some bison output.
542 Index discussion of "accepting state".
543 Say deterministic rather than LALR(1).
544 (Bison Options): In --yacc entry, say deterministic rather than
545 LALR(1).
546 In --report, --graph, and --xml entries, just don't mention
547 LALR(1).
548 (C++ Parsers): Say deterministic rather than LALR(1).
549 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
550 (Glossary): Add Accepting State, Consistent State, Default Rule,
551 and IELR(1) definitions.
552 In Generalized LR (GLR) definition, make same changes as in
553 previous GLR sections.
554 In LALR(1) definition, say Bison uses LALR(1) by default rather
555 than implying Bison is limited to LALR(1).
556 (LocalWords): Add IELR.
557
558 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
559
560 Finish implementing %define lr.type.
561 Its value can be "LALR", "IELR", or "canonical LR".
562 * lib/timevar.def (TV_IELR_PHASE1): New var.
563 (TV_IELR_PHASE2): New var.
564 (TV_IELR_PHASE3): New var.
565 (TV_IELR_PHASE4): New var.
566 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
567 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
568 Sbitset.h, ielr.h, and ielr.c.
569 * src/getargs.h, src/getargs.c (enum trace, trace_args,
570 trace_types): Add trace_ielr.
571 * src/lalr.h, src/lalr.c (ngotos): Export it.
572 (F): Rename to...
573 (goto_follows): ... this, update all uses, and export it.
574 (set_goto_map): Export it.
575 (map_goto): Export it.
576 (compute_lookahead_tokens): Don't free goto_follows yet. Now
577 handled in ielr.
578 (initialize_LA): Export it. Move lookback allocation to...
579 (lalr): ... here because, for canonical LR, initialize_LA must
580 be invoked but lookback and much of the rest of LALR isn't
581 needed.
582 * main.c (main): Instead of lalr, invoke ielr, which invokes
583 lalr.
584 * src/reader.c (reader): Default lr.type to "LALR".
585 Default lr.default_rules to "accepting" if lr.type is "canonical
586 LR". Leave the default as "all" otherwise.
587 Check for a valid lr.type value.
588 * src/state.h, src/state.c (struct state_list): Add state_list
589 member.
590 (state_new): Initialize state_list member to NULL.
591 (state_new_isocore): New function, exported.
592 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
593 exercises all values of lr.type.
594 (GNU AWK Grammar): Rename test group to...
595 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
596 AT_TEST_EXISTING_GRAMMAR.
597 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
598 (GNU pic Grammar): Rename test group to...
599 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
600 AT_TEST_EXISTING_GRAMMAR.
601 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
602 all values of lr.type.
603 (Single State Split): New test groups using AT_TEST_LR_TYPE.
604 (Lane Split): Likewise.
605 (Complex Lane Split): Likewise.
606 (Split During Added Lookahead Propagation): Likewise.
607
608 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
609
610 Add new files for IELR and canonical LR implementation.
611 * src/AnnotationList.c: New.
612 * src/AnnotationList.h: New.
613 * src/InadequacyList.c: New.
614 * src/InadequacyList.h: New.
615 * src/Sbitset.c: New.
616 * src/Sbitset.h: New.
617 * src/ielr.c: New.
618 * src/ielr.h: New.
619
620 2009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
621
622 Implement %define lr.default_rules.
623 Its value describes the states that are permitted to contain
624 default rules: "all", "consistent", or "accepting".
625 * src/reader.c (reader): Default lr.default_rules to "all".
626 Check for a valid lr.default_rules value.
627 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
628 is "accepting", then only mark the accepting state as
629 consistent.
630 (initialize_LA): Tell state_lookahead_tokens_count whether
631 lr.default_rules is "accepting".
632 * src/tables.c (action_row): If lr.default_rules is not "all",
633 then disable default rules in inconsistent states.
634 * src/print.c (print_reductions): Use this opportunity to
635 perform some assertions about whether lr.default_rules was
636 obeyed correctly.
637 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
638 helps with checking the parser tables for a grammar.
639 * tests/input.at (%define lr.default_rules invalid values): New
640 test group.
641 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
642 AT_TEST_TABLES_AND_PARSE.
643 (`no %define lr.default_rules'): New test group generated by
644 AT_TEST_LR_DEFAULT_RULES.
645 (`%define lr.default_rules "all"'): Likewise.
646 (`%define lr.default_rules "consistent"'): Likewise.
647 (`%define lr.default_rules "accepting"'): Likewise.
648
649 2009-04-20 Akim Demaille <demaille@gostai.com>
650
651 Formatting change.
652
653 2009-04-20 Akim Demaille <demaille@gostai.com>
654
655 bison: factoring.
656 * src/output.c (token_definitions_output): Use symbol_id_get
657 instead of duplicating its logic.
658 * TODO (YYERRCODE): Extend.
659
660 2009-04-20 Akim Demaille <demaille@gostai.com>
661
662 variables: prefer error-verbose to error_verbose.
663 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
664 instead of error_verbose.
665 * src/scan-gram.l (%error-verbose): Map to the error-verbose
666 variable.
667 * doc/bison.texinfo: Promote %define error-verbose instead of
668 %error-verbose.
669 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
670
671 2009-04-15 Akim Demaille <demaille@gostai.com>
672
673 variables: accept dashes.
674 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
675 underscores.
676 * src/scan-gram.l ({id}): Also accept dashes after the initial
677 letter.
678 ({directive}): Use {id}.
679 * src/parse-gram.y: Comment and formatting changes.
680 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
681 symbols.
682 * src/complain.h, src/complain.c (yacc_at): New.
683 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
684 symbol names.
685 * src/output.c (token_definitions_output): Do not #define token
686 names with dashes.
687
688 2009-04-20 Akim Demaille <demaille@gostai.com>
689
690 Consistently refer to Yacc, not YACC.
691 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
692
693 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
694
695 Pacify make maintainer-check-posix.
696 * tests/input.at (%define, --define): Move bison command-line
697 options before grammar file name.
698
699 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
700
701 Document semicolon warnings.
702 * NEWS (2.5): Here.
703
704 2009-04-14 Akim Demaille <demaille@gostai.com>
705
706 variables: use `parse.assert' instead of `assert'.
707 * TODO (assert): Remove.
708 * data/bison.m4 (b4_assert_if): Replace with...
709 (b4_parse_assert_if): this.
710 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
711 * doc/bison.texinfo (Decl Summary): Document parse.assert.
712
713 2009-04-14 Akim Demaille <demaille@gostai.com>
714
715 variables: use `parse.trace' instead of `debug'.
716 * src/getargs.c (getargs): Map -t to %define trace.parse.
717 * src/scan-gram.l (%debug): Map to %define trace.parse.
718 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
719 names to `_' in macro names.
720 (b4_debug_if): Replace with...
721 (b4_parse_trace_if): this.
722 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
723 * data/yacc.c: Adjust.
724 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
725 Use @code to label the variable list.
726 Document the variable parse.trace.
727 (Tracing): Promote the parse.trace variable.
728 * TODO: %printer is not documented.
729
730 2009-04-14 Akim Demaille <demaille@gostai.com>
731
732 doc: minor fixes.
733 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
734 (Table of Symbols): Remove duplicate entry for %debug.
735
736 2009-04-10 Eric Blake <ebb9@byu.net>
737
738 submodules: update to latest
739 * submodules/autoconf: Use latest upstream Autoconf.
740
741 2009-04-06 Eric Blake <ebb9@byu.net>
742
743 Work around autoconf 2.63b bug in testsuite.
744 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
745 autoconf bug related to # in test.
746
747 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
748
749 * NEWS (2.5): New section. Describe new -D/--define feature.
750
751 2009-04-06 Akim Demaille <demaille@gostai.com>
752
753 Regen.
754 * src/parse-gram.h, src/parse-gram.c: Regen.
755
756 2009-04-06 Akim Demaille <demaille@gostai.com>
757
758 rename muscle_tab.* as muscle-tab.* for consistency.
759 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
760 * src/muscle-tab.h, src/muscle-tab.c: these.
761 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
762 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
763
764 2009-04-06 Akim Demaille <demaille@gostai.com>
765
766 Makefile: introduce $(BISON).
767 * src/local.mk (BISON): New.
768 (YACC): Use it.
769
770 2009-04-06 Akim Demaille <demaille@gostai.com>
771
772 parser: handle %locations as %define locations.
773 * src/getargs.h, src/getargs.c (locations_flag): Remove.
774 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
775 to set "locations" to true.
776 * src/output.c (prepare): Don't output "locations".
777 * src/scan-gram.l (%locations): Handle it as a %<flag>.
778 * src/parse-gram.y: It's no longer a token.
779 Don't handle it.
780 * data/bison.m4 (b4_locations_if): Define it with
781 b4_percent_define_if_define.
782 * data/c.m4, data/glr.cc: Adjust.
783
784 2009-04-06 Akim Demaille <demaille@gostai.com>
785
786 Regen.
787 * src/parse-gram.c: Regen.
788
789 2009-04-06 Akim Demaille <demaille@gostai.com>
790
791 muscle: factor the handling of obsolete of obsolete directives.
792 Suggested by Joel E. Denny.
793
794 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
795 New, extracted from...
796 * src/parse-gram.y (prologue_declaration: pure-parser): here.
797 Remove it.
798 (prologue_declaration: "%<flag>"): Use
799 muscle_percent_define_ensure.
800 (%error-verbose, %pure-parser): No longer tokens.
801 * src/scan-gram.l (pure-parser): Return as a %<flag>.
802
803 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
804
805 Fix options documentation.
806 * build-aux/cross-options.pl: As in --help output, write optional
807 arguments as [=ARG] not =[ARG].
808 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
809
810 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
811
812 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
813 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
814 requirements for a correct m4 are stricter.
815 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
816 * configure.ac: Update to use AC_PROG_GNU_M4.
817 Reported by Eric Blake.
818
819 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
820
821 Help with updating web manual.
822 * HACKING: Incorporate instructions from gnulib/doc/README.
823 * bootstrap.conf (gnulib_modules): Add gendocs.
824
825 2009-04-03 Akim Demaille <demaille@gostai.com>
826
827 Regen.
828 * src/parse-gram.h, src/parse-gram.c: Regen.
829
830 2009-04-03 Akim Demaille <demaille@gostai.com>
831
832 Factor %FLAG at scan level.
833 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
834 definitions and associated rules, replaced by....
835 (PERCENT_FLAG): this new token type, and rule.
836 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
837 Use it for %debug and %error-verbose.
838
839 2009-04-03 Akim Demaille <demaille@gostai.com>
840
841 Regen.
842 * src/parse-gram.h, src/parse-gram.c: Regen.
843
844 2009-04-03 Akim Demaille <demaille@gostai.com>
845
846 Treat %debug as %define debug.
847 * data/bison.m4 (b4_debug_if): New.
848 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
849 * data/lalr1.java: Use it instead of b4_debug_flag.
850 * src/getargs.h, src/getargs.c (debug_flag): Remove.
851 * src/output.c (prepare): Don't output it.
852 * src/parse-gram.y: Treat %debug as %define debug.
853
854 2009-04-03 Akim Demaille <demaille@gostai.com>
855
856 Treat %error-verbose as %define error_verbose.
857 This allows to pass -Derror_verbose on the command line. Better
858 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
859 ERROR_VERBOSE being defined as false or true.
860 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
861 on b4_percent_define_ifdef, for does not check the defined value,
862 but only whether the symbol is defined, rely on
863 b4_percent_define_flag_if, so that a value of "false" is processed
864 as a false.
865 If not defined, define the flag to "false".
866 (b4_error_verbose_if): New.
867 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
868 b4_error_verbose_flag.
869 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
870 * src/output.c (prepare): Don't output it.
871 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
872
873 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
874
875 Fix strange %define locations for default values.
876 Reported by Akim Demaille at
877 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
878 and discussed again starting at
879 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
880 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
881 because location information is bogus.
882 Use angle brackets to delimit fake file name because square brackets
883 look like underexpanded m4. Choose a better fake file name.
884 Use negative line numbers.
885 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
886 * src/location.c (location_print): If line for a boundary is negative,
887 only print that boundary's file name.
888 * src/location.h: Document that.
889 * tests/skeletons.at (%define Boolean variables: invalid skeleton
890 defaults): Update output.
891
892 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
893
894 Pacify ./configure --enable-gcc-warnings.
895 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
896 in lib won't compile with it.
897 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
898
899 2009-03-31 Akim Demaille <demaille@gostai.com>
900
901 bootstrap: --help to stdout.
902 * bootstrap (usage): Don't send --help to stderr.
903 Use a here doc instead of a long string.
904
905 2009-03-31 Akim Demaille <demaille@gostai.com>
906
907 bootstrap: README-hacking no longer exists
908 * bootstrap (checkout_only_file): Set to HACKING.
909
910 2009-03-26 Akim Demaille <demaille@gostai.com>
911
912 doc: merge HACKING and README-hacking.
913 Two files is confusing.
914 Reported by Alexandre Duret-Lutz.
915
916 * README-hacking: Merge into...
917 * HACKING (Working from the repository): here.
918
919 2009-03-26 Akim Demaille <demaille@gostai.com>
920
921 doc: update README-hacking.
922 * README-hacking: We now use git and git submodules.
923 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
924
925 2009-03-26 Akim Demaille <demaille@gostai.com>
926
927 lalr1.cc: avoid GCC 4.3 warnings.
928 GCC 4.3 now warns about "a || b && c" and asks for explicit
929 parentheses.
930 Reported by Alexandre Duret-Lutz.
931 * data/location.cc: Update copyright years.
932 (Position::operator==): Use parens to make precedence explicit.
933 Compare lines and columns first, as they are more likely to be
934 different, and they are faster to compare.
935
936 2009-03-26 Akim Demaille <demaille@gostai.com>
937
938 gnulib: update.
939 * gnulib: Update to latest.
940 * src/local.mk (AM_CFLAGS): Move to...
941 * Makefile.am: here.
942 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
943 AM_CFLAGS.
944
945 2009-03-02 Akim Demaille <demaille@gostai.com>
946
947 Comment changes.
948
949 2009-03-02 Akim Demaille <demaille@gostai.com>
950
951 Share b4_yytranslate_define.
952 * data/lalr1.cc (b4_yytranslate_define): Move to...
953 * data/c++.m4: here.
954
955 2009-03-02 Akim Demaille <demaille@gostai.com>
956
957 Use locations in the variant example.
958 Yes, this obfuscates the point of this example, variants only.
959 But glr.cc cannot work (yet?) without locations. This change
960 makes it easier to use this example with glr.cc.
961
962 * examples/variant.yy (assert): %define it.
963 (locations): Request them.
964 (yylex): Bind the location to the stage.
965
966 2009-03-02 Akim Demaille <demaille@gostai.com>
967
968 Dub make_TOKEN as a public type interface.
969 * data/c++.m4 (b4_symbol_constructor_declare)
970 (b4_symbol_constructor_define): New empty stubs.
971 (b4_public_types_declare, b4_public_types_define): Use them.
972 * data/lalr1.cc (b4_symbol_constructor_declare)
973 (b4_symbol_constructor_declare_)
974 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
975 Move to...
976 * data/variant.hh: here.
977 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
978 needed.
979 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
980 b4_symbol_constructor_declare, as it is now done by
981 b4_public_types_define and b4_public_types_declare.
982
983 2009-03-02 Akim Demaille <demaille@gostai.com>
984
985 Coding style changes.
986 * data/lalr1.cc (b4_symbol_constructor_declaration_)
987 (b4_symbol_constructor_declarations)
988 (b4_symbol_constructor_definition_)
989 (b4_symbol_constructor_definitions)
990 (b4_yytranslate_definition): Rename as...
991 (b4_symbol_constructor_declare_)
992 (b4_symbol_constructor_declare)
993 (b4_symbol_constructor_define_)
994 (b4_symbol_constructor_define)
995 (b4_yytranslate_define): these.
996 * data/variant.hh (b4_variant_definition): Rename as...
997 (b4_variant_define): this.
998
999 2009-03-02 Akim Demaille <demaille@gostai.com>
1000
1001 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
1002 * data/bison.m4 (b4_percent_define_if_define): New.
1003 * data/c++.m4 (b4_variant_if): Move to...
1004 * data/bison.m4: Here, using b4_percent_define_if_define.
1005 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
1006 * data/bison.m4: Here, using b4_percent_define_if_define.
1007
1008 2009-03-02 Akim Demaille <demaille@gostai.com>
1009
1010 Dub symbol_type_base as a public type.
1011 * data/c++.m4 (b4_public_types_declare): Now define
1012 symbol_type_base and symbol_type.
1013 (b4_public_types_define): New.
1014 In both cases, the definitions are taken verbatim from lalr1.cc.
1015 * data/lalr1.cc: Adjust.
1016
1017 2009-03-02 Akim Demaille <demaille@gostai.com>
1018
1019 b4_public_types_declare.
1020 * data/c++.m4 (b4_public_types_declare): New.
1021 * data/glr.cc, data/lalr1.cc: Use it.
1022
1023 2009-03-02 Akim Demaille <demaille@gostai.com>
1024
1025 b4_semantic_type_declare.
1026 * data/c++.m4 (b4_semantic_type_declare): New.
1027 Factors and generalizes what was in glr.cc and lalr1.cc.
1028 * data/variant.hh (b4_semantic_type_declare): Redefine it for
1029 variants.
1030 * data/lalr1.cc, data/glr.cc: Use it.
1031
1032 2009-02-26 Akim Demaille <demaille@gostai.com>
1033
1034 Upgrade gnulib.
1035 * gnulib: Upgrade from master.
1036 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
1037 Regen.
1038
1039 2009-02-25 Akim Demaille <demaille@gostai.com>
1040
1041 Remove useless arguments.
1042 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
1043 relevant.
1044
1045 2009-02-25 Akim Demaille <demaille@gostai.com>
1046
1047 Comment changes.
1048 * data/lalr1.cc: here.
1049
1050 2009-02-25 Akim Demaille <demaille@gostai.com>
1051
1052 Fix glr.cc's debug level handling.
1053 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
1054 glr.c which is used.
1055 (debug_level, set_debug_level): Adjust.
1056
1057 2009-02-25 Akim Demaille <demaille@gostai.com>
1058
1059 Copyright years.
1060 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1061
1062 2009-02-25 Akim Demaille <demaille@gostai.com>
1063
1064 Style changes.
1065 * etc/bench.pl.in (generate_grammar_list): Consitently use
1066 location_type, not yy::location.
1067
1068 2009-02-25 Akim Demaille <demaille@gostai.com>
1069
1070 Comment change.
1071 * data/lalr1.cc: here.
1072
1073 2009-02-19 Akim Demaille <demaille@gostai.com>
1074
1075 Make yyparser::error public.
1076 * data/lalr1.cc: here.
1077 There is no good reason to keep it private (and it is convenient
1078 to use it from the scanner for instance). It is already public in
1079 glr.cc.
1080
1081 2009-02-19 Akim Demaille <demaille@gostai.com>
1082
1083 Comment changes.
1084 * data/glr.cc: here.
1085
1086 2009-02-19 Akim Demaille <demaille@gostai.com>
1087
1088 Remove trailing blanks.
1089 The epilogue has its own ending \n, no need to add another.
1090
1091 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
1092 epilogue.
1093 * data/glr.cc: dnl when extending the epilogue.
1094 Remove stray "private:".
1095
1096 2009-02-19 Akim Demaille <demaille@gostai.com>
1097
1098 Use b4_c_modern.
1099 * data/c.m4 (b4_c_function_decl): Here.
1100
1101 2009-02-19 Akim Demaille <demaille@gostai.com>
1102
1103 Comment changes.
1104 * data/lalr1.cc: here.
1105
1106 2009-02-19 Akim Demaille <demaille@gostai.com>
1107
1108 Extract variant.hh
1109 * data/variant.hh: New, extracted from...
1110 * data/lalr1.cc: here.
1111 Adjust.
1112 * data/local.mk: Adjust.
1113
1114 2009-02-19 Akim Demaille <demaille@gostai.com>
1115
1116 Extract stack.hh from lalr1.cc.
1117 * data/stack.hh: New.
1118 * data/lalr1.cc: Extract from here.
1119 * data/local.mk: Adjust.
1120
1121 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1122
1123 Add reminder about uploading public key to keys.gnupg.net.
1124 * HACKING (Release Procedure): Here.
1125
1126 2009-01-28 Akim Demaille <demaille@gostai.com>
1127
1128 * NEWS: Update information about 2.4.1 and 2.4.2.
1129
1130 2008-11-04 Akim Demaille <demaille@gostai.com>
1131
1132 Reformat NEWS.
1133 * NEWS: Use more outline-mode markup.
1134 Suggested by Jim Meyering.
1135
1136 2009-01-08 Akim Demaille <demaille@gostai.com>
1137
1138 Fix grep portability issues.
1139 Grep on Solaris does not support -q.
1140 Reported by Summum Bonum.
1141
1142 * NEWS: Add a stub for 2.4.2.
1143 * THANKS: Add Summum Bonum.
1144 * tests/atlocal.in (EGREP): New.
1145 (CC, CXX, XSLTPROC): Make it possible to override them via
1146 envvars.
1147 * tests/java.at: Use $EGREP instead of egrep.
1148 Use AT_CHECK's ignore instead of grep's -q.
1149
1150 2008-12-11 Akim Demaille <demaille@gostai.com>
1151
1152 Pass the token type to yysyntax_error.
1153 * data/yacc.c (yysyntax_error): Take the transated token instead
1154 of the raw number.
1155 Adjust callers.
1156 * TODO: Update.
1157
1158 2008-12-11 Akim Demaille <demaille@gostai.com>
1159
1160 Formatting changes.
1161 * data/glr.c: Formatting changes.
1162
1163 2008-12-11 Akim Demaille <demaille@gostai.com>
1164
1165 Propagate i18n changes into glr.c.
1166 * TODO: Update.
1167 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
1168 building the error message format dynamically.
1169 * data/lalr1.java: Formatting changes.
1170
1171 2008-12-11 Akim Demaille <demaille@gostai.com>
1172
1173 Use testsuite -C.
1174 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
1175 Solves problems when top_srcdir is an absolute path.
1176 Suggested by Eric Blake.
1177 * configure.ac: Require Autoconf 2.62.
1178
1179 2008-12-11 Akim Demaille <demaille@gostai.com>
1180
1181 Simplify the i18n of the error messages.
1182 * data/lalr1.cc: Comment changes.
1183 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
1184 lalr1.cc instead of building dynamically the format string.
1185
1186 2008-12-08 Akim Demaille <demaille@gostai.com>
1187
1188 Fix portability issue in the test suite.
1189 * tests/local.at (AT_MATCHES_CHECK): New.
1190 Based on Perl instead of Sed. Sed has too many portability
1191 pitfalls, not ever Sed is GNU Sed.
1192 * tests/actions.at (Fix user actions without a trailing semicolon):
1193 Use it.
1194
1195 2008-12-08 Akim Demaille <demaille@gostai.com>
1196
1197 Update data/README.
1198 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1199
1200 2008-12-08 Akim Demaille <demaille@gostai.com>
1201
1202 Install autoconf as a submodule to get m4sugar.
1203 * .gitmodules: Add submodules/autoconf.
1204 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1205 submodules/autoconf.
1206
1207 2008-12-08 Akim Demaille <demaille@gostai.com>
1208
1209 Test token.prefix in all the skeletons.
1210 * data/java.m4 (b4_token_enum): Use the token.prefix.
1211 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
1212 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
1213 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
1214 * tests/java.at: Comment changes.
1215 (AT_CHECK_JAVA_MINIMAL): Define the END token.
1216 (Java parser class and package names): Add token.prefix check.
1217
1218 2008-12-08 Akim Demaille <demaille@gostai.com>
1219
1220 Fix regeneration of atconfig.
1221 * tests/local.mk (tests/atconfig): The rule was incorrect, but
1222 remove it: now that there is no tests/Makefile.am, the top-level
1223 Makefile properly updates atconfig when needed.
1224
1225 2008-12-07 Di-an Jan <dianj@freeshell.org>
1226
1227 Implement the FIXME that ends an user action with a semicolon
1228 if it seems necessary.
1229 * src/scan-code.l (flex rules section): Flag cpp directive from
1230 any `#' to the first unescaped end-of-line. Semicolon is not
1231 needed after `;', `{', '}', or cpp directives and is needed after
1232 any other token (whitespaces and comments have no effect).
1233 * tests/actions.at (Fix user actions without a trailing semicolon):
1234 New test.
1235 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1236 to make user actions complete statements.
1237 Adjust column numbers in error messages.
1238 * tests/regression.at (Fix user actions without a trailing semicolon):
1239 Remove. Covered by new test.
1240
1241 2008-12-07 Akim Demaille <demaille@gostai.com>
1242
1243 Update gnulib.
1244 * gnulib: Update from master.
1245
1246 2008-12-05 Eric Blake <ebb9@byu.net>
1247
1248 Avoid compiler warning.
1249 * src/output.c (muscle_insert_item_number_table): Delete unused
1250 function.
1251
1252 2008-12-02 Eric Blake <ebb9@byu.net>
1253
1254 Build testsuite with newer autoconf.
1255 * tests/output.at (m4_expand): Don't override in newer autoconf,
1256 where the underlying implementation changed.
1257 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1258 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1259 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1260 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1261 since some of them contain unbalanced ')'.
1262
1263 2008-12-01 Akim Demaille <demaille@gostai.com>
1264
1265 Use b4_symbol for printers and destructors everywhere.
1266 * data/bison.m4 (b4_symbol_action_location): New.
1267 * data/c.m4 (b4_symbol_actions): Remove.
1268 Adjust all callers to use by b4_symbol_foreach and the corresponding
1269 b4_symbol_printer/destructor macro.
1270 * data/glr.cc: Adjust.
1271 * data/lalr1.java: Adjust the %destructor sanity check.
1272 * src/output.c (symbol_code_props_output): Remove, we no longer
1273 need the b4_symbol_printers/destructors tables.
1274
1275 2008-12-01 Akim Demaille <demaille@gostai.com>
1276
1277 Use b4_symbol_case_.
1278 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
1279 b4_symbol_case_.
1280
1281 2008-12-01 Akim Demaille <demaille@gostai.com>
1282
1283 Move b4_symbol based macro to bison.m4.
1284 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
1285 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
1286 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
1287 (b4_type_foreach): Move to...
1288 * data/bison.m4: Here.
1289 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
1290 b4_symbol_value_template instead of b4_symbol_value.
1291
1292 2008-12-01 Akim Demaille <demaille@gostai.com>
1293
1294 b4_symbol/type_foreach.
1295 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
1296 Use them.
1297
1298 2008-12-01 Akim Demaille <demaille@gostai.com>
1299
1300 Use the symbol properties to output the printer/destructor for lalr1.cc.
1301 Instead of defining complex list of tuples to define various
1302 properties of the symbols, we now prefer to define symbols as
1303 "structs" in m4: using the symbol key (its number), and the
1304 property name, b4_symbol gives it value. Use this to handle
1305 destructors and printers.
1306
1307 * src/output.c (CODE_PROP): New.
1308 (prepare_symbol_definitions): Use it to define the printer and
1309 destructor related attributes of the symbols.
1310 * data/lalr1.cc (b4_symbol_actions): Rename as...
1311 (b4_symbol_action): this.
1312 Use b4_symbol instead of 6 arguments.
1313 (b4_symbol_printer, b4_symbol_destructor): New.
1314 Use them instead of b4_symbol_actions.
1315
1316 2008-12-01 Akim Demaille <demaille@gostai.com>
1317
1318 Avoid capturing variables too easily.
1319 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
1320 v__ and p__ instead of v and p.
1321
1322 2008-12-01 Akim Demaille <demaille@gostai.com>
1323
1324 Remove spurious empty line before syncline.
1325 * data/bison.m4 (b4_syncline): Don't output an empty line before
1326 the output.
1327
1328 2008-11-26 Akim Demaille <demaille@gostai.com>
1329
1330 Convert lib/Makefile.am into lib/local.mk.
1331 The real problem is rather gnulib.mk, which itself is extracted
1332 from a Makefile.am that gnulib expects to the "recursive". The
1333 tool prefix-gnulib-mk converts such a gnulib.mk to be
1334 non-recursive. Also, some AC_SUBST variables need to be adjusted.
1335
1336 * etc/prefix-gnulib-mk: New.
1337 * bootstrap (slurp): Use it to convert further gnulib.mk.
1338 No longer try to avoid re-creation of lib/gnulib.mk as the changes
1339 are deeper.
1340 * lib/Makefile.am: Rename as...
1341 * lib/local.mk: this.
1342 Adjust to be prefixed.
1343 * Makefile.am, configure.ac: Adjust.
1344 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
1345
1346 2008-11-26 Akim Demaille <demaille@gostai.com>
1347
1348 s/_FLAGS/FLAGS/.
1349 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
1350 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
1351 Reported by Eric Blake.
1352
1353 2008-11-26 Akim Demaille <demaille@gostai.com>
1354
1355 Use b4_parser_tables_define in glr.cc.
1356 * data/glr.c: Use b4_parser_tables_define instead of defining the
1357 (deterministic integral) tables by hand.
1358
1359 2008-11-26 Akim Demaille <demaille@gostai.com>
1360
1361 Use b4_parser_tables_define in Java.
1362 * data/java.m4 (b4_typed_parser_table): Rename as...
1363 (b4_typed_parser_table_define): this, for consistency.
1364 Accept a comment as $4.
1365 Move $2 into yy*_.
1366 (b4_integral_parser_table): Rename as...
1367 (b4_integral_parser_table_define): this.
1368 * data/lalr1.java: Adjust all uses.
1369 Use b4_parser_tables_define instead of generation by hand.
1370
1371 2008-11-26 Akim Demaille <demaille@gostai.com>
1372
1373 Prepare the convergence bw C style and Java table generation.
1374 * data/bison.m4 (b4_tables_map, b4_tables_declare)
1375 (b4_tables_define): Rename as...
1376 (b4_integral_parser_tables_map, b4_parser_tables_declare)
1377 (b4_parser_tables_define): these.
1378 * data/c.m4 (b4_table_define): Rename as...
1379 (b4_integral_parser_table_define): this.
1380 * data/lalr1.cc: Adjust.
1381 (b4_table_define, b4_table_declare): Rename as...
1382 (b4_integral_parser_table_define)
1383 (b4_integral_parser_table_declare): these.
1384 (yyrline_): Move the comment where it is actually used.
1385 * data/yacc.c: Adjust.
1386 (yyrline): Use b4_integral_parser_table_define.
1387
1388 2008-11-26 Akim Demaille <demaille@gostai.com>
1389
1390 Regen.
1391 * src/parse-gram.h, src/parse-gram.c: Regen.
1392
1393 2008-11-26 Akim Demaille <demaille@gostai.com>
1394
1395 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
1396 * data/lalr1.cc (b4_tables_map): Move to...
1397 * data/bison.m4: here.
1398 Update the comment for yytable during the flight.
1399 (b4_tables_declare, b4_tables_define): New.
1400 * data/lalr1.cc: Use them.
1401 * data/c.m4 (b4_table_define): New.
1402 * data/yacc.c: Use b4_tables_define instead of output the tables
1403 by hand.
1404 * tests/regression.at (Web2c Actions): Adjust the expected output,
1405 the order of the tables changed.
1406
1407 2008-11-26 Akim Demaille <demaille@gostai.com>
1408
1409 Get rid of (yy)rhs and (yy)prhs.
1410 These tables are no longer needed in the parsers, and they don't seem to
1411 be useful. They are not documented either.
1412
1413 * src/output.c (prepare_rules): Get rid of rhs and prhs.
1414 Adjust the computation of (yy)r2.
1415
1416 2008-11-26 Akim Demaille <demaille@gostai.com>
1417
1418 Rule length is unsigned.
1419 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
1420
1421 2008-11-26 Akim Demaille <demaille@gostai.com>
1422
1423 Get rid of lalr1-split.cc.
1424 It was no longer maintainer.
1425
1426 * data/lalr1-split.cc: Remove.
1427 * etc/bench.pl.in (bench_fusion_parser): Remove.
1428 Adjust.
1429
1430 2008-11-26 Akim Demaille <demaille@gostai.com>
1431
1432 Use yy* consistently.
1433 * data/glr.c: Now that yyrhs no longer exists as a global
1434 variable, rename local "rhs" variables into "yyrhs" for
1435 consistency.
1436
1437 2008-11-25 Akim Demaille <demaille@gostai.com>
1438
1439 Get rid of yyrhs and yyprhs in glr.c.
1440 * data/glr.c (yyrhs, yyprhs): Remove.
1441 Instead, use the state stack and yystos.
1442
1443 2008-11-25 Akim Demaille <demaille@gostai.com>
1444
1445 Flag glr tests.
1446 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
1447 as an Autotest keyword.
1448
1449 2008-11-25 Akim Demaille <demaille@gostai.com>
1450
1451 Prefer TESTSUITE_FLAGS.
1452 TESTSUITEFLAGS is barely readable.
1453
1454 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
1455 for backward compatibility.
1456 Use the former instead of the latter.
1457
1458 2008-11-25 Akim Demaille <demaille@gostai.com>
1459
1460 Get rid of yyrhs and yyprhs in larl1.java.
1461 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
1462 (yy_reduce_print): Rather, use yystos_ and the state stack.
1463
1464 2008-11-25 Akim Demaille <demaille@gostai.com>
1465
1466 Formatting changes.
1467
1468 2008-11-25 Akim Demaille <demaille@gostai.com>
1469
1470 Get rid of yyrhs and yyprhs in yacc.c.
1471 They were used to get the symbol types, given a rule number, when
1472 displaying the top of the stack before a reduction. But the
1473 symbol type is available from the state stack. This has two be
1474 benefits: two tables less in the parser (making it smaller), and a
1475 more consistent use of the three stacks which will help to fuse
1476 them.
1477
1478 * data/yacc.c (yyprhs, yyrhs): Remove.
1479 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
1480 (yy_reduce_print): Take yyssp as argument.
1481 Use it, together with yystos, to get the symbol type.
1482 * tests/regression.at (Web2c Report): Remove these tables from the
1483 expected output.
1484
1485 2008-11-25 Akim Demaille <demaille@gostai.com>
1486
1487 b4_tables_map.
1488 The point is to factor the generation of the tables across skeletons.
1489 This is language dependant.
1490
1491 * data/c.m4 (b4_comment_): New.
1492 Should be usable to define how to generate tables independently of
1493 the language.
1494 (b4_c_comment): New.
1495 (b4_comment): Bounce to b4_c_comment.
1496 Now support $2 = [PREFIX] for indentation.
1497 * data/lalr1.cc (b4_table_declare): Don't output a comment if
1498 there is no comment.
1499 Indent it properly when there is one.
1500 Output the ending semicolon.
1501 (b4_table_define): Space changes.
1502 Output the ending semicolon.
1503 (b4_tables_map): New.
1504 Use it twice instead of declaring and defining the (integral)
1505 tables by hand.
1506
1507 2008-11-25 Akim Demaille <demaille@gostai.com>
1508
1509 b4_table_declare.
1510 * data/lalr1.cc (b4_table_declare): New.
1511 Use it to declare the tables defined with b4_table_define.
1512 (b4_table_define): Declare a third arg to match b4_table_declare
1513 signature.
1514 Move all the comments around invocations of b4_table_define into
1515 the invocations itselves.
1516 Move things around to have the order for declarations and
1517 definitions.
1518
1519 2008-11-25 Akim Demaille <demaille@gostai.com>
1520
1521 Formatting changes.
1522 * data/lalr1.java: here.
1523
1524 2008-11-25 Akim Demaille <demaille@gostai.com>
1525
1526 b4_args is more general than only C++.
1527 * data/lalr1.cc (b4_args, _b4_args): Move to...
1528 * data/bison.m4: here.
1529
1530 2008-11-21 Di-an Jan <dianj@freeshell.org>
1531
1532 Implement no-XXX arguments for --warnings, --report, --trace.
1533 * src/getargs.c (flags_argmatch): Handles no-XXX.
1534 Fix typo in doxygen comment.
1535
1536 2008-11-21 Akim Demaille <demaille@gostai.com>
1537
1538 Display the changes in cross-options.texi.
1539 * build-aux/cross-options.pl ($sep): New, to separate items.
1540 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
1541 changes.
1542
1543 2008-11-20 Di-an Jan <dianj@freeshell.org>
1544
1545 Improves options in the manual.
1546 * doc/bison.texinfo (-g, -x): Add space before argument.
1547 (Option Cross Key): Implement FIXME: listing directives also.
1548 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1549 (Short Option): Special case -d. Put arguments inside @option.
1550 (Bison Directive): Add column, automatically extracted from
1551 src/scan-gram.l (actual name passed as the first argument)
1552 with special case for %define.
1553 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
1554 to build-aux/cross-options.pl.
1555 * src/getargs.c (usage): Document limitations of cross-options.pl.
1556 * src/scan-gram.l: Likewise.
1557
1558 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1559
1560 Fix unexpanded macros in GLR defines file.
1561 Reported by Csaba Raduly at
1562 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1563 * THANKS (Csaba Raduly): Add.
1564 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1565 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1566 lexer in a separate module that includes the defines file.
1567 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
1568 source.
1569 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1570 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1571 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1572 (AT_DATA_SOURCE_PROLOGUE): New.
1573 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1574 (AT_DATA_SOURCE): New.
1575 (AT_FULL_COMPILE): Extend to support an additional source file.
1576
1577 2008-11-18 Akim Demaille <demaille@gostai.com>
1578
1579 More TODO.
1580 * TODO: More short term issues.
1581
1582 2008-11-18 Akim Demaille <demaille@gostai.com>
1583
1584 Regen.
1585 * src/parse-gram.h, src/parse-gram.c: Regen.
1586
1587 2008-11-18 Akim Demaille <demaille@gostai.com>
1588
1589 Use b4_subtract where possible.
1590 * data/lalr1.cc (b4_subtract): Move to...
1591 * data/bison.m4: here.
1592 * data/glr.c (b4_rhs_data): Use it.
1593 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
1594
1595 2008-11-18 Akim Demaille <demaille@gostai.com>
1596
1597 Remove incorrect mode specification.
1598 * data/glr.cc: Don't pretend it's C code.
1599
1600 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1601
1602 Simplify last patch slightly.
1603 * src/getargs.c (getargs): Here.
1604
1605 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1606
1607 Fix last warning from --enable-gcc-warnings.
1608 * src/getargs.c (getargs): Don't assign const address to non-const
1609 pointer.
1610
1611 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1612
1613 Don't let maintainer-*-check targets force a version update.
1614 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1615 handled.
1616
1617 2008-11-17 Di-an Jan <dianj@freeshell.org>
1618
1619 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1620 Align menus. Adjust word wrapping. Use node names for menu names.
1621 (Examples): Don't abbreviate node names.
1622 (LocalWords): Remove abbreviations.
1623 (Copying): Make description a sentence.
1624 (Java Action Features): Remove period to match the rest of menu.
1625
1626 2008-11-17 Di-an Jan <dianj@freeshell.org>
1627
1628 Handles several --enable-gcc-warnings.
1629 * src/getargs.c (command_line_location): Set parameters to void.
1630 * src/output.c (symbol_type_name_cmp): Make static.
1631 (symbols_by_type_name): Set parameters to void.
1632 (symbol_definitions_output): Remove unused parameter. Rename as...
1633 (prepare_symbol_definitions): this.
1634 (muscles_output): Move symbol_definitions_output to...
1635 (output): here as prepare_symbol_definitions.
1636 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
1637 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
1638
1639 2008-11-17 Di-an Jan <dianj@freeshell.org>
1640
1641 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
1642 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
1643
1644 2008-11-16 Akim Demaille <demaille@gostai.com>
1645
1646 Add missing $(EXEEXT).
1647 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
1648 "src/bison$(EXEEXT)".
1649 Reported by Di-an Jan.
1650
1651 2008-11-15 Akim Demaille <demaille@gostai.com>
1652
1653 * TODO: Update.
1654
1655 2008-11-15 Akim Demaille <demaille@gostai.com>
1656
1657 Formatting changes.
1658 * tests/input.at: here.
1659
1660 2008-11-15 Akim Demaille <demaille@gostai.com>
1661
1662 Remove duplicate header inclusion.
1663 * src/LR0.c: here.
1664
1665 2008-11-15 Akim Demaille <demaille@gostai.com>
1666
1667 * src/parse-gram.h, src/parse-gram.c: Regen.
1668
1669 2008-11-15 Akim Demaille <demaille@gostai.com>
1670
1671 Support parametric types.
1672
1673 There are two issues to handle: first scanning nested angle
1674 bracket pairs to support types such as std::pair< std::string,
1675 std::list<std::string> > >.
1676
1677 Another issue is to address idiosyncracies of C++: do not glue two
1678 closing angle brackets together (otherwise it's operator>>), and
1679 avoid sticking blindly a TYPE to the opening <, as it can result
1680 in '<:' which is a digraph for '['.
1681
1682 * src/scan-gram.l (brace_level): Rename as...
1683 (nesting): this.
1684 (SC_TAG): New.
1685 Implement support for complex tags.
1686 (tag): Accept
1687 , but not <.
1688 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
1689 (b4_symbol_variant): Leave space around types as parameters.
1690 * examples/variant.yy: Use nested template types and leading ::.
1691 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
1692 Rename as...
1693 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
1694 * tests/c++.at: Test parametric types.
1695
1696 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1697
1698 Test token.prefix.
1699 This is not sufficient, but we test at least that the make_SYMBOL
1700 interface is not affected by token.prefix. A more general test
1701 will be implemented when the support of token.prefix is generalized
1702 to more skeletons.
1703
1704 * tests/c++.at: One more variant test, using token.prefix.
1705
1706 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1707
1708 Test the make_TOKEN interface.
1709 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
1710 Factor the common code in yylex.
1711 Use it to test "%define lex_symbol".
1712
1713 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1714
1715 Formatting change.
1716
1717 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1718
1719 Simplify code for variants bench marks.
1720 * etc/bench.pl.in (&generate_grammar_list): Define and use
1721 location_type.
1722 Factor the common code in yylex.
1723
1724 2008-11-15 Akim Demaille <demaille@gostai.com>
1725
1726 Better error message.
1727 * bootstrap (find_tool): Fix the error message.
1728
1729 2008-11-15 Akim Demaille <demaille@gostai.com>
1730
1731 Update variant.yy to newest interface.
1732 * examples/variant.yy: Define lex_symbol.
1733 Adjust.
1734
1735 2008-11-15 Akim Demaille <demaille@gostai.com>
1736
1737 Don't use locations in variant.yy.
1738 * examples/variant.yy: Adjust to not using locations.
1739
1740 2008-11-15 Akim Demaille <demaille@gostai.com>
1741
1742 Comment changes.
1743 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
1744 comments for the license.
1745
1746 2008-11-15 Akim Demaille <demaille@gostai.com>
1747
1748 Remove tests/Makefile.am.
1749 * tests/Makefile.am: Rename as...
1750 * tests/local.mk: this.
1751 * Makefile.am, configure.ac: Adjust.
1752 * Makefile.am (DISTCLEANFILES): Define.
1753 (maintainer-check, maintainer-xml-check, maintainer-push-check):
1754 Remove, we no longer need to bounce to the real targets.
1755
1756 2008-11-15 Akim Demaille <demaille@gostai.com>
1757
1758 Comment changes.
1759
1760 2008-11-15 Akim Demaille <demaille@gostai.com>
1761
1762 djgpp/local.mk.
1763 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
1764 * djgpp/local.mk: this new file.
1765
1766 2008-11-15 Akim Demaille <demaille@gostai.com>
1767
1768 Remove doc/Makefile.am.
1769 * doc/Makefile.am: Rename as...
1770 * doc/local.mk: this.
1771 Adjust paths
1772 * Makefile.am, configure.ac: Adjust.
1773 * Makefile.am (MOSTLYCLEANFILES): New.
1774 * src/local.mk: Adjust.
1775
1776 2008-11-15 Akim Demaille <demaille@gostai.com>
1777
1778 Move sc_tight_scope into maint.mk.
1779 It does not work, and I don't know how it was supposed to work: it
1780 seems to be looking for sources in the build tree. I just moved
1781 it at a better place, fixing it is still required.
1782
1783 * src/local.mk (echo): Remove.
1784 (sc_tight_scope): Move to...
1785 * maint.mk: here.
1786
1787 2008-11-15 Akim Demaille <demaille@gostai.com>
1788
1789 Regen.
1790 * src/parse-gram.h, src/parse-gram.h: Regen.
1791
1792 2008-11-15 Akim Demaille <demaille@gostai.com>
1793
1794 Remove src/Makefile.am.
1795 * src/Makefile.am: Rename as...
1796 * src/local.mk: this.
1797 Prefix all the paths with src/.
1798 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
1799 (AM_CPPFLAGS): Find find in builddir/src.
1800 (YACC): Move the flags into...
1801 (AM_YFLAGS): here.
1802 * maint.mk (sc_tight_scope): Disable.
1803 It used to bounce to the version in src/Makefile.am which is now
1804 part of this very Makefile.
1805 * Makefile.am, configure.ac: Adjust.
1806 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
1807 include "..." to find files "here": we are no longer in src/, so
1808 qualify the includes with src/.
1809 * doc/Makefile.am (PREPATH): No longer include the top_builddir
1810 prefix.
1811 (.x.1): Adjust to be able to create src/foo from the top level
1812 Makefile, instead of going bounce to src/Makefile the creation of
1813 foo.
1814
1815 2008-11-15 Akim Demaille <demaille@gostai.com>
1816
1817 Remove useless variable.
1818 * doc/Makefile.am (srcsrcdir): Remove.
1819
1820 2008-11-15 Akim Demaille <demaille@gostai.com>
1821
1822 Remove data/Makefile.am.
1823 * data/Makefile.am: Rename as...
1824 * data/local.mk: this.
1825 Adjust paths.
1826 * Makefile.am, configure.ac: Adjust.
1827
1828 2008-11-15 Akim Demaille <demaille@gostai.com>
1829
1830 Remove etc/Makefile.am.
1831 * etc/Makefile.am: Rename as...
1832 * etc/local.mk: this.
1833 Adjust.
1834 * Makefile.am, configure.ac: Adjust.
1835
1836 2008-11-15 Akim Demaille <demaille@gostai.com>
1837
1838 Remove examples/local.mk.
1839 examples/calc++/Makefile.am might be interesting to keep as is, since
1840 it is an example in itself.
1841
1842 * examples/Makefile.am: Rename as...
1843 * examples/local.mk: this.
1844 Adjust.
1845 * Makefile.am, configure.ac: Adjust.
1846
1847 2008-11-15 Akim Demaille <demaille@gostai.com>
1848
1849 Remove build-aux/Makefile.am.
1850 Recursive Makefiles are really way too slow, let's get rid of some of
1851 them.
1852
1853 * build-aux/Makefile.am: Rename as...
1854 * build-aux/local.mk: this.
1855 Adjust paths.
1856 * Makefile.am, configure.ac: Adjust.
1857
1858 2008-11-15 Akim Demaille <demaille@gostai.com>
1859
1860 Provide convenience constructors for locations and positions.
1861 * data/location.cc (position::position): Accept file, line and
1862 column as arguments with default values.
1863 Always qualify initial line and column literals as unsigned.
1864 (location::location): Provide convenience constructors.
1865
1866 2008-11-15 Akim Demaille <demaille@gostai.com>
1867
1868 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
1869 token type.
1870 Using template buys us nothing, and makes it uselessly complex to
1871 construct a symbol. Besides, it could not be generalized to other
1872 languages, while make_FOO would work in C/Java etc.
1873
1874 * data/lalr1.cc (b4_symbol_): New.
1875 (b4_symbol): Use it.
1876 (b4_symbol_constructor_declaration_)
1877 (b4_symbol_constructor_definition_): Instead of generating
1878 specializations of an overloaded template function, just generate
1879 several functions whose names are forged from the token names
1880 without the token.prefix.
1881 (b4_symbol_constructor_declarations): Generate them for all the
1882 symbols, not just by class of symbol type, now that instead of
1883 specializing a function template by the token, we generate a
1884 function named after the token.
1885 (b4_symbol_constructor_specialization_)
1886 (b4_symbol_constructor_specializations): Remove.
1887 * etc/bench.pl.in: Adjust to this new API.
1888
1889 2008-11-13 Akim Demaille <demaille@gostai.com>
1890
1891 %define token.prefix.
1892 Provide a means to add a prefix to the name of the tokens as
1893 output in the generated files. Because of name clashes, it is
1894 good to have such a prefix such as TOK_ that protects from names
1895 such as EOF, FILE etc. But it clutters the grammar itself.
1896
1897 * data/bison.m4 (token.prefix): Empty by default.
1898 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
1899 * data/lalr1.cc (b4_symbol): Ditto.
1900
1901 2008-11-13 Akim Demaille <demaille@gostai.com>
1902
1903 Compute at M4 time some of the subtractions.
1904 * data/lalr1.cc (b4_subtract): New.
1905 (b4_rhs_data): Use it.
1906
1907 2008-11-13 Akim Demaille <demaille@gostai.com>
1908
1909 symbol::token.
1910 This allows the user to get the type of a token returned by yylex.
1911
1912 * data/lalr1.cc (symbol::token): New.
1913 (yytoknum_): Define when %define lex_symbol, independently of
1914 %debug.
1915 (yytoken_number_): Move into...
1916 (symbol::token): here, since that's the only use.
1917 The other one is YYPRINT which was not officially supported
1918 by lalr1.cc, and anyway it did not work since YYPRINT uses this
1919 array under a different name (yytoknum).
1920
1921 2008-11-13 Akim Demaille <demaille@gostai.com>
1922
1923 YYERRCODE.
1924 * TODO (YYERRCODE): Mention the case of $undef.
1925
1926 2008-11-13 Akim Demaille <demaille@gostai.com>
1927
1928 TODO: YYPRINT.
1929 * TODO (YYPRINT): New.
1930
1931 2008-11-13 Akim Demaille <demaille@gostai.com>
1932
1933 Comment changes.
1934 * data/lalr1.cc, data/yacc.c: Fix the description of the
1935 yytranslate and yytoknum tables.
1936
1937 2008-11-13 Akim Demaille <demaille@gostai.com>
1938
1939 Define make_symbol in the header.
1940 To reach good performances these functions should be inlined (yet
1941 this is to measure precisely). To this end they must be available
1942 to the caller.
1943
1944 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
1945 location_type with the class name.
1946 Since will now be output in the header, declare "inline".
1947 No longer use b4_symbol_constructor_specializations, but
1948 b4_symbol_constructor_definitions in the header.
1949 Don't call it in the *.cc file.
1950
1951 2008-11-13 Akim Demaille <demaille@gostai.com>
1952
1953 Define yytranslate in the header for lex_symbol.
1954 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
1955 into the header file when using %define lex_symbol.
1956 (yytranslate_): Declare inline.
1957
1958 2008-11-13 Akim Demaille <demaille@gostai.com>
1959
1960 Define the constructors of symbol_type in
1961 b4_symbol_constructor_definitions.
1962 The constructors are called by the make_symbol functions, which a
1963 forthcoming patch will move elsewhere. Hence the interest of
1964 putting them together.
1965
1966 The stack_symbol_type does not need to be moved, it is used only
1967 by the parser.
1968
1969 * data/lalr1.cc: Move symbol_type and symbol_base_type
1970 constructors into...
1971 (b4_symbol_constructor_definitions): here.
1972 Adjust.
1973
1974 2008-11-13 Akim Demaille <demaille@gostai.com>
1975
1976 Make it easier to move the definition of yytranslate_.
1977 Forthcoming changes will make it possible to use yytranslate_
1978 from outside the parser implementation file.
1979
1980 * data/lalr1.cc (b4_yytranslate_definition): New.
1981 Use it.
1982
1983 2008-11-13 Akim Demaille <demaille@gostai.com>
1984
1985 Remove useless class specification.
1986 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
1987 to refer to the class name to use a type defined by the class for
1988 arguments of member functions.
1989
1990 2008-11-13 Akim Demaille <demaille@gostai.com>
1991
1992 Finer input type for yytranslate.
1993 This patch is debatable: the tradition expects yylex to return an int
1994 which happens to correspond to token_number (which is an enum). This
1995 allows for instance to return characters (such as '*' etc.). But this
1996 goes against the stronger typing I am trying to have with the new
1997 lex interface which return a symbol_type. So in this case, feed
1998 yytranslate_ with a token_type.
1999
2000 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
2001 expect a token_type.
2002
2003 2008-11-13 Akim Demaille <demaille@gostai.com>
2004
2005 Honor lex-params in %define lex_symbol mode.
2006 * data/lalr1.cc: Use b4_lex_param.
2007
2008 2008-11-13 Akim Demaille <demaille@gostai.com>
2009
2010 Simplify names.
2011 * src/output.c (symbol_definitions_output): Rename symbol
2012 attributes type_name and has_type_name as type and has_type.
2013 * data/lalr1.cc: Adjust uses.
2014
2015 2008-11-13 Akim Demaille <demaille@gostai.com>
2016
2017 Use b4_type_names for the union type.
2018 The union used to compute the size of the variant used to iterate
2019 over the type of all the symbols, with a lot of redundancy. Now
2020 iterate over the lists of symbols having the same type-name.
2021
2022 * data/lalr1.cc (b4_char_sizeof_): New.
2023 (b4_char_sizeof): Use it.
2024 Adjust to be called with a list of numbers instead of a single
2025 number.
2026 Adjust its caller for new-line issues.
2027
2028 2008-11-13 Akim Demaille <demaille@gostai.com>
2029
2030 Define the "identifier" of a symbol.
2031 Symbols may have several string representations, for instance if
2032 they have an alias. What I call its "id" is a string that can be
2033 used as an identifier. May not exist.
2034
2035 Currently the symbols which have the "tag_is_id" flag set are
2036 those that don't have an alias. Look harder for the id.
2037
2038 * src/output.c (is_identifier): Move to...
2039 * src/symtab.c (is_identifier): here.
2040 * src/symtab.h, src/symtab.c (symbol_id_get): New.
2041 * src/output.c (symbol_definitions_output): Use it to define "id"
2042 and "has_id".
2043 Remove the definition of "tag_is_id".
2044 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
2045 "tag_is_id" were used to produce code.
2046 We still use "tag" for documentation.
2047
2048 2008-11-11 Akim Demaille <demaille@gostai.com>
2049
2050 Locations are no longer required by lalr1.cc.
2051 * data/lalr1.cc (_b4_args, b4_args): New.
2052 Adjust all uses of locations to make them optional.
2053 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
2054 (AT_CHECK_NAMESPACE): Check the use of locations.
2055 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
2056 without locations with lalr1.cc.
2057 Test these cases.
2058 * tests/output.at: Check lalr1.cc with and without location
2059 support.
2060 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
2061 Don't use locations.
2062
2063 2008-11-11 Akim Demaille <demaille@gostai.com>
2064
2065 AT_FULL_COMPILE.
2066 * tests/local.at (AT_FULL_COMPILE): New.
2067 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
2068
2069 2008-11-11 Akim Demaille <demaille@gostai.com>
2070
2071 Support parens in calc++.
2072 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
2073 * examples/calc++/test (run): Check the expected output.
2074 Adjust callers.
2075 Check parens too.
2076
2077 2008-11-11 Akim Demaille <demaille@gostai.com>
2078
2079 Simplify lalr1.cc since %defines is mandatory.
2080 * data/lalr1.cc: Remove useless calls to b4_defines_if.
2081
2082 2008-11-11 Akim Demaille <demaille@gostai.com>
2083
2084 TODO: yyfmt.
2085 * TODO (yysyntax_error): New item.
2086
2087 2008-11-11 Akim Demaille <demaille@gostai.com>
2088
2089 Prefer M4 to CPP.
2090 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
2091 YYERROR_VERBOSE.
2092
2093 2008-11-11 Akim Demaille <demaille@gostai.com>
2094
2095 Support i18n of the parse error messages.
2096 * TODO (lalr1.cc/I18n): Remove.
2097 * data/lalr1.cc (yysyntax_error_): Support the translation of the
2098 error messages, as done in yacc.c.
2099 Stay within the yy* pseudo namespace.
2100
2101 2008-11-11 Akim Demaille <demaille@gostai.com>
2102
2103 More TODO.
2104 * TODO (single stack, yysyntax_error): New.
2105
2106 2008-11-11 Akim Demaille <demaille@gostai.com>
2107
2108 Make it possible to return a symbol_type from yylex.
2109 * data/lalr1.cc (b4_lex_symbol_if): New.
2110 (parse): When lex_symbol is defined, expected yylex to return the
2111 complete lookahead.
2112 * etc/bench.pl.in (generate_grammar_list): Extend to support this
2113 yylex interface.
2114 (bench_variant_parser): Exercise it.
2115
2116 2008-11-11 Akim Demaille <demaille@gostai.com>
2117
2118 Remove useless bench case.
2119 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
2120 no longer used.
2121
2122 2008-11-11 Akim Demaille <demaille@gostai.com>
2123
2124 Improve display of directives.
2125 * etc/bench.pl.in (parse_term): Don't add useless eol.
2126
2127 2008-11-11 Akim Demaille <demaille@gostai.com>
2128
2129 Use string_cast in the bench.
2130 * etc/bench.pl.in (generate_grammar_list): Define and use
2131 string_cast.
2132
2133 2008-11-11 Akim Demaille <demaille@gostai.com>
2134
2135 Replace yychar with a Boolean.
2136 * data/lalr1.cc (parse::yychar): Replace by...
2137 (parse::yyempty): this.
2138
2139 2008-11-11 Akim Demaille <demaille@gostai.com>
2140
2141 Factor the tables.
2142 * TODO: New item.
2143
2144 2008-11-11 Akim Demaille <demaille@gostai.com>
2145
2146 Let yytranslate handle the eof case.
2147 * data/lalr1.cc (yytranslate_): Handle the EOF case.
2148 Adjust callers.
2149 No longer expect yychar to be equal to yyeof_, rather, test the
2150 lookahead's (translated) kind.
2151
2152 2008-11-11 Akim Demaille <demaille@gostai.com>
2153
2154 yychar cannot be empty in yyerrlab.
2155 * TODO (yychar == yyempty_): New.
2156 * data/lalr1.cc: Remove the handling of this case.
2157 This eases forthcoming changes related to yychar and yytranslate.
2158
2159 2008-11-11 Akim Demaille <demaille@gostai.com>
2160
2161 Bench: syntactic sugar for %define/#define.
2162 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
2163 (&bench_push_parser, bench_variant_parser): Use this feature.
2164 (&eat): New.
2165 Use it.
2166
2167 2008-11-11 Akim Demaille <demaille@gostai.com>
2168
2169 Less memory pressure on the "list" bench.
2170 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
2171 the values, to limit memory pressure.
2172
2173 2008-11-11 Akim Demaille <demaille@gostai.com>
2174
2175 Introduce make_symbol.
2176 make_symbol provides a means to construct a full symbol (kind,
2177 value, location) in a single shot. It is meant to be a Symbol
2178 constructor, parameterized by the symbol kind so that overloading
2179 would prevent incorrect kind/value pairs. Unfortunately
2180 parameterized constructors do not work well in C++ (unless the
2181 parameter also appears as an argument, which is not acceptable),
2182 hence the use of a function instead of a constructor.
2183
2184 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2185 (b4_symbol_constructor_declarations)
2186 (b4_symbol_constructor_specialization_)
2187 (b4_symbol_constructor_specializations)
2188 (b4_symbol_constructor_definition_)
2189 (b4_symbol_constructor_definitions): New.
2190 Use them where appropriate to generate declaration, declaration of
2191 the specializations, and implementations of the templated
2192 overloaded function "make_symbol".
2193 (variant::variant): Always define a default ctor.
2194 Also provide a copy ctor.
2195 (symbol_base_type, symbol_type): New ctor overloads for value-less
2196 symbols.
2197 (symbol_type): Now public, so that functions such as yylex can use
2198 it.
2199
2200 2008-11-11 Akim Demaille <demaille@gostai.com>
2201
2202 Inform m4 whether a tag is a valid id.
2203 * src/output.c (is_identifier): New.
2204 (symbol_definitions_output): Use it to define tag_is_id.
2205 But maybe this should be done at m4 level?
2206
2207 2008-11-11 Akim Demaille <demaille@gostai.com>
2208
2209 Test 214 was failing: it greps with a pattern containing [ ]*
2210 which obviously meant to catch spaces and tabs, but contained only
2211 spaces. Tabulations in sources are a nuisance, so to simplify the
2212 matter, get rid of all the tabulations in the Java sources. The
2213 other skeletons will be treated equally later.
2214
2215 * data/java.m4, data/lalr1.java: Untabify.
2216 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
2217 tabulations are no longer generated.
2218
2219 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
2220
2221 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2222 * configure.ac: Adjust usage.
2223 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2224 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2225 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2226
2227 2008-11-10 Di-an Jan <dianj@freeshell.org>
2228
2229 Workaround Java's ``code too large'' problem for parser tables
2230 in most cases, by using one function per initialization.
2231 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
2232 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
2233 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
2234 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
2235 (yytname_): Use b4_typed_parser_table.
2236 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
2237 ``code too large'' error.
2238
2239 2008-11-10 Di-an Jan <dianj@freeshell.org>
2240
2241 * NEWS: Document them.
2242
2243 General Java skeleton improvements.
2244 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
2245 using gcj < 4.3 in the testsuite, according to comments in
2246 gnulib/m4/javacomp.m4.
2247 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
2248 location_type, position_type): Remove extraneous brackets from
2249 b4_percent_define_default.
2250 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
2251 m4_define and m4_define_default.
2252 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
2253 which marks the end of user code with appropriate syncline, like all
2254 the other skeletons.
2255 (b4_user_post_prologue): Add. Don't silently drop.
2256 (yylex): Remove.
2257 (parse): Inline yylex.
2258 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
2259 (%{...%}): Fix typo of %code imports.
2260 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
2261
2262 Support annotations on parser class with %define annotations.
2263 * data/lalr1.java (annotations): Add to parser class modifier.
2264 * doc/bison.texinfo (Java Parser Interface): Document
2265 %define annotations.
2266 (Java Declarations Summary): Document %define annotations.
2267 * tests/java.at (Java parser class modifiers): Test annotations.
2268
2269 Do not generate code for %error-verbose unless requested.
2270 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
2271 Make private. Make conditional on %error-verbose.
2272 (getErrorVerbose, setErrorVerbose): New.
2273 (yytnamerr_): Make conditional on %error-verbose.
2274 (yysyntax_error): Make some code conditional on %error-verbose.
2275 * doc/bison.texinfo (Java Bison Interface): Remove the parts
2276 about %error-verbose having no effect.
2277 (getErrorVerbose, setErrorVerbose): Document.
2278
2279 Move constants for token names to Lexer interface.
2280 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
2281 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
2282 (parse): Qualify EOF to Lexer.EOF.
2283 * doc/bison.texinfo (Java Parser Interface): Move documentation of
2284 EOF and token names to Java Lexer Interface.
2285 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
2286
2287 Make yyerror public.
2288 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
2289 (yyerror): Change to public. Add Javadoc comments. Use longer
2290 parameter names. Make the body rather than the declarator
2291 conditional on %locations.
2292 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
2293
2294 Allow user to add code to the constructor with %code init.
2295 * data/java.m4 (b4_init_throws): New, for %define init_throws.
2296 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
2297 Add %code init to the front of the constructor body.
2298 * doc/bison.texinfo (YYParser.YYParser): Document %code init
2299 and %define init_throws.
2300 (Java Declarations Summary): Document %code init and
2301 %define init_throws.
2302 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
2303 (Java constructor init and init_throws): Add tests.
2304
2305 2008-11-10 Akim Demaille <demaille@gostai.com>
2306
2307 Update TODO.
2308 * TODO (-D): is implemented.
2309 (associativity): Same precedence must have the same associativity.
2310 For instance, how can a * b / c be parsed if * is %left and / is
2311 %right?
2312 (YYERRORCODE, YYFAIL, YYBACKUP): New.
2313
2314 2008-11-10 Akim Demaille <demaille@gostai.com>
2315
2316 Formatting changes.
2317
2318 2008-11-10 Akim Demaille <demaille@gostai.com>
2319
2320 More information about the symbols.
2321 * src/output.c (type_names_output): Document all the symbols,
2322 including those that don't have a type-name.
2323 (symbol_definitions_output): Define "is_token" and
2324 "has_type_name".
2325 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
2326 type-name, now that they are defined too in b4_type_names.
2327
2328 2008-11-10 Akim Demaille <demaille@gostai.com>
2329
2330 Regen.
2331
2332 2008-11-10 Akim Demaille <demaille@gostai.com>
2333
2334 Make parser::yytranslate static.
2335 Small speedup (1%) on the list grammar. And makes yytranslate_
2336 available in non member functions.
2337
2338 * data/lalr1.cc (yytranslate_): Does not need to be a instance
2339 function.
2340
2341 2008-11-10 Akim Demaille <demaille@gostai.com>
2342
2343 Avoid trailing spaces.
2344 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
2345 * data/lalr1.cc: Don't indent before rule and symbol actions, as
2346 they can be empty, and anyway this incorrectly indents the first
2347 action.
2348
2349 2008-11-10 Akim Demaille <demaille@gostai.com>
2350
2351 Comment changes.
2352
2353 2008-11-10 Akim Demaille <demaille@gostai.com>
2354
2355 Use "enum" for integral constants.
2356 This is just nicer to read, I observed no speedup.
2357
2358 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
2359 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
2360 (yyuser_token_number_max_, yyundef_token_): Move into...
2361 (yytranslate_): here.
2362
2363 2008-11-10 Akim Demaille <demaille@gostai.com>
2364
2365 Shortcuts in bench directives.
2366 * etc/bench.pl.in (parse_dirs): New.
2367 Use it.
2368 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
2369 Create the benches in "benches/".
2370
2371 2008-11-10 Akim Demaille <demaille@gostai.com>
2372
2373 Formatting changes.
2374 * data/lalr1.cc: here.
2375
2376 2008-11-10 Akim Demaille <demaille@gostai.com>
2377
2378 Adjust verbose message to using emacs.
2379 * etc/bench.pl.in: Inform compilation-mode when we change the
2380 directory.
2381 (generate_grammar_list): Recognize %define "variant" in addition
2382 to %define variant.
2383
2384 2008-11-10 Akim Demaille <demaille@gostai.com>
2385
2386 Classify symbols by type-name.
2387 * src/uniqstr.h (UNIQSTR_CMP): New.
2388 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
2389 (type_names_output): New.
2390 (muscles_output): Use it.
2391 * data/lalr1.cc (b4_symbol_action_): Remove.
2392 (b4_symbol_case_, b4_type_action_): New.
2393 Adjust uses of b4_symbol_action_ to use b4_type_action_.
2394
2395 2008-11-10 Akim Demaille <demaille@gostai.com>
2396
2397 Change the handling of the symbols in the skeletons.
2398 Before we were using tables which lines were the symbols and which
2399 columns were things like number, tag, type-name etc. It is was
2400 difficult to extend: each time a column was added, all the numbers had
2401 to be updated (you asked for colon $2, not for "tag"). Also, it was
2402 hard to filter these tables when only a subset of the symbols (say the
2403 tokens, or the nterms, or the tokens that have and external number
2404 *and* a type-name) was of interest.
2405
2406 Now instead of monolithic tables, we define one macro per cell. For
2407 instance "b4_symbol(0, tag)" is a macro name which contents is
2408 self-decriptive. The macro "b4_symbol" provides easier access to
2409 these cells.
2410
2411 * src/output.c (type_names_output): Remove.
2412 (symbol_numbers_output, symbol_definitions_output): New.
2413 (muscles_output): Call them.
2414 (prepare_symbols): Define b4_symbols_number.
2415
2416 2008-11-10 Akim Demaille <demaille@gostai.com>
2417
2418 --trace=muscles
2419 * src/getargs.h, src/getargs.c (trace_muscle): New.
2420 (trace_types, trace_args): Support it.
2421 * src/output.c (output_skeleton): Use it.
2422
2423 2008-11-10 Akim Demaille <demaille@gostai.com>
2424
2425 muscles_output.
2426 * src/output.c (muscles_output): New, extracted from...
2427 (output_skeleton): here.
2428 Adjust.
2429
2430 2008-11-10 Akim Demaille <demaille@gostai.com>
2431
2432 Formatting changes.
2433
2434 2008-11-10 Akim Demaille <demaille@gostai.com>
2435
2436 Update the variant example.
2437 * examples/variant.yy: Formatting changes.
2438 One stage build.
2439
2440 2008-11-10 Akim Demaille <demaille@gostai.com>
2441
2442 Support constructor with an argument.
2443 This improves the "list" bench by 2%.
2444
2445 * data/lalr1.cc (variant::build): Add an overloaded version with
2446 an argument.
2447 * tests/c++.at (AT_CHECK_VARIANT): Check it.
2448
2449 2008-11-10 Akim Demaille <demaille@gostai.com>
2450
2451 Test variants.
2452 * tests/c++.at (AT_CHECK_VARIANTS): New.
2453 Use it with and without %define assert.
2454
2455 2008-11-10 Akim Demaille <demaille@gostai.com>
2456
2457 Add %precedence support.
2458 Unfortunately it is not possible to reuse the %prec directive. This
2459 is because to please POSIX, we do not require to end the rules with a
2460 semicolon. As a result,
2461
2462 foo: bar %prec baz
2463
2464 is ambiguous: either a rule which precedence is that of baz, or a rule,
2465 and then a declaration of the precedence of the token baz.
2466
2467 * doc/bison.texinfo: Document %precedence.
2468 (Precedence Only): New.
2469 * src/assoc.h, src/assoc.c (precedence_assoc): New.
2470 * src/conflicts.c (resolve_sr_conflict): Support it.
2471 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
2472 Parse it.
2473 * tests/calc.at: Use %precedence for NEG.
2474 * tests/conflicts.at (%precedence does not suffice)
2475 (%precedence suffices): New tests.
2476
2477 2008-11-09 Akim Demaille <demaille@gostai.com>
2478
2479 Make benches in a sub dirs.
2480 * etc/bench.pl.in ($dir): New.
2481 Use it.
2482 Check the use of constructors with an argument.
2483 (bench_variant_parser): Fix.
2484
2485 2008-11-09 Akim Demaille <demaille@gostai.com>
2486
2487 fix eof condition
2488
2489 2008-11-09 Akim Demaille <demaille@gostai.com>
2490
2491 Fix --help.
2492
2493 2008-11-09 Akim Demaille <demaille@gostai.com>
2494
2495 Require the generation of parse-gram.output.
2496 * src/Makefile.am (YACC): Pass --report=all.
2497
2498 2008-11-09 Akim Demaille <demaille@gostai.com>
2499
2500 Formatting changes.
2501
2502 2008-11-09 Akim Demaille <demaille@gostai.com>
2503
2504 Update TODO.
2505 * TODO: Remove obsolete items.
2506 Update others.
2507
2508 2008-11-09 Akim Demaille <demaille@gostai.com>
2509
2510 Enhance bench.pl.
2511 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
2512 (@token, $grammar, $bench): New.
2513 (generate_grammar_variant): Rename as...
2514 (generate_grammar_list): this.
2515 (generate_grammar): Adjust.
2516 (bench_grammar): Rename as...
2517 (bench): this.
2518 Use it in the various bench-marking routines.
2519 (-b, -g): New options.
2520
2521 2008-11-09 Akim Demaille <demaille@gostai.com>
2522
2523 Use a static hierarchy for symbols in the C++ parser.
2524 * data/lalr1.cc (symbol_base_type, symbol_type)
2525 (stack_symbol_type): Make it a static hierarchy.
2526 Adjust dependencies.
2527
2528 2008-11-09 Akim Demaille <demaille@gostai.com>
2529
2530 bench.pl -d, --directive.
2531 * etc/bench.pl.in (@directive): New.
2532 (&bench_grammar): Use it.
2533 (&bench_list_grammar): New, to provide access to the "variant"
2534 grammar.
2535 Use it.
2536 (getopts): Support -d, --directive.
2537
2538 2008-11-09 Akim Demaille <demaille@gostai.com>
2539
2540 Use inline for small operations.
2541 * data/lalr1.cc (symbol_base_type, symbol_type)
2542 (stack_symbol_type): Declare constructor and other operations as
2543 inline.
2544 (yy_destroy_): Inline.
2545
2546 2008-11-09 Akim Demaille <demaille@gostai.com>
2547
2548 Introduce a hierarchy for symbols.
2549 * data/lalr1.cc (symbol_base_type, symbol_type): New.
2550 (data_type): Rename as...
2551 (stack_symbol_type): this.
2552 Derive from symbol_base_type.
2553 (yy_symbol_value_print_): Merge into...
2554 (yy_symbol_print_): this.
2555 Rename as...
2556 (yy_print_): this.
2557 (yydestruct_): Rename as...
2558 (yy_destroy_): this.
2559 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
2560 (parser::parse): yyla is now of symbol_type.
2561 Use its type member instead of yytoken.
2562
2563 2008-11-09 Akim Demaille <demaille@gostai.com>
2564
2565 Rename data_type and stack_symbol_type.
2566 * data/lalr1.cc (data_type): Rename as...
2567 (stack_symbol_type): this.
2568
2569 2008-11-09 Akim Demaille <demaille@gostai.com>
2570
2571 Handle semantic value and location together.
2572 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
2573 yydata.value and yydata.location.
2574 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
2575 (YY_SYMBOL_PRINT): Now take semantic value and location as a
2576 single arg.
2577 Adjust all callers.
2578 (yydestruct_): New overload for a stack symbol.
2579
2580 2008-11-09 Akim Demaille <demaille@gostai.com>
2581
2582 Push a complete symbol, not connected parts.
2583 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
2584 state, value and location.
2585 Adjust callers.
2586
2587 2008-11-09 Akim Demaille <demaille@gostai.com>
2588
2589 Agregate yylval and yylloc.
2590 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
2591 (parser::yyla): this.
2592
2593 2008-11-09 Akim Demaille <demaille@gostai.com>
2594
2595 Rely on the state stack to display reduction traces.
2596 To display rhs symbols before a reduction, we used information
2597 about the rule reduced, which required the tables yyrhs and
2598 yyprhs. Now use rely only on the state stack to get the same
2599 information.
2600
2601 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
2602 Use them.
2603 (parser::yyrhs_, parser::yyprhs_): Remove.
2604 (parser::yy_reduce_print_): Use the state stack.
2605
2606 2008-11-09 Akim Demaille <demaille@gostai.com>
2607
2608 Fuse yyval and yyloc into yylhs.
2609 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
2610 yylhs.
2611 (parse): Replace yyval and yyloc with yylhs.value and
2612 yylhs.location.
2613 After a user action, compute yylhs.state earlier.
2614 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
2615 fresh error_token.
2616
2617 2008-11-09 Di-an Jan <dianj@freeshell.org>
2618
2619 Remove unused variable.
2620 * src/output.c (type_names_output): Remove unused variable sep.
2621
2622 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
2623
2624 Change tests/output.at quoting.
2625 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
2626 expanding arguments.
2627
2628 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2629
2630 Don't add a semicolon to actions for %skeleton or %language.
2631 It breaks Java test cases as reported by Akim Demaille.
2632 * src/scan-code.l: Implement.
2633
2634 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2635
2636 Clean up %skeleton and %language priority implementation.
2637 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
2638 remove static qualifier because others will soon need to see it.
2639 (language_prio): Likewise.
2640 (getargs): Use command_line_prio rather than 0.
2641 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
2642 enum fields.
2643 (skeleton_prio): Extern it.
2644 (language_prio): Extern it.
2645 * src/parse-gram.y: Use grammar_prio rather than 1.
2646
2647 2008-11-07 Akim Demaille <demaille@gostai.com>
2648
2649 Moving push traces into yypush_.
2650 * data/lalr1.cc (yypush_): Now takes a optional trace message.
2651 Adjust all uses.
2652
2653 2008-11-07 Akim Demaille <demaille@gostai.com>
2654
2655 The single-stack C++ parser is now the standard one.
2656 * data/lalr1.cc: Rename as...
2657 * data/lalr1-split.cc: this.
2658 * data/lalr1-fusion.cc: Rename as...
2659 * data/lalr1.cc: this.
2660 * etc/bench.pl.in: Adjust.
2661
2662 2008-11-07 Akim Demaille <demaille@gostai.com>
2663
2664 Avoid empty-if warnings.
2665 Reported by Quentin Hocquet.
2666
2667 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
2668 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
2669
2670 2008-11-07 Akim Demaille <demaille@gostai.com>
2671
2672 Pass command line location to skeleton_arg and language_argmatch.
2673 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2674 The location argument is now mandatory.
2675 Adjust all dependencies.
2676 (getargs): Use command_line_location.
2677
2678 2008-11-07 Akim Demaille <demaille@gostai.com>
2679
2680 -D, --define.
2681 * src/getargs.c (usage): Document -D.
2682 Fix help string for --locations.
2683 (command_line_location): New.
2684 (short_options, long_options, getargs): Support -D, --define.
2685 (getargs): Move -d support at the right place.
2686 * doc/bison.texinfo (Bison Options): Update.
2687 * tests/input.at (%define, --define): New.
2688
2689 2008-11-07 Akim Demaille <demaille@gostai.com>
2690
2691 Initialize the muscle table before parsing the command line.
2692 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2693 (getargs): Define file_name.
2694 * src/main.c (main): Initialize muscle_tab before calling
2695 getargs.
2696 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2697 its value is not available yet.
2698
2699 2008-11-07 Akim Demaille <demaille@gostai.com>
2700
2701 Locations without columns for command line arguments.
2702 * src/location.c (location_print): Don't display negative columns.
2703 * src/location.h: Document this.
2704
2705 2008-11-07 Akim Demaille <demaille@gostai.com>
2706
2707 Fix --help.
2708 * src/getargs.c (usage): Fix help string for -W.
2709
2710 2008-11-07 Akim Demaille <demaille@gostai.com>
2711
2712 Handle more general types of option arguments.
2713 * build-aux/cross-options.pl: The argument ends at the first
2714 space, not the first non-symbol character.
2715 Use @var for each word appearing the argument description.
2716
2717 2008-11-07 Akim Demaille <demaille@gostai.com>
2718
2719 Destroy the variants that remain on the stack in case of error.
2720 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
2721 destructor.
2722 Display the value only if yymsg is nonnull.
2723 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
2724
2725 2008-11-07 Akim Demaille <demaille@gostai.com>
2726
2727 Add "%define assert" to variants.
2728 This is used to help the user catch cases where some value gets
2729 ovewritten by a new one. This should not happen, as this will
2730 probably leak.
2731
2732 Unfortunately this uncovered a bug in the C++ parser itself: the
2733 lookahead value was not destroyed between two calls to yylex. For
2734 instance if the previous lookahead was a std::string, and then an int,
2735 then the value of the std::string was correctly taken (i.e., the
2736 lookahead was now an empty string), but std::string structure itself
2737 was not reclaimed.
2738
2739 This is now done in variant::build(other&) (which is used to take the
2740 value of the lookahead): other is not only stolen from its value, it
2741 is also destroyed. This incurs a new performance penalty of a few
2742 percent, and union becomes faster again.
2743
2744 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
2745 (b4_variant_if): New.
2746 (variant::built): New.
2747 Use it whereever the status of the variant changes.
2748 * etc/bench.pl.in: Check the penalty of %define assert.
2749
2750 2008-11-07 Akim Demaille <demaille@gostai.com>
2751
2752 Use "%define variant" in bench.pl.
2753 * etc/bench.pl.in: No longer use the pseudo directive %variants,
2754 just use %define variants.
2755
2756 2008-11-07 Akim Demaille <demaille@gostai.com>
2757
2758 Regen.
2759 * src/parse-gram.h, src/parse-gram.c: Regen.
2760
2761 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2762
2763 Fix user actions without a trailing semicolon.
2764 Reported by Sergei Steshenko at
2765 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2766 * THANKS (Sergei Steshenko): Add.
2767 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2768 * tests/regression.at (Fix user actions without a trailing semicolon):
2769 New test case.
2770
2771 2008-11-04 Akim Demaille <demaille@gostai.com>
2772
2773 Use b4_copyright_years.
2774 * data/yacc.c (b4_copyright_years): New.
2775 Fix its value according to the comments in the file.
2776 Use it and undefine it.
2777
2778 2008-11-04 Akim Demaille <demaille@gostai.com>
2779
2780 Formatting changes.
2781 * data/lalr1-fusion.cc, src/parse-gram.y: here.
2782
2783 2008-11-04 Akim Demaille <demaille@gostai.com>
2784
2785 Formatting changes.
2786 * data/lalr1-fusion.cc: here.
2787
2788 2008-11-04 Akim Demaille <demaille@gostai.com>
2789
2790 Use strict on bench.pl.
2791 * etc/bench.pl.in (&run, &generate_grammar): New.
2792 Rename the grammar generating functions for consistency.
2793 Change the interface so that the list of benches to run is passed
2794 as (optionless) arguments.
2795 (&compile): Use &run.
2796
2797 2008-11-04 Akim Demaille <demaille@gostai.com>
2798
2799 Remove spurious initial empty lines.
2800 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
2801 * data/yacc.c: End the @output lines with an @.
2802
2803 2008-11-04 Akim Demaille <demaille@gostai.com>
2804
2805 Improve the display of sizes.
2806 * etc/bench.p.in: Higher precision.
2807 Sort by decreasing size.
2808
2809 2008-11-04 Akim Demaille <demaille@gostai.com>
2810
2811 Don't memcpy C++ structures.
2812 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
2813 arguments.
2814 (variant::build): New overload for
2815 copy-construction-that-destroys.
2816 (variant::swap): New.
2817 (parser::yypush_): Use it in variant mode.
2818
2819 2008-11-04 Akim Demaille <demaille@gostai.com>
2820
2821 Better defaults for bench.pl.
2822 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
2823 default values.
2824 Adjust &verbose uses.
2825 (-q, --quiet): New.
2826
2827 2008-11-04 Akim Demaille <demaille@gostai.com>
2828
2829 Make variant.yy more complex.
2830 std::list cannot be copied via memcpy, they are more demanding than
2831 std::string. Use one std::list to strengthen the test.
2832
2833 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
2834 Adjust.
2835 Create a list of strings, instead of a single large string.
2836
2837 2008-11-04 Akim Demaille <demaille@gostai.com>
2838
2839 bench.pl --bench.
2840 * etc/bench.pl.in (--bench, $bench): New.
2841
2842 2008-11-04 Akim Demaille <demaille@gostai.com>
2843
2844 Sort methods.
2845 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
2846 Define it after as().
2847
2848 2008-11-04 Akim Demaille <demaille@gostai.com>
2849
2850 Useless parens.
2851 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
2852
2853 2008-11-04 Akim Demaille <demaille@gostai.com>
2854
2855 Issue missing synclines after user actions.
2856 * data/c.m4 (b4_case): Issue synclines on the output file.
2857
2858 2008-11-04 Akim Demaille <demaille@gostai.com>
2859
2860 Remove trailing empty line.
2861 * data/lalr1-fusion.cc: Don't add an empty line after the user's
2862 epilogue.
2863
2864 2008-11-04 Akim Demaille <demaille@gostai.com>
2865
2866 Fix output of copyright years.
2867 * data/bison.m4 (b4_copyright): Fix the indentation of the
2868 copyright year paragraph.
2869 Use b4_copyright_years when no years are given.
2870 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
2871 (b4_copyright_years): New.
2872 Use it.
2873
2874 2008-11-04 Akim Demaille <demaille@gostai.com>
2875
2876 Avoid the spurious initial empty line.
2877 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
2878 the end of @output request to suppress the empty line that
2879 results.
2880
2881 2008-11-04 Akim Demaille <demaille@gostai.com>
2882
2883 Remove parser::rhs_number_type.
2884 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
2885 (yyrhs_): Use b4_table_define.
2886
2887 2008-11-04 Akim Demaille <demaille@gostai.com>
2888
2889 Fix iteration type.
2890 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
2891
2892 2008-11-04 Akim Demaille <demaille@gostai.com>
2893
2894 Factor the declaration of the integer tables.
2895 * data/lalr1-fusion.cc (b4_table_define): New.
2896 Use it.
2897
2898 2008-11-03 Akim Demaille <demaille@gostai.com>
2899
2900 Fix indentation of tables in lalr1.cc
2901 * data/lalr1-fusion.cc: Fix the indentation.
2902
2903 2008-11-03 Akim Demaille <demaille@gostai.com>
2904
2905 Destroy the lhs symbols after reduction.
2906 * data/lalr1-fusion.cc (parse): After the user action, when in
2907 variant mode, destroy the lhs symbols.
2908
2909 2008-11-03 Akim Demaille <demaille@gostai.com>
2910
2911 Simplify yysyntax_error_ use.
2912 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
2913 type, but make it unnamed in the declaration when it is not used.
2914
2915 2008-11-03 Akim Demaille <demaille@gostai.com>
2916
2917 Let yy::variant::build return an lvalue.
2918 * data/lalr1-fusion.cc (variant::build): Return a reference to the
2919 object.
2920
2921 2008-11-03 Akim Demaille <demaille@gostai.com>
2922
2923 Define yy::variant only when needed.
2924 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
2925 used.
2926
2927 2008-11-03 Akim Demaille <demaille@gostai.com>
2928
2929 Bench the three-stack lalr1.cc.
2930 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
2931 one-stack one.
2932
2933 2008-11-03 Akim Demaille <demaille@gostai.com>
2934
2935 Fail on parse error in calc++.
2936 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
2937 status.
2938 * examples/calc++/test ($me, $number, $exit, run): New.
2939 Use them to propagate errors to the exit status.
2940
2941 2008-11-03 Akim Demaille <demaille@gostai.com>
2942
2943 Don't specify the skeleton twice in the example.
2944 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
2945 file does what is needed.
2946
2947 2008-11-03 Akim Demaille <demaille@gostai.com>
2948
2949 bench: Improve output.
2950 * etc/bench.pl.in (bench_grammar): Tune the printf format.
2951
2952 2008-11-03 Akim Demaille <demaille@gostai.com>
2953
2954 bench: check impact of %debug on variants.
2955 * etc/bench.pl.in (variant_grammar): Fix the computation of
2956 $variant.
2957 Generate a grammar file that can work with or without %debug.
2958 Do use the @directive.
2959 (bench_variant_parser): Check impact of %debug.
2960 (@directives): Rename all the occurrences to...
2961 (@directive): this, for consistency.
2962
2963 2008-11-03 Akim Demaille <demaille@gostai.com>
2964
2965 bench: report the size too.
2966 * etc/bench.pl.in ($iterations): Defaults to -3.
2967 (&bench_grammar): Require hireswallclock.
2968 Compute and display the size of the result.
2969 More comments.
2970
2971 2008-11-03 Akim Demaille <demaille@gostai.com>
2972
2973 bench: More use of the verbosity level.
2974 * etc/bench.pl.in ($verbose, &verbose): New.
2975 Use them.
2976 More POD documentation.
2977
2978 2008-11-03 Akim Demaille <demaille@gostai.com>
2979
2980 bench.pl: a command line interface
2981 * etc/bench.pl.in: More doc.
2982 Some fixes in the documentation.
2983 ($cflags, $iterations, &help, &getopt): New.
2984 Use them.
2985 (&variant_grammar): Let the number of stages be 10 times what is
2986 specified.
2987
2988 2008-11-03 Akim Demaille <demaille@gostai.com>
2989
2990 Bench the use of Boost.Variants.
2991 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
2992 New.
2993 (&compile): Be ready to compile C++ parsers.
2994 (&bench_push_parser): Move debug information to the outermost
2995 level.
2996 * THANKS: Add Michiel De Wilde.
2997
2998 2008-11-03 Akim Demaille <demaille@gostai.com>
2999
3000 bench.pl: Pass directives as a list instead of as a string.
3001 * etc/bench.pl.in (&directives): New.
3002 (&triangular_grammar, &calc_grammar): Use it to format the Bison
3003 directives.
3004 (&triangular_grammar): Do use the directives (were ignored).
3005 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
3006 directives.
3007
3008 2008-11-03 Akim Demaille <demaille@gostai.com>
3009
3010 Improve genericity of bench.pl.
3011 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
3012 argument.
3013 (&bench_push_parser): New.
3014 Call it.
3015
3016 2008-11-03 Akim Demaille <demaille@gostai.com>
3017
3018 Add documentation to bench.pl.
3019 * etc/bench.pl.in: Comment changes.
3020
3021 2008-11-03 Akim Demaille <demaille@gostai.com>
3022
3023 Fuse the three stacks into a single one.
3024
3025 In order to make it easy to perform benchmarks to ensure that
3026 there are no performance loss, lalr1.cc is forked into
3027 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
3028 lalr1.cc.
3029
3030 Meanwhile, to make sure that lalr1-fusion.cc is correctly
3031 exercized by the test suite, the user must install a symbolic link
3032 from lalr1.cc to it.
3033
3034 Instead of having three stacks (state, value, location), use a
3035 stack of triples. This considerably simplifies the code (and it
3036 will be easier not to require locations as currently does the C++
3037 parser), and also gives a 10% speedup according to
3038 etc/bench (probably mainly since memory allocation is done once
3039 instead of three times).
3040
3041 Another motivation is to make it easier to destruct properly
3042 semantic values: now that they are bound to their state (hence
3043 symbol type) it will be easier to call the appropriate destructor.
3044
3045 These changes should probably benefit the C parser too.
3046
3047 * data/lalr1.cc: Copy as...
3048 * data/lalr1-fusion.cc: this new file.
3049 (b4_rhs_value, b4_rhs_location): New definitions overriding those
3050 from c++.m4.
3051 (state_stack_type, semantic_stack_type, location_stack_type)
3052 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
3053 (data_type, stack_type, yystack_): New.
3054 (YYLLOC_DEFAULT, yypush_): Adjust.
3055 (yyerror_range): Now based on data_type, not location_type.
3056
3057 2008-11-03 Akim Demaille <demaille@gostai.com>
3058
3059 Push the state, value, and location at the same time.
3060 This is needed to prepare a forthcoming patch that fuses the three
3061 stacks into one.
3062
3063 * data/lalr1.cc (parser::yypush_): New.
3064 (parser::yynewstate): Change the semantics: instead of arriving to
3065 this label when value and location have been pushed, but yystate
3066 is to be pushed on the state stack, now the three of them must
3067 have been pushed before. yystate still must be the new state.
3068 This allows to use yypush_ everywhere instead of individual
3069 handling of the stacks.
3070
3071 2008-11-03 Akim Demaille <demaille@gostai.com>
3072
3073 Prefer references to pointers.
3074 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
3075 definition to use references instead of pointers.
3076 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
3077 Take the value and location as references.
3078 Adjust callers.
3079
3080 2008-11-03 Akim Demaille <demaille@gostai.com>
3081
3082 stack::size instead of stack::height.
3083 * data/lalr1.cc (stack::height): Rename as...
3084 (stack::size): this.
3085 Fix the output type.
3086 Comment changes.
3087
3088 2008-11-03 Akim Demaille <demaille@gostai.com>
3089
3090 Use variants to support objects as semantic values.
3091 This patch was inspired by work by Michiel De Wilde. But he used
3092 Boost variants which (i) requires Boost on the user side, (ii) is
3093 slow, and (iii) has useless overhead (the parser knows the type of
3094 the semantic value there is no reason to duplicate this
3095 information as Boost.Variants do).
3096
3097 This implementation reserves a buffer large enough to store the
3098 largest objects. yy::variant implements this buffer. It was
3099 implemented with Quentin Hocquet.
3100
3101 * src/output.c (type_names_output): New.
3102 (output_skeleton): Invoke it.
3103 * data/c++.m4 (b4_variant_if): New.
3104 (b4_symbol_value): If needed, provide a definition for variants.
3105 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
3106 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
3107 (b4_char_sizeof, yy::variant): New.
3108 (parser::parse): If variants are requested, define
3109 parser::union_type, parser::variant, change the definition of
3110 semantic_type, construct $$ before running the user action instead
3111 of performing a default $$ = $1.
3112 * examples/variant.yy: New.
3113 Based on an example by Michiel De Wilde.
3114
3115 2008-11-03 Akim Demaille <demaille@gostai.com>
3116
3117 Parameterize the extraction of semantic values.
3118 To make future changes easier, no longer rely on ".TYPE" being the
3119 way to get a semantic value.
3120
3121 * data/c.m4 (b4_symbol_value): New.
3122 Use it.
3123 * data/c++.m4, data/yacc.c: Use it.
3124 * data/glr.c: Use b4_symbol_value.
3125 (b4_rhs_data): New.
3126 Use it.
3127
3128 2008-11-03 Akim Demaille <demaille@gostai.com>
3129
3130 Prepare easier M4 changes.
3131 * data/lalr1.cc: Use escaped [] instead of literals to prepare
3132 future changes.
3133
3134 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3135
3136 Initiate further development.
3137 * NEWS: Create an empty section for new entries.
3138 * gnulib: Update submodule to HEAD.
3139
3140 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3141
3142 * NEWS: Version 2.4.
3143
3144 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3145
3146 Prepare for next release.
3147 * NEWS: Briefly mention changes since 2.3b.
3148 * README: Say GNU m4 1.4.6, which we've been requiring in release
3149 announcements already, not 1.4.3, which breaks the build.
3150
3151 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3152
3153 Say %language is experimental.
3154 We're thinking of extending it's effect on output file naming. See the
3155 thread at
3156 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
3157 * NEWS: Say it's experimental.
3158 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
3159 recommend it over %skeleton for now.
3160 (Bison Options): Likewise.
3161 (C++ Bison Interface): Use %skeleton not %language.
3162 (Calc++ Parser): Use %skeleton not %language.
3163 * src/getargs.c (usage): Say it's experimental.
3164
3165 2008-11-01 Di-an Jan <dianj@freeshell.org>
3166 Paolo Bonzini <bonzini@gnu.org>
3167
3168 Support all Java parser class modifiers.
3169 * data/java.m4 (b4_percent_define_get3): New.
3170 (b4_final_if, b4_strictfp_if): New.
3171 * data/lalr1.java (final, strictfp, extends, implements): Support.
3172 * doc/bison.texinfo (final, strictfp, extends, implements): Add
3173 documentation.
3174 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
3175 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
3176 (AT_CHECK_JAVA_GREP): New.
3177 (Java parser class modifiers): New test.
3178 (Java parser class extends and implements): New test.
3179
3180 Model exception propagation better with throws and lex_throws.
3181 * data/java.m4 (b4_list2): New.
3182 (throws): Change default.
3183 * data/lalr1.java (yyaction): Add throws.
3184 (parse): Add lex_throws in addition to throws.
3185 * doc/bison.texinfo (throws, lex_throws): Add documentation.
3186 * tests/java.at (Java throws specifications): New test.
3187
3188 Improve documentation for Java parsers.
3189 * doc/bison.texinfo (Java Parsers): Add subsections.
3190 Don't quote first argument of %define.
3191 (Java Bison Interface): Document output files. Move documentation
3192 of parser class and merge into Java Parser Interface. Document
3193 features that error out. Document directives with no effect.
3194 Move note about Javadoc higher.
3195 (Java Semantic Values): Explicitly mention stype.
3196 Document that generic types cannot be used.
3197 (Java Location Values): Use @deftypeivar. Document constructors.
3198 Correct return value for toString.
3199 (Java Parser Interface): List undocumented constants/fields.
3200 Move documentation of fields added by %parse-param closer to list
3201 of members. Document that token names are added as fields.
3202 Document constructors accurately. Remove error method.
3203 (Java Scanner Interface): Move note on %pure-parser to Java Bison
3204 Interface. Describe %code lexer and yylex accutately.
3205 Remove documentation that does not match the code.
3206 (Java Action Features): New.
3207 (Java Differences): Add reference. Add item on semantic values.
3208 Add note about @{ ... @}. Clarify %% epilogue placement.
3209 (Java Declarations Summary): New.
3210
3211 Fix Java skeleton.
3212 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
3213 (b4_remove_comma): Quote test argument.
3214 (b4_identification): Remove "bison" field.
3215 * tests/java.at (Java parser class and package names): New test.
3216 (Java %parse-param and %lex-param): New test.
3217 (Java stype, position_class and location_class): New test.
3218
3219 2008-10-31 Di-an Jan <dianj@freeshell.org>
3220
3221 * data/lalr1.jave: Update copyright years.
3222 (YYParser): Correct name of "generated from" file in Javadoc:
3223 use b4_file_name instead of @ofile@.
3224 (Location constructor): Correct Javadoc parameter name.
3225 (yylloc): Add missing opening m4 quote after b4_location_if.
3226 This removes a stray [ in the Javadoc of Lexer.getStartPos.
3227 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
3228 (YYParser constructor): Correct Javadoc parameter name.
3229
3230 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
3231
3232 Always put auxiliary code files in the same dir as other output files.
3233 * src/files.c (compute_file_name_parts): When the user specifies
3234 --output but not --file-prefix, extract the directory prefix from the
3235 file prefix not from the grammar file name. This affects the location
3236 of files like location.hh generated by the C++ skeleton. The includes
3237 in the other output files require this fix.
3238 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
3239 for expected output files.
3240 (Output files): Add a test for the above.
3241
3242 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
3243
3244 * gnulib: Update submodule to HEAD.
3245
3246 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3247
3248 Update copyright year.
3249 * src/files.c: Here.
3250
3251 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
3252
3253 Don't overwrite the input file.
3254 * src/files.c (output_file_name_check): Fatal error if using input file
3255 for output.
3256 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
3257 argument.
3258 (Conflicting output files): Add test.
3259
3260 2008-10-28 Akim Demaille <demaille@gostai.com>
3261
3262 Space changes.
3263 * data/lalr1.cc: Formatting changes.
3264
3265 2008-10-28 Akim Demaille <demaille@gostai.com>
3266
3267 Don't define debugging functions when !YYDEBUG.
3268 * data/lalr1.cc (debug_stream, set_debug_stream)
3269 (debug_level_type, debug_level, set_debug_level): Don't
3270 declare them when YYDEBUG is not defined.
3271 The implementation are already YYDEBUG-aware.
3272
3273 2008-10-28 Akim Demaille <demaille@gostai.com>
3274
3275 Prefer "continue" for empty loop bodies.
3276 * etc/bench.pl.in: Use "continue" instead of {}.
3277
3278 2008-10-28 Akim Demaille <demaille@gostai.com>
3279
3280 Space and comments changes.
3281 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3282 * data/c.m4, data/lalr1.cc: Space changes.
3283
3284 2008-10-28 Akim Demaille <demaille@gostai.com>
3285
3286 Make gnulib a submodule.
3287 * gnulib: New.
3288 * .gitmodules (gnulib): New.
3289
3290 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3291
3292 Fix yyerror_range for user-defined location type in C++. Reported by
3293 Georg Sauthoff at
3294 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3295 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3296 * THANKS (Georg Sauthoff): Add.
3297
3298 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3299
3300 Update several administrative files mainly to facilitate releasing.
3301 * HACKING (Administrivia): Make the git-merge-changelog notes more
3302 helpful.
3303 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3304 (Release Procedure): Update for git and add numerous details that were
3305 previously missing.
3306 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3307 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3308 that announcements don't claim we bootstrapped with whatever bison
3309 happened to be in PATH. Add flex as a bootstrap tool.
3310 * Makefile.maint: Remove, previously replaced by maint.mk.
3311 * Makefile.cfg: Remove, and migrate settings to...
3312 * cfg.mk: ... here for the sake of `make announcement'.
3313 * bootstrap.conf (gnulib_modules): Add announce-gen.
3314 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3315 Berry.
3316
3317 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3318
3319 Small but important bugfixes for the Java skeleton.
3320 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3321 (yy_symbol_print): Call toString on yyvaluep.
3322
3323 2008-08-29 Akim Demaille <demaille@gostai.com>
3324
3325 Clarify UPDATED use.
3326 * doc/bison.texinfo: It refers to the last edition of this file,
3327 not to the release date of Bison.
3328 Reported by Joel E. Denny.
3329
3330 2008-08-29 Akim Demaille <demaille@gostai.com>
3331
3332 * README: Update FAQ pointer.
3333 Reported by Joel E. Denny.
3334
3335 2008-08-27 Eric Blake <ebb9@byu.net>
3336
3337 Resync m4sugar from autoconf.
3338 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3339 (m4_init): Adjust to latest m4.git changes.
3340 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3341 effects.
3342 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3343 (_m4_list_cmp): Reduce side effects.
3344
3345 2008-08-27 Akim Demaille <demaille@gostai.com>
3346
3347 Check yyerrok in calc.at.
3348 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3349 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3350 expected.
3351
3352 2008-08-27 Akim Demaille <demaille@gostai.com>
3353
3354 Support yyerrok in lalr1.cc.
3355 YYBACKUP is still to import back into lalr1.cc.
3356 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
3357
3358 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3359
3360 For maintainer-check*, don't recompile for a $(VERSION) update.
3361 * cfg.mk: New file.
3362 (_is-dist-target): Override the one in GNUmakefile.
3363 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3364
3365 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3366
3367 Update for recent change to gnulib.
3368 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3369 string.h now.
3370
3371 2008-08-15 Eric Blake <ebb9@byu.net>
3372
3373 Remaining m4sugar merge from autoconf.
3374 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3375 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3376 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3377 * src/output.c (output_skeleton): Tell m4 how to find it.
3378
3379 Partial m4sugar merge from autoconf: m4_map.
3380 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3381 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3382 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3383 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3384 for empty list.
3385 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3386 Likewise.
3387 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3388 declares it.
3389
3390 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3391
3392 Keep .version and PACKAGE_VERSION in sync.
3393 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3394 dependency, and add comments justifying this in more detail. Discussed
3395 starting at
3396 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3397
3398 2008-08-06 Eric Blake <ebb9@byu.net>
3399
3400 Partial m4sugar merge from autoconf: m4_shiftn.
3401 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3402 (m4_shift2, m4_shift3): New macros.
3403 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3404 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3405 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3406 * data/java.m4 (b4_remove_comma): Likewise.
3407
3408 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3409 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3410 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3411 (m4_init): Consolidate wrapped text into single m4_wrap.
3412 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3413 in wrapped text.
3414
3415 2008-08-05 Eric Blake <ebb9@byu.net>
3416
3417 Partial m4sugar merge from autoconf: builtins, version.m4.
3418 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3419 (m4_prepend): Remove, as it is unused and inherently quadratic,
3420 whereas m4_append is linear in newer m4.
3421 (m4_mkstemp): New builtin.
3422 (m4_symbols): Make rename conditional.
3423 (m4_version_prereq): Ensure fatal error if used in bison, which
3424 intentionally lacks version.m4.
3425
3426 Fix comments in m4sugar.
3427 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3428
3429 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3430
3431 Update for recent .gitignore fix in Gnulib.
3432 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3433 anchored .gitignore entries.
3434
3435 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3436
3437 Set gnu or gnits strictness.
3438 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3439 development and gnits strictness for releases. Based on Eric Blake's
3440 suggestion at
3441 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3442
3443 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
3444
3445 * NEWS: Clarify documentation of %language.
3446
3447 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
3448
3449 Support usage of git-merge-changelog.
3450 * .gitattributes: New.
3451 * HACKING: Document usage of git-merge-changelog.
3452 * bootstrap: Install git-merge-changelog entries in .git/config
3453 if appropriate.
3454
3455 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3456
3457 Remove remaining dependence on CVS Id keyword.
3458 * ChangeLog: For the sake of people still using CVS, don't use dollars
3459 when mentioning Id.
3460 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3461 unusual anyway.
3462 * data/xslt/xml2dot.xsl: Likewise.
3463 * data/xslt/xml2text.xsl: Likewise.
3464 * data/xslt/xml2xhtml.xsl: Likewise.
3465 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3466 * doc/Makefile.am (neutralize): Remove, no longer needed.
3467 (.x.1): Don't use neutralize.
3468 (edit): Don't substitute for ID.
3469 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3470
3471 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3472
3473 Fix dependence on computed configure variables.
3474 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3475 $(top_srcdir)/configure.ac so that changes to computed variables, such
3476 as PACKAGE_VERSION, are seen.
3477 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3478
3479 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3480
3481 Update copyright dates for recent changes.
3482 * Makefile.am: Here.
3483 * src/Makefile.am: Here.
3484 * src/reduce.c: Here.
3485 * tests/reduce.at: Here.
3486
3487 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3488
3489 Use git-version-gen for version names between releases.
3490 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3491 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3492 * .prev-version: New.
3493 * .version.in: Remove.
3494 * ChangeLog: Remove the Id previously used for capturing the CVS
3495 revision.
3496 * GNUmakefile: Remove, now copied from Gnulib.
3497 * Makefile.am: Add code suggested by comments in
3498 build-aux/git-version-gen.
3499 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3500 .prev-version, and .version.
3501 * NEWS (2.3b+): Rename to...
3502 (?.?): ... this because we're dropping the "+" version naming scheme,
3503 but, in general, we still can't be sure of our next release name.
3504 * bootstrap: Add a quick hack to remove from .gitignore the
3505 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3506 entry. This should really be fixed in gnulib instead.
3507 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3508 * configure.ac (AC_INIT): Set version name by invoking
3509 build-aux/git-version-gen.
3510 (AC_CONFIG_FILES): Remove .version, now generated by
3511 build-aux/git-version-gen.
3512 * maint.mk: New, copied from coreutils.
3513 * doc/.cvsignore (bison.1): Add.
3514 * doc/.gitignore (/bison.1): Add.
3515 * doc/bison.1: Remove, generated.
3516 * src/.cvsignore (revision.c): Remove.
3517 * src/.gitignore (/revision.c): Remove.
3518 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3519 (BUILT_SOURCES): Remove revision.c.
3520 (revision.c): Remove.
3521 * src/getargs.c (version): Don't print revision after the VERSION.
3522 * src/revision.h: Remove.
3523
3524 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3525
3526 Fix untranslatable composition of sentences. Reported by Goran
3527 Uddeborg at
3528 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3529 * THANKS (Goran Uddeborg): Add.
3530 * src/reduce.c (reduce_print): Report the number of nonterminals and
3531 rules useless in the grammar in separate sentences.
3532 * tests/reduce.at (Useless Rules): Update output.
3533 (Reduced Automaton): Likewise.
3534 (Underivable Rules): Likewise.
3535 (Empty Language): Likewise.
3536
3537 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3538
3539 Fix some .gitignore and .cvsignore problems.
3540 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3541 (insert_vc_ignore): ... this new function, which prepends `/' to all
3542 .gitignore entries before passing them to insert_sorted_if_absent.
3543 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3544 .cvsignore files are maintained even though Bison developers run
3545 bootstrap while using Git.
3546 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3547 unneeded by Bison.
3548 (gnulib): Add.
3549 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3550 unneeded. Reported by Eric Blake.
3551 * lib/.gitignore (/*~): Add.
3552 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3553 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3554 Blake.
3555 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3556
3557 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3558
3559 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3560 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3561 * bootstrap.conf (gnulib_modules): Add unsetenv.
3562 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3563 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3564 (/setenv.m4): Add.
3565 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3566 the first argument because it may become position-dependent, and unset
3567 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3568 Add comments explaining these issues in more detail.
3569
3570 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3571
3572 Add .gitignore everywhere based on .cvsignore.
3573 * .gitignore: New.
3574 * build-aux/.gitignore: New.
3575 * data/.gitignore: New.
3576 * doc/.gitignore: New.
3577 * etc/.gitignore: New.
3578 * examples/.gitignore: New.
3579 * examples/calc++/.gitignore: New.
3580 * lib/.gitignore: New.
3581 * m4/.gitignore: New.
3582 * po/.gitignore: New.
3583 * runtime-po/.gitignore: New.
3584 * src/.gitignore: New.
3585 * tests/.gitignore: New.
3586
3587 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3588
3589 * NEWS (2.3b+): New section, empty for now.
3590 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3591
3592 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3593
3594 * NEWS (2.3b): Update release date since there has been a delay in
3595 getting the announcements and tarballs out.
3596
3597 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3598
3599 * NEWS: Version 2.3b.
3600 * configure.ac (AC_INIT): Likewise.
3601 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3602
3603 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3604
3605 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3606 been doing it for years.
3607 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3608 (Release Procedure): Add FIXME about make alpha being unmaintained.
3609
3610 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3611
3612 * data/yacc.c: Reformat m4 a little for readability.
3613 * src/lalr.c (build_relations): Correct comment.
3614
3615 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3616
3617 DJGPP specific issue.
3618 * djgpp/config.sed: Fixes required to run configure scripts generated
3619 by autoconf 2.62.
3620
3621 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3622
3623 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3624 coordinator@translationproject.org.
3625
3626 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3627
3628 * THANKS: Add Eric Blake.
3629
3630 2008-04-23 Eric Blake <ebb9@byu.net>
3631
3632 Revert prior patch, by working around autoconf regression.
3633 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3634 ("Output file name: ("): Uncomment test.
3635 ("Output file name: )"): Likewise.
3636 Based on an idea from Noah Misch.
3637
3638 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3639
3640 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3641 2.61. Reported by Juan Manuel Guerrero at
3642 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3643 * tests/output.at ("Output file name: ("): Comment out test case for
3644 now.
3645 ("Output file name: )"): Likewise.
3646
3647 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3648
3649 * GNUmakefile: Update git-version-gen invocation so make dist
3650 succeeds.
3651
3652 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3653
3654 Update to the current gnulib CVS repository, and fix trigraph handling
3655 in Bison.
3656 * bootstrap: Update gnulib CVS repository URL.
3657 (symlink_to_dir): Encapsulate the code that guarantees the destination
3658 directory exists into...
3659 (check_dst_dir): ... this new function, and...
3660 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3661 fail when copying files into lib/uniwidth/.
3662 * src/output.c (prepare_symbols): When writing yytname muscles, where
3663 symbol names will be encoded in C-string literals, tell quotearg to
3664 escape trigraphs. This used to be the default in gnulib.
3665 * tests/regression.at (Token definitions): Because of the change in
3666 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3667 escapes trigraphs in symbol names. Thus, yytname no longer has
3668 trigraphs unnecessarily doubly escaped. Update test case output.
3669 Extend test case to be sure Bison's own error messages will no longer
3670 have trigraphs in symbol names unnecessarily escaped once.
3671
3672 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3673
3674 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3675 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3676 * .cvsignore: Add .version.
3677 * .version.in: New.
3678 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3679 * configure.ac (AC_CONFIG_FILES): Add .version.
3680 * build-aux/.cvsignore: Add git-version-gen.
3681
3682 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3683
3684 * NEWS (2.3a+): Mention that -g now takes an argument.
3685 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3686 consistency. Update the -g and -x entries now that they take
3687 arguments. Use brackets to indicate optional arguments.
3688 * src/getargs.c (usage): Explain the relationship between arguments of
3689 long and short options more completely. Document --defines and -d
3690 separately since the former takes an argument but, for POSIX Yacc, the
3691 latter does not.
3692 (short_options): Let -W take an optional argument like --warnings.
3693 (getargs): Sort cases.
3694
3695 2008-02-28 Akim Demaille <demaille@gostai.com>
3696
3697 * doc/bison.texinfo: Fix a few typos.
3698
3699 2008-02-28 Akim Demaille <akim@epita.fr>
3700
3701 * doc/bison.texinfo (Bison Options): Document -W.
3702 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3703
3704 2008-02-28 Akim Demaille <akim@epita.fr>
3705
3706 * src/getargs.c (short_options): Split and sort for readability.
3707 -g and -x take optional arguments, just like their long options.
3708 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3709 understand.
3710 Fix the handling of $opt which resulted in all the argument to be
3711 considered as optional.
3712
3713 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3714
3715 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3716 say its interface is experimental.
3717 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3718 Java.
3719 (Bison Options): In the -L and --language entry, mention Java.
3720 (Java Bison Interface): Say the interface is experimental.
3721 * src/getargs.c (usage): Mention -L and --language.
3722
3723 * NEWS (2.3a+): Say the push parsing interface is experimental.
3724 * doc/bison.texinfo (Push Decl): Likewise.
3725 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3726 (Push Parser Function): Likewise.
3727 (Pull Parser Function): Likewise.
3728 (Parser Create Function): Likewise.
3729 (Parser Delete Function): Likewise.
3730 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3731 yypull_parse, and yypush_parse entries.
3732
3733 * NEWS (2.3a+): Mention XML support, and say the schema is
3734 experimental.
3735 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3736 * src/getargs.c (usage): Say the XML schema is experimental.
3737
3738 * NEWS (2.3a+): Say option instead of flag.
3739
3740 2008-02-21 Wojciech Polak <polak@gnu.org>
3741
3742 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3743 text.
3744
3745 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3746
3747 Fix impure push parser compile error reported by Bob Rossi at
3748 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3749 * data/yacc.c: Clean up whitespace in the output a little.
3750 (yypstate_allocated): Define for impure push parsers regardless of
3751 whether the pull interface is also requested.
3752 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3753 check impure push parsers without the pull interface.
3754
3755 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3756 yyerror takes arguments specified by %parse-param while yypstate_new
3757 does not.
3758 * doc/bison.texinfo (Parser Create Function): Document that
3759 yypstate_new returns 0 for multiple impure parser instances.
3760 * tests/push.at (Push Parsing: Multiple impure instances): Update
3761 expected stderr output.
3762
3763 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3764
3765 * runtime-po/POTFILES.in (push.c): Remove.
3766
3767 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3768
3769 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3770 * data/push.c: Rename to...
3771 * data/yacc.c: ... this, overwriting it.
3772 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3773 `%push-pull-parser' -> `%define api.push_pull "both"'.
3774 Remove old yacc.c tests, and update push.c tests to yacc.c.
3775
3776 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3777
3778 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3779 `"%code top" blocks' instead of `%code "top" blocks'.
3780 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3781 Clean up whitespace in the output a little.
3782
3783 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3784
3785 Fix documentation problems reported by Tim Josling at
3786 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3787 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3788 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3789 integers. Explain the effect of literal string aliases on error
3790 messages. Copy token 0 documentation from the C++ skeleton
3791 documentation.
3792
3793 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3794
3795 Accept a token number in a %left, %right, or %nonassoc for POSIX
3796 conformance. Reported by Tim Josling at
3797 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
3798 * NEWS (2.3a+): Mention.
3799 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
3800 and code numbers are treated by precedence declarations.
3801 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
3802 of symbols.1.
3803 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
3804 of symbol.
3805 (symbol.prec): New, just like symbol but allows INT.
3806 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
3807 longer holds.
3808 * tests/regression.at (Token number in precedence declaration): New
3809 test case.
3810
3811 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3812
3813 DJGPP specific issues.
3814 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
3815 be changed. Copyright timestamp adjusted.
3816 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
3817 be changed. Copyright timestamp adjusted.
3818 * djgpp/config.site: Copyright timestamp adjusted.
3819 * djgpp/config_h.sed: Copyright timestamp adjusted.
3820 * djgpp/djunpack.bat: Copyright timestamp adjusted.
3821 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
3822 filename translation list.
3823 * djgpp/subpipe.c (init_subpipe): Check the environment variables
3824 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
3825 files shall be created. Before trying to use the temp dir where the
3826 environment variable points to check that the dir really exists. If
3827 not default to the cwd as temp dir. Copyright timestamp adjusted.
3828 * djgpp/subpipe.h: Copyright timestamp adjusted.
3829 * djgpp/testsuite.sed: Copyright timestamp adjusted.
3830
3831 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
3832
3833 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
3834
3835 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
3836
3837 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
3838 Problem reported by Claudio Saavedra in
3839 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
3840
3841 2008-01-05 Wojciech Polak <polak@gnu.org>
3842
3843 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
3844 document's title with the input grammar file name.
3845
3846 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
3847
3848 Automate regression testing of the XML/XSLT implementation. Discussed
3849 starting at
3850 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
3851 * configure.ac (XSLTPROC): New substitution.
3852 * Makefile.am (maintainer-xml-check): New phony target invoking...
3853 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
3854 invoking make maintainer-check with BISON_TEST_XML=1.
3855 * tests/atlocal.in (XSLTPROC): New.
3856 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
3857 not to report reachable memory when Bison is expected to have a
3858 non-zero exit status and (2) to compare XML/XSLT output with --graph
3859 and --report=all output for every working grammar when
3860 BISON_TEST_XML=1.
3861 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
3862 (AT_BISON_CHECK_XML): New.
3863 (AT_QUELL_VALGRIND): New.
3864 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
3865 (AT_CHECK): ... don't redefine this since this was the old way to
3866 quell Valgrind.
3867 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
3868 AT_BISON_CHECK invocations.
3869 * tests/c++.at: Likewise.
3870 * tests/calc.at: Likewise.
3871 * tests/conflicts.at: Likewise.
3872 * tests/cxx-type.at: Likewise.
3873 * tests/existing.at: Likewise.
3874 * tests/glr-regression.at: Likewise.
3875 * tests/headers.at: Likewise.
3876 * tests/input.at: Likewise.
3877 * tests/java.at: Likewise.
3878 * tests/output.at: Likewise.
3879 * tests/push.at: Likewise.
3880 * tests/reduce.at: Likewise.
3881 * tests/regression.at: Likewise.
3882 * tests/sets.at: Likewise.
3883 * tests/skeletons.at: Likewise.
3884 * tests/synclines.at: Likewise.
3885 * tests/torture.at: Likewise.
3886 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
3887 tends to hang xsltproc.
3888 (Big horizontal): Likewise.
3889
3890 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3891
3892 In XML output, remove redundant class attribute on symbol element.
3893 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
3894 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
3895 look up a symbol to determine whether it's a nonterminal or terminal.
3896 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
3897 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
3898
3899 Add prec/assoc information to XML output.
3900 * src/gram.c (grammar_rules_print_xml): For each rule that has a
3901 %prec, add a percent_prec attribute.
3902 * src/print-xml.c (print_grammar): For each terminal that has a
3903 precedence or associativity, add a prec or assoc attribute.
3904 (xml_indent): New.
3905 (xml_puts): Use xml_indent.
3906 (xml_printf): Use xml_indent.
3907 * src/print-xml.h (xml_indent): Prototype.
3908
3909 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
3910 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
3911
3912 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
3913
3914 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
3915 (bison:ruleByNumber): ... this for clarity.
3916 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
3917 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
3918 (xsl:template match="reduction"): Update.
3919 (xsl:template match="item"): Update.
3920 (xsl:template match="reduction"): Update.
3921
3922 In the XML output, don't print the list of rules where symbols appear.
3923 Compute it in XSLT instead. Discussed at
3924 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
3925 * data/xslt/bison.xsl (bison:ruleByLhs): New.
3926 (bison:ruleByRhs): New.
3927 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
3928 bison:ruleByRhs.
3929 (xsl:template match="terminal/rule"): Remove.
3930 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3931 bison:ruleByRhs.
3932 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3933 Remove.
3934 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
3935 bison:ruleByRhs and mode="number-link" for rule template.
3936 (xsl:template match="terminal/rule"): Remove.
3937 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
3938 bison:ruleByRhs and mode="number-link" for rule template.
3939 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
3940 Rewrite as...
3941 (xsl:template match="rule" mode="number-link"): ... this.
3942 * src/print-xml.c (print_grammar): Don't print the list of rules.
3943
3944 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
3945
3946 Don't let --report affect XML output; always print all information.
3947 Discussed at
3948 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
3949 * src/conflicts.c (log_resolution): Implement.
3950 * src/print-xml.c (print_core): Implement.
3951 (print_state): Implement.
3952 (print_xml): Implement.
3953
3954 * NEWS (2.3a+): Fix quotes.
3955 * src/parse-gram.y (prologue_declaration): For consistency with -v,
3956 don't let %verbose clear the list specified by --report.
3957
3958 2007-11-26 Akim Demaille <akim@epita.fr>
3959
3960 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
3961
3962 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
3963
3964 In the XML output, list useless and unused symbols and rules with the
3965 useful ones and add a "usefulness" attribute. Discussed starting at
3966 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
3967 * src/gram.c (grammar_rules_partial_print_xml): Remove.
3968 (grammar_rules_print_xml): Print all rules instead of just those
3969 useful in the grammar, and add a "usefulness" attribute.
3970 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
3971 * src/print-xml.c (print_rules_useless_in_parser): Remove.
3972 (print_grammar): Print all nonterminals instead of just useful ones,
3973 and add a "usefulness" attribute to nonterminals and terminals.
3974 (print_xml): Don't print a separate "reductions" or
3975 "rules-useless-in-parser" element.
3976 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
3977 (reduce_xml): Remove.
3978 (reduce_token_unused_in_grammar): New.
3979 (reduce_nonterminal_useless_in_grammar): New.
3980 * src/reduce.h (reduce_xml): Remove prototype.
3981 (reduce_token_unused_in_grammar): Add prototype.
3982 (reduce_nonterminal_useless_in_grammar): Add prototype.
3983 * data/xslt/xml2text.xsl: Update for XML changes.
3984 * data/xslt/xml2xhtml.xsl: Update for XML changes.
3985 * tests/reduce.at (Useless Terminals): Update output.
3986 (Useless Rules): Update output.
3987 (Reduced Automaton): Update output.
3988
3989 Say "Terminals unused in grammar" instead of "Unused terminals".
3990 * NEWS (2.3a+): Update.
3991 * doc/bison.texinfo (Understanding): Update example output.
3992 * src/reduce.c (reduce_output): Implement.
3993 * data/xslt/xml2text.xsl: Implement.
3994 * data/xslt/xml2xhtml.xsl: Implement.
3995
3996 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
3997
3998 Accept --report-file=FILE to override the default `.output' filename.
3999 * NEWS (2.3a+): Mention.
4000 * doc/bison.texinfo (Bison Options): Add an entry.
4001 * src/files.c (compute_output_file_names): Don't override
4002 spec_verbose_file if already set.
4003 * src/getargs.c (usage): Document --report-file.
4004 (REPORT_FILE_OPTION): New anonymous enum member.
4005 (long_options): Add entry for it.
4006 (getargs): Add case for it setting spec_verbose_file.
4007
4008 * build-aux/cross-options.pl: Don't record a short option just because
4009 there's an arg.
4010 * doc/.cvsignore: Add yacc.1.
4011
4012 2007-11-14 Akim Demaille <akim@epita.fr>
4013
4014 * doc/yacc.1.in: New.
4015 * configure.ac, doc/Makefile.am: Adjust.
4016 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
4017 config.h symbol.
4018 Use AC_SUBST for assignments too.
4019 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
4020
4021 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4022
4023 * src/gram.c: Remove comments that duplicate comments in gram.h.
4024
4025 When reporting useless rules and nonterminals, say "useless in grammar"
4026 instead of "useless", and say "useless in parser" instead of "never
4027 reduced". Discussed starting at
4028 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
4029 * NEWS (2.3a+): Mention this change.
4030 * data/xslt/xml2text.xsl: Update output text and expected input XML
4031 element names to match changes below.
4032 * data/xslt/xml2xhtml.xsl: Likewise.
4033 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4034 Contents: "Rules useless in parser due to conflicts".
4035 * doc/bison.texinfo (Decl Summary): Reword a little.
4036 (Understanding): Update example output for changes below.
4037 * src/gram.c: (rule_useful_p): Rename to...
4038 (rule_useful_in_grammar_p): ... this.
4039 (rule_useless_p): Rename to...
4040 (rule_useless_in_grammar_p): ... this.
4041 (rule_never_reduced_p): Rename to...
4042 (rule_useless_in_parser_p): ... this.
4043 (grammar_rules_print): Update for renames.
4044 (grammar_rules_print_xml): Update for renames.
4045 (grammar_rules_never_reduced_report): Rename to...
4046 (grammar_rules_useless_report): ... this since it is used for either
4047 kind of useless rule.
4048 * src/gram.h: Reword comments and update function names in prototypes.
4049 * src/main.c (main): Say "rule useless in parser due to conflicts".
4050 * src/print-xml.c (print_rules_never_reduced): Rename to...
4051 (print_rules_useless_in_parser): ... this, and rename output XML
4052 element "rules-never-reduced" to "rules-useless-in-parser".
4053 (print_xml): Update for rename.
4054 * src/print.c (print_results): Say "Rules useless in parser due to
4055 conflicts".
4056 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4057 (nonterminals_reduce): Say "nonterminal useless in grammar".
4058 (reduce_output): Say "Nonterminals useless in grammar".
4059 Say "Rules useless in grammar".
4060 (reduce_xml): Rename output XML element "useless" to
4061 "useless-in-grammar".
4062 (reduce_print): Don't report the count of grammatically useless rules
4063 as "rules never reduced" just because %yacc is specified.
4064 In the correct report of this count, say nonterminal(s) and rule(s)
4065 "useless in grammar".
4066 * tests/conflicts.at (S/R in initial): Update expected output.
4067 (Defaulted Conflicted Reduction): Likewise.
4068 (Unreachable States After Conflict Resolution): Likewise.
4069 * tests/existing.at (GNU pic Grammar): Likewise.
4070 * tests/reduce.at (Useless Nonterminals): Likewise.
4071 (Useless Rules): Likewise.
4072 (Reduced Automaton): Likewise.
4073 (Underivable Rules): Likewise.
4074 (Empty Language): Likewise.
4075
4076 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4077
4078 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4079 here document and before the EOF so that BSD's implementation of Bourne
4080 shell doesn't parse the delimiter as part of the here document.
4081 * doc/.cvsignore: Add cross-options.texi.
4082 * src/getargs.c (usage): Add a blank line after the warning categories.
4083
4084 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
4085
4086 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4087
4088 2007-11-05 Akim Demaille <akim@epita.fr>
4089
4090 Remove Id: from bison.1.
4091 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4092 (perl -0777 -pi -e 's/\.PP\nId): New.
4093 (.x.1): Use it to ignore the version control revision.
4094
4095 2007-11-05 Akim Demaille <demaille@gostai.com>
4096
4097 * build-aux/Makefile.am: Ship cross-options.pl.
4098 * doc/Makefile.am: Always refer to cross-options.texi with
4099 $(srcdir).
4100 (MAINTAINERCLEANFILES): Add it.
4101
4102 2007-11-04 Akim Demaille <demaille@gostai.com>
4103
4104 Generate the long/short option cross-table.
4105 * build-aux/cross-options.pl: New.
4106 * doc/Makefile.am (cross-options.texi): New.
4107 * doc/bison.texinfo: Use it.
4108
4109 2007-11-04 Akim Demaille <demaille@gostai.com>
4110
4111 Generate bison.1 using help2man.
4112 * doc/common.x, doc/bison.x: New.
4113 * doc/Makefile.am (bison.1, .x.1): New.
4114 The code is taken from autoconf-2.61/man/Makefile.am.
4115 * configure.ac: Look for help2man.
4116
4117 2007-11-04 Akim Demaille <demaille@gostai.com>
4118
4119 Complete --help.
4120 * src/getargs.c (usage): Document -W, make it clear that -d,
4121 -g and -x have optional arguments.
4122
4123 2007-11-04 Akim Demaille <demaille@gostai.com>
4124
4125 Find sha1sum when named gsha1sum.
4126 * bootstrap (find_tool): New.
4127 ($SHA1SUM): New.
4128
4129 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4130
4131 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
4132 at
4133 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
4134 * NEWS (2.3a+): Mention.
4135 * data/bison.m4 (b4_pure_if): Don't define it here.
4136 * data/c.m4 (b4_identification): Depend on individual skeletons to
4137 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
4138 values of the %define variables api.pure or api.push_pull. Define
4139 YYPURE, YYPUSH, and YYPULL accordingly.
4140 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
4141 glr.cc has already defined b4_pure_flag.
4142 * data/push.c: Define b4_pure_if based on `%define api.pure'.
4143 Remove YYPUSH and YYPULL since they're back in b4_identification again.
4144 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
4145 * doc/bison.texinfo (Pure Decl): Update.
4146 (Push Decl): Update.
4147 (Decl Summary): Add api.pure to %define entry.
4148 In %pure-parser entry, say it's deprecated and reference %define.
4149 (Pure Calling): Update.
4150 (Error Reporting): Update.
4151 (C++ Scanner Interface): Update.
4152 (How Can I Reset the Parser): Update.
4153 (Table of Symbols): In %pure-parser entry, say it's deprecated and
4154 reference %define.
4155 * src/getargs.c (pure_parser): Remove global variable.
4156 * src/getargs.h (pure_parser): Remove extern.
4157 * src/output.c (prepare): Don't define pure_flag muscle.
4158 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
4159 wrapper around `%define api.pure'.
4160 * tests/calc.at (Simple LALR Calculator): Update.
4161 (Simple GLR Calculator): Update.
4162 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
4163 Update.
4164 (GLR: Resolve ambiguity, pure, locations): Update.
4165 (GLR: Merge conflicting parses, pure, no locations): Update.
4166 (GLR: Merge conflicting parses, pure, locations): Update.
4167 * tests/glr-regression.at (Uninitialized location when reporting
4168 ambiguity): Update
4169 * tests/input.at (Unused %define api.pure): New test case.
4170 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
4171 AT_PURE_IF and AT_PURE_AND_LOC_IF.
4172 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4173
4174 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4175
4176 %define push_pull -> %define api.push_pull. Discussed starting at
4177 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
4178 * data/push.c: Expect the new name.
4179 * data/yacc.c: Likewise.
4180 * doc/bison.texinfo (Push Decl): Update.
4181 (Decl Summary): Update %define entry.
4182 (Push Parser Function): Update.
4183 (Pull Parser Function): Update.
4184 (Parser Create Function): Update.
4185 (Parser Delete Function): Update.
4186 * tests/calc.at (Simple LALR Calculator): Update.
4187 * tests/input.at (%define enum variables): Update.
4188 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4189 (Push Parsing: Multiple impure instances): Update.
4190 (Push Parsing: Unsupported Skeletons): Update.
4191 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
4192 (Exploding the Stack Size with Malloc): Update.
4193
4194 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
4195 other entries some.
4196
4197 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
4198
4199 For the XML output's terminal element, rename @number to @token-number,
4200 and add @symbol-number. In the nonterminal element, rename @number to
4201 @symbol-number. Discussed starting at
4202 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
4203 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
4204 renames.
4205 (xsl:template match="nonterminal"): Likewise.
4206 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
4207 (xsl:template match="nonterminal"): Likewise.
4208 * src/print-xml.c (print_grammar): Implement.
4209
4210 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4211
4212 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4213 2007-10-11 change, the child elements here are items not rules.
4214 (xsl:template match="item"): New.
4215 (xsl:template match="rule"): Update for new reduced itemset.
4216 (xsl:template match="point"): Remove.
4217 (xsl:template match="empty"): For consistency with --graph, don't
4218 output "/* empty */".
4219 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
4220 line-wrap, don't pass a negative value as first-line-length since this
4221 won't work with the following changes.
4222 (xsl:template name="line-wrap"): Simplify slightly.
4223 (xsl:template name="ws-search"): Eliminate recursion.
4224 * src/print_graph.c (print_core): Don't print a reduction's lookahead
4225 set next to an item whose dot is not at the end of the RHS even if it
4226 happens to be associated with the same rule.
4227
4228 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4229
4230 Add %define lr.keep_unreachable_states.
4231 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
4232 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
4233 * src/main.c (main): Implement it.
4234 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4235 Extend to test it, and fix a typo.
4236
4237 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4238
4239 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
4240 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
4241 the example .output text.
4242 * tests/regression.at (Extra lookahead sets in report): Improve wording
4243 of comments.
4244
4245 2007-10-17 Wojciech Polak <polak@gnu.org>
4246
4247 * src/print-xml.c (print_grammar): Renamed
4248 <terminal> and <nonterminal> attributes:
4249 "type" to "number" and "symbol" to "name".
4250 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
4251 Use new attribute names.
4252 (xsl:template match="nonterminal"): Likewise.
4253 * data/xslt/xml2xhtml.xsl: Likewise.
4254
4255 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
4256
4257 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
4258 (Option Cross Key): Likewise.
4259
4260 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
4261 next to an item whose dot is not at the end of the RHS even if it
4262 happens to be associated with the same rule.
4263 * src/print.c (print_core): Likewise.
4264 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4265 (Resolved SR Conflicts): Update output.
4266 * tests/regression.at (Extra lookahead sets in report): New test case.
4267
4268 2007-10-11 Wojciech Polak <polak@gnu.org>
4269
4270 * src/print-xml.c (print_core): Remove item set
4271 redundancy.
4272 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4273 Improve processing time. Suggested by Joel E. Denny.
4274 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4275 Write xsl:param "required" attribute as comment.
4276 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4277 (xsl:template match="rule"): Support new reduced itemset.
4278 (xsl:template match="point"): Remove.
4279 * data/xslt/xml2xhtml.xsl: Likewise.
4280
4281 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4282
4283 * src/getargs.c (version): Update copyright year.
4284
4285 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4286
4287 Make xml2dot.xsl and --graph produce the same output.
4288 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
4289 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4290 escaped later.
4291 (xsl:template name="output-node"): Use the new escape template instead
4292 of the string-replace template directly.
4293 (xsl:template name="output-edge"): Likewise.
4294 (xsl:template name="escape"): New, escapes backslashes and newlines in
4295 addition to quotation marks.
4296 * src/graphviz.c (start_graph, output_node, output_edge): Add
4297 whitespace to output for legibility.
4298
4299 Make xml2text.xsl and --report produce the same output, and remove the
4300 XML "conflicts" element since a conflict summary is easily extracted
4301 from the automaton.
4302 * data/xslt/bison.xsl: New.
4303 (xsl:template match="state" mode="bison:count-conflicts): New.
4304 * data/xslt/xml2text.xsl: Import bison.xsl.
4305 (xsl:template match="bison-xml-report"): Instead of styling the
4306 "conflicts" element, style the "automaton" element with mode
4307 "conflicts". Unlike the former, the latter lists S/R and R/R
4308 conflicts for a state on the same line.
4309 (xsl:template match="conflicts"): Remove.
4310 (xsl:template match="conflict"): Remove.
4311 (xsl:template match="terminal"): Line-wrap the list of rules in which
4312 the terminal is used.
4313 (xsl:template match="nonterminal"): Likewise for nonterminals.
4314 (xsl:template match="automaton" mode="conflicts"): New.
4315 (xsl:template match="state" mode="conflicts"): New.
4316 (xsl:template name="line-wrap"): New.
4317 (xsl:template name="ws-search"): New.
4318 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4319 (xsl:template match="bison-xml-report"): Instead of styling the
4320 "conflicts" element, style the "automaton" element with mode
4321 "conflicts."
4322 (xsl:template match="conflicts"): Remove.
4323 (xsl:template match="conflict"): Remove.
4324 (xsl:template match="automaton" mode="conflicts"): New.
4325 (xsl:template match="state" mode="conflicts): New.
4326 * src/conflicts.c (conflicts_output_xml): Remove.
4327 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4328 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4329 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4330 the corresponding XSLT is easier. Also, never wrap between a word and
4331 the comma that follows it.
4332
4333 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4334
4335 Improve C++ namespace support. Discussed starting at
4336 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4337 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4338 b4_namespace_close): New macros that interpret the %define variable
4339 "namespace" so its value can contain "::" to indicate nested
4340 namespaces.
4341 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4342 the above macros.
4343 * data/lalr1.cc (b4_namespace): Likewise.
4344 * data/location.cc (b4_namespace): Likewise.
4345 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4346 inside a new table in the general %define entry. Document `%define
4347 namespace' there as well. Point the %name-prefix entry to it since it
4348 explains it more completely in the case of C++.
4349 (C++ Bison Interface): Mention `%define namespace' instead of
4350 %name-prefix.
4351 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4352 entry suffices.
4353 * tests/c++.at (Relative namespace references): New test case.
4354 (Absolute namespace references): New test case.
4355 (Syntactically invalid namespace references): New test case.
4356 * tests/input.at (C++ namespace reference errors): New test case.
4357
4358 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4359
4360 Add syncline support and location accessor to internal %define
4361 interfaces.
4362 * data/bison.m4 (b4_percent_define_get_loc): New.
4363 (b4_percent_define_get_syncline): New.
4364 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4365 (b4_percent_define_default): Record defining location as line 1 rather
4366 than 0 for the sake of synchronizing #line's, and define
4367 b4_percent_define_syncline(VARIABLE).
4368 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4369 * src/muscle_tab.c (muscle_syncline_grow): New.
4370 (muscle_code_grow): Use muscle_syncline_grow.
4371 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4372 define b4_percent_define_syncline(VARIABLE).
4373 (muscle_percent_define_get_loc): New.
4374 (muscle_percent_define_get_syncline): New.
4375 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4376 remove some unused variables.
4377 (muscle_percent_define_default): Record defining location as line 1
4378 rather than 0 for the sake of synchronizing #line's, and define
4379 b4_percent_define_syncline(VARIABLE).
4380 (muscle_percent_define_check_values): Use
4381 muscle_percent_define_get_loc.
4382 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4383 (muscle_percent_define_get_syncline): Prototype.
4384 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4385 defaults): Update output for location change.
4386 (Complaining during macro argument expansion): Extend to test
4387 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4388
4389 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4390
4391 Fix some error-reporting macro bugs.
4392 * data/bison.m4 (b4_cat): New.
4393 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4394 to stdout so they don't become arguments to other macros. Update
4395 comments and add examples.
4396 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4397 add examples.
4398 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4399 after printing the error directive so that M4 doesn't report subsequent
4400 problems that are induced by this problem.
4401 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4402 instead of just in them. Recognize @\n in both places. Both expand to
4403 the empty string. Needed by b4_cat.
4404 * tests/skeletons.at (Complaining during macro argument expansion):
4405 New test case.
4406 (Fatal errors make M4 exit immediately): New test case.
4407
4408 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4409
4410 Implement --print-datadir.
4411 * src/getargs.c (usage): Mention.
4412 (PRINT_DATADIR_OPTION): New anonymous enum member.
4413 (long_options): Add entry for it.
4414 (getargs): Add case for it calling compute_pkgdatadir.
4415 * src/output.c (output_skeleton): Encapsulate data directory
4416 computation from here...
4417 (prepare): ... and from here...
4418 (compute_pkgdatadir): ... into this new function.
4419 * src/output.h (compute_pkgdatadir): Prototype.
4420
4421 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4422
4423 * src/print-xml.c (escape_bufs): New static global variable
4424 replacing...
4425 (xml_escape_n): ... the static local variable buf here.
4426 (print_xml): Free memory for escape_bufs.
4427 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4428
4429 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4430
4431 Replace `%push-parser' and `%push-pull-parser' with
4432 `%define push_pull "push"' and `%define push_pull "both"'.
4433 `%define push_pull "pull"' is the default.
4434 * doc/bison.texinfo (Push Decl, Push Parser Function,
4435 Pull Parser Function, Parser Create Function, Parser Delete Function):
4436 Update declarations.
4437 (Decl Summary, Table of Symbols): Replace %push-parser and
4438 %push-pull-parser entries with a %define push_pull entry.
4439 * data/bison.m4 (b4_percent_define_check_values): New macro.
4440 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4441 definitions...
4442 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4443 definitions...
4444 * data/push.c: ... to here and compute them from the value of the
4445 %define variable push_pull.
4446 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4447 parsing requests here...
4448 * data/yacc.c: ... hack this to switch to push.c any time
4449 b4_use_push_pull_flag or the %define variable push_pull is set. This
4450 will go away when we mv push.c yacc.c.
4451 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4452 push parsing is not supported since unused %define variables are
4453 reported anyway.
4454 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4455 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4456 comments for consistency with b4_percent_define_check_values.
4457 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4458 muscles.
4459 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4460 Remove.
4461 (prologue_declaration): Remove %push-parser and %push-pull-parser
4462 rules.
4463 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4464 * tests/calc.at: Update declarations.
4465 * tests/input.at (%define enum variables): New test case.
4466 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4467 declaration.
4468 (Push Parsing: Multiple impure instances): Update declaration.
4469 (Push Parsing: Unsupported Skeletons): New test case.
4470 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4471 declaration.
4472 (Exploding the Stack Size with Malloc): Update declaration.
4473
4474 2007-09-24 Wojciech Polak <polak@gnu.org>
4475
4476 Add XSLT transformations.
4477
4478 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4479 * data/xslt/xml2text.xsl: Transform XML into plain text.
4480 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4481 * data/Makefile.am (xsltdir): New variable.
4482 (dist_xslt_DATA): Add xslt/*.xsl files.
4483
4484 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4485
4486 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4487 Problem reported by Wojciech Polak.
4488 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4489 (xml_printf): Undo change I made on 21 September; that is,
4490 indent 2 spaces, not 1.
4491
4492 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4493
4494 Pacify ./configure --enable-gcc-warnings.
4495 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4496 `char const *' instead of `char *'.
4497 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4498 local variable `sep'.
4499
4500 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4501
4502 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4503 elsewhere.
4504 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4505 (xml_printf): Indent just 1 space for level.
4506 (e_char, xlate_char): Remove.
4507 (xml_escape_string): Rewrite to avoid undefined behavior (used
4508 storage that was freed from the stack).
4509 (xml_escape_n): Don't bother checking for subscript error.
4510
4511 2007-09-21 Wojciech Polak <polak@gnu.org>
4512
4513 Add Bison XML Automaton Report.
4514
4515 Add support for an -x option to generate an XML report.
4516 It is not documented yet.
4517 * src/print-xml.c: New file.
4518 * src/print-xml.h: Likewise.
4519 * lib/timevar.def (TV_XML): New var.
4520 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4521 * src/conflicts.c: Include print-xml.h.
4522 (solved_conflicts_xml_obstack): New var.
4523 (log_resolution, conflicts_solve, conflicts_free):
4524 Add support for XML report.
4525 (conflicts_output_val): New function.
4526 * src/conflicts.h (conflicts_output_val): New decl.
4527 * src/files.c (spec_xml_file): New var.
4528 (compute_output_file_names, output_file_names_free): Add XML support.
4529 * src/files.h (spec_xml_file): New decl.
4530 * src/getargs.c (xml_flag): New var.
4531 (usage, short_options, long_options, getargs): Add XML support.
4532 * src/getargs.h (xml_flag): New decl.
4533 * src/gram.c: Include print-xml.h.
4534 (rule_lhs_print_xml, rule_rhs_print_xml):
4535 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4536 New functions.
4537 * src/gram.h: Declare external ones.
4538 * src/main.c: Include print-xml.h.
4539 (main): Add XML support.
4540 * src/reduce.c: Include print-xml.h.
4541 (reduce_xml): New function.
4542 * src/reduce.h: Declare it.
4543 * src/state.c: Include print-xml.h.
4544 (state_new): Add XML support.
4545 (state_rule_lookahead_tokens_print_xml): New function.
4546 * src/state.h: Declare it.
4547 (struct state): New member solved_conflicts_xml.
4548 * src/symtab.c (symbol_class_get_string): New function.
4549 * src/symtab.h: Declare it.
4550
4551 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4552
4553 * GNUmakefile: Switch to coreutils's version.
4554 * bootstrap: Likewise.
4555 * Makefile.cfg: Adjust to new GNUmakefile.
4556 * README-hacking: Likewise.
4557
4558 Import from gnulib:
4559
4560 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4561 Bruno Haible <bruno@clisp.org>
4562
4563 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4564 and is a script that invokes bison. Tighten the code. Add comments.
4565
4566 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4567
4568 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4569 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4570 * doc/bison.texinfo (Decl Summary): Fix.
4571 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4572 * tests/input.at (Boolean %define variables): Update output.
4573 * tests/skeletons.at (%define boolean variables: invalid skeleton
4574 defaults): Rename to...
4575 (%define Boolean variables: invalid skeleton defaults): ... this and
4576 update output.
4577
4578 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4579
4580 In impure push mode, don't allow more than one yypstate to be allocated
4581 since multiple impure parsers would corrupt yynerrs.
4582 * data/push.c (yypstate_allocated): New static global variable
4583 initialized to 0.
4584 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4585 exhaustion if yypstate_allocated is 1, but still return 2.
4586 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4587 already 1. Otherwise, set it to 1.
4588 (yypstate_delete): Set it to 0.
4589 * tests/push.at (Push Parsing: Multiple impure instances): New test
4590 case.
4591
4592 2007-08-17 Bob Rossi <bob@brasko.net>
4593
4594 * doc/bison.texinfo (Push Decl): Document the push parser.
4595 (Table of Symbols): Ditto.
4596 (Pure Decl): Ditto.
4597 (Decl Summary): Ditto.
4598 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4599 Parser Create Function, Parser Delete Function):
4600 Add new push parser symbols.
4601 (Table of Symbols): Document push-parser, push-pull-parser,
4602 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4603
4604 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4605
4606 Update to GPLv3.
4607 * doc/gpl-3.0.texi: New file.
4608 * doc/gpl.texi: Remove.
4609 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4610 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4611 * README-hacking, TODO, bootstrap, bootstrap.conf:
4612 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4613 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4614 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4615 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4616 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4617 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4618 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4619 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4620 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4621 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4622 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4623 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4624 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4625 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4626 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4627 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4628 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4629 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4630 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4631 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4632 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4633 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4634 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4635 * src/complain.c, src/complain.h, src/conflicts.c:
4636 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4637 * src/files.h, src/flex-scanner.h, src/getargs.c:
4638 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4639 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4640 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4641 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4642 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4643 * src/print.c, src/print.h, src/print_graph.c:
4644 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4645 * src/reduce.h, src/relation.c, src/relation.h:
4646 * src/revision.h, src/scan-code.h, src/scan-code.l:
4647 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4648 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4649 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4650 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4651 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4652 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4653 * tests/existing.at, tests/glr-regression.at:
4654 * tests/headers.at, tests/input.at, tests/java.at:
4655 * tests/local.at, tests/output.at, tests/push.at:
4656 * tests/reduce.at, tests/regression.at, tests/sets.at:
4657 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4658 * tests/torture.at:
4659 Update to GPLv3.
4660
4661 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4662
4663 Get rid of broken %no-parser, -n, and --no-parser implementation and
4664 documentation.
4665 * TODO: Don't mention them.
4666 * doc/bison.1: Likewise.
4667 * doc/bison.texinfo (Decl Summary): Likewise.
4668 (Bison Options): Likewise.
4669 (Option Cross Key): Likewise.
4670 * src/getargs.c (no_parser_flag): Remove global variable.
4671 (usage): Don't print description of -n and --no-parser.
4672 (long_options): Remove --no-parser entry here.
4673 (getargs): Remove -n case in the switch here.
4674 * src/getargs.h (no_parser_flag): Remove extern.
4675 * tests/regression.at (Web2c Actions): Remove comment that mentions
4676 --no-parser.
4677
4678 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4679
4680 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4681 name user variables starting with `yy'. Just pass NULL instead of a
4682 dummy local &yylval to yypush_parse.
4683 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4684 starting with `yy'.
4685
4686 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4687
4688 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4689 true since it's then always used regardless of whether yyoverflow is
4690 defined. Reported by Christian Burger at
4691 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4692 * THANKS: Add Christian Burger.
4693
4694 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4695 node names: say "Decl Summary" not "Bison Declaration Summary".
4696
4697 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4698
4699 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4700 determine whether this function has already complained about an invalid
4701 value for a %define boolean variable, don't check whether Bison has
4702 ever examined the value. As written, the check was a tautology.
4703 Instead, record and check for this complaint using a separate muscle.
4704
4705 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4706
4707 Fix push parsing memory leak reported by Brandon Lucia at
4708 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4709 * THANKS: Add Brandon Lucia.
4710 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4711 but the parse never completed and thus freed it.
4712 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4713 * tests/testsuite.at: Include push.at.
4714 * test/push.at: New.
4715 (Push Parsing: Memory Leak for Early Deletion): New test case.
4716
4717 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4718
4719 Improve handling of multiple S/R conflicts in the same state and of S/R
4720 conflicts involving multiple reductions.
4721 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4722 set for a state here or Bison will abort if it is reassigned on a
4723 later conflicted reduction in the same state.
4724 Similarly, don't finalize and assign the solved conflicts report here
4725 or it will be lost if it is reassigned on a later conflicted reduction
4726 in the same state.
4727 (set_conflicts): Instead, assign them both here after all S/R conflicts
4728 in the state have been fully examined.
4729 * src/print.c (shift_set): Rename to...
4730 (no_reduce_set): ... this.
4731 (print_reductions): Update for rename, and add %nonassoc error action
4732 tokens to no_reduce_set so that, when printing the first remaining
4733 reduction on an error action token, the reduction is enclosed in
4734 brackets.
4735 (print_results): Update for rename.
4736 * tests/conflicts.at (Solved conflicts report for multiple reductions
4737 in a state): New test case.
4738 (%nonassoc error actions for multiple reductions in a state): New test
4739 case.
4740
4741 * src/main.c (main): Don't depend on C99 features.
4742
4743 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4744
4745 * build-aux/.cvsignore: Add compile.
4746 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4747 uniwidth.
4748
4749 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4750
4751 * bootstrap (slurp): Create target directories that don't exist.
4752 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4753
4754 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4755
4756 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4757 than item number.
4758 * closure.c (closure): Likewise.
4759 * state.h (reductions): Comment sorting of rules.
4760 (state): Comment sorting of items.
4761
4762 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4763
4764 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4765 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4766 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4767 definition in order to avoid Gnulib headers since we don't use config.h
4768 here.
4769 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4770 rather than AT_DATA so that config.h is included.
4771
4772 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4773
4774 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4775 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4776 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4777 and so that YYFPRINTF is guaranteed to be defined here.
4778
4779 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4780
4781 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4782 with...
4783 (muscle_percent_define_check_values): ... this more helpful function.
4784 Again, it's not used yet, but it will be.
4785 * src/muscle_tab.h: Likewise.
4786
4787 Improve some comments in parser table construction.
4788 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4789 (generate_states): Don't mention ruleset, which is internal to closure.
4790 * src/closure.c (closure): Explain sorting of core and itemset, which
4791 is required for this function to behave correctly.
4792 * src/closure.h (closure): Mention sorting.
4793
4794 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4795
4796 * src/lalr.c (state_lookahead_tokens_count): For code readability,
4797 move the check for disabled transitions to an aver since conflict
4798 resolution hasn't happened yet.
4799
4800 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
4801 labels a state as inconsistent just because it has error transitions.
4802 The original form of this check appeared in revision 1.1 of lalr.c,
4803 which was committed on 1991-12-21. Now (at least), changing the
4804 consistency label on such a state appears to have no useful effect in
4805 any of the places it is examined, which I enumerate below. The key
4806 point to understanding each item in this enumeration is that a state
4807 with an error transition is labelled consistent in the first place only
4808 if it has no rules, so the check cannot matter for states that have
4809 rules. (1) Labelling a state as inconsistent will cause set_conflicts
4810 to try to identify its conflicts, and a state must have *rules* to have
4811 conflicts. (2) Labelling a state as inconsistent will affect how
4812 action_row sets the default *rule* for the state. (3) Labelling a
4813 state as inconsistent will cause build_relations to add lookback edges
4814 to *rules* in that state.
4815 * src/state.h (struct state): Word the comment for member consistent
4816 more carefully.
4817
4818 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4819
4820 Don't depend on C99 features.
4821 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
4822 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
4823 * src/reader.c (check_and_convert_grammar): Fix for-loop.
4824 * src/state.c (state_mark_reachable_states): Fix for-loop.
4825 (state_remove_unreachable_states): Fix for-loop.
4826
4827 Don't widen struct state with member reachable just to temporarily
4828 record reachability. Instead, use a local bitset.
4829 * src/state.h (struct state): Remove member.
4830 * src/state.c (state_new): Don't initialize it.
4831 (state_mark_reachable_states): Rename to...
4832 (state_record_reachable_states): ... this, and use bitset.
4833 (state_remove_unreachable_states): Use bitset.
4834
4835 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
4836
4837 * src/Makefile.am (yacc): Quote target action commands properly so
4838 that the yacc script isn't corrupt. Reported by Hans Aberg at
4839 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
4840
4841 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
4842 the case of pure parsers. Reported by Frans Englich at
4843 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
4844 * THANKS: Add Frans Englich.
4845
4846 * NEWS (2.3a+): In the %code entry, reference section `Bison
4847 Declaration Summary' from the manual now since the %code summary has
4848 moved there.
4849 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
4850 in the rules section must be terminated by semicolons.
4851
4852 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
4853
4854 Extend the front-end API for %define variables to more completely
4855 mirror the back-end. This will be useful in the future.
4856 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
4857 Update comments to mention the new front-end counterparts of these
4858 macros.
4859 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
4860 for muscle_string_decode and muscle_location_decode.
4861 (muscle_string_decode): New static function.
4862 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
4863 (muscle_percent_define_get, muscle_percent_define_ifdef): New
4864 functions.
4865 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
4866 muscle_percent_define_get to mimic the b4_percent_define_flag_if
4867 implementation more closely.
4868 (muscle_percent_define_invalid_value): New function.
4869 * src/muscle_tab.h (muscle_percent_define_get,
4870 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
4871 Prototype.
4872
4873 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4874
4875 * NEWS (2.3a+): Mention yesterday's state-removal change.
4876 (2.3a): Remove the %language entry, which was added after 2.3a.
4877 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
4878 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
4879 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
4880 tests/existing.at: Update copyright date.
4881
4882 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4883
4884 If conflict resolution makes states unreachable, remove those states,
4885 report rules that are then unused, and don't report conflicts in those
4886 states.
4887 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
4888 New global function.
4889 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
4890 function.
4891 * src/main.c (main): After conflict resolution, remove the unreachable
4892 states and update all data structures that reference states by number.
4893 * src/state.c (state_new): Initialize each state's reachable member to
4894 false.
4895 (state_mark_reachable_states): New static function.
4896 (state_remove_unreachable_states): New global function.
4897 * src/state.h (struct state): Add member bool reachable.
4898 (state_remove_unreachable_states): Prototype.
4899 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4900 New test case.
4901 * tests/existing.at (GNU pic Grammar): Update test case output now that
4902 an unused rule is discovered.
4903
4904 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4905
4906 Minor code cleanup in parser table construction.
4907 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
4908 (new_itemsets, save_reductions): Update for rename to nitemset.
4909 * src/closure.c (nritemset): Rename to...
4910 (nitemset): ... this since the "r" appears to meaningless and isn't
4911 used in the comments.
4912 (closure): Update for rename.
4913 * src/closure.h (nritemset): Update extern to...
4914 (nitemset): ... this.
4915 * src/lalr.c (LA): Fix a typo in comments.
4916 * src/print.c (print_core): Update for rename to nitemset.
4917 * src/print_graph.c (print_graph): Likewise.
4918 * src/state.h: Fix some typos in header comments.
4919
4920 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
4921
4922 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
4923 still sticks to ASCII. Sorry!
4924
4925 * README-hacking: New file, taken mostly from coreutils, with changes
4926 for Bison. Contains much of the contents of:
4927 * README-cvs: Remove.
4928 * bootstrap: Sync from gnulib.
4929 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
4930 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
4931
4932 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
4933
4934 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
4935 Setzer.
4936 (Java Differences): Fix some typos.
4937 * THANKS: Add Sebastian Setzer.
4938
4939 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
4940
4941 * data/java.m4 (b4_single_class_if): Remove.
4942 (b4_abstract_if): Look at "%define abstract".
4943 (b4_lexer_if): New.
4944 (b4_union_name): Rename...
4945 (b4_yystype): ... to this. Map to "%define stype".
4946 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
4947 b4_maybe_throws): Fix quoting.
4948 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
4949 * data/lalr1.java (Lexer interface): Always define.
4950 (Lexer interface within parser class): Remove.
4951 (YYLexer class): New, used when "%code lexer" is present.
4952 (constructor): When "%code lexer" is used, pass %lex-param
4953 to the lexer constructor.
4954 (yylex, yyparse): Remove %lex-param from method invocations
4955 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
4956
4957 * doc/bison.texinfo (Java Bison Interface): Mention "%define
4958 abstract". Rename "%define union_name" to "%define stype".
4959 Rename method names according to previous patch.
4960 (Java Scanner Interface): Describe "%code lexer" instead of
4961 "%pure-parser" and "%define single_class".
4962 (Java Differences): Mention "%code lexer".
4963
4964 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
4965 Include scanner here, using macros from tests/local.at.
4966 (AT_DATA_CALC_Y): Remove final argument.
4967 (_AT_CHECK_JAVA_CALC): Likewise.
4968 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
4969 of %locations and %error-verbose.
4970 (main): Test with and without %lex-param.
4971 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
4972 (AT_BISON_OPTION_POPDEFS): Pop it.
4973
4974 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4975
4976 DJGPP spefic issue. Inhibit the use of disallowed characters for
4977 file name genertion on Win98, WinXP, etc. These are |<>":?*\
4978 and concern testsuite case 46.
4979 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
4980 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
4981 * djgpp/config.bat: Inhibit the use of disallowed characters.
4982
4983 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4984
4985 Miscellaneous %define and %code cleanup.
4986 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
4987 values are interpreted.
4988 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
4989 documentation a little more.
4990 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
4991 muscle_percent_define_insert, muscle_percent_code_grow): New
4992 functions/macros.
4993 * src/muscle_tab.h (muscle_percent_define_insert,
4994 muscle_percent_code_grow): Prototype.
4995 * src/parse-gram.y (prologue_declaration): Use
4996 muscle_percent_define_insert and muscle_percent_code_grow when parsing
4997 %define and %code directives.
4998
4999 Make it easy to share %define boolean variables between the front-end
5000 and back-end. Though not used yet, this will be useful in the future.
5001 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
5002 Bison uses of names rather than just skeleton uses of names.
5003 (b4_percent_define_get, b4_percent_define_ifdef): Rename
5004 b4_percent_define_skeleton_variables(VARIABLE) to
5005 b4_percent_define_bison_variables(VARIABLE).
5006 (b4_percent_code_get, b4_percent_code_ifdef): Rename
5007 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
5008 b4_percent_code_bison_qualifiers(QUALIFIER).
5009 (b4_check_user_names_wrap): Update for renames.
5010 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
5011 muscle_percent_define_default): New functions mimicking
5012 b4_percent_define_flag_if and b4_percent_define_default.
5013
5014 For %define variables, report locations for invalid values and
5015 redefinitions.
5016 * data/bison.m4 (b4_percent_define_flag_if): Read
5017 b4_percent_define_loc(VARIABLE) to report the location of an invalid
5018 value for VARIABLE.
5019 (b4_percent_define_default): Save a special location in
5020 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
5021 must later be reported as invalid.
5022 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
5023 functions.
5024 (muscle_percent_define_insert): Record the location of VARIABLE in
5025 muscle percent_define_loc(VARIABLE), and use it to report the previous
5026 location for a redefinition.
5027 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
5028 (muscle_percent_define_default): Update like b4_percent_define_default.
5029 (muscle_grow_user_name_list): Rename to...
5030 (muscle_user_name_list_grow): ... this for consistency and use
5031 muscle_location_grow.
5032 * src/muscle_tab.h (muscle_location_grow): Prototype.
5033 * tests/input.at (%define errors): Update expected output.
5034 * tests/skeletons.at (%define boolean variables: invalid skeleton
5035 defaults): New test case.
5036
5037 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5038
5039 * src/print.c (lookahead_set, state_default_rule): Remove.
5040 (print_reductions): Replace state_default_rule invocation with
5041 equivalent use of yydefact, which was computed in token_actions in
5042 tables.c.
5043 (print_results): Don't allocate lookahead_set.
5044
5045 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
5046
5047 * data/lalr1.java: Prefix all private members with yy.
5048
5049 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5050
5051 Use YYFPRINTF instead of fprintf where appropriate. Reported by
5052 Sebastien Fricker at
5053 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
5054 * THANKS: Add Sebastien Fricker.
5055 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5056 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5057 accept a variable number of arguments.
5058
5059 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5060
5061 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5062
5063 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5064
5065 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5066 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5067 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5068
5069 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5070
5071 Undo my 2007-02-07 change, switching back to the c-strcase module
5072 introduced in the 2007-02-03 change. Bruno Haible reported that
5073 the 2007-02-07 change would be dangerous in Turkish if we add a
5074 language whose name contains "i", since "i" is not lowercase "I"
5075 in Turkish.
5076 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5077 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5078 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5079 * m4/.cvsignore: Remove strcase.m4.
5080 * src/getargs.c: Revert 2007-02-07 change, as follows.
5081 Include c-strcase.h.
5082 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5083
5084 2007-02-11 Bruno Haible <bruno@clisp.org>
5085
5086 Enable the Java related testsuite tests when the only Java compiler
5087 found is a gcj < 4.3. Discussed at
5088 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5089 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5090
5091 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5092
5093 * data/Makefile.am: Update copyright date.
5094 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5095 yypstate_new returns NULL.
5096 (yypstate_new): Return NULL if malloc does.
5097 * src/reader.c (packgram): Move translation of rule actions from the
5098 beginning of packgram to...
5099 (check_and_convert_grammar): ... here right before packgram is invoked
5100 so it's easier to write more complete comments, and remove redundant
5101 code.
5102
5103 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5104
5105 As in semantic actions, make @$ in %initial-action, %destructor, and
5106 %printer imply %locations.
5107 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5108 scanning @$.
5109 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5110 (@$ in %initial-action implies %locations,
5111 @$ in %destructor implies %locations,
5112 @$ in %printer implies %locations): ... these new test cases.
5113
5114 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
5115
5116 Undo most of the 2007-02-03 change, switching to the strcase module
5117 now that gnulib strcase has been fixed.
5118 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
5119 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
5120 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
5121 * m4/.cvsignore: Add strcase.m4.
5122 * src/getargs.c: Revert 2007-02-03 change, as follows.
5123 Don't include c-strcase.h.
5124 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
5125 strcasecmp has "unspecified behavior" outside the POSIX locale,
5126 but it works fine in practice if at least one argument is ASCII,
5127 as is the case in Bison.
5128
5129 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
5130
5131 * tests/java.at: Skip tests if only one of javac/java is present.
5132 Reported by Joel E. Denny.
5133 * tests/atlocal.in: Adjust copyright years.
5134
5135 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
5136
5137 * data/lalr1.java (Stack): Work around old verifiers that disallow
5138 access to the private fields of an inner class, from the outer class.
5139 We can make Stack's fields public because user code doesn't have access
5140 to the instance of Stack used by parse(). Reported by Paul Eggert.
5141
5142 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
5143
5144 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
5145 the right spot for these files?
5146 * bootstrap.conf (gnulib_modules): Add c-strcase.
5147 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
5148 c-strncasecmp.c.
5149 * src/getargs.c: Include c-strcase.h.
5150 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
5151 to avoid unspecified behavior.
5152
5153 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
5154
5155 * doc/bison.texinfo (Decl Summary): Correct typo.
5156
5157 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
5158
5159 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
5160 Complain if the value does not match empty, "true" or "false".
5161 * data/c++.m4: Adjust default definitions of %define variables.
5162 * data/java.m4: Adjust default definitions of %define variables.
5163 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
5164 to above behavior.
5165 * tests/input.at (Boolean %define variables): Test new behavior.
5166
5167 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
5168
5169 * NEWS: Mention java.
5170 * TODO: Remove things that are done.
5171 * bootstrap.conf: Add javacomp-script and javaexec-script.
5172 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
5173
5174 * data/Makefile.am: Add new files.
5175 * data/java-skel.m4: New.
5176 * data/java.m4: New.
5177 * data/lalr1.java: New.
5178
5179 * doc/bison.texinfo: Put "A Complete C++ Example" under
5180 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
5181 under Other Languages.
5182
5183 * src/getargs.c (valid_languages): Add Java.
5184 * src/getargs.h (struct bison_language): Update size of string fields.
5185
5186 * tests/Makefile.am: Add java.at.
5187 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
5188 * tests/java.at: New.
5189 * tests/testsuite.at: Include it.
5190
5191 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
5192
5193 Clean up.
5194 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
5195 at_directive_argv arguments so these no longer have to be global
5196 variables. Also, update the implementation for the following changes.
5197 (fail_for_at_directive_too_many_args,
5198 fail_for_at_directive_too_few_args): Add at_directive_name argument.
5199 (at_directive_name): Remove as at_directive_argv[0] will be used for
5200 this now.
5201 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
5202 for the directive name.
5203 (at_directive_argc, at_directive_argv): Make these local within
5204 skel_lex instead of global.
5205 (INITIAL): Update directive start action for above changes.
5206 (SC_AT_DIRECTIVE_ARG): Rename to...
5207 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
5208 (SC_AT_DIRECTIVE_SKIP_WS): Update.
5209 (scan_skel): Move yylex_destroy to...
5210 (skel_scanner_free): ... here.
5211 * tests/skeletons.at (installed skeleton file name): Rename to...
5212 (installed skeleton file names): ... this.
5213
5214 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
5215
5216 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5217 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
5218 Summary" not "Directives".
5219 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
5220 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
5221 since the former is now the more complete one.
5222 (Prologue Alternatives): Likewise and do the same for %defines.
5223 (Table of Symbols): Add summary of %code, add summary of %define, and
5224 move full %code documentation to...
5225 (Decl Summary): ... here for consistency with other entries in these
5226 sections.
5227 Move %define entry in order to keep this list alphabetized.
5228 Reword %define entry a little to put less emphasis on the skeleton
5229 concept, which most users shouldn't have to think about.
5230
5231 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
5232
5233 Adjust to recent gnulib changes.
5234 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
5235 Add string.h, string_.h, unistd_.h, wchar_.h.
5236 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
5237 * src/system.h: Don't include <stpcpy.h>; this is now done by
5238 <string.h>.
5239
5240 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
5241
5242 Simplify implementation of unqualified %code, implement macros for
5243 uniform treatment of boolean %define flags. Document %define.
5244 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
5245 b4_percent_code_ifdef): New.
5246 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
5247 * data/c++.m4: Define default value for global_tokens_and_yystype.
5248 * data/glr.cc: Likewise.
5249 * data/location.cc: Use b4_percent_define_flag_if.
5250
5251 * doc/bison.texinfo (Decl Summary): Document %define.
5252
5253 * src/parse-gram.y (Unqualified %code): Change muscle name to
5254 b4_percent_code().
5255 (content.opt): Default to empty.
5256
5257 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5258
5259 Implement support for relative and absolute skeleton file names.
5260 Discussed starting at
5261 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5262 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5263 (Bison Options): Document in --skeleton entry.
5264 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5265 full_skeleton can't necessarily hold all of pkgdatadir.
5266 If the specified skeleton file name contains a `/', don't prepend
5267 pkgdatadir.
5268 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5269 file name contains a `/', prepend the grammar file directory.
5270 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5271 * skeletons.at: New file.
5272 (relative skeleton file names): New test case.
5273 (installed skeleton file names): New test case.
5274 * tests/testsuite.at: Include skeletons.at.
5275
5276 * bootstrap: Update copyright to 2007.
5277
5278 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
5279
5280 * bootstrap: Remove occurrences of .#bootmp from the files.
5281
5282 2007-01-17 Akim Demaille <akim@epita.fr>
5283
5284 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5285 nonterminals.
5286 Use per-type %printer.
5287
5288 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5289
5290 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5291 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5292 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5293 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5294 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5295 tests/glr-regression.at, tests/input.at, tests/local.at,
5296 tests/output.at, tests/torture.at: Update copyright to 2007.
5297
5298 2007-01-16 Akim Demaille <akim@epita.fr>
5299
5300 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5301 error code.
5302 (Calc++ Scanner): Exit with failure if we can't open the input
5303 file.
5304 Accept "-" standing for stdin.
5305 (Calc++ Top Level): Print the result only if the parsing was
5306 successful.
5307
5308 2007-01-16 Akim Demaille <akim@epita.fr>
5309
5310 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5311
5312 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
5313 and Joel E. Denny <jdenny@ces.clemson.edu>
5314
5315 Clean up %define and %code implementation in M4 some. Most
5316 importantly, rename all related macros to be in the b4_percent_define
5317 and b4_percent_code namespaces. Also, complete support for `.' in
5318 %define variable names and %code qualifiers.
5319 * data/bison.m4 (b4_check_user_names): Check for special
5320 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5321 m4_foreach loops.
5322 (b4_get_percent_define, b4_get_percent_code): Rename to...
5323 (b4_percent_define_get, b4_percent_code_get): ... these.
5324 Extend documentation with examples.
5325 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5326 b4_percent_define_skeleton_variables and
5327 b4_percent_code_skeleton_qualifiers.
5328 Expect any value for the %define variable `foo' to be stored in the
5329 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5330 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5331 expect any unqualified %code blocks to be stored in a macro named
5332 `b4_percent_code_unqualified'.
5333 Use m4_indir so that %define variable names and %code qualifiers can
5334 contain `.', which is allowed by the grammar parser.
5335 (b4_percent_define_default): New macro to set a default value for a
5336 %define variable.
5337 (m4_wrap): Update wrapped code, and fix some underquoting.
5338 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5339 Expect grammar uses of %define variables and %code qualifiers to be
5340 defined in b4_percent_define_user_variables and
5341 b4_percent_code_user_qualifiers.
5342 * data/c++.m4: Use b4_percent_define_default rather than
5343 m4_define_default. Fix some underquoting. Skeleton usage of %define
5344 variable define_location_comparison now implies skeleton usage of
5345 %define variable filename_type.
5346 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5347 data/push.c, data/yacc.c: Update macro names.
5348 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5349 muscle names.
5350
5351 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5352
5353 DJGPP specific issues.
5354
5355 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5356 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5357
5358 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5359
5360 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5361 run parsers in all tests so that Valgrind is invoked during
5362 maintainer-check-valgrind.
5363 (Duplicate representation of merged trees): Free all semantic values.
5364 (Duplicated user destructor for lookahead): Likewise.
5365
5366 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5367
5368 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5369 command-line prefix.
5370 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5371 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5372 miss Valgrind messages.
5373 (Exploding the Stack Size with Malloc): Likewise.
5374
5375 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5376
5377 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5378 locals. Reported by Juan Manuel Guerrero at
5379 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5380 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5381 Fix some indentation also.
5382 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5383 explaining this issue.
5384
5385 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
5386 and Joel E. Denny <jdenny@ces.clemson.edu>
5387
5388 Simplify union and prologue handling, and escape union and lex/parse
5389 params with digraphs.
5390 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5391 values to the empty string since these are no longer guaranteed
5392 initialized by the front-end.
5393 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5394 braces around b4_user_stype since this is no longer done by the
5395 front-end.
5396 * src/files.c, src/files.h (pre_prologue_obstack,
5397 post_prologue_obstack): Remove.
5398 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5399 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5400 with digraphs. This fixes lex params and parse params.
5401 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5402 * src/output.c (prepare): Remove muscle insertion of the prologues.
5403 (output): Remove freeing of pre_prologue_obstack and
5404 post_prologue_obstack.
5405 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5406 than prologue_augment for prologue parsing so you don't need prologue
5407 obstacks.
5408 (grammar_declaration): For %union RHS, use `braceless' instead of
5409 "{...}" so that braces are already stripped and code is escaped with
5410 digraphs.
5411 * src/reader.c (prologue_augment): Remove.
5412 (reader): Remove initialization of pre_prologue_obstack and
5413 post_prologue_obstack.
5414 * src/reader.h (prologue_augment): Remove.
5415
5416 * data/c.m4: Remove stray parenthesis.
5417
5418 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5419
5420 Remove quotes from variables names in %define directives and from
5421 qualifiers in %code directives, and restrict the characters that are
5422 allowed in them to M4-friendly ones. For %define, continue to support
5423 the quoted form as a deprecated feature. Discussed starting at
5424 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5425 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5426 %code.
5427 * doc/bison.texinfo (Prologue Alternatives): Update.
5428 (Decl Summary): In %defines entry, update mention of `%code requires'
5429 and `%code provides'.
5430 (C++ Location Values): Update %define uses.
5431 (Calc++ Parser Interface): Likewise.
5432 (Calc++ Parser): Likewise, and update `%code requires' uses.
5433 (Table of Symbols): Update %code documentation.
5434 * src/parse-gram.y (prologue_declaration): For %define variables, use
5435 `variable' instead of `STRING'.
5436 (grammar_declaration): For %code qualifiers, use `ID' instead of
5437 `STRING'.
5438 (variable): New nonterminal that takes an `ID' or a `STRING'.
5439 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5440 and %define uses.
5441 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5442 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5443 (%define errors): Update %define uses.
5444
5445 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5446
5447 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5448 instead of muscle_insert for %define values so that M4-special
5449 characters are replaced with digraphs.
5450 * tests/input.at (%define errors): Extend to check weird values.
5451
5452 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5453
5454 Instead of having skeletons declare all valid %define variables and
5455 %code qualifiers, provide macros that retrieve the associated values
5456 and build these lists automatically. Thus Bison will now warn when a
5457 variable or qualifier is not used by the skeleton in the current
5458 invocation regardless of whether it might sometimes be used by that
5459 skeleton in other invocations. Also, move all %define value macros to
5460 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5461 form, which is replaced by %code.
5462 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5463 (b4_check_user_names): ... this, and change the series of valid name
5464 arguments to a single list argument for names used in the skeleton
5465 similar to the existing list argument for names used in the grammar.
5466 Warn instead of complaining.
5467 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5468 values and %code code, to format %code code properly, and to build
5469 lists of all %define variables and %code qualifiers used in the
5470 skeleton: b4_skeleton_percent_define_variables and
5471 b4_skeleton_percent_code_qualifiers.
5472 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5473 Remove, and...
5474 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5475 the skeleton names lists can finish building first. In place of
5476 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5477 expect the lists b4_user_percent_define_variables and
5478 b4_user_percent_code_qualifiers.
5479 * data/c++.m4: Where setting default values for b4_parser_class_name,
5480 b4_location_type, b4_filename_type, b4_namespace, and
5481 b4_define_location_comparison, update their names to the
5482 b4_percent_define_ namespace.
5483 * data/glr.c: Don't use b4_check_percent_define_variables and
5484 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5485 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5486 (b4_parser_class_name, b4_namespace): Define these using
5487 b4_get_percent_define for parser_class_name and namespace.
5488 * data/location.cc: Use b4_get_percent_define.
5489 * data/push.c: Don't use b4_check_percent_define_variables and
5490 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5491 * data/yacc.c: Likewise, and don't call m4_exit in
5492 b4_use_push_for_pull_if or m4_wrap code will never execute.
5493 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5494 Rename to...
5495 (muscle_grow_user_name_list): ... this for consistency with the
5496 terminology used in bison.m4.
5497 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5498 %define variable names, and rename muscle used_percent_define_variables
5499 to user_percent_define_variables.
5500 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5501 user_percent_code_qualifiers.
5502 (content): Remove.
5503 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5504 {CODE} form is no longer accepted.
5505 * tests/input.at (Reject bad %code qualifiers): Rename to...
5506 (Reject unused %code qualifiers): ... this, and update test output.
5507 (%define error): Update test output.
5508
5509 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5510
5511 Check for unrecognized %define variables similar to checking for
5512 unrecognized %code qualifiers. Check for redefined %define variables.
5513 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5514 generalizes...
5515 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5516 (b4_check_percent_define_variables): New, also wraps it.
5517 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5518 variables using b4_check_percent_define_variables.
5519 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5520 all those exercised in the test suite and all those listed in the
5521 `Default values' section of c++.m4. Are there others?
5522 * data/push.c, data/yacc.c: Declare no valid %define variables.
5523 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5524 similar to muscle_find, but it works even when the muscle stores a
5525 const value.
5526 (muscle_grow_used_name_list): New function for constructing the used
5527 name list muscles that b4_check_for_unrecognized_names requires.
5528 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5529 %define'd more than once. Define the b4_used_percent_define_variables
5530 muscle with muscle_grow_used_name_list.
5531 (grammar_declaration): Abbreviate %code code with
5532 muscle_grow_used_name_list.
5533 * tests/input.at (%define errors): New.
5534
5535 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5536
5537 Provide warn_at, complain_at, and fatal_at function callbacks to the
5538 skeletons, and use this for %code qualifier complaints.
5539 * data/bison.m4 (b4_error_at): New, invoked by...
5540 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5541 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5542 @fatal_at(...@) directives.
5543 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5544 qualifiers in b4_used_percent_code_qualifiers and to use
5545 b4_complain_at.
5546 * src/location.c, src/location.h (boundary_set_from_string): New global
5547 function.
5548 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5549 function.
5550 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5551 to b4_used_percent_code_qualifiers.
5552 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5553 function.
5554 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5555 (lineno): Rename to...
5556 (out_lineno): ... this so I don't misunderstand it again.
5557 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5558 here; these newlines are in the input but not the output file.
5559 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5560 (at_directive_perform): ... this new static function, and add handling
5561 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5562 directives.
5563 * tests/input.at (Reject bad %code qualifiers): Update test output with
5564 locations and extend.
5565
5566 * tests/output.at (Output file name: [, Output file name: ]): Remove
5567 bogus comment about these tests failing.
5568
5569 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5570
5571 Clean up b4_check_percent_code_qualifiers a little.
5572 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5573 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5574 documentation and add examples.
5575 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5576 qualifiers here.
5577
5578 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5579
5580 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5581 unreliable -- especially when they're hidden inside another macro.
5582 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5583 data/c.m4: Remove m4_divert(-1).
5584 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5585 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5586 m4_divert_push(0) and m4_divert_pop(0).
5587 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
5588 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5589 pushed and popped by m4sugar, should be first on the stack.
5590
5591 Provide warn, complain, and fatal function callbacks to the skeletons.
5592 This provides more flexibility than m4_fatal, improves the error
5593 message format, and captures messages for translation. Discussed
5594 starting at
5595 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5596 * data/bison.m4 (b4_error): New, invoked by...
5597 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5598 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5599 directives. Because these M4 macros might be called when the current
5600 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5601 the previous removal of uses of m4_divert, which caused trouble.
5602 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5603 m4_fatal to report unrecognized %code qualifiers.
5604 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5605 push parser requests.
5606 * data/glr.c: Use b4_complain instead of m4_fatal to report
5607 non-deterministic push parser requests.
5608 Update @output usage to @output(...@) form.
5609 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5610 report missing %defines. Update @output usage to @output(...@) form.
5611 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5612 @output(...@) form.
5613 * src/main.c (main): Invoke skel_scanner_free.
5614 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5615 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5616 obstack_for_string from flex-scanner.h.
5617 (YY_DECL): Use to declare skel_lex static.
5618 (decode_at_digraphs): Remove; now handled in the new
5619 SC_AT_DIRECTIVE_ARG start condition.
5620 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5621 functions.
5622 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5623 at_directive_argv): New static globals.
5624 (INITIAL): Use fail_for_invalid_at.
5625 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5626 recognize the start of a generalized `@directive(...@)' form and
5627 start...
5628 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5629 directive args (using the new obstack_for_string), to decode the
5630 contained @ diagraphs, and to perform the directive. It recognizes
5631 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5632 @output(...@).
5633 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5634 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5635 `@,'.
5636 (scan_skel): Initialize obstack_for_string on the first call.
5637 (skel_scanner_free): New function to free obstack_for_string.
5638 * tests/input.at (Reject bad %code qualifiers): Update test output.
5639
5640 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5641
5642 Consolidate the 4 prologue alternative directives (%code, %requires,
5643 %provides, and %code-top) into a single %code directive with an
5644 optional qualifier field. Discussed at
5645 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5646 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5647 alternatives.
5648 * doc/bison.texinfo (Prologue Alternatives): Update.
5649 (Decl Summary): Update to %code "requires" and %code "provides".
5650 (Calc++ Parser): Update to %code "requires".
5651 (Table of Symbols): Remove entries for %requires, %provides, and
5652 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5653 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5654 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5655 which are skeleton-specific.
5656 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5657 declare what %code qualifiers it supports and to complain if any other
5658 qualifiers were used in the grammar.
5659 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5660 and b4_user_code([b4_percent_code_provides]) in place of
5661 b4_user_requires and b4_user_provides.
5662 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5663 Add b4_user_code([b4_percent_code_top]) and
5664 b4_user_code([b4_percent_code]).
5665 Invoke b4_check_percent_code_qualifiers.
5666 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5667 PERCENT_REQUIRES): Remove.
5668 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5669 %requires. Rewrite the %code RHS as the unqualified form defining the
5670 muscle b4_percent_code. Add another RHS for the qualified %code form,
5671 which defines muscles of the form b4_percent_code_QUALIFIER and the
5672 b4_used_percent_code_qualifiers muscle.
5673 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5674 PERCENT_REQUIRES): Remove.
5675 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5676 %code "requires" and %code "provides".
5677 * tests/input.at (Reject bad %code qualifiers): New.
5678
5679 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5680
5681 Use the new code_props interface for destructors and printers.
5682 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5683 printer_location members, and change the type of the destructor and
5684 printer members to code_props.
5685 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5686 symbol_printer_get, semantic_type_destructor_set,
5687 semantic_type_printer_set, default_tagged_destructor_set,
5688 default_tagless_destructor_set, default_tagged_printer_set,
5689 default_tagless_printer_set): Use code_props in arguments and return
5690 types in place of char const * and location.
5691 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5692 since the locations are now contained in the return of
5693 symbol_destructor_get and symbol_printer_get.
5694 * src/output.c (symbol_destructors_output, symbol_printers_output):
5695 Replace with...
5696 (symbol_code_props_output): ... this to eliminate duplicate code.
5697 (output_skeleton): Update to use symbol_code_props_output.
5698 * src/reader.c (symbol_should_be_used): Update use of
5699 symbol_destructor_get.
5700 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5701 Update uses of the various _destructor_set and _printer_set functions.
5702 * src/symtab.c: (default_tagged_destructor_location,
5703 default_tagless_destructor_location, default_tagged_printer_location,
5704 default_tagless_printer_location): Remove since we...
5705 (default_tagged_destructor, default_tagless_destructor,
5706 default_tagged_printer, default_tagless_printer): ... change the type
5707 of these to code_props.
5708 (symbol_new, semantic_type_new, symbol_destructor_set,
5709 semantic_type_destructor_set, symbol_destructor_get,
5710 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5711 symbol_check_alias_consistency, default_tagged_destructor_set,
5712 default_tagless_destructor_set, default_tagged_printer_set,
5713 default_tagless_printer_set): Update.
5714 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5715 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5716 code_props members.
5717 (symbol_print): Use SYMBOL_CODE_PRINT.
5718
5719 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5720
5721 Use the new code_props interface for rule actions.
5722 * src/symlist.h (symbol_list): Replace action, action_location, and
5723 used members with a code_props action_props member.
5724 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5725 grammar_midrule_action, grammar_current_rule_merge_set,
5726 grammar_current_rule_symbol_append, packgram): Update.
5727 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5728 * src/scan-code.l (handle_action_dollar): Update.
5729 (translate_rule_action): Remove, no longer used.
5730 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5731
5732 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5733
5734 Use the new code_props interface in parse-gram.y.
5735 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5736 Update all uses of translate_* functions to use the new code_props
5737 interface and to use gram_scanner_last_string_free and
5738 code_scanner_last_string_free where possible.
5739 (grammar_declaration): symbol_list_destructor_set and
5740 symbol_list_printer_set now perform the translation, so don't do it
5741 here. Use gram_scanner_last_string_free where possible.
5742 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5743 translate_code): Remove, no longer used.
5744 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5745 symbol_list_printer_set): Perform code translation here rather than
5746 depending on the caller to do so.
5747
5748 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5749 * src/scan-gram.h (gram_last_string): Remove declaration.
5750 * src/scan-gram.l (last_string): Declare it static.
5751
5752 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5753
5754 Encapsulate code properties and related functionality for the various
5755 destructors, printers, and actions into a code_props structure and
5756 interface. This patch merely implements code_props in scan-code.h and
5757 scan-code.l. Future patches will rewrite other modules to use it.
5758 Discussed starting at
5759 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5760 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5761 consistently initialize const structs that have an empty location
5762 field.
5763 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5764 to ensure consistency.
5765 * src/scan-code.h (code_props): New structure.
5766 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5767 function, macro, and const global variable for initializing a
5768 code_props with no code.
5769 (code_props_plain_init, code_props_symbol_action_init,
5770 code_props_rule_action_init, code_props_translate_code): The rest of
5771 the new code_props functional interface. Among other things, the init
5772 functions set the code_props kind field so that
5773 code_props_translate_code will know whether to behave like
5774 translate_symbol_action, translate_rule_action, or translate_code.
5775 These old translate functions must remain until all other modules are
5776 updated to use the new code_props interface.
5777 (code_scanner_last_string_free): New function similar to
5778 gram_scanner_last_string_free.
5779 (code_scanner_free): Add documentation.
5780 * src/scan-code.l: Implement the new interface.
5781 (code_lex): Make it static, add a code_props* argument, and remove the
5782 rule argument.
5783 (last_string): New static global similar to the one in scan-gram.l.
5784 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5785 instead of rule.
5786 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5787 code_props since Bison may one day use this information for destructors
5788 and printers.
5789 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5790 (handle_action_dollar): Use symbol_list_n_get and set used flag
5791 directly since symbol_list_n_used_set is removed.
5792 (translate_action): Add a code_props* argument and remove the rule,
5793 action, and location arguments. Pass the code_props* on to code_lex.
5794 (translate_rule_action, translate_symbol_action, translate_code):
5795 Rewrite as wrappers around the new code_props interface.
5796 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
5797 it would eventually need to break the encapsulation of code_props.
5798
5799 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5800
5801 * etc/.cvsignore: New.
5802
5803 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
5804
5805 Add maintainer-push-check to run maintainer-check using push parsing in
5806 place of pull parsing where available.
5807 * Makefile.am (maintainer-push-check): New.
5808 * data/bison.m4 (b4_use_push_for_pull_if): New.
5809 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
5810 appropriately based on their existing values.
5811 (yypush_parse): Don't print push-parser-specific diagnostics if push
5812 parsing is being used in place of pull parsing.
5813 * data/yacc.c: If push parsing should replace pull parsing, redirect to
5814 push.c.
5815 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
5816 variable, and insert b4_use_push_for_pull_flag into muscles.
5817 * tests/Makefile.am (maintainer-push-check): New.
5818
5819 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5820
5821 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
5822 (whether successful or failed) so that yypush_parse can be invoked
5823 again to start a new parse using the same yypstate.
5824 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
5825 check multiple yypull_parse invocations on the same yypstate. For pull
5826 mode, extend to check multiple yyparse invocations.
5827 (Exploding the Stack Size with Alloca): Extend to try with
5828 %push-pull-parser.
5829 (Exploding the Stack Size with Malloc): Likewise.
5830
5831 * tests/calc.at (Simple LALR Calculator): Don't specify
5832 %skeleton "push.c" since %push-pull-parser implies that now.
5833 * tests/headers.at (export YYLTYPE): Don't check for the push
5834 declarations. Otherwise, this test case can't be used to see if push
5835 mode can truly emulate pull mode.
5836 * tests/input.at (Torturing the Scanner): Likewise.
5837 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
5838 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
5839 AT_YACC_IF, which now includes the case of push mode since %skeleton
5840 need not be used for push mode. This will be more intuitive once
5841 push.c is renamed to yacc.c.
5842
5843 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
5844
5845 For push mode, convert yyparse from a macro to a function, invoke yylex
5846 instead of passing a yylexp argument to yypull_parse, and don't
5847 generate yypull_parse or yyparse unless %push-pull-parser is declared.
5848 Discussed starting at
5849 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
5850 * data/bison.m4 (b4_pull_if): New.
5851 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
5852 * data/push.c: Improve M4 quoting a little.
5853 (b4_generate_macro_args, b4_parenthesize): Remove.
5854 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
5855 any time a pull parser is requested.
5856 Don't #define this as a wrapper around yypull_parse. Instead, when
5857 both push and pull are requested, make it a function that does that
5858 same thing.
5859 (yypull_parse): If there's a b4_prefix, #define this to
5860 b4_prefix[pull_parse] when both push and pull are requested.
5861 Don't define this as a function unless both push and pull are
5862 requested.
5863 Remove the yylexp argument and hard-code yylex invocation instead.
5864 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
5865 %push-parser.
5866 * src/getargs.c (pull_parser): New global initialized to true.
5867 * getargs.h (pull_parser): extern it.
5868 * src/output.c (prepare): Insert pull_flag muscle.
5869 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
5870 (prologue_declaration): Set both push_parser and pull_parser = true for
5871 %push-pull-parser. Set push_parser = true and pull_parser = false for
5872 %push-parser.
5873 * src/scan-gram.l: Don't accept %push_parser as an alternative to
5874 %push-parser since there's no backward-compatibility concern here.
5875 Scan %push-pull-parser.
5876 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
5877 instead of %push-parser.
5878 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
5879 prototype it in the module that calls yyparse.
5880 * tests/input.at (Torturing the Scanner): Likewise.
5881 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
5882
5883 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
5884
5885 Update etc/bench.pl. Optimize push mode a little (the yyn change
5886 deserves most of the credit).
5887 * Makefile.am (SUBDIRS): Add etc subdirectory.
5888 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
5889 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
5890 yytoken, yyval, and yyloc declarations to...
5891 (yyparse or yypush_parse): ... here to improve performance. For
5892 yypush_parse invocations after the first, be sure to assign yyn its old
5893 value again.
5894 (yypstate_new): Don't bother initializing the yyresult field since the
5895 initial value isn't used.
5896 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
5897 remove the #define that, in push mode, set it to yyps->NAME.
5898 * etc/Makefile.am: New.
5899 * etc/bench.pl: Remove and build it instead from...
5900 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
5901 "tests/bison" from the build directory by default rather than just
5902 invoking "bison" from $PATH.
5903 (calc_grammar): Update push parser code: don't declare yylval globally,
5904 don't define yyparse_wrapper, and don't #define yyparse.
5905 (bench_grammar): Update to check all working combinations of yacc.c,
5906 push.c, impure, pure, pull, and push.
5907
5908 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5909
5910 For push mode, add pull wrappers around yypush_parse.
5911 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
5912 (yypull_parse): New function wrapping yypush_parse.
5913 (yyparse): New #define wrapping yypull_parse.
5914 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
5915 is declared.
5916 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
5917 prototype yylex in the module that calls yyparse, and don't prototype
5918 yyparse there. Otherwise, the yyparse expansion won't compile.
5919 * tests/input.at (Torturing the Scanner): Likewise.
5920
5921 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
5922
5923 Enable push parsers to operate in impure mode. Thus, %push-parser no
5924 longer implies %pure-parser. The point of this change is to move
5925 towards being able to test the push parser code by running the entire
5926 test suite as if %push-parser had been declared.
5927 * data/push.c (yypush_parse): For impure mode, remove the
5928 yypushed_char, yypushed_val, and yypushed_loc arguments.
5929 Instead, declare these as local variables initialized to the global
5930 yychar, yylval, and yylloc.
5931 For the first yypush_parse invocation only, restore the initial values
5932 of these global variables when it's time to read a token since they
5933 have been overwritten.
5934 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
5935 %push-parser.
5936 * tests/calc.at (Simple LALR(1) Calculator): Always declare
5937 %pure-parser along with %push-parser since this test case was designed
5938 for pure push parsers.
5939 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
5940 (AT_YACC_OR_PUSH_IF): New.
5941 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
5942 add a note that it's still wrong for some cases (as it has been for a
5943 while).
5944 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
5945 %push-parser no longer implies %pure-parser.
5946
5947 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5948
5949 Remove some unnecessary differences between the pull parser code and
5950 the push parser code. This patch enables yynerrs in push mode.
5951 * data/push.c: Reformat M4 a little.
5952 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
5953 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
5954 because push mode is on. Instead, if pure mode is on, move yynerrs
5955 to...
5956 (b4_declare_parser_state_variables): ... here.
5957 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
5958 to yyps->NAME so it can be used in yypush_parse.
5959 (yypush_parse): Don't omit uses of yynerrs in push mode.
5960
5961 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5962
5963 Fix bug such that the first pushed token's value and location are
5964 sometimes overwritten (sometimes by %initial-action) before being used.
5965 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
5966 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
5967 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
5968 more closely mimic the pull parser logic.
5969 Don't copy the pushed token to yychar, yylval, and yylloc until it's
5970 time to read a token, which is after any initialization of yylval and
5971 yylloc.
5972 (gottoken): Rename label to...
5973 (yyread_pushed_token): ... for clarity and to avoid infringing on the
5974 user namespace.
5975
5976 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
5977
5978 Rearrange initialization of the parser state variables so that the
5979 skeleton doesn't have to have a copy for pull mode and another for push
5980 mode. This patch also fixes at least a bug such that yylloc was not
5981 initialized (with b4_location_initial_line and
5982 b4_location_initial_column) upon calling yypush_parse. However, that
5983 initialization now overwrites the first token's location;
5984 %initial-action assigning @$ already did the same thing, and both bugs
5985 will be fixed in a later patch.
5986 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
5987 (b4_declare_parser_state_variables): Remove initialization of yytoken,
5988 yyss, yyvs, yyls, and yystacksize.
5989 (yypstate_new): Remove initialization of some yypstate fields: yystate,
5990 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
5991 yylsp.
5992 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
5993 yyps->NAME so it can be used in yypush_parse.
5994 (yyparse or yypush_parse): For yypush_parse, don't print the
5995 "Starting parse" diagnostic for invocations after the first.
5996 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
5997 yypush_parse, only do it for the first invocation.
5998 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
5999 initialization to occur in yypush_parse but only on the first
6000 invocation.
6001
6002 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6003
6004 * data/push.c: Add CPP guards around push parser declarations in both
6005 the header and the code file.
6006 In the code file, move the push parser declarations to the same place
6007 they appear in the header file.
6008 Clean up the M4 some, especially the inconsistent underquoting in
6009 some b4_c_function_def and b4_c_function_decl uses.
6010
6011 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6012
6013 Encapsulate the push parser state variables into an M4 macro so the
6014 push skeleton doesn't have to list them again for pull mode's yyparse.
6015 For push mode, remove yypush_parse's local equivalents of these
6016 variables to eliminate unnecessary copying between the two sets at
6017 run-time. This patch also fixes at least a bug related to multiple
6018 %initial-action invocations in push mode.
6019 * data/push.c (b4_declare_parser_variables): Rename to...
6020 (b4_declare_scanner_communication_variables): ... this for clarity and
6021 update both uses.
6022 (b4_declare_yyparse_variables): Remove and move its contents to the one
6023 spot where it was invoked.
6024 (b4_declare_parser_state_variables): New macro containing the parser
6025 state variables required by push mode.
6026 (struct yypstate): Replace all fields but yynew with
6027 b4_declare_parser_state_variables.
6028 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
6029 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
6030 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6031 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6032 parser state variable declarations with
6033 b4_declare_parser_state_variables.
6034 Don't initialize parser state variables when calling yypush_parse since
6035 yypstate_new already does that.
6036 Invoke the user's initial action only upon the first yypush_parse
6037 invocation.
6038 Remove all code that copies between the local parser state variables
6039 and the yypstate.
6040
6041 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6042
6043 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6044 prevent a name collision in a future patch where these names will
6045 sometimes be #define'd.
6046 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6047 since it no longer has the same name as the existing argument.
6048 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6049
6050 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
6051 and Joel E. Denny <jdenny@ces.clemson.edu>
6052
6053 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6054 that the argument is case-insensitive, and there's no `=' here.
6055 For the %skeleton entry, mention that %language is better.
6056 (Bison Options): Likewise for --language and --skeleton. Move the
6057 --skeleton entry so that the `Tuning the parser' section is sorted
6058 alphabetically on long options.
6059 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6060 %language directive in detail here; cross-reference the %language
6061 documentation instead.
6062 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6063 `%require "2.3b"' so that the example is always up-to-date.
6064 (Table of Symbols): Add entries for %language and %skeleton.
6065 * examples/extexi (normalize): Instead of replacing every %require
6066 argument with the current Bison version, just substitute for
6067 `@value{VERSION}'. This guarantees that we're testing what actually
6068 appears in the documentation.
6069 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6070 rather than `@VERSION@'.
6071
6072 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6073
6074 * NEWS: Reword the %language news a bit, and put it earlier.
6075
6076 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6077 Rewrite to simplify the logic.
6078 (language_argmatch): Likewise.
6079 (program_name): We now own this var.
6080 * src/getargs.h (struct bison_language): Use char[] rather than
6081 const char *.
6082
6083 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6084 Java is supported.
6085 * src/complain.c (program_name): Remove decl; no longer needed.
6086 * src/main.c (program_name): Remove; now belongs to getargs.
6087
6088 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
6089
6090 * NEWS: Document %language.
6091
6092 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6093
6094 * data/c-skel.m4, data/c++-skel.m4: New files.
6095 * data/glr.c: Complain on push parsers.
6096
6097 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6098 over %skeleton.
6099 (Decl Summary): Document %language and %skeleton.
6100 (Command line): Document -L.
6101
6102 * examples/extexi: Rewrite %require directive.
6103 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6104
6105 * src/files.c (compute_exts_from_gc): Look in language structure
6106 for .y extension.
6107 (compute_file_name_parts): Check whether .tab should be added.
6108 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6109 (language, skeleton_arg, language_argmatch): New.
6110 (long_options): Add --language.
6111 (getargs): Use skeleton_arg, add -L/--language.
6112 * src/getargs.h: Include location.h.
6113 (struct bison_language, language, skeleton_arg, language_argmatch): New.
6114 * src/output.c (prepare): Pick default skeleton from struct language.
6115 Don't dispatch C skeletons here.
6116 * src/parse-gram.y (PERCENT_LANGUAGE): New.
6117 (prologue_declaration): Add "%language" rule, use skeleton_arg.
6118 * src/scan-gram.l ("%language"): New rule.
6119
6120 * tests/calc.at: Test %skeleton and %language.
6121 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
6122 (AT_GLR_IF): Look for %skeleton "glr.cc".
6123 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
6124 (AT_YACC_IF): Reject %language.
6125
6126 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6127
6128 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
6129 since it wasn't used; only the typedef name 'semantic_type' is needed.
6130 Also, omit trailing white space.
6131
6132 * bootstrap: Sync from coreutils.
6133 (gnulib_extra_files): Add build-aux/announce.gen.
6134 (slurp): Adjust .gitignore files like .cvsignore files.
6135 * build-aux/announce-gen: Remove from CVS, since bootstrap
6136 now creates this.
6137
6138 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
6139
6140 Make %push-parser imply %pure-parser. This fixes several bugs; see
6141 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
6142 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6143 pure_parser = true.
6144 * data/push.c: Don't bother testing b4_push_if when deciding whether
6145 to expand b4_declare_parser_variables globally.
6146 (yypush_parse): Likewise in here.
6147
6148 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
6149 (yy_reduce_print): Reformat M4 for readability.
6150
6151 2006-12-15 Bob Rossi <bob@brasko.net>
6152 and Joel Denny <jdenny@ces.clemson.edu>
6153
6154 * data/push.c (yypstate): Add typedef, and update all uses of
6155 struct yypstate to just yypstate.
6156 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
6157
6158 2006-12-14 Bob Rossi <bob@brasko.net>
6159
6160 * data/push.c (yypush_parse): Declare prototype regardless of
6161 %locations option.
6162
6163 2006-12-14 Bob Rossi <bob@brasko.net>
6164
6165 * data/push.c (yyparse): Remove the prototype and the #define when in
6166 push-parser mode.
6167
6168 2006-12-13 Bob Rossi <bob@brasko.net>
6169
6170 * data/push.c (yypstate_init): Rename to...
6171 (yypstate_new): ... this and use b4_c_function_def.
6172 (yypstate_delete): New.
6173 (yypush_parse): Change parameters yynval and yynlloc to be const.
6174 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
6175 yypstate_delete functions.
6176
6177 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
6178
6179 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
6180 strange test case titles. Reported by Bob Rossi.
6181
6182 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
6183
6184 * TODO: Add pointer to Sylvain Schmitz's work on static detection
6185 of potential ambiguities in GLR grammers.
6186
6187 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
6188
6189 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
6190 `bison ', use m4_index instead of m4_substr since chopping up a string
6191 containing M4-special characters causes problems here.
6192
6193 Fix a couple of bugs related to special characters in user-specified
6194 file names, and make it easier for skeletons to compute output file
6195 names with the same file name prefix as Bison-computed output file
6196 names.
6197 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
6198 b4_parser_file_name and b4_spec_defines_file instead of
6199 @output_parser_name@ and @output_header_name@, which are now redundant.
6200 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
6201 b4_parser_file_name, b4_spec_defines_file, and the new
6202 @basename(FILENAME@) instead of @output_parser_name@ and
6203 @output_header_name@, which inappropriately escaped the file names as
6204 C string literals.
6205 * src/files.c (all_but_ext): Remove static qualifier.
6206 (compute_output_file_names): Move `free (all_but_ext)' to...
6207 (output_file_names_free): ... here since all_but_ext is needed later.
6208 * src/files.h (all_but_ext): Extern.
6209 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
6210 exactly what MUSCLE_INSERT_STRING used to do.
6211 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
6212 characters are escaped properly.
6213 * src/output.c (prepare): Define muscle file_name_all_but_ext as
6214 all_but_ext.
6215 For pkgdatadir muscle, maintain previous functionality by using
6216 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
6217 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
6218 digraphs would never be expanded. Hopefully no one has M4-special
6219 characters in his Bison installation path.
6220 * src/scan-skel.l: Don't parse @output_header_name@ and
6221 @output_parser_name@ anymore since they're now redundant.
6222 In @output, use decode_at_digraphs.
6223 Parse a new @basename command that invokes last_component.
6224 (decode_at_digraphs): New.
6225 (BASE_QPUTS): Remove unused.
6226 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
6227 (Output file name): New tests.
6228
6229 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
6230
6231 Warn about output files that are generated by the skeletons and that
6232 conflict with other output files.
6233 * data/glr.c: Don't generate the header file here when glr.cc does.
6234 * src/files.c (file_names, file_names_count): New static globals.
6235 (compute_output_file_names): Invoke output_file_name_check for files
6236 not generated by the skeletons and remove existing checks.
6237 (output_file_name_check): New function that warns about conflicting
6238 output file names.
6239 (output_file_names_free): Free file_names.
6240 * src/files.h (output_file_name_check): Declare.
6241 * src/scan-skel.l: Invoke output_file_name_check for files generated by
6242 the skeletons.
6243 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
6244 (Conflicting output files): New tests.
6245
6246 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6247
6248 * doc/bison.texinfo: Fix a couple of typos.
6249
6250 2006-12-08 Bob Rossi <bob@brasko.net>
6251
6252 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
6253 Rename to...
6254 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
6255 update all uses.
6256 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
6257 (yypush_parse): Rename yypvars argument to yyps and remove redundant
6258 local pv.
6259 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
6260 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
6261
6262 2006-12-07 Bob Rossi <bob@brasko.net>
6263 and Joel Denny <jdenny@ces.clemson.edu>
6264
6265 * data/push.c (yypvarsinit): Change return type from void* to struct
6266 yypvars*. No longer cast to void* on return.
6267 (struct yypvars): Remove yylen since it need not be remembered between
6268 yypushparse invocations.
6269 (yypushparse): Don't copy between yylen and pv->yylen.
6270
6271 2006-12-05 Bob Rossi <bob@brasko.net>
6272
6273 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6274 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6275 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6276 (struct yypvars): Remove b4_declare_parser_variables.
6277 (yypvarsinit): Remove init code for removed variables.
6278 (global scope): Do not declare b4_declare_parser_variables if
6279 push or pure mode.
6280 (yypushparse): Add b4_declare_parser_variables.
6281 Init new local variables, and remove init code for removed
6282 yypvars variables.
6283 (yyparse): Delete.
6284 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6285 and yyparse for other modes.
6286 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6287 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6288 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6289 (AT_PURE_LEX_IF): True if pure or push parser.
6290
6291 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6292
6293 Document Yacc prologue alternatives and default %destructor's and
6294 %printer's as experimental. Don't mention Java yet. Discussed at
6295 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6296 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6297 (2.3a): Annotate this entry to say the old forms of these features were
6298 also experimental.
6299 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
6300 Table of Symbols): Say they're experimental. Comment out any mention
6301 of Java (we'll want this back eventually).
6302
6303 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6304
6305 Support a file name argument to %defines. Deprecate `=' in
6306 %file-prefix, %name-prefix, and %output. Discussed at
6307 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6308 * NEWS (2.3a+): Mention.
6309 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
6310 form of %defines, and remove `=' from entries for %file-prefix,
6311 %name-prefix, and %output.
6312 * src/parse-gram.y (prologue_declaration): Implement.
6313 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6314 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6315 all but one occurrence of %name-prefix.
6316 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6317 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6318 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6319 occurrence of each of %file-prefix and %output. Add check for %defines
6320 with argument.
6321 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6322 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6323 Remove the `=' from %output.
6324
6325 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6326
6327 Don't escape $ in test case titles since Autoconf 2.61 now does that
6328 correctly.
6329 * tests/actions.at (Default %printer and %destructor are not for error
6330 or $undefined): Here.
6331 (Default %printer and %destructor are not for $accept): Here.
6332 * tests/input.at (Invalid $n and @n): Here.
6333
6334 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6335
6336 Rename <!> to <>. Discussed starting at
6337 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6338 * NEWS (2.3a+): Update.
6339 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
6340 Update.
6341 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6342 * src/scan-gram.l (INITIAL): Implement.
6343 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6344 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6345 comment.
6346 * tests/actions.at (Default tagless %printer and %destructor,
6347 Default tagged and per-type %printer and %destructor,
6348 Default %printer and %destructor are not for error or $undefined,
6349 Default %printer and %destructor are not for $accept,
6350 Default %printer and %destructor for mid-rule values): Update.
6351 * tests/input.at (Default %printer and %destructor redeclared,
6352 Unused values with default %destructor): Update.
6353
6354 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6355
6356 Don't let %prec take a nonterminal.
6357 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6358 token.
6359 * tests/input.at (%prec takes a token): New test checking that %prec
6360 won't take a nonterminal.
6361
6362 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6363
6364 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6365 it was double-quoted.
6366 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6367 grammar is maintained with Bison's highest standards.
6368 * src/getargs.c: Fix some typos in Doxygen comments.
6369
6370 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6371
6372 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6373 later. Reported by Paul Eggert in
6374 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6375 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6376 * src/scan-code.l (translate_action): Don't bother invoking
6377 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6378 (code_scanner_free): Instead of invoking
6379 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6380 which frees more.
6381 * src/scan-gram.l (gram_scanner_free): Likewise.
6382 * src/scan-skel.l (scan_skel): Likewise.
6383
6384 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6385
6386 * src/files.c (tr): Change return type to void.
6387 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6388 has been called previously for the same key.
6389 (muscle_find): Return storage instead of value so that
6390 --enable-gcc-warnings doesn't produce warnings that the return discards
6391 const. aver that the value and storage are the same since storage
6392 could potentially be NULL when value is not.
6393 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6394 same as 0.
6395
6396 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6397
6398 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6399 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6400 us a slightly cleaner distribution, and also works.
6401 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6402 gnulib changes.
6403
6404 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6405 and Paul Eggert <eggert@cs.ucla.edu>
6406
6407 Don't let Bison leak memory except when it complains.
6408 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6409 (spec_defines_file, dir_prefix): Now char *, not const char *,
6410 since they are freed.
6411 * src/files.c: Likewise.
6412 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6413 Likewise.
6414 (tr): Now operates in-place. All uses changed.
6415 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6416 values.
6417 (compute_file_name_parts, compute_output_file_names): Don't store
6418 read-only data in variables that will be freed.
6419 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6420 src_extension, and header_extension.
6421 (output_file_names_free): New public function to free
6422 spec_verbose_file, spec_graph_file, spec_defines_file,
6423 parser_file_name, and dir_prefix.
6424 * src/getargs.c (getargs): Don't store read-only data in variables that
6425 will be freed.
6426 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6427 (which previously existed but was unused), and quotearg_free.
6428 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6429 * src/muscle_tab.c: Likewise.
6430 (muscle_entry): Make the value char const *,
6431 and add a new storage member that is char * and can be freed.
6432 (muscle_entry_free): New private function.
6433 (muscle_init): Use it instead of free.
6434 (muscle_insert, muscle_grow): Update and use new storage member.
6435 (muscle_code_grow): Free the string passed to muscle_grow
6436 since it's not needed anymore.
6437 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6438 add a new `char *code' member.
6439 ("{...}"): Declare semantic type as code.
6440 * src/scan-code.h (translate_rule_action):
6441 (translate_symbol_action, translate_code, translate_action): Return
6442 `char const *' rather than `char *' since external code should not free
6443 these strings.
6444 * src/scan-code.l: Likewise.
6445 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6446 which is "{...}" in the parser.
6447 * tests/Makefile.am (maintainer-check-valgrind): Set
6448 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6449 Valgrind.
6450 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6451 complain.
6452 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6453 expecting a non-zero exit status sets --leak-check=summary and
6454 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6455 this case, and we don't want to hear about it.
6456
6457 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6458
6459 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6460 instead of from the template, to simplify configuration a bit.
6461 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6462 and m4/wint_t.m4, as they are needed with the latest gnulib.
6463
6464 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6465
6466 Disable unset/unused mid-rule value warnings by default, and recognize
6467 --warnings=midrule-values to enable them. Discussed starting at
6468 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6469 * NEWS (2.3a+): Mention.
6470 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6471 warnings): Add entry for midrule-values subargument.
6472 * src/reader.c (symbol_should_be_used): Don't return true just because
6473 the value is a set/used mid-rule value unless
6474 --warnings=midrule-values was specified.
6475 * tests/input.at (Unused values, Unused values before symbol
6476 declarations): Run tests with and without --warnings=midrule-values.
6477
6478 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6479 than LIST_FREE directly.
6480
6481 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6482
6483 Finish implementing --warnings=error, which should not be implied by
6484 --warnings=all (or by its synonyms -W and --warnings without
6485 subarguments).
6486 * src/complain.c (set_warning_issued): New function to report that
6487 warnings are being treated as errors and to record an error if so.
6488 Invoke...
6489 (warn_at, warn): ... here.
6490 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6491 "error - warnings are errors" does not appear above "all - all of the
6492 above".
6493 (getargs): For -W and --warnings without subarguments, don't let
6494 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6495 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6496
6497 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6498
6499 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6500 empty subargument list. For example: `bison --warnings= parser.y'.
6501
6502 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6503
6504 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6505 the parser header file so that gcc doesn't warn.
6506
6507 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6508
6509 Split the default %destructor/%printer into two kinds: <*> and <!>.
6510 Discussed starting at
6511 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6512 * NEWS (2.3a+): Mention.
6513 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6514 previous change today related to mid-rules.
6515 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
6516 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
6517 (TYPE_TAG_ANY): Add as <*>.
6518 (TYPE_TAG_NONE): Add as <!>.
6519 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6520 for <*> and <!>.
6521 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6522 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6523 * src/symlist.c (symbol_list_default_new): Split into tagged and
6524 tagless versions.
6525 (symbol_list_destructor_set, symbol_list_printer_set): Split
6526 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6527 SYMLIST_DEFAULT_TAGLESS.
6528 * src/symlist.h: Update symbol_list_default*_new prototypes.
6529 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6530 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6531 * src/symtab.c (default_destructor, default_destructor_location,
6532 default_printer, default_printer_location): Split each into tagged and
6533 tagless versions.
6534 (symbol_destructor_get, symbol_destructor_location_get,
6535 symbol_printer_get, symbol_printer_location_get): Implement tagged
6536 default and tagless default cases.
6537 (default_destructor_set, default_printer_set): Split each into tagged
6538 and tagless versions.
6539 * src/symtab.h: Update prototypes.
6540 * tests/actions.at (Default %printer and %destructor): Rename to...
6541 (Default tagless %printer and %destructor): ... this, and extend.
6542 (Per-type %printer and %destructor): Rename to...
6543 (Default tagged and per-type %printer and %destructor): ... this, and
6544 extend.
6545 (Default %printer and %destructor for user-defined end token): Extend.
6546 (Default %printer and %destructor are not for error or $undefined):
6547 Update.
6548 (Default %printer and %destructor are not for $accept): Update.
6549 (Default %printer and %destructor for mid-rule values): Extend.
6550 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6551 (Unused values with default %destructor): Extend.
6552
6553 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6554
6555 Don't apply the default %destructor/%printer to an unreferenced midrule
6556 value. Mentioned at
6557 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6558 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6559 like $@n instead of just @n so that the default %destructor/%printer
6560 logic doesn't see them as user-defined symbols.
6561 (symbol_is_dummy): Check for both forms of the name.
6562 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6563 name for which the midrule value is referenced in any action.
6564 * tests/actions.at (Default %printer and %destructor for mid-rule
6565 values): New test.
6566 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6567 for change to dummy symbol names.
6568
6569 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6570
6571 Warn about unset midrule $$ if the corresponding $n is used.
6572 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6573 $n usage.
6574 (packgram): Before invoking grammar_rule_check on any rule, make sure
6575 all actions have already been scanned in order to set `used' flags.
6576 Otherwise, checking that a midrule's $$ is set will not always work
6577 properly because the midrule check must forward-reference the midrule's
6578 parent rule.
6579 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6580 warning.
6581
6582 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6583
6584 More improvements to the documentation of the prologue alternatives:
6585 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6586 Bison manual.
6587 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6588 some text to clarify the relative importance of the new directives and
6589 to show how these directives may be viewed as code labels.
6590
6591 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6592
6593 Similar to the recently removed %before-header, add %code-top as the
6594 alternative to the pre-prologue. Mentioned at
6595 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6596 Also, let the prologue alternatives appear in the grammar section.
6597 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6598 (prologue_declaration): Move the existing prologue alternatives to...
6599 (grammar_declaration): ... here and add %code-top.
6600 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6601
6602 Clean up and extend documentation for the prologue alternatives.
6603 * NEWS (2.3a+): Describe prologue alternatives.
6604 * doc/bison.texinfo (Prologue): Move discussion of prologue
6605 alternatives to...
6606 (Prologue Alternatives): ... this new section, and extend it to discuss
6607 all 4 directives in detail.
6608 (Table of Symbols): Clean up discussion of prologue alternatives and
6609 add %code-top.
6610
6611 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6612
6613 DJGPP specific issues.
6614
6615 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6616 config.bat accordingly.
6617 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6618 * djgpp/config.site: Likewise.
6619
6620 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
6621
6622 Replace %*-header with %provides, %requires, %code. See discussion at
6623 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6624
6625 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6626 (b4_user_start_header): Remove.
6627 * data/glr.c: Use new macros instead of b4_*start_header
6628 and b4_*end_header.
6629 * data/glr.cc: Likewise.
6630 * data/lalr1.cc: Likewise.
6631 * data/push.c: Likewise.
6632 * data/yacc.c: Likewise.
6633
6634 * doc/bison.texinfo: Remove %before-header, rename
6635 %{start,end,after}-header to %requires, %provides, %code.
6636
6637 * src/parse-gram.y: Likewise (also rename token names accordingly).
6638 * src/scan-gram.l: Likewise.
6639 * tests/actions.at: Likewise.
6640
6641 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6642
6643 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6644 Problem reported by Joel E. Denny.
6645
6646 2006-10-14 Jim Meyering <jim@meyering.net>
6647
6648 (Sync from coreutils.)
6649 Work also when the working directory (with e.g. coreutils sources)
6650 is version controlled with git, rather than CVS.
6651 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6652 rather than CVS.
6653 In messages and comments, say e.g., "checked-out sources",
6654 rather than "CVS sources".
6655 (version_controlled_file): New function. Work for git as well as
6656 for CVS. Don't use grep's -q option.
6657 (slurp): Call it here, in place of CVS-specific code.
6658
6659 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6660
6661 Fix testsuite for ./configure --enable-gcc-warnings:
6662 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6663 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6664 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6665 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6666 * test/regression.at (Diagnostic that expects two alternatives):
6667 Likewise.
6668
6669 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6670
6671 * bootstrap.conf (gnulib_modules): Add config-h.
6672 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6673 worry about HAVE_CONFIG_H.
6674 * lib/abitset.c: Likewise.
6675 * lib/bitset.c: Likewise.
6676 * lib/bitset_stats.c: Likewise.
6677 * lib/bitsetv-print.c: Likewise.
6678 * lib/bitsetv.c: Likewise.
6679 * lib/ebitset.c: Likewise.
6680 * lib/get-errno.c: Likewise.
6681 * lib/lbitset.c: Likewise.
6682 * lib/subpipe.c: Likewise.
6683 * lib/timevar.c: Likewise.
6684 * lib/vbitset.c: Likewise.
6685 * lib/bitset.c: Include "bitset.h" first, to test interface.
6686 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6687 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6688 * lib/bitsetv.c: Include "bitsetv.h" first.
6689 * lib/get-errno.c: Include "get-errno.h" first.
6690 * m4/.cvsignore: Add config-h.m4.
6691 * tests/actions.at (Default %printer and %destructor for ...):
6692 Adjust expected line numbers in output to reflect removal of #if
6693 HAVE_CONFIG_H lines.
6694 * tests/glr-regression.at (Missed %merge type warnings when ...):
6695 Likewise.
6696 * tests/regression.at (Braced code in declaration in rules section):
6697 Likewise.
6698 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6699 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6700 Include <config.h> unconditionally.
6701
6702 * bootstrap: Sync from coreutils, as follows:
6703
6704 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6707 variable was sometimes used without being initialized. This
6708 messed up the installation of the INSTALL file in some cases.
6709
6710 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6711
6712 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6713 --copy. Inspired by a suggestion from Bruno Haible.
6714
6715 2006-10-03 Jim Meyering <jim@meyering.net>
6716
6717 * bootstrap: Undo last change to this file, since now gnulib-tool
6718 sticks with the automake default in generating dependencies.
6719
6720 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6721
6722 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6723 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6724
6725 * doc/bison.1: Add copyright notice.
6726
6727 * data/glr.c: Don't include <stdarg.h>; not used.
6728
6729 * NEWS: The -g and --graph options now output graphs in Graphviz
6730 DOT format, not VCG format.
6731 * doc/bison.1: Likewise.
6732 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
6733 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6734 of this change in
6735 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
6736 * TODO: Remove Graphviz entry.
6737 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6738 remove vcg.c, vcg.h, vcg_defaults.h.
6739 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6740 * src/graphviz.c, src/graphviz.h: New files.
6741 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6742 * src/files.h: Make comment more generic.
6743 * src/main.c (main): Likewise.
6744 * src/print_graph.h: Likewise.
6745 * src/getargs.c (usage): Make usage description more generic.
6746 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6747 (static_graph, fgraph): Remove. All uses changed to pass
6748 arguments instead of sharing a static var.
6749 (print_core, print_actions, print_state, print_graph):
6750 Output graphviz format rather than VCG format.
6751 * tests/.cvsignore: Remove *.vcg; add *.dot.
6752 * tests/output.at: Expect *.dot files, not *.vcg files.
6753
6754 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6755 accommodates the 2006-10-08 change.
6756
6757 2006-10-11 Bob Rossi <bob@brasko.net>
6758
6759 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6760 (b4_yyssa, b4_yyerror_range): New macros.
6761 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6762 (yypvarsinit): Remove init of removed fields.
6763 (yypushparse): Remove use of removed fields; use new macros instead.
6764
6765 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6766
6767 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6768 in a push parser. Reindent slightly to match yacc.c better.
6769
6770 2006-10-11 Bob Rossi <bob@brasko.net>
6771
6772 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6773 yymsg_alloc fields.
6774 (yypvarsinit, yypushparse): Remove init of removed fields.
6775 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
6776
6777 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6778
6779 * THANKS: Add Paolo Bonzini and Bob Rossi.
6780
6781 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
6782
6783 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6784 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6785 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6786 b4_define_user_cde and uses): Remove.
6787 (b4_comment, b4_prefix, b4_sync_start): New.
6788 * data/bison.m4: New file, with most of the content removed from c.m4.
6789 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6790 * src/output.c (output_skeleton): Pass bison.m4.
6791 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6792 only if specified.
6793
6794 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6795
6796 Fix test failure reported by Tom Lane in
6797 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
6798 and try to make such failures easier to catch in the future.
6799 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
6800 that's now the caller's responsibility.
6801 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
6802 Set yychar = YYEOF if it's negative.
6803 * tests/actions.at (yylex): Abort if asked to read past EOF.
6804 * tests/conflicts.at (yylex): Likewise.
6805 * tests/cxx-type.at (yylex): Likewise.
6806 * tests/glr-regression.at (yylex): Likewise.
6807 * tests/input.at (yylex): Likewise.
6808 * tests/regression.at (yylex): Likewise.
6809 * tests/torture.at (yylex): Likewise.
6810
6811 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
6812
6813 Fix problems with translating English-language diagnostics.
6814 * bootstrap: Fix bug introduced in recent bootstrap changes, with
6815 respect to bison-runtime pot generation. The YY_ stuff
6816 wasn't being captured.
6817 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
6818 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
6819 * runtime-po/POTFILES.in: Add data/push.c.
6820
6821 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
6822
6823 Merge bootstrap changes from coreutils.
6824
6825 2006-09-28 Jim Meyering <jim@meyering.net>
6826
6827 Automatically generated dependencies are important even
6828 when all of the sources in a directory come from gnulib.
6829 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
6830 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
6831
6832 2006-09-23 Jim Meyering <jim@meyering.net>
6833
6834 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
6835
6836 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6837
6838 * bootstrap: Add support for --force.
6839 (usage): New function. Describe usage less tersely.
6840 (CVS_only_file): New var.
6841
6842 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
6843
6844 * data/push.c (YYPUSH_MORE): Make it an enum instead.
6845 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
6846 Adjust white space and comments to match GNU style better.
6847
6848 2006-09-20 Bob Rossi <bob@brasko.net>
6849
6850 * data/push.c (yyresult_get): Remove function.
6851 (YYPUSH_MORE): Add #define.
6852 (yypushparse): Modify return value.
6853
6854 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6855
6856 * stamp-h.in: Remove; no longer needed.
6857 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
6858 Remove config.h, config.hin, intl (no longer created).
6859 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
6860 stamp-h1.
6861
6862 Sync bootstrap from coreutils, as follows:
6863
6864 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
6865
6866 * bootstrap (symlink_to_gnulib): New function.
6867 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
6868 to copies-of-gnulib.
6869 (cp_mark_as_generated, slurp, gnulib_files):
6870 Avoid making a copy if it's the same as the old version.
6871 (gnulib_files): Add support for this variable (used by Bison).
6872
6873 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
6874
6875 * src/getargs.c (usage): Rework to use conventions similar to
6876 coreutils, to make translation a bit easier and the code a bit
6877 smaller. Problem reported by Tim Van Holder.
6878
6879 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
6880
6881 Use some of gnulib's new modules, taken from coreutils.
6882
6883 * bootstrap: Sync from coreutils, except add support for gnulib_files.
6884 * bootstrap.conf: New file.
6885 (gnulib_modules): Add configmake, inttypes, unistd.
6886 (XGETTEXT_OPTIONS): Add complain, complain_at,
6887 fatal, fatal_at, warn, warn_at, unexpected_end.
6888 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
6889 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
6890 (gl_EARLY): Add.
6891 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
6892 (gl_INIT): Add
6893 (GNULIB_AUTOCONF_SNIPPET): Remove.
6894 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
6895 the pickiest.
6896 * lib/.cvsignore: Add inttypes_.h.
6897 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
6898 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
6899 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
6900 no-longer-necessary initializations.
6901 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
6902 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
6903 use the unistd module.
6904 * src/system.h: Likewise.
6905 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
6906 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
6907 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
6908 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
6909 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
6910 * src/system.h: Include inttypes.h unconditionally, now that we
6911 use the inttypes module. Don't bother to include stdint.h, since
6912 inttypes.h now does that for us.
6913 (LOCALEDIR): Remove, now that we use the configmake module.
6914 * src/getargs.c: Include configmake.h.
6915 * src/main.c: Likewise.
6916 * src/output.c: Likewise.
6917 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
6918 not from $abs_top_builddir, since config.h moved.
6919
6920
6921 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
6922 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
6923
6924 * src/parse-gram.y (symbol_declaration): Don't put statements
6925 before declarations; it's not portable to C89.
6926 * src/scan-code.l (handle_action_at): Likewise.
6927
6928 * src/scan-code.l: Always initialize braces_level; the old code
6929 left it uninitialized and therefore had undefined behavior.
6930
6931 Don't attempt to redefine 'assert', since it runs afoul of
6932 systems where standard headers (mistakenly) include <assert.h>.
6933 Instead, define and use our own alternative, called 'aver'.
6934 * src/reader.c: Don't include assert.h, since we no longer
6935 use assert.
6936 * src/scan-code.l: Likewise.
6937 * src/system.h (assert): Remove, replacing with....
6938 (aver): New function, taking a bool arg. All uses changed.
6939 * src/tables.c (pack_vector): Ensure that aver arg is bool,
6940 not merely an integer.
6941
6942 2006-09-15 Bob Rossi <bob@brasko.net>
6943
6944 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
6945 * data/c.m4 (YYPUSH): New.
6946 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
6947 * src/getargs.c (push_parser): New var.
6948 * src/getargs.h (push_parser): New declaration.
6949 * src/output.c (prepare): Add macro insertion of `push_flag'.
6950 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
6951 (prologue_declaration): Parse %push-parser.
6952 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
6953 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
6954 list of removed lines from the traces observed.
6955 (AT_CHECK_CALC_LALR): Added push parser tests.
6956
6957 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
6958
6959 * NEWS: Version 2.3a.
6960 * configure.ac (AC_INIT): Likewise.
6961
6962 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
6963 "#define YYSTYPE int" that caused "make maintainer-check" to fail
6964 due to header ordering dependencies. I don't know why the #define
6965 was there.
6966
6967 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
6968 runtime cost when YYDEBUG is not defined, and so that some tests
6969 that used to fail now work. Problem and initial suggestion by
6970 Paolo Bonzini.
6971 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
6972 * data/glr.cc (b4_parser_class_name):
6973 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
6974 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
6975 (yydebug_) [YYDEBUG]: New member.
6976 (yycdebug_): Now defined only if YYDEBUG.
6977 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
6978 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
6979 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
6980 if YYYDEBUG.
6981 (debug_stream, set_debug_stream, debug_level, set_debug_level):
6982 Define only if YYDEBUG.
6983 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
6984 set_debug_level.
6985 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
6986 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
6987 AT_CHECK_CALC_GLR_CC that are working now.
6988
6989 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
6990
6991 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
6992 We don't need them in glr.cc, and glr.c defines them.
6993 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
6994 assumes that defining it to anything is the same as defining
6995 it to 1. Problem reported by Paolo Bonzini.
6996
6997 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
6998
6999 * data/c.m4 (b4_null, b4_case): Define.
7000 * src/output.c (prepare_symbols): Use b4_null.
7001 (user_actions_output): Use b4_case.
7002
7003 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
7004
7005 * data/glr.c (b4_shared_declarations): Put start-header first,
7006 before any #includes that we generate, so that feature-test
7007 macros work. Problem reported by Michael Deutschmann in
7008 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7009 * data/lalr1.cc: Likewise.
7010 * doc/bison.texinfo (Prologue): Document that feature-test macros
7011 should be defined before any Bison declarations.
7012 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
7013 that depend on location.hh after, not before, Bison decls, since
7014 we now include location.hh after the first user prologue.
7015
7016 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
7017 Sander Brandenburg in
7018 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
7019 Also, fix minor white space and comment issues.
7020 (Prologue): Mention that it's better to define feature-test macros
7021 before Bison declarations. Problem reported by Michael Deutschmann.
7022
7023 * README-cvs: Fix typo: "&" should be "&&". Problem reported
7024 by Jim Meyering.
7025 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
7026 This adjusts to recent gnulib changes.
7027
7028 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7029
7030 Finish implementation of per-type %destructor/%printer. Discussed
7031 starting at
7032 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7033 and
7034 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7035 * NEWS (2.3+): Add a description of this feature to the default
7036 %destructor/%printer description.
7037 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7038 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7039 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7040 list node contains a semantic type.
7041 * src/symtab.c, src/symtab.h: Extend with a table that associates
7042 semantic types with their %destructor's and %printer's.
7043 (semantic_type_from_uniqstr, semantic_type_get,
7044 semantic_type_destructor_set, semantic_type_printer_set): New functions
7045 composing the public interface of that table.
7046 (symbol_destructor_get, symbol_destructor_location_get,
7047 symbol_printer_get, symbol_printer_location_get): If there's no
7048 per-symbol %destructor/%printer, look up the per-type before trying
7049 the default.
7050 * tests/actions.at (Per-type %printer and %destructor): New test case.
7051 * tests/input.at (Default %printer and %destructor redeclared):
7052 Extend to check that multiple occurrences of %symbol-default in a
7053 single %destructor/%printer declaration is an error.
7054 (Per-type %printer and %destructor redeclared, Unused values with
7055 per-type %destructor): New test cases.
7056
7057 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7058
7059 Require default %destructor/%printer to be declared using
7060 %symbol-default instead of an empty symbol list, and start working on
7061 new per-type %destructor/%printer. Discussed at
7062 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7063 * NEWS (2.3+): Add %symbol-default to example.
7064 * bison.texinfo (Freeing Discarded Symbols): Likewise.
7065 (Table of Symbols): Add entry for %symbol-default.
7066 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7067 (generic_symlist, generic_symlist_item): New nonterminals for creating
7068 a list in which each item is a symbol, semantic type, or
7069 %symbol-default.
7070 (grammar_declaration): Use generic_symlist in %destructor and %printer
7071 declarations instead of symbols.1 or an empty list.
7072 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7073 for changes to symbol_list.
7074 * src/reader.c: Update for changes to symbol_list.
7075 * src/scan-code.l: Likewise.
7076 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7077 * src/symlist.c, src/symlist.h: Extend such that a list node may
7078 represent a semantic type or a %symbol-default in addition to just an
7079 ordinary symbol. Add switched functions for setting %destructor's and
7080 %printer's.
7081 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7082 %destructor/%printer declarations.
7083
7084 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7085
7086 Whether the default %destructor/%printer applies to a particular symbol
7087 isn't a question of whether the user *declares* that symbol (in %token,
7088 for example). It's a question of whether the user by any means
7089 *defines* the symbol at all (by simply using a char token, for
7090 example). $end is defined by Bison whereas any other token with token
7091 number 0 is defined by the user. The error token is always defined by
7092 Bison regardless of whether the user declares it with %token, but we
7093 may one day let the user define error as a nonterminal instead.
7094 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7095 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7096 the meaning of "user-defined".
7097 * tests/actions.at (Default %printer and %destructor for user-declared
7098 end token): Rename to...
7099 (Default %printer and %destructor for user-defined end token): ...
7100 this.
7101
7102 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7103 computation of whether to apply the default, don't maintain a list of
7104 every Bison-defined symbol. Instead, just check for a first character
7105 of '$', which a user symbol cannot have, and check for the error token.
7106
7107 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7108
7109 Don't apply the default %destructor or %printer to the error token,
7110 $undefined, or $accept. This change fits the general rule that the
7111 default %destructor and %printer are only for user-declared symbols,
7112 and it solves several difficulties that are described in the new test
7113 cases listed below.
7114 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
7115 * tests/actions.at (Default %printer and %destructor are not for error
7116 or $undefined, Default %printer and %destructor are not for $accept):
7117 New test cases.
7118
7119 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
7120
7121 Allow %start after the first rule.
7122 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
7123 when parsing the first rule.
7124 (check_and_convert_grammar): Search for it here after all grammar
7125 declarations have been parsed. Skip midrules, which have dummy LHS
7126 nonterminals.
7127 * src/symtab.c (symbol_is_dummy): New function.
7128 * src/symtab.h (symbol_is_dummy): Declare it.
7129 * tests/input.at (%start after first rule): New test.
7130
7131 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7132
7133 Redo some of the previous commit: add back the ability to use
7134 non-aliased/undeclared string literals since it might be useful to
7135 those declaring %token-table.
7136 * src/reader.c (check_and_convert_grammar): Undo changes in previous
7137 commit: don't worry about complaints from symbols_pack.
7138 * src/symtab.c (symbol_new, symbol_class_set,
7139 symbol_check_alias_consistency): Undo changes in previous commit: count
7140 each string literal as a new symbol and token, assign it a symbol
7141 number, and don't complain about non-aliased string literals.
7142 (symbols_pack): Since symbol_make_alias still does not decrement symbol
7143 and token counts but does still set aliased tokens to the same number,
7144 symbol_pack_processor now leaves empty slots in the symbols array.
7145 Remove those slots.
7146 * tests/regression.at (Undeclared string literal): Remove test case
7147 added in previous commit since non-aliased string literals are allowed
7148 again.
7149 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
7150 remove unnecessary string literal declarations.
7151 * tests/sets.at (Firsts): Likewise.
7152
7153 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7154
7155 Don't allow an undeclared string literal, but allow a string literal to
7156 be used before its declaration.
7157 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
7158 symbols_pack complained.
7159 * src/symtab.c (symbol_new): Don't count a string literal as a new
7160 symbol.
7161 (symbol_class_set): Don't count a string literal as a new token, and
7162 don't assign it a symbol number since symbol_make_alias does that.
7163 (symbol_make_alias): It's not necessary to decrement the symbol and
7164 token counts anymore. Don't assume that an alias declaration occurs
7165 before any uses of the identifier or string, and thus don't assert that
7166 one of them has the highest symbol number so far.
7167 (symbol_check_alias_consistency): Complain if there's a string literal
7168 that wasn't declared as an alias.
7169 (symbols_pack): Bail if symbol_check_alias_consistency failed since
7170 symbol_pack asserts that every token has been assigned a symbol number
7171 although undeclared string literals have not.
7172 * tests/regression.at (String alias declared after use, Undeclared
7173 string literal): New test cases.
7174 (Characters Escapes, Web2c Actions): Declare string literals as
7175 aliases.
7176 * tests/sets.at (Firsts): Likewise.
7177
7178 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
7179
7180 In the grammar scanner, STRING_FINISH unclosed constructs and return
7181 them to the parser in order to improve error messages.
7182 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
7183 SC_BRACED_CODE, SC_PROLOGUE): Implement.
7184 * tests/input.at (Unclosed constructs): New test case.
7185 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
7186 seen.
7187
7188 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
7189 unused global.
7190
7191 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
7192
7193 Handle string aliases for character tokens correctly.
7194 * src/symtab.c (symbol_user_token_number_set): If the token has an
7195 alias, check and set its alias's user token number instead of its own,
7196 which is set to indicate the alias. Previously, every occurrence of
7197 the character token in the grammar overwrote that alias indicator with
7198 the character code.
7199 * tests/input.at (String aliases for character tokens): New test.
7200
7201 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
7202
7203 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
7204
7205 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
7206
7207 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
7208 to prevent failures when building on older platforms.
7209 Check for autopoint failure.
7210 Set XGETTEXT_OPTIONS to values that check for C format strings,
7211 so that translators are warned about them (this also helps
7212 prevent core dumps).
7213
7214 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
7215 function, since it simplifies our code a bit.
7216
7217 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
7218 rather than -W, so we don't get bogus warnings about sign comparisons.
7219 Add -Wpointer-arith, since that warning is useful (it reports code
7220 that does not conform to C89 and that some compilers reject).
7221 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
7222 since it's no longer needed.
7223
7224 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
7225
7226 Clean up scanners a bit.
7227 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
7228 definitions so gcc won't warn when obstack_for_string is unused.
7229 * src/scan-code.l: config.h and system.h are already #include'd by
7230 scan-code-c.c, so get rid of them here.
7231 * src/scan-gram.l: Likewise.
7232 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
7233 definitions rather than duplicating the rest of it.
7234 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
7235
7236 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
7237
7238 Suppress signed/unsigned comparison warnings for yycheck.
7239 * data/c.m4 (b4_safest_int_type): New macro.
7240 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
7241 a signed int type, cast it to b4_safest_int_type first.
7242 * data/yacc.c: Likewise.
7243 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
7244 also overwritten.
7245
7246 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
7247
7248 * doc/bison.texinfo: Fix some typos.
7249
7250 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
7251
7252 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
7253 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
7254
7255 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
7256 the latest gnulib does this a different way.
7257 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
7258 translation was patched, so stop omitting it.
7259
7260 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7261
7262 Enable declaration of default %printer/%destructor. Make the parser
7263 use these for all user-declared grammar symbols for which the user does
7264 not declare a specific %printer/%destructor. Thus, the parser uses it
7265 for token 0 if the user declares it but not if Bison generates it as
7266 $end. Discussed starting at
7267 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7268 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7269 and
7270 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7271 * NEWS (2.3+): Mention.
7272 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7273 declare a %destructor for a mid-rule's semantic value. It's just
7274 impossible to declare one specific to it.
7275 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7276 code. Describe default %destructor form.
7277 * src/parse-gram.y (grammar_declaration): Parse default
7278 %printer/%destructor declarations.
7279 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7280 and symbol_destructor_location_get rather than accessing the destructor
7281 and destructor_location members of struct symbol.
7282 (symbol_printers_output): Likewise but for %printer's.
7283 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7284 again.
7285 * src/symtab.c (default_destructor, default_destructor_location,
7286 default_printer, default_printer_location): New static global
7287 variables to record the default %destructor and %printer.
7288 (symbol_destructor_get, symbol_destructor_location_get,
7289 symbol_printer_get, symbol_printer_location_get): New functions to
7290 compute the appropriate %destructor and %printer for a symbol.
7291 (default_destructor_set, default_printer_set): New functions to set the
7292 default %destructor and %printer.
7293 * src/symtab.h: Prototype all those new functions.
7294 * tests/actions.at (Default %printer and %destructor): New test to
7295 check that the right %printer and %destructor are called, that they're
7296 not called for $end, and that $$ and @$ work correctly.
7297 (Default %printer and %destructor for user-declared end token): New
7298 test to check that the default %printer and %destructor are called for
7299 a user-declared end token.
7300 * tests/input.at (Default %printer and %destructor redeclared, Unused
7301 values with default %destructor): New tests to check related grammar
7302 warnings and errors.
7303
7304 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7305
7306 Clean up handling of %destructor for the end token (token 0).
7307 Discussed starting at
7308 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7309 and
7310 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7311
7312 Make the skeletons consistent in how they pop the end token and invoke
7313 its %destructor.
7314 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7315 state, which has token number 0, since this would invoke the
7316 %destructor for the end token.
7317 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7318 until after shifting the end token, or else it won't be popped.
7319 * data/yacc.c (yyparse): Likewise.
7320
7321 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7322 it's the end token. Upon termination, destroy an unshifted lookahead
7323 even when it's the end token.
7324 * data/lalr1.cc (yy::parser::parse): Likewise.
7325 * data/yacc.c (yyparse): Likewise.
7326
7327 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7328 value warnings for the end token when the user gives the end token a
7329 %destructor.
7330
7331 * tests/actions.at (Printers and Destructors): Test all the above.
7332
7333 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7334
7335 Update to latest gnulib and gettext versions.
7336 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7337 Add fopen-safer.
7338 (gnulib_files): Add m4/warning.m4. Don't worry about files
7339 overwritten by autopoint.
7340 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7341 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7342 rejects them.
7343 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7344 so that we can remove the intl files at a better time.
7345 (intl_files_to_remove): Remove aclocal.m4, since it gets
7346 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7347 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7348 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7349 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7350 Remove datarootdir hack; no longer needed.
7351 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7352 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7353 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7354 strdup.h.
7355 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7356 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7357
7358 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7359
7360 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7361 it with --assume-autoconf='latest-stable'.
7362
7363 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7364
7365 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7366 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7367 YYSTYPE' and `{'.
7368 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7369 those from muscle_tab.c since the old ones are misleading.
7370
7371 2006-07-13 Akim Demaille <akim@epita.fr>
7372
7373 Support %define "KEY" {VALUE}.
7374 * src/scan-code.h, src/scan-code.l (translate_action)
7375 (translate_rule_action, translate_symbol_action, translate_code):
7376 Return char *, not const char *.
7377 * src/parse-gram.y (declaration): Rename as...
7378 (prologue_declaration): this.
7379 (string_content): Remove this nonterminal, use STRING.
7380 (braceless, content, content.opt): New nonterminal.
7381 Use them.
7382 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7383 as value.
7384 * src/scan-gram.l (getargs.h): Don't include it.
7385
7386 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7387
7388 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7389 rather than a for-loop that declares a local bool variable. This
7390 should work around a compatibility problem with a Cray x1e C++
7391 compiler reported by Hung Nguyen in
7392 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7393 The for-loop was introduced in the 2004-11-17 change but I don't
7394 know why it was needed.
7395
7396 2006-07-12 Akim Demaille <akim@epita.fr>
7397
7398 * data/c.m4: Comment changes.
7399
7400 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
7401
7402 * src/complain.c (error_message, ERROR_MESSAGE): New.
7403 To factor...
7404 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7405 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7406
7407 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7408
7409 * NEWS: Instead of %union, you can define and use your own union type
7410 YYSTYPE if your grammar contains at least one <type> tag.
7411 Your YYSTYPE need not be a macro; it can be a typedef.
7412 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7413 (Union Decl, Decl Summary): Document this.
7414 * data/glr.c (YYSTYPE): Implement this.
7415 * data/glr.cc (YYSTYPE): Likewise.
7416 * data/lalr1.cc (YYSTYPE): Likewise.
7417 * data/yacc.c (YYSTYPE): Likewise.
7418 * src/output.c (prepare): Output tag_seen_flag.
7419 * src/parse-gram.y (declaration, grammar_declaration):
7420 Use 'union_seen' rather than 'typed' to determine whether
7421 %union has been seen, since grammars can now be typed without
7422 %union.
7423 (symbol_declaration, type.opt, symbol_def):
7424 Keep track of whether a tag has been seen.
7425 * src/reader.c (union_seen, tag_seen): New vars.
7426 (typed): remove.
7427 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7428 * src/scan-code.l (untyped_var_seen): New variable.
7429 (handle_action_dollar): Adjust to above changes.
7430 (handle_action_dollar, handle_action_at):
7431 Improve overflow checking for outlandish numbers.
7432 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7433 avoid new diagnostics generated by above changes.
7434 * tests/regression.at (YYSTYPE typedef): Add test to check
7435 for type tags without %union.
7436
7437 * src/symlist.c (symbol_list_length): Return int, not unsigned
7438 int, since callers expect int. This may need to get revisited
7439 once we have proper integer overflow checking.
7440
7441 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7442 object is now static.
7443
7444 * src/getargs.c (flags_argmatch): Return void, not int,
7445 to pacify ./configure --enable-gcc-warnings.
7446
7447 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7448 since last_string is already defined to FLEX_PREFIX (last_string).
7449
7450 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
7451
7452 Implement --warnings/-W.
7453 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7454 replaced by...
7455 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7456 Adjust callers.
7457 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7458 (warnings_args, warnings_types): New.
7459 (getargs, short_options, long_options): Accept -W/--warnings.
7460 Sort the options by alphabetical order, upper case letter right
7461 before its lower case.
7462
7463 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7464
7465 Change %merge result type clash warnings to errors. Discussed at
7466 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7467 * src/reader.c (record_merge_function_type): Use complain_at.
7468 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7469 declared later): Update test case results.
7470
7471 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
7472
7473 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7474 to be in alphabetical order.
7475 (trace_args): Spelling fixes.
7476
7477 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7478
7479 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7480 so they don't collide with user-defined macros.
7481 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7482 this was never guaranteed, and now that we're using gnulib stdint,
7483 which defines int_fast16_t to long int, the problem is exposed.
7484
7485 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7486
7487 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7488 need the full POSIX semantics (and weren't implementing them
7489 anyway).
7490
7491 Adjust to Autoconf 2.60 and today's gnulib.
7492 * bootstrap (gnulib_modules): Add stdint.
7493 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7494 no longer copies it.
7495 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7496 since stdint needs the former and wcwidth (which is now required
7497 by mbswidth) needs the latter.
7498 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7499 work around a compatibility glitch between gettext 0.14.6 and
7500 Autoconf 2.60.
7501 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7502 Do not check for uintptr_t, since new stdint module does the right
7503 thing.
7504 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7505 Add stdint.h, stdint_.h, wcwidth.h.
7506 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7507 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7508 stdint.m4, wchar_t.m4, wcwidth.m4.
7509 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7510 usual order for ../lib/*.h files.
7511 (file_name_split): Use last_component, not base_name, to adjust
7512 to gnulib changes.
7513 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7514 for ../lib/*.h files.
7515 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7516 Define unconditionally, since we now assume the stdint module.
7517 * src/scan-skel.l: Include <dirname.h>.
7518 (BASE_QPUTS): Use last_component, not base_name.
7519 * src/system.h: Include <unlocked-io.h> in the usual order
7520 for ../lib/*.h files. Include <stdint.h> unconditionally,
7521 since we now use the stdint module.
7522 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7523 HAVE_UINTPTR_T, since we now use the stdint module.
7524 (base_name): Remove decl, since files now include <dirname.h>
7525 to get the decl.
7526
7527 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
7528
7529 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7530 New, default to 1.
7531 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7532 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7533 default.
7534 * tests/calc.at: Adjust.
7535
7536 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
7537
7538 * data/c.m4 (b4_basename): New.
7539 (b4_syncline): Also output the location of its invocation (from
7540 the skeleton).
7541 (b4_user_action, b4_define_user_action, b4_user_actions)
7542 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7543 (b4_user_stype): New.
7544 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7545
7546 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7547
7548 In the grammar file, the first column is 1 not 0 on the first line as
7549 on every other line.
7550 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7551 * tests/input.at (Torturing the Scanner): Update output.
7552
7553 * src/scan-gram.l (scanner_cursor): Declare it static.
7554
7555 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7556
7557 In warnings, say "previous declaration" rather than "first
7558 declaration".
7559 * src/symtab.c (redeclaration): Do that here.
7560 * src/reader.c (record_merge_function_type): In the case of a result
7561 type clash, report the previous declaration rather than the very first
7562 one in the grammar file.
7563 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7564 declared later): Add a third declaration to check this behavior.
7565 * tests/input.at (Incompatible Aliases): Update output.
7566
7567 2006-06-27 Akim Demaille <akim@epita.fr>
7568
7569 * doc/Doxyfile.in: New.
7570 * doc/Makefile.am: Use it.
7571 * src/lalr.h, src/symtab.h: Initial doxygenation.
7572
7573 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7574
7575 Don't miss %merge result type warnings just because the LHS types are
7576 declared after the %merge. This continues the effort of the previous
7577 patch.
7578 * src/reader.c (get_merge_function): Don't set the merger type yet.
7579 (record_merge_function_type): New function for setting the merger type
7580 and checking for clashes.
7581 (grammar_current_rule_merge_set): Set the location of the %merge for
7582 the current rule.
7583 (packgram): Invoke record_merge_function_type for each rule now that
7584 all symbol type declarations have been parsed.
7585 * src/reader.h (merger_list.type_declaration_location): New member
7586 storing the location of the first %merge from which the type for this
7587 merging function was derived.
7588 * src/symlist.h (symbol_list.merger_declaration_location): New member
7589 storing the location of a rule's %merge, if any.
7590 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7591 declared later): New test to catch the error fixed by the above patch.
7592
7593 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7594
7595 Get action warnings (grammar_rule_check) right even when symbol
7596 declarations appear after the rules. Discussed at
7597 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7598 and
7599 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7600 Don't mistake the type of $$ in a midrule to be that of its parent
7601 rule's $$.
7602 * src/reader.c (grammar_current_rule_end): Don't invoke
7603 grammar_rule_check yet since not all symbol declarations may have been
7604 parsed yet.
7605 (grammar_midrule_action): Likewise.
7606 Don't record whether the midrule's $$ has been used yet since actions
7607 haven't been translated yet.
7608 Record the midrule's parent rule and its RHS index within the parent
7609 rule.
7610 (grammar_current_rule_action_append): Don't translate the action yet
7611 since not all symbol declarations may have been parsed yet and, thus,
7612 warnings about types for $$, $n, @$, and @n can't be reported yet.
7613 (packgram): Translate the action and invoke grammar_rule_check now that
7614 all symbol declarations have been parsed.
7615 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7616 after parsing the entire grammar file, the symbol list here in the case
7617 of a midrule is actually the midrule's empty RHS, so reference its
7618 parent rule's RHS where necessary.
7619 On the other hand, now that you can already know it's a midrule, you
7620 aren't forced to think $$ has the same type as its parent rule's $$.
7621 (handle_action_at): In the case of a midrule, reference the parent rule
7622 where necessary.
7623 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7624 members.
7625 (symbol_list_length): Now that this is invoked after all rules have
7626 been parsed, a NULL symbol (rather than a NULL symbol list node)
7627 terminates a rule. symbol_list_print already does this correctly.
7628 * src/symlist.h (symbol_list.midrule_parent_rule,
7629 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7630 remember their relationships with their parents.
7631 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7632 fixed by the above patch.
7633 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7634 implementing...
7635 (Unused values): ... this old test case and...
7636 (Unused values before symbol declarations): ... this new test case.
7637 This one is the same as `Unused values' except that all symbol
7638 declarations appear after the rules in order to catch the rest of the
7639 errors fixed by the above patch.
7640
7641 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7642
7643 More cleanup.
7644 * src/reader.c (current_rule): Declare it static since it's no longer
7645 used outside this file.
7646 (grammar_current_rule_action_append): Remove redundant arguments from
7647 translate_rule_action invocation.
7648 * src/reader.h (current_rule): Remove this unused extern.
7649 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7650 * src/scan-code.l (translate_rule_action): Likewise.
7651
7652 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7653
7654 Clean up yesterday's patch.
7655 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7656 to...
7657 * src/reader.c (grammar_current_rule_action_append): ... here for
7658 consistency with grammar_current_rule_symbol_append.
7659 * tests/regression.at (Braced code in declaration in rules section):
7660 Make yyerror and yylex static as usual.
7661
7662 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7663
7664 Fix bug that mistakes braced code in a declaration in the rules section
7665 to be a rule action. Mentioned at
7666 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7667 * src/scan-gram.l: Move midrule action detection from the start of the
7668 scanning of any braced code to...
7669 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7670 action. For readability, use $2 and @2 rather than the equivalent
7671 global variables.
7672 * tests/regression.at (Braced code in declaration in rules section):
7673 New test to catch the error fixed by the above patch.
7674
7675 Work on code readability some.
7676 * src/scan-code.l (current_rule): Get rid of this misleading and
7677 redundant declaration: it's actually extern'ed in reader.h.
7678 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7679 translate_action): Add a rule argument and use it instead of the global
7680 current_rule.
7681 (translate_rule_action): This already receives current_rule through an
7682 argument, so pass it on to translate_action instead of assigning
7683 current_rule to current_rule.
7684 (translate_symbol_action, translate_code): Pass rule = NULL to
7685 translate_action.
7686
7687 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7688
7689 Rename %before-definitions to %start-header and %after-definitions to
7690 %end-header. Don't use these declarations to separate pre-prologue
7691 blocks from post-prologue blocks. Add new order-independent
7692 declarations %before-header and %after-header as alternatives to the
7693 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7694 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7695 * NEWS (2.3+): Update for these changes.
7696 * data/glr.c (b4_before_definitions): Update to...
7697 (b4_start_header): ... this.
7698 (b4_after_definitions): Update to...
7699 (b4_end_header): ... this.
7700 * data/glr.cc: Likewise.
7701 * data/lalr1.cc: Likewise.
7702 * data/yacc.c: Likewise.
7703 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7704 prologue blocks with %*-header declarations.
7705 (Calc++ Parser): Likewise.
7706 (Decl Summary): Update names.
7707 (Table of Symbols): Update description.
7708 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7709 (PERCENT_END_HEADER): ... this.
7710 (PERCENT_BEFORE_DEFINITIONS): Update to...
7711 (PERCENT_START_HEADER): ... this.
7712 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7713 (declaration): Update token names and m4 macro names.
7714 When parsing %end-header and %start-header, invoke translate_code
7715 before muscle_code_grow, and no longer set global booleans to remember
7716 whether these declarations have been seen.
7717 Parse new %after-header and %before-header.
7718 * src/reader.c (before_definitions, after_definitions): Remove.
7719 (prologue_augment): Accept a new bool argument to specify whether to
7720 augment the pre-prologue or post-prologue.
7721 * src/reader.h (before_definitions, after_definitions): Remove these
7722 extern's.
7723 (prologue_augment): Add new bool argument.
7724 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7725 (PERCENT_END_HEADER): ... this.
7726 (PERCENT_BEFORE_DEFINITIONS): Update to...
7727 (PERCENT_START_HEADER): ... this.
7728 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7729 * tests/actions.at (Printers and Destructors): Update names.
7730
7731 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7732
7733 Add comparison operators for C++ location classes. Discussed at
7734 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7735 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7736 declaration indicating whether filename_type has an operator==. If
7737 filename_type is `std::string', it defaults to `1', `0' otherwise.
7738 * data/location.cc: Iff b4_define_location_comparison is `1', add
7739 operator== and operator!= for class position and for class location.
7740
7741 Some minor fixes.
7742 * src/scan-action.l: Remove unused file.
7743 * src/symtab.c (symbol_printer_set): Use printer_location not
7744 destructor_location.
7745 * src/symtab.h (struct symbol): Replace incorrect source comment for
7746 printer members.
7747 * tests/input.at (Incompatible Aliases): Update output with correct
7748 printer location.
7749
7750 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7751
7752 Don't put the pre-prologue in the header file. For the yacc.c code
7753 file and the glr.c header and code files, move the pre-prologue before
7754 the token definitions. Add new %before-definitions and
7755 %after-definitions to declare code that will go in both the header file
7756 and code file. Discussed at
7757 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7758 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7759 and
7760 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7761 * NEWS (2.3+): Describe these changes.
7762 * data/glr.c (b4_pre_prologue): Move from within to before...
7763 (b4_shared_declarations): ... this.
7764 Add new b4_before_definitions before b4_token_enums.
7765 Add new b4_after_definitions at the end.
7766 * data/glr.cc (b4_pre_prologue): Replace with...
7767 (b4_before_definitions): ... this in the header file.
7768 (b4_after_definitions): New near the end of the header file.
7769 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7770 code file right before including the header file.
7771 (b4_before_definitions): New in the previous position of
7772 b4_pre_prologue in the header file.
7773 (b4_after_definitions): New near the end of the header file.
7774 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7775 (b4_token_enums_defines): In the code file, move to right before
7776 YYSTYPE for consistency with the header file.
7777 (b4_before_definitions): New right before b4_token_enums_defines in
7778 both the header and code file.
7779 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7780 header and code file.
7781 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7782 of prologues for %union dependencies.
7783 (Decl Summary): In %defines description, mention the effect of
7784 %before-definitions and %after-definitions on the header file.
7785 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7786 than in the pre-prologue so that make check succeeds.
7787 (Table of Symbols): Add entries for %before-definitions and
7788 %after-definitions.
7789 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7790 %before-definitions.
7791 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7792 (declaration): Parse those declarations and append to
7793 b4_before_definitions and b4_after_definitions, respectively.
7794 * src/reader.c (before_definitions, after_definitions): New bools to
7795 track whether those declarations have been seen.
7796 (prologue_augment): Add to the post-prologue if %union,
7797 %before-definitions, or %after-definitions has been seen.
7798 * src/reader.h (before_definitions, after_definitions): New extern's.
7799 * src/scan-gram.l: Scan the new declarations.
7800 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
7801 prologue block in a %before-definitions or a %after-definitions based
7802 on whether the %union is declared.
7803 * tests/regression.at (Early token definitions with --yacc, Early token
7804 definitions without --yacc): Move tests for token definitions into the
7805 post-prologue since token names are no longer defined in the
7806 pre-prologue.
7807
7808 2006-06-20 Akim Demaille <akim@epita.fr>
7809
7810 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
7811 (symbol_get): Use it.
7812 * src/parse-gram.y: Use it.
7813
7814 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
7815
7816 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
7817 build succeeds when configured with --enable-gcc-warnings.
7818
7819 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
7820
7821 * src/parse-gram.y (char_name): New function.
7822 (CHAR, STRING, string_content): For %printer, properly escape.
7823 (ID): Prefer fputs to fprintf.
7824 (id): Reindent to be consistent with other rules.
7825 Properly quote char.
7826
7827 The Translation Project changed its way of publishing translations
7828 to maintainers. I haven't received any responses to my request
7829 for supporting the old way, or for documenting the new way. I
7830 have modified 'bootstrap' to use screen scraping
7831 (in this case, HTML scraping). This is unreliable and inelegant,
7832 but I don't see any better way. Yuck.
7833 * bootstrap (TP_URL, WGET_COMMAND): New vars.
7834 (get_translations): New function, which uses HTML scraping to
7835 deduce locations of latest translations.
7836 Use this function to grab both bison and bison-runtime .po files.
7837 Don't bother priming the pump for the runtime-po domain any more,
7838 as it's now translated better than bison is.
7839
7840 2006-06-19 Akim Demaille <akim@epita.fr>
7841
7842 * src/scan-gram.l: No longer "parse" things after `%union' until
7843 `{'. Rather, return a single "%union" token.
7844 No longer make symbols: return strings, and leave the conversion
7845 to symbols to the parser.
7846 (SC_PRE_CODE, token_type): Remove.
7847 * src/parse-gram.y (%union): New field `character'.
7848 Sort tokens.
7849 (CHAR): New token.
7850 (ID, ID_COLON): Now that the scanner no longer makes them
7851 identifiers, adjust all uses to invoke symbol_get.
7852 (id_colon): New, wraps the conversion from string to symbol.
7853 (%union): Accept a possible union_name.
7854 (symbol): Now can be a char.
7855 * data/c.m4 (b4_union_name): Leave a default value.
7856 * data/glr.c, data/yacc.c: Use it.
7857
7858 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
7859
7860 For associating token numbers with token names for "yacc.c", don't use
7861 #define statements unless `--yacc' is specified; always use enum
7862 yytokentype. Most important discussions start at:
7863 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
7864 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
7865 and
7866 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
7867 * NEWS (2.3+): Mention.
7868 * data/c.m4 (b4_yacc_if): New.
7869 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
7870 token #define's.
7871 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
7872 on token name definitions.
7873 * src/getargs.c (usage): Capitalize `Yacc' in English.
7874 * src/output.c (prepare): Define b4_yacc_flag.
7875 * tests/regression.at (Early token definitions): Test that tokens names
7876 are defined before the pre-prologue not just before the post-prologue.
7877 Remove this test case and copy to...
7878 (Early token definitions with --yacc): ... this to test #define's.
7879 (Early token definitions without --yacc): ... and this to test enums.
7880
7881 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
7882
7883 * NEWS: Reword the post-2.3 change to not be so optimistic about
7884 removing the old "look-ahead" spelling.
7885 Update previous look-ahead/lookahead change reports.
7886 * REFERENCES: look-ahead -> lookahead (since that's
7887 what he actually wrote).
7888 * doc/refcard.tex: look ahead -> lookahead,
7889 look-ahead -> lookahead
7890
7891 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
7892
7893 For consistency, use `lookahead' instead of `look-ahead' or
7894 `look_ahead'. Discussed starting at
7895 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
7896 and then at
7897 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
7898 * NEWS: For the next release, note the change to `--report'.
7899 * TODO, doc/bison.1: Update English.
7900 * doc/bison.texinfo: Update English.
7901 (Understanding Your Parser, Bison Options): Document as
7902 `--report=lookahead' rather than `--report=look-ahead'.
7903 * src/conflicts.c: Update English in comments.
7904 (lookahead_set): Rename from look_ahead_set.
7905 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
7906 (resolve_sr_conflict): Rename local look_ahead_tokens to
7907 lookahead_tokens, and update other uses.
7908 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
7909 count_rr_conflicts, conflicts_free): Update uses.
7910 * src/getargs.c (report_args): Move "lookahead" before alternate
7911 spellings.
7912 (report_types): Update uses.
7913 (usage): For `--report' usage description, state `lookahead' spelling
7914 rather than `look-ahead'.
7915 * src/getargs.h (report.report_lookahead_tokens): Rename from
7916 report_look_ahead_tokens.
7917 * src/lalr.c: Update English in comments.
7918 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
7919 (state_lookahead_tokens_count): Rename from
7920 state_look_ahead_tokens_count.
7921 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7922 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
7923 Rename local n_look_ahead_tokens to n_lookahead_tokens.
7924 Update other uses.
7925 Update English in output.
7926 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
7927 * src/print.c: Update English in comments.
7928 (lookahead_set): Rename from look_ahead_set.
7929 (print_reduction): Rename argument lookahead_token from
7930 look_ahead_token.
7931 (print_core, state_default_rule, print_reductions, print_results):
7932 Update uses.
7933 * src/print_graph.c: Update English in comments.
7934 (print_core): Update uses.
7935 * src/state.c: Update English in comments.
7936 (reductions_new): Update uses.
7937 (state_rule_lookahead_tokens_print): Rename from
7938 state_rule_look_ahead_tokens_print, and update other uses.
7939 * src/state.h: Update English in comments.
7940 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
7941 (state_rule_lookahead_tokens_print): Rename from
7942 state_rule_look_ahead_tokens_print.
7943 * src/tables.c: Update English in comments.
7944 (conflict_row, action_row): Update uses.
7945 * tests/glr-regression.at
7946 (Incorrect lookahead during deterministic GLR,
7947 Incorrect lookahead during nondeterministic GLR): Rename
7948 print_look_ahead to print_lookahead.
7949 * tests/torture.at: Update English in comments.
7950 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
7951 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
7952 (Many lookahead tokens): Update uses.
7953 * data/glr.c: Update English in comments.
7954 * lalr1.cc: Likewise.
7955 * yacc.c: Likewise.
7956 * src/conflicts.h: Likewise.
7957 * src/lalr.h: Likewise.
7958 * src/main.c: Likewise.
7959 * src/output.c: Likewise.
7960 * src/parse-gram.c: Likewise.
7961 * src/tables.h: Likewise.
7962 * tests/calc.at: Likewise.
7963
7964 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
7965
7966 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
7967
7968 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
7969
7970 * TODO: Add request from Nelson H. F. Beebe to be able to install
7971 Bison without installing the yacc script.
7972
7973 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7974
7975 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
7976 and yytext if they're already #define'd.
7977 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
7978 * src/scan-code-c.c: ... here.
7979 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
7980 <config.h>.
7981
7982 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
7983
7984 Get Bison to build again when configured with --enable-gcc-warnings.
7985 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
7986 missing #include's.
7987 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
7988 loc argument as it shadows a global.
7989 * src/scan-gram.l: Remove stray comma that prevents boundary_set
7990 invocation.
7991
7992 * src/.cvsignore: Add scan-code.c.
7993
7994 2006-06-07 Akim Demaille <akim@epita.fr>
7995
7996 * src/scan-gram.l: Move the "add a trailing ; to actions" code
7997 to...
7998 * src/scan-code.l: here.
7999 * tests/input.at (Torturing the Scanner): Fix another location
8000 error.
8001
8002 2006-06-07 Akim Demaille <akim@epita.fr>
8003
8004 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
8005
8006 2006-06-06 Akim Demaille <akim@epita.fr>
8007
8008 Extract the parsing of user actions from the grammar scanner.
8009 As a consequence, the relation between the grammar scanner and
8010 parser is much simpler. We can also split "composite tokens" back
8011 into simple tokens.
8012 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
8013 * src/scan-gram.l (add_column_width, adjust_location): Move to and
8014 rename as...
8015 * src/location.h, src/location.c (add_column_width)
8016 (location_compute): these.
8017 Fix the column count: the initial column is 0.
8018 (location_print): Be robust to ending column being 0.
8019 * src/location.h (boundary_set): New.
8020 * src/main.c: Adjust to scanner_free being renamed as
8021 gram_scanner_free.
8022 * src/output.c: Include scan-code.h.
8023 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
8024 Use boundary_set.
8025 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
8026 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
8027 which is now, again, a separate token.
8028 Adjust all dependencies.
8029 Whereever actions with $ and @ are used, use translate_code.
8030 (action): Remove this nonterminal which is now useless.
8031 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8032 (grammar_current_rule_action_append): Use translate_code.
8033 (packgram): Bound check ruleno, itemno, and rule_length.
8034 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8035 (last_string, last_braced_code_loc, max_left_semantic_context)
8036 (scanner_initialize, scanner_free, scanner_last_string_free)
8037 (gram_out, gram_lineno, YY_DECL_): Move to...
8038 * src/scan-gram.h: this new file.
8039 (YY_DECL): Rename as...
8040 (GRAM_DECL): this.
8041 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8042 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8043 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8044 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8045 Move these declarations, and...
8046 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8047 these to...
8048 * src/flex-scanner.h: this new file.
8049 * src/scan-gram.l (rule_length, rule_length_overflow)
8050 (increment_rule_length): Remove.
8051 (last_braced_code_loc): Rename as...
8052 (gram_last_braced_code_loc): this.
8053 Adjust to the changes of the parser.
8054 Move all the handling of $ and @ into...
8055 * src/scan-code.l: here.
8056 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8057 (handle_action_dollar, handle_action_at): Move to...
8058 * src/scan-code.l: here.
8059 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8060 scan-code.h, scan-code-c.c, scan-gram.h.
8061 (EXTRA_bison_SOURCES): Add scan-code.l.
8062 (BUILT_SOURCES): Add scan-code.c.
8063 (yacc): Be robust to white spaces.
8064
8065 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8066 * tests/regression.at: Adjust the column numbers.
8067 * tests/regression.at: Adjust the error message.
8068
8069 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8070
8071 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8072 Use Akim's wording from
8073 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8074
8075 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8076
8077 Between Bison releases, manually append `+' to the previous Bison
8078 release number, and use that as a signal to automatically print the
8079 ChangeLog's CVS Id keyword from --version. Discussed starting at
8080 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8081 * ChangeLog: Add Id header.
8082 * configure.ac (AC_INIT): Append `+' to `2.3'.
8083 * src/.cvsignore: Add revision.c.
8084 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8085 (BUILT_SOURCES): Add revision.c.
8086 (revision.c): New target rule. This file defines a new global variable
8087 named revision. It initializes it with either the Id from ChangeLog
8088 or, if VERSION doesn't contain `+', with the empty string.
8089 * src/getargs.c (version): Print the value of revision.
8090 * src/revision.h: Extern revision.
8091
8092 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8093
8094 * NEWS: Version 2.3.
8095 * configure.ac (AC_INIT): Likewise.
8096
8097 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8098
8099 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8100 with no arguments, not as an object-like macro. This is for
8101 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8102 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8103 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8104 Document this.
8105
8106 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8107
8108 * src/getargs.c (usage): Back out yesterday's modification of the
8109 --help output so that we don't have to wait for translation before
8110 releasing 2.3.
8111
8112 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
8113
8114 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
8115 Problem reported by Akim Demaille.
8116
8117 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
8118
8119 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8120
8121 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
8122
8123 * data/yacc.c (yy_reduce_print): Omit trailing white space in
8124 generated source code. Problem reported by Frans Englich in
8125 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
8126
8127 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
8128
8129 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
8130 shell, not within 'make', so that 'make' by an ordinary builder
8131 (using GNU make) does not worry about configuring gzip. This also
8132 works around a bug reported independently by Keith Thompson and by
8133 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
8134 stderr rather than stdout, messing up the build logs.
8135
8136 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8137
8138 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
8139 to make sure that YYID will never be unused. This fixes a 'make
8140 maintainer-check' failure caused by the recent changes to the 'Trivial
8141 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
8142 not used.
8143 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
8144
8145 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8146
8147 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
8148 state before an empty RHS is always resolved here. Only the location
8149 of that state is guaranteed to be resolved, and that's enough. This
8150 fixes the remaining bug reported by Derek M. Jones in
8151 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8152 * tests/glr-regression.at (Uninitialized location when reporting
8153 ambiguity): Test the above case.
8154 Also, the embedded comments in this test case claim it checks the case
8155 of an empty RHS that has inherited the initial location. However, the
8156 corresponding LHS was already resolved, so yyresolveLocations didn't
8157 actually have reason to modify it. Fix this by forcing
8158 nondeterministic operation at the beginning of the parse.
8159
8160 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
8161
8162 * data/c.m4 (b4_yy_symbol_print_generate):
8163 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
8164 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
8165 of the bugs reported today by Derek M Jones in
8166 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8167 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
8168 defined to be a type name without parens or brackets.
8169 (Location Type): Similarly for YYLTYPE.
8170 * tests/regression.at (Trivial grammars): Put in a test for this
8171 bug that will be caught by 'make maintainer-check' (though not,
8172 alas, by 'make check' unless your compiler is picky).
8173
8174 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
8175
8176 * NEWS: Version 2.2.
8177 * configure.ac (AC_INIT): Likewise.
8178
8179 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
8180
8181 * data/glr.c (yyreportTree): Make room in yystates for the state
8182 preceding the RHS. This fixes the segmentation fault reported by Derek
8183 M. Jones in
8184 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
8185 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
8186 to the user. Reported for yyreportTree by Derek M. Jones later in the
8187 same thread.
8188 * THANKS: Add Derek M. Jones.
8189 Update my email address.
8190 Fix typo in Steve Murphy's name.
8191
8192 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
8193
8194 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
8195 checking against YYLAST that caused the parser to miss a potential
8196 alternative in its diagnostic.
8197 Problem reported by Maria Jose Moron Fernandez in
8198 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
8199 * data/lalr1.cc (yysyntax_error_): Likewise.
8200 * data/yacc.c (yysyntax_error): Likewise.
8201 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
8202 tokens, in case we run into an older C compiler.
8203 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
8204 Use them to check for the off-by-one error fixed above.
8205
8206 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
8207 YYSIZE_T, not size_t.
8208 * tests/regression.at (Trivial grammars): New test, to catch
8209 the error fixed by the above patch.
8210
8211 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8212
8213 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
8214 scheme.
8215 Reported by Steve Murphy.
8216
8217 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8218
8219 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
8220 * data/glr.cc: b4_location_flag is now b4_locations_flag.
8221
8222 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8223
8224 Implement --trace=m4.
8225 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
8226 * src/output.c (output_skeleton): When set, pass -dV to m4.
8227
8228 Factor the handling of flags in m4.
8229 * src/output.c (prepare): Rename the muscle names debug, defines,
8230 error_verbose to debug_flag, defines_flag, error_verbose_flag.
8231 * data/c.m4: Adjust.
8232 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
8233 Use b4_define_flag_if to define other b4_FLAG_if macros.
8234 (b4_location_if): As a consequence, rename as...
8235 (b4_locations_if): this, for consistency.
8236 Adjust all the skeletons.
8237
8238 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8239
8240 * etc/bench.pm: Shorten bench names.
8241
8242 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8243
8244 * src/output.h, src/output.c (error_verbose): Move to...
8245 * src/getargs.h, src/getargs.c: here.
8246 Sort the flags.
8247 Adjust dependencies.
8248
8249 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
8250
8251 * data/c.m4 (b4_copyright): Put the special exception for Bison
8252 skeletons here, so we don't have to put it in each skeleton. All
8253 uses changed. Suggested by Akim Demaille. Also, wrap the
8254 copyright notice, in case it is longer than 80 columns. Replace
8255 comma by newline after title.
8256
8257 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
8258
8259 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
8260 incompatibility, not a bug. Mention that it wasn't fixed as of
8261 flex 2.5.33.
8262
8263 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
8264
8265 * examples/extexi: Enforce the precedence of concatenation over
8266 >>.
8267 Reported by Tommy Nordgren.
8268
8269 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
8270
8271 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8272 with the member "token".
8273 Reported by Martin Nylin.
8274
8275 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8276
8277 * data/glr.c: Switch to Bison 2.2 special-exception language in
8278 the copyright notice. Use more-regular format for titles and
8279 copyright notices.
8280 * data/glr.cc: Likewise.
8281 * data/location.cc: Likewise.
8282 * data/yacc.cc: Likewise.
8283 * doc/bison.texinfo (Conditions): Document this.
8284 * NEWS: likewise. Upgrade version to 2.2.
8285
8286 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
8287
8288 * data/glr.cc: Remove dead code.
8289
8290 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8291
8292 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8293 that variable and the line breaks the bootstrap. Problem reported
8294 by Juan M. Guerrero.
8295
8296 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
8297
8298 * doc/bison.texinfo (Multiple start-symbols): New.
8299
8300 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
8301
8302 * etc/README, etc/bench.pl: New.
8303
8304 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
8305
8306 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8307 rule.
8308 Reported by Mickael Labau.
8309 * tests/input.at (Torturing the Scanner): Test it.
8310
8311 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8312
8313 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8314 Problem reported by Bob Rossi.
8315
8316 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8317
8318 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8319 and didn't really work.
8320 For the index, use @ifnotinfo, not @iftex.
8321 Minor cleanups of spacing and terminology.
8322
8323 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
8324
8325 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8326 of AT_NAME_PREFIX when %name-prefix is not used.
8327
8328 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
8329
8330 Apply --prefix to C++ skeletons too: they change the namespace.
8331 The test suite already exercize these cases.
8332 * data/c++.m4 (b4_namespace): New.
8333 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8334 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8335 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8336 * doc/bison.texinfo: Document it.
8337 (Option Cross Key): Use @multitable in all formats. It looks
8338 nicer, even in TeX outputs.
8339 (Rules): Use the same code whatever the output type is.
8340 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8341 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8342 * tests/calc.at: Use it, instead of hard coding `yy'.
8343
8344 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8345
8346 * TODO: Remove dead items.
8347
8348 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8349
8350 * doc/FAQ: Remove, merged into...
8351 * doc/bison.texinfo (FAQ): this.
8352 * doc/Makefile.am (EXTRA_DIST): Adjust.
8353
8354 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8355
8356 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8357 even if empty.
8358 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8359 * doc/bison.texinfo (Calc++ Scanner): Use it.
8360
8361 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8362
8363 Fix two nits reported by twlevo, plus one more that I discovered.
8364
8365 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8366 this is the usual Bison style.
8367 * src/location.h (location_print): Likewise.
8368
8369 * src/reader.h (token_name): Likewise.
8370
8371 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8372
8373 Fix some nits reported by twlevo.
8374 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8375 and "POSIX". Use more-modern syntax for URLs. Mention C++
8376 and ask for Java. Don't hardwire OS version numbers. Add
8377 copyright notice.
8378 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8379 * src/conflicts.c (solved_conflicts_obstack): Now static.
8380
8381 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8382
8383 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8384 page. Say "you can use it" not "you may use it" as on the web page;
8385 we're describing capabilities not granting permission.
8386
8387 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8388
8389 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8390 shadowing warnings. Use usual patter for iterating through RHS.
8391 * tests/glr-regression.at
8392 (Uninitialized location when reporting ambiguity):
8393 Modify yylex so that it uses its argument, rather than trying
8394 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8395 const char -> char const.
8396
8397 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8398 Don't use tabs inside commands; it messes up 'ps'.
8399 Problem reported by twlevo.
8400
8401 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8402
8403 * tests/glr-regression.at (Uninitialized location when reporting
8404 ambiguity): New test case.
8405 * data/glr.c (yyresolveLocations): New function, which uses
8406 YYLLOC_DEFAULT.
8407 (yyresolveValue): Invoke yyresolveLocations before reporting an
8408 ambiguity.
8409 * doc/bison.texinfo (Default Action for Locations): Note
8410 YYLLOC_DEFAULT's usage for ambiguity locations.
8411 (GLR Semantic Actions): Cross-reference those notes.
8412
8413 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8414
8415 * tests/glr-regression.at (Leaked semantic values when reporting
8416 ambiguity): Remove unnecessary union and type declarations.
8417 (Leaked lookahead after nondeterministic parse syntax error): New test
8418 case.
8419 * data/glr.c (yyparse): Check for zero stacks remaining before
8420 attempting to shift the lookahead so that you don't lose it.
8421
8422 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8423
8424 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8425 * tests/glr-regression.at (Leaked semantic values when reporting
8426 ambiguity): New test case.
8427 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8428 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8429 now unnecessary yystackp parameter.
8430 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8431 destructors can be called.
8432
8433 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8434 in existing testcases.
8435
8436 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8437
8438 Don't leak semantic values for parent RHS when a user action cuts the
8439 parser, and clean up related code a bit.
8440 * tests/glr-regression.at (Leaked merged semantic value if user action
8441 cuts parse): Rename to...
8442 (Leaked semantic values if user action cuts parse): ... this. Add check
8443 for leaked parent RHS values.
8444 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8445 between an unresolved state (non-empty chain of semantic options) and
8446 an incomplete one (signaled by an empty chain).
8447 (yyresolveStates): Document the interface. Move all manipulation of a
8448 successfully or unsuccessfully resolved yyGLRState to...
8449 (yyresolveValue): ... here so that yyresolveValue always leaves a
8450 yyGLRState with consistent data and thus is easier to understand.
8451 Remove the yyvalp and yylocp parameters since they are always just
8452 taken from the yys parameter. When reporting a discarded merged value
8453 in debugging output, note that it is incompletely merged. Document the
8454 interface.
8455 (yyresolveAction): If resolving any of the RHS states fails, destroy
8456 them all rather than leaking them. Thus, as long as user actions are
8457 written to clean up the RHS correctly, yyresolveAction always cleans up
8458 the RHS of a semantic option. Document the interface.
8459
8460 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8461
8462 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8463 led to a segmentation fault in GNU Pascal. Problem reported
8464 by Waldek Hebisch.
8465
8466 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8467
8468 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8469 mid-rule action inside a nonterminal symbol in order to declare a
8470 destructor for its semantic value.
8471
8472 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8473
8474 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8475 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8476 __cplusplus && ! defined _STDLIB_H && !
8477 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8478 defined free))]: Include <stdlib.h> rather than rolling our own
8479 declarations of malloc and free, to avoid problems with
8480 incompatible declarations (using 'throw') C++'s stdlib.h. This
8481 should fix Debian bug 340012
8482 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8483 reported by Guillaume Melquiond.
8484
8485 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8486
8487 * NEWS: Clarify symbols versus types in unused-value warnings.
8488
8489 * configure.ac (AC_INIT): Bump version number.
8490
8491 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8492
8493 * NEWS: Version 2.1a.
8494 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8495 since C99 requires this.
8496
8497 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8498
8499 * m4/c-working.m4: New file.
8500 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8501
8502 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8503
8504 * Makefile.maint: Merge from coreutils.
8505
8506 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8507
8508 More portability fixes for problems summarized by Nelson H. F. Beebe.
8509
8510 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8511 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8512 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8513 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8514 messes up because C++ code is compiled in 32-bit mode but linked
8515 in 64-bit mode.
8516
8517 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8518
8519 More portability fixes for problems summarized by Nelson H. F. Beebe.
8520
8521 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8522 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8523
8524 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8525 nodist_PROGRAMS, since we don't need to actually compile the
8526 example if we're just doing a plain 'make'. This avoids bothering
8527 the installer unnecessarily about problems due to weird C++
8528 compilers.
8529
8530 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8531
8532 More portability fixes for problems summarized by Nelson H. F. Beebe.
8533
8534 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8535 than #include "...", and compile with -I'.'. The old method was
8536 not portable, according to Posix and the C standard, and it does
8537 not work with Sun C 5.7, where previous #line directives affect
8538 the working directory used in later #include "..." directives.
8539
8540 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8541
8542 Various DJGGP specific issues in /djgpp
8543
8544 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8545
8546 More portability fixes for problems summarized by Nelson H. F. Beebe.
8547
8548 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8549 '#include <map>' works and that you can apply ++ to iterators.
8550
8551 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8552
8553 Work around portability problems summarized by Nelson H. F. Beebe in
8554 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8555
8556 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8557 that '#include <string>' works.
8558
8559 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8560 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8561 "warning: sorry: semantics of inline function static data `const
8562 unsigned char translate_table[262]' are wrong (you'll wind up with
8563 multiple copies)".
8564
8565 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8566 or, xor to not_, and_, or_, and xor_, respectively. This works
8567 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8568 random system header somewhere that includes the equivalent of
8569 <iso646.h>.
8570
8571 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8572 -E" works; it apparently doesn't work with PathScale EKO Compiler
8573 Suite Version 2.0.
8574
8575 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8576
8577 During deterministic GLR operation, user actions should be able to
8578 influence the parse by changing yychar. To make this easier to fix and
8579 to make glr.c easier to evolve in general, don't maintain yytoken in
8580 parallel with yychar; just compute yytoken when needed.
8581 * tests/glr-regression.at (Incorrect lookahead during deterministic
8582 GLR): Check that setting yychar in a user action has the intended
8583 effect.
8584 * data/glr.c (yyGLRStack): Remove yytokenp member.
8585 (yyclearin): Don't set *yytokenp.
8586 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8587 yychar rather than *yytokenp to determine the current lookahead.
8588 Compute yytoken locally when needed.
8589 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8590 point to.
8591
8592 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8593 after `--report' documentation.
8594
8595 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8596
8597 * src/parse-gram.y (grammar_declaration): Location of printer
8598 symbol is @1, not list->location. Bug reported by twlevo.
8599 * tests/input.at (Incompatible Aliases): Adjust to above change.
8600
8601 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8602
8603 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8604 all the test at once. This makes the output easier to read in the
8605 normal case.
8606
8607 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8608 got from <http://bro-ids.org/download.html>. The bug is that
8609 when two actions appeared in succession, the second one was
8610 scanned before the first one was added to the grammar rule
8611 as a midrule action. Bison then output the incorrect warning
8612 "parse.y:905.17-906.36: warning: unused value: $3".
8613 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8614 associated with a value.
8615 (rhs): Don't invoke grammar_current_rule_action_append.
8616 (action): Invoke it here instead.
8617 * src/reader.c (grammar_midrule_action): Now extern.
8618 (grammar_current_rule_action_append): Don't invoke
8619 grammar_midrule_action; that is now the scanner's job.
8620 * src/reader.h (last_string, last_braced_code_loc):
8621 (grammar_midrule_action): New decls.
8622 * src/scan-gram.l (last_string): Now extern, sigh.
8623 (last_braced_code_loc): New extern variable.
8624 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8625 rule already has an action.
8626 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8627 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8628 Add some tests to check that the above changes fixed the bug.
8629
8630 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8631
8632 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8633 All used changed. Check whether the symbol has a destructor,
8634 not whether it is typed.
8635 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8636 that the values are still reported as unused. All line numbers
8637 adjusted.
8638
8639 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8640
8641 Work around a bug in bro 0.8, which underparenthesizes its
8642 definition of YYLLOC_DEFAULT.
8643 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8644 their arguments.
8645 * data/lalr1.cc: Likewise.
8646 * data/yacc.cc: Likewise.
8647
8648 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8649
8650 Work around a bug in Pike 7.0, and give the Pike folks a
8651 better way to override the usual int widths.
8652 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8653 user can override the types.
8654 (short): #undef, to work around a bug in Pike 7.0.
8655 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8656 (union yyalloc.yyss): Use yytype_int16 rather than short.
8657 All uses changed.
8658 (yysigned_char): Remove.
8659 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8660 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8661 * tests/regression.at (Web2c Actions): Adjust to above changes.
8662
8663 * src/reader.c (check_and_convert_grammar): New function.
8664 (reader): Close the input file even if something went wrong during
8665 parsing. Minor file descriptor leak reported by twlevo.
8666
8667 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8668 to pacify gcc -Wswitch-default.
8669 * src/scan-gram.l (adjust_location): Use a default: break; case
8670 to pacify gcc -Wswitch-default.
8671 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8672 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8673 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8674 Move these decls to scan-skel.l, since they don't need to be
8675 visible elsewhere.
8676 * src/scan-skel.l: Accept the above decls.
8677 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8678 is used.
8679
8680 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8681
8682 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8683 since we don't want to insist on a version number at the start
8684 of the changelog every time.
8685 * Makefile.maint: Sync from coreutils a bit better.
8686 (sc_trailing_blank): Renamed from sc_trailing_space.
8687 All uses changed.
8688 (sc_no_if_have_config_h, sc_require_config_h):
8689 (sc_prohibit_assert_without_use): New rules.
8690 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8691 (sc_dd_max_sym_length): Fix leading spaces in rule.
8692 (sc_system_h_headers): Prefix with @.
8693 (sc_useless_cpp_parens, m4-check): Output line numbers.
8694 (changelog-check): Allow version only in head.
8695 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8696 satisfy new Makefile.maint rule.
8697 * data/glr.c: Likewise.
8698 * data/glr.cc: Likewise.
8699 * data/lalr1.cc: Likewise.
8700 * data/yacc.c: Likewise.
8701 * lib/ebitsetv.c: Likewise.
8702 * lib/lbitset.c: Likewise.
8703 * lib/subpipe.c: Likewise.
8704 * lib/timevar.c: Likewise.
8705 * src/system.h: Likewise.
8706 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8707 * djgpp/Makefile.maint: Add copyright notice.
8708 * djgpp/README.in: Likewise.
8709 * djgpp/config.bat: Likewise.
8710 * djgpp/config.site: Likewise.
8711 * djgpp/config_h.sed: Likewise.
8712 * djgpp/djunpack.bat: Likewise.
8713 * djgpp/config.sed: Fix copyright notice to match standard format.
8714 * djgpp/subpipe.h: Likewise.
8715 * lib/bitsetv-print.c: Likewise.
8716 * lib/bitsetv.c: Likewise.
8717 * lib/subpipe.h: Likewise.
8718 * lib/timevar.c: Likewise.
8719 * lib/timevar.h: Likewise.
8720 * djgpp/subpipe.c: Use standard recipe for config.h.
8721 * lib/abitset.c: Likewise.
8722 * lib/bitset.c: Likewise.
8723 * lib/bitset_stats.c: Likewise.
8724 * lib/bitsetv-print.c: Likewise.
8725 * lib/bitsetv.c: Likewise.
8726 * lib/ebitsetv.c: Likewise.
8727 * lib/get-errno.c: Likewise.
8728 * lib/lbitset.c: Likewise.
8729 * lib/subpipe.c: Likewise.
8730 * lib/timevar.c: Likewise.
8731 * lib/vbitset.c: Likewise.
8732 * tests/local.at: Likewise.
8733 * src/scan-gram.l: Don't include verify.h, since system.h does
8734 that for us.
8735 * .x-sc_require_config_h: New file.
8736 * .x-sc_unmarked_diagnostics: New file.
8737
8738 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8739
8740 Be a bit more systematic about using 'abort'.
8741 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8742 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8743 Put 'default: abort ();' before some other case, to satisfy older
8744 pedantic compilers.
8745 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8746 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8747 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8748 * src/conflicts.c (resolve_sr_conflict): Likewise.
8749 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8750 (get_decision_str, get_orientation_str, get_node_alignment_str):
8751 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8752 (get_linestyle_str, get_arrowstyle_str): Likewise.
8753 * src/conflicts.c (resolve_sr_conflict):
8754 Use a default case rather than one for the one remaining enum
8755 value, to catch invalid enum values as well.
8756 * src/lalr.c (set_goto_map, map_goto):
8757 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8758 * src/nullable.c (nullable_compute, token_definitions_output):
8759 Likewise.
8760 * src/reader.c (packgram, reader): Likewise.
8761 * src/state.c (transitions_to, state_new, state_reduction_find):
8762 Likewise.
8763 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8764 (symbol_pack): Likewise.
8765 * src/tables.c (conflict_row, pack_vector): Likewise.
8766 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8767 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
8768 * src/system.h: Don't include <assert.h>.
8769 (assert): New macro.
8770
8771 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8772 (Destructor Decl, Parser Function, Pure Calling):
8773 Describe rules for braces inside C code more carefully.
8774
8775 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8776
8777 Fix some porting glitches found by Nelson H. F. Beebe.
8778 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8779 compilers that don't understand that abort () does not return.
8780 * src/state.c (transitions_to): Likewise.
8781 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8782 that '#include <cstdlib>' works.
8783 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8784 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8785 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8786 for the benefit of some pre-C99 compilers.
8787
8788 * bootstrap: Undo changes to gnulib files that autoreconf made.
8789
8790 Minor fixups to get 'make maintainer-check' to work.
8791 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8792 with the new verify.h implementation.
8793 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8794 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8795 * data/yacc.c (YYUSE): Likewise.
8796 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
8797 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
8798 * src/parse-gram.y (declaration): Don't pass a string constant
8799 to a function that expects char *, since GCC might complain
8800 about the constant value.
8801 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
8802 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
8803 before #defining them.
8804 * tests/glr-regression.at
8805 (Incorrectly initialized location for empty right-hand side in GLR):
8806 In yyerror, use the msg arg.
8807 (Corrupted semantic options if user action cuts parse):
8808 (Incorrect lookahead during deterministic GLR):
8809 (Incorrect lookahead during nondeterministic GLR):
8810 Don't name a local var 'index'; it shadows string.h's 'index'.
8811
8812 2006-01-19 Akim Demaille <akim@epita.fr>
8813
8814 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
8815 location, not just parts of it.
8816
8817 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
8818
8819 * NEWS: Document the fact that multiple %unions are now allowed.
8820 * doc/bison.texinfo (Union Decl): Likewise.
8821 * TODO: This feature is now implemented, so remove it from
8822 the wishlist.
8823
8824 * Makefile.maint: Merge with coreutils Makefile.maint.
8825 (CVS_LIST): Use build-aux version if available.
8826 (VERSION_REGEXP): New macro.
8827 (syntax-check-rules): Add sc_no_if_have_config_h,
8828 sc_prohibit_assert_without_use, sc_require_config_h,
8829 sc_useless_cpp_parens.
8830 (sc_obsolete_symbols): Check for O_NDELAY.
8831 (sc_dd_max_sym_length): Track coreutils.
8832 (sc_unmarked_diagnostics): Look in all files, not just *.c.
8833 (sc_useless_cpp_parens): New rule.
8834 (news-date-check): Look for version or today's date.
8835 (changelog-check): Don't require version number near head.
8836 (copyright-check): Use current year instead of hardwiring 2005.
8837 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
8838 (announcement): Add --gpg-key-ID.
8839
8840 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
8841 with "file system".
8842
8843 Avoid undefined behavior that addressed just before the start of an
8844 array. Problem reported by twlevo.
8845 * src/reader.c (packgram): Prepend a new sentinel before ritem.
8846 * src/lalr.c (build_relations): Rely on new sentinel.
8847 * src/gram.c (gram_free): Adjust to new sentinel.
8848
8849 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
8850
8851 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
8852 yylookaheadNeeds. All uses updated.
8853 (yysplitStack): Rename local yynewLookaheadStatuses to
8854 yynewLookaheadNeeds.
8855 * data/glr-regression.at (Incorrect lookahead during nondeterministic
8856 GLR): In comments, change `lookahead status' to `lookahead need'.
8857
8858 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8859
8860 * data/glr.c (yysplitStack): A little stylistic rewrite.
8861
8862 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8863
8864 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
8865
8866 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
8867
8868 * doc/bison.texinfo: Fix some typos.
8869 (GLR Semantic Actions): New subsection discussing special
8870 considerations because GLR semantic actions might be deferred.
8871 (Actions): Mention look-ahead usage of yylval.
8872 (Actions and Locations): Mention look-ahead usage of yylloc.
8873 (Special Features for Use in Actions): Add YYEOF entry and mention it
8874 in the yychar entry.
8875 In the yychar entry, remove mention of the local yychar case (pure
8876 parser) since this is irrelevant information when writing semantic
8877 actions and since it's already discussed in `Table of Symbols' where
8878 yychar is otherwise described as an external variable.
8879 In the yychar entry, don't call it the `current' look-ahead since it
8880 isn't when semantic actions are deferred.
8881 In the yychar and yyclearin entries, add note about deferred semantic
8882 actions.
8883 Add yylloc and yylval entries discussing look-ahead usage.
8884 (Look-Ahead Tokens): When discussing yychar, don't call it the
8885 `current' look-ahead, and do mention yylval and yylloc.
8886 (Error Recovery): Cross-reference `Action Features' when mentioning
8887 yyclearin.
8888 (Table of Symbols): In the yychar entry, don't call it the `current'
8889 look-ahead.
8890 In the yylloc and yylval entries, mention look-ahead usage.
8891
8892 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
8893
8894 * tests/glr-regression.at: Update copyright year to 2006.
8895
8896 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8897
8898 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
8899 use during nondeterministic operation to track which stacks have
8900 actually needed the current lookahead.
8901 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
8902 Allocate, deallocate, resize, and otherwise shuffle space for
8903 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
8904 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
8905 appropriately during nondeterministic operation.
8906 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
8907 members to store the current lookahead to be used by the deferred
8908 user action.
8909 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
8910 from which the RHS is taken. Set the lookahead members of the new
8911 yySemanticOption according to the lookahead status for stack yyk.
8912 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
8913 yyaddDeferredAction.
8914 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
8915 members of yySemanticOption before invoking yyuserAction, and then set
8916 them back to their current values afterward.
8917 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
8918 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
8919 * tests/glr-regression.at: Remove `.' from the ends of recent test case
8920 titles for consistency.
8921 (Leaked merged semantic value if user action cuts parse): In order to
8922 suppress lint warnings, use arguments in merge function, and assign
8923 char value < 128 in main.
8924 (Incorrect lookahead during deterministic GLR): New test case.
8925 (Incorrect lookahead during nondeterministic GLR): New test case.
8926
8927 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8928
8929 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
8930 !yyvaluep as signal that no semantic value is available to print.
8931 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
8932 to print a semantic value.
8933
8934 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
8935
8936 * tests/glr-regression.at: For consistency with my newer test cases,
8937 don't thank myself.
8938
8939 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
8940
8941 * data/glr.c (yyresolveValue): When merging semantic options, if at
8942 least one user action succeeds but a later one cuts the parse, then
8943 destroy the semantic value before returning rather than leaking it.
8944 (yyresolveStates): If a user action cuts the parse and thus
8945 yyresolveValue fails, ignore the (unset) semantic value rather than
8946 corrupting the yyGLRState, and empty the semantic options list since
8947 the user actions should have called all necessary destructors.
8948 Simplify code with YYCHK.
8949 * tests/glr-regression.at (Corrupted semantic options if user action
8950 cuts parse): New test case.
8951 (Undesirable destructors if user action cuts parse): New test case.
8952 Before applying any of this patch, this test case never actually failed
8953 for me... but only because the corrupted semantic options usually
8954 masked this bug.
8955 (Leaked merged semantic value if user action cuts parse): New test
8956 case.
8957
8958 2006-01-05 Akim Demaille <akim@epita.fr>
8959
8960 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
8961
8962 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
8963
8964 * data/c.m4 (b4_c_modern): New macro, with a new provision for
8965 _MSC_VER. Problem reported by Cenzato Marco.
8966 (b4_c_function_def): Use it.
8967 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
8968 b4_c_modern.
8969 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
8970 than rolling our own.
8971
8972 2006-01-04 Akim Demaille <akim@epita.fr>
8973
8974 Also warn about non-used mid-rule values.
8975 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
8976 member.
8977 (symbol_list_new): Adjust.
8978 * src/reader.c (symbol_typed_p): New.
8979 (grammar_rule_check): Use it.
8980 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
8981 Check its rule.
8982 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
8983 Use it.
8984 * tests/actions.at (Exotic Dollars): Adjust.
8985
8986 2006-01-04 Akim Demaille <akim@epita.fr>
8987
8988 * src/reader.c (grammar_midrule_action): If $$ is set in a
8989 mid-rule, move the `used' bit to its lhs.
8990 * tests/input.at (Unused values): New.
8991 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
8992
8993 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
8994
8995 * doc/bison.texinfo (Bison Options): Say more accurately what
8996 --yacc does.
8997 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
8998 about declarations in the grammar when in Yacc mode, as POSIX does
8999 not require a diagnostic when the grammar uses extensions.
9000
9001 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
9002
9003 Warn about dubious constructions like "%token T T".
9004 Reported by twlevo.
9005 * src/symtab.h (struct symbol.declared): New member.
9006 * src/symtab.c (symbol_new): Initialize it to false.
9007 (symbol_class_set): New arg DECLARING, specifying whether
9008 this is a declaration that we want to warn about, if there
9009 is more than one of them. All uses changed.
9010
9011 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
9012 Allow multiple %union directives, whose contents concatenate.
9013 * src/parse-gram.y (grammar_declaration): Likewise.
9014 Use muscle_code_grow, so that we don't need stype_line any more.
9015 All uses changed.
9016
9017 * src/muscle_tab.c (muscle_grow): Fix comment.
9018
9019 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
9020 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
9021 Update copyright year to 2006.
9022
9023 2006-01-03 Akim Demaille <akim@epita.fr>
9024
9025 Have glr.cc pass (some of) the calc.at tests.
9026 * data/glr.cc (b4_parse_param_orig): New.
9027 (b4_parse_param): Improve its definition, and bound it more
9028 clearly in the skeleton.
9029 (b4_epilogue): Append, instead of prepending, in order to keep
9030 #line consistency.
9031 Simplify the generation of auxiliary functions: locations and
9032 purity are mandated.
9033 (b4_global_tokens_and_yystype): Honor it.
9034 * data/location.cc (c++.m4): Don't include it.
9035 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9036 and AT_SKEL_CC_IF.
9037 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9038 AT_LALR1_CC_IF.
9039 Be sure to initialize the first position's filename.
9040 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9041 mandated anyway.
9042 (AT_CHECK_CALC_GLR_CC): New.
9043 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9044
9045 2006-01-02 Akim Demaille <akim@epita.fr>
9046
9047 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9048 c.m4.
9049 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
9050 * data/glr.cc: Do not include stack.hh.
9051
9052 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9053
9054 * data/glr.c: Reformat whitespace with tabs.
9055 (b4_lpure_formals): Remove this unused m4 macro.
9056 * tests/cxx-type.at: Reformat whitespace with tabs.
9057 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9058 since it's a member. Rename type to isNterm for clarity.
9059
9060 2005-12-29 Akim <akim@sulaco.local>
9061
9062 Let glr.cc catch up with symbol_value_print.
9063 * data/glr.cc (b4_yysymprint_generate): Replace by...
9064 (b4_yy_symbol_print_generate): this.
9065 (yy_symbol_print, yy_symbol_value_print): Declare them.
9066
9067 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9068
9069 * src/location.h (boundary): Note that a line or column equal
9070 to INT_MAX indicates an overflow.
9071 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9072 (rule_length_overflow, increment_rule_length, add_column_width):
9073 New functions.
9074 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9075 (<SC_BRACED_CODE>"}"):
9076 Use increment_rule_length rather than incrementing it by hand.
9077 (adjust_location, handle_syncline): Diagnose overflow.
9078 (handle_action_dollar, handle_action_at):
9079 Fix bug with monstrosities like $-2147483648.
9080 Remove now-unnecessary checks.
9081 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9082 (convert_ucn_to_byte): Verify assumptions.
9083 (handle_syncline): New arg LOC. All callers changed.
9084 Don't store through a value derived from char const * pointer.
9085
9086 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9087 GCC warnings.
9088
9089 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9090
9091 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9092 Remove unnecessary forward static decls.
9093
9094 2005-12-27 Akim Demaille <akim@epita.fr>
9095
9096 * src/reader.c (grammar_current_rule_check): Also check that $$
9097 is used.
9098 Take the rule to check as argument, hence rename as...
9099 (grammar_rule_check): this.
9100 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9101 Rename as...
9102 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9103 (grammar_midrule_action, grammar_symbol_append): Now static.
9104 * tests/torture.at (input): Don't rely on the default action
9105 being always performed.
9106 * tests/calc.at: "Set" $$ even when the action is "cut" with
9107 YYERROR or other.
9108 * tests/actions.at (Exotic Dollars): Instead of using unused
9109 values, check that the warning is issued.
9110
9111 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
9112
9113 * NEWS: Improve wording for unused-value warnings.
9114
9115 2005-12-22 Akim Demaille <akim@epita.fr>
9116
9117 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
9118 (b4_yysymprint_generate): Rename as...
9119 (b4_yy_symbol_print_generate): this.
9120 Generate yy_symbol_print instead of yysymprint.
9121 Generate also yy_symbol_value_print, and use it.
9122
9123 2005-12-22 Akim Demaille <akim@epita.fr>
9124
9125 * NEWS: Warn about unused values.
9126 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
9127 a `used' member.
9128 (symbol_list_n_get, symbol_list_n_used_set): New.
9129 (symbol_list_n_type_name_get): Use symbol_list_n_get.
9130 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
9131 * src/reader.c (grammar_current_rule_check): Check that values are
9132 used.
9133 * src/symtab.c (symbol_print): Accept 0.
9134 * tests/existing.at: Remove the type information.
9135 Empty the actions.
9136 Remove useless actions (beware of mid-rule actions: perl -000
9137 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
9138 * tests/actions.at (Exotic Dollars): Use unused values.
9139 * tests/calc.at: Likewise.
9140 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9141 Likewise.
9142
9143 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
9144 rule_useful_p.
9145
9146 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
9147
9148 Undo 2005-12-01 tentative license wording change. The wording is
9149 still being reviewed by the lawyers, and we don't want to wait for
9150 them before publishing a test release. For now, revert to the
9151 previous wording.
9152 * NEWS: Undo 2005-12-01 change.
9153 * data/glr.c: Revert to previous license wording.
9154 * data/glr.cc: Likewise.
9155 * data/lalr1.cc: Likewise.
9156 * data/location.cc: Likewise.
9157 * data/yacc.c: Likewise.
9158
9159 * NEWS: Reword %destructor vs YYABORT etc.
9160 * data/glr.c: Use American spacing, for consistency.
9161 * data/glr.cc: Likewise.
9162 * data/lalr1.cc: Likewise.
9163 * data/yacc.c: Likewise.
9164 * data/yacc.c: Reformat comments slightly.
9165 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
9166 for consistency. Fix some spelling errors and reword recently-included
9167 text slightly.
9168 * tests/cxx-type.at: Cast results of malloc, for C++.
9169
9170 2005-12-21 Joel E. Denny <address@hidden>
9171
9172 * tests/cxx-type.at: Construct a tree, count the parents of shared
9173 nodes, and free each node once and only once. Previously, the memory
9174 for semantic values was leaked instead.
9175
9176 2005-12-21 Joel E. Denny <address@hidden>
9177
9178 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
9179 (yylval, yylloc): If pure, #define to yystackp->yyval and
9180 yystackp->yyloc similar to yychar and yynerrs.
9181 (yyparse): If pure, remove local yylval and yylloc. Add local
9182 yystackp to accommodate pure definitions of yylval and yylloc.
9183 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
9184 yylvalp and yyllocp to &yylval and &yylloc.
9185 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
9186 namespace. Previously, nerrs and char were missing, but lval and lloc
9187 weren't necessary.
9188 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
9189 yylvalp and yyllocp parameters since, if pure, these are now always
9190 accessible through yystackp. If not pure, they are still accessible
9191 globally.
9192 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
9193 `if (YYID (N))' to pacify lint.
9194
9195 2005-12-21 Akim Demaille <akim@epita.fr>
9196
9197 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
9198 destroy the RHS symbols of a rule.
9199 * data/yacc.c (yylen): Initialize to 0.
9200 Keep its value to the number of items to possibly shift.
9201 In particular, a regular successful parse that ends on YYFINAL by
9202 a (internal) YYACCEPT must not have yylen != 0.
9203 (yyerrorlab, yyreturn): Pop the RHS.
9204 Reorder a bit to emphasize the `shifting' bits of code.
9205 (YYPOPSTACK): Now accept a number of items to pop.
9206 * data/lalr1.cc: Likewise.
9207 * data/glr.c: Formatting changes.
9208 Use goto instead of fall through.
9209 * doc/bison.texinfo (Destructor Decl): Complete.
9210
9211 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9212
9213 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9214 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
9215 * djgpp/config.bat: Replace every occurence of the file name
9216 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9217 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9218 * djgpp/config.sed: Replace every occurence of the file name
9219 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9220 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9221 * djgpp/djunpack.bat: DJGPP specific file.
9222 * djgpp/fnchange.lst: DJGPP specific file.
9223 * djgpp/README.in: Add new information about how to unpack the bison
9224 source on MSDOS and other systems which have 8.3 file name restrictions
9225 using djunpack.bat and fnchange.lst.
9226
9227 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
9228
9229 * bootstrap (build_cvs_prefix): Remove; unused.
9230 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
9231 when getting gnulib.
9232
9233 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
9234
9235 * data/glr.c: Reorder typedef declarations for structs to match order
9236 of struct declarations.
9237 Rename yystack everywhere to yystackp except in yyparse where it's not
9238 a pointer.
9239 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
9240 consistency.
9241 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
9242 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
9243 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
9244 lint.
9245
9246 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
9247
9248 * tests/sets.at (Accept): Fix typos in regular expression used to
9249 sed out the final state number.
9250
9251 Work around portability problem on Solaris 10: flex-generated
9252 files include <stdio.h> before <config.h>, which messes up
9253 because the latter defines __EXTENSIONS__. Address the problem
9254 by creating two new little files that include <config.h> first,
9255 then include the flex-generated files. Rewrite everyone else
9256 to include <config.h> first, as well.
9257 * lib/timevar.c: Always include "config.h".
9258 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
9259 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
9260 (EXTRA_bison_SOURCES): New macro.
9261 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9262 * src/system.h: Don't include config.h.
9263 * src/LR0.c: Include <config.h> first.
9264 * src/assoc.c: Likewise.
9265 * src/closure.c: Likewise.
9266 * src/complain.c: Likewise.
9267 * src/conflicts.c: Likewise.
9268 * src/derives.c: Likewise.
9269 * src/files.c: Likewise.
9270 * src/getargs.c: Likewise.
9271 * src/gram.c: Likewise.
9272 * src/lalr.c: Likewise.
9273 * src/location.c: Likewise.
9274 * src/main.c: Likewise.
9275 * src/muscle_tab.c: Likewise.
9276 * src/nullable.c: Likewise.
9277 * src/output.c: Likewise.
9278 * src/parse-gram.y: Likewise.
9279 * src/print.c: Likewise.
9280 * src/print_graph.c: Likewise.
9281 * src/reader.c: Likewise.
9282 * src/reduce.c: Likewise.
9283 * src/relation.c: Likewise.
9284 * src/state.c: Likewise.
9285 * src/symlist.c: Likewise.
9286 * src/symtab.c: Likewise.
9287 * src/tables.c: Likewise.
9288 * src/uniqstr.c: Likewise.
9289 * src/vcg.c: Likewise.
9290
9291 * src/parse-gram.y: Fix minor problems uncovered by lint.
9292 (current_lhs, current_lhs_location): Now static.
9293 (current_assoc): Remove unused variable.
9294
9295 Cleanups so that Bison-generated parsers have less lint.
9296 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9297 Prepend /*ARGSUSED*/, for lint's sake.
9298 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9299 definition if 'lint' is defined.
9300 (YYID): New macro (or function, if lint).
9301 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9302 * data/yacc.c: Likewise.
9303 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9304 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9305 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9306 is C++ only.
9307 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9308 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9309 Use YYID(0) rather than 0, for lint.
9310 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9311 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9312
9313 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9314
9315 * tests/glr-regression.at
9316 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9317 Close memory leak reported by twlevo.
9318
9319 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9320
9321 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9322 all stacks.
9323 (yyparse): Iterate another stack in order to call user destructors.
9324 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9325 New test case.
9326 (Duplicated user destructor for lookahead): This test now is expected
9327 to succeed.
9328
9329 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9330
9331 * NEWS: Document the following change.
9332 * data/yacc.c: Say "parser skeleton" rather than "file", since
9333 it's no longer just a file.
9334 * data/glr.c: Grant a special exception for C GLR parsers, that
9335 reads like the already-existing exception for C LALR(1) parsers.
9336 * data/glr.cc: Likewise.
9337 * data/lalr1.cc: Likewise.
9338 * data/location.cc: Likewise.
9339 * data/yacc.c: Reword the "written by" statement to clarify that
9340 it was the parser skeleton, not the entire output file.
9341 * data/glr.c: Written by Paul Hilfinger.
9342 * data/glr.cc: Written by Akim Demaille.
9343 * data/lalr1.cc: Likewise.
9344
9345 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9346
9347 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9348 Fix typos in previous change that broke 'make check'.
9349 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9350 supported in C.
9351 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9352 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9353 We can revert this once things settle down.
9354
9355 * src/conflicts.c (conflicts_print): Don't print file name twice
9356 when %expect fails because there were no conflicts.
9357 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9358 change.
9359 * tests/conflicts.at (%expect not enough, %expect too much):
9360 (%expect with reduce conflicts): Adjust to new behavior.
9361
9362 2005-11-18 Akim Demaille <akim@epita.fr>
9363
9364 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9365 errors.
9366 * NEWS: Document this.
9367 * doc/bison.texinfo (Expect Decl): Likewise.
9368
9369 2005-11-16 Akim Demaille <akim@epita.fr>
9370
9371 Generalize the display of semantic values and locations in traces.
9372 * data/glr.c (yy_reduce_print): Fix indices (again).
9373 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9374 literal integers.
9375 * data/lalr1.cc (yyreduce_print): Rename as...
9376 (yy_reduce_print): this.
9377 Display values and locations.
9378 * data/yacc.c (yy_reduce_print): Likewise.
9379 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9380 (yysymprint): Move higher to be visible from yy_reduce_print).
9381 (yyparse): Adjust.
9382 * tests/calc.at: Adjust the expected length of the traces.
9383
9384 2005-11-14 Akim Demaille <akim@epita.fr>
9385
9386 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9387 from 1 to N, while values and location start at 0.
9388 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9389
9390 2005-11-14 Akim Demaille <akim@epita.fr>
9391
9392 * data/glr.c (yy_reduce_print): Fix the $ number.
9393
9394 2005-11-14 Akim Demaille <akim@epita.fr>
9395
9396 "Use" parse parameters.
9397 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9398 * data/glr.c, data/glr.cc: Use them.
9399 * data/glr.c (YYUSE): Have a C++ definition that supports
9400 non-pointer types.
9401
9402 2005-11-14 Akim Demaille <akim@epita.fr>
9403
9404 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9405
9406 2005-11-14 Akim Demaille <akim@epita.fr>
9407
9408 * data/glr.cc: New.
9409 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
9410
9411 2005-11-12 Akim Demaille <akim@epita.fr>
9412
9413 Let position and location be PODs.
9414 * data/location.cc (position::initialize, location::initialize): New.
9415 (position::position, location::location): Define only if
9416 b4_location_constructors is defined.
9417 * data/lalr1.cc (b4_location_constructors): Define it for backward
9418 compatibility.
9419 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9420
9421 2005-11-12 Akim Demaille <akim@epita.fr>
9422
9423 * data/lalr1.cc: Move the body of the ctor and dtor into the
9424 parser file (instead of the header).
9425 Wrap the implementations in a "namespace yy".
9426
9427 2005-11-12 Akim Demaille <akim@epita.fr>
9428
9429 Have glr.c include its header file when created.
9430 * data/glr.c (b4_shared_declarations): New.
9431 Output them verbatim in the parser if !%defines, otherwise
9432 output then in the header file, and include it instead.
9433
9434 2005-11-11 Akim Demaille <akim@epita.fr>
9435
9436 * data/glr.c: Comment changes.
9437
9438 2005-11-11 Akim Demaille <akim@epita.fr>
9439
9440 When yydebug, report semantic and location values for reductions.
9441 * data/glr.c (yy_reduce_print): Report the semantic values and the
9442 locations.
9443 (YY_REDUCE_PRINT): Adjust.
9444 (yyglrReduce): Use them.
9445 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9446 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9447 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9448 traces.
9449
9450 2005-11-10 Akim Demaille <akim@epita.fr>
9451
9452 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9453 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9454 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9455
9456 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9457
9458 * m4/cxx.m4, examples/Makefile.am: Don't build
9459 examples/calc++ if no C++ compiler is available. (trivial change)
9460
9461 2005-11-09 Akim Demaille <akim@epita.fr>
9462
9463 * src/scan-skel.l: Use a couple of asserts.
9464
9465 2005-11-03 Akim Demaille <akim@epita.fr>
9466
9467 In some (weird) cases, the final state number is incorrect.
9468 Reported by Alexandre Duret-Lutz.
9469 * src/LR0.c (state_list_append): Remove the computation of
9470 final_state.
9471 (save_reductions): Do it here.
9472 (get_state): Alpha conversion.
9473 (generate_states): Use a for loop.
9474 * src/gram.h (item_number_is_rule_number)
9475 (item_number_is_symbol_number): New.
9476 * src/state.c: Use assert.
9477 * src/system.h: Include assert.h.
9478 * tests/sets.at (Accept): New.
9479
9480 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9481
9482 * data/glr.c (yyfill): Adjust comment.
9483 (yyresolveAction): Initialize default location properly
9484 for empty right-hand sides.
9485 (yydoAction): Ditto.
9486 Add comment explaining apparently dead code.
9487 * tests/glr-regression.at
9488 (Incorrectly initialized location for empty right-hand side in GLR):
9489 New test.
9490
9491 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9492
9493 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9494 gnulib when interrupted. This fixes some race conditions and
9495 works around some portability problems (one noted by Paul
9496 Hilfinger).
9497
9498 2005-10-22 Akim <akim@epita.fr>
9499
9500 * Makefile.cfg: Adjust to config -> build-aux.
9501 Reported by twledo.
9502
9503 2005-10-21 Akim Demaille <akim@epita.fr>
9504
9505 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9506 the %parse-params.
9507 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9508 * data/yacc.c (b4_Pure_if): Rename as...
9509 (b4_yacc_pure_if): this.
9510 (YY_SYMBOL_PRINT, yyparse): Adjust.
9511 * doc/bison.texinfo: Formatting changes.
9512
9513 2005-10-21 Akim Demaille <akim@epita.fr>
9514
9515 Finish the transition config -> build-aux.
9516 * configure.ac, Makefile.am: Use build-aux.
9517 * config/prev-version, config/announce-gen, config/Makefile.am:
9518 Move to...
9519 * build-aux/prev-version, build-aux/announce-gen,
9520 * build-aux/Makefile.am: here.
9521
9522 2005-10-14 Akim Demaille <akim@epita.fr>
9523
9524 * examples/calc++/test: Use set -x only when VERBOSE.
9525
9526 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9527
9528 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9529 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9530
9531 2005-10-13 Akim Demaille <akim@epita.fr>
9532
9533 * src/scan-skel.l: Output the base name parts of the parser and
9534 header file names.
9535 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
9536 additional checks.
9537 Use this to exercise C++ outputs in subdirs.
9538 Reported by Oleg Smolsky.
9539
9540 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9541
9542 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9543 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9544 Problem reported by John P. Hartmann.
9545 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9546 already defined it.
9547
9548 2005-10-12 Akim Demaille <akim@epita.fr>
9549
9550 * src/parse-gram.y (version_check): Exit 63 to please missing
9551 (stands for "version mismatch).
9552 * tests/input.at, doc/bison.texinfo: Adjust.
9553
9554 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9555
9556 Work around portability problems with Visual Age C compiler
9557 (xlc and xlC_r) reported by John P. Hartmann.
9558 * data/location.cc (initial_column, initial_line): Remove.
9559 All uses replaced by 0 and 1.
9560 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9561 that xlc complains about.
9562 * src/scan-skel.l (skel_wrap): Likewise.
9563 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
9564 as __STDC__.
9565 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9566 __STDC_VERSION__. Use it everywhere instead of looking at
9567 __STDC__ and __cplusplus.
9568
9569 2005-10-10 Akim Demaille <akim@epita.fr>
9570
9571 * examples/calc++/test: Be quiet unless VERBOSE.
9572
9573 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9574
9575 * data/c.m4 (yydestruct, yysymprint):
9576 Use YYUSE instead of casting to void.
9577 * data/glr.c (YYUSE): New macro.
9578 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9579 Use it instead of rolling our own.
9580 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9581 (YYCHK1):
9582 Use /*CONSTCOND*/ to suppress lint warnings.
9583 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9584 (YY_STACK_PRINT): Use 'false' not '0'.
9585 (YYUSE): New macro.
9586 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9587 * data/yacc.c (YYUSE): New macro.
9588 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9589 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9590 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9591
9592
9593 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9594 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9595
9596 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9597
9598 Undo the parts of the unlocked-I/O change that substituted
9599 putc or puts for printf. This might hurt performance a bit,
9600 but some people prefer the printf style.
9601 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9602 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9603 All uses replaced by YYFPRINTF and YYDPRINTF.
9604 * data/yacc.c: Likewise.
9605 * lib/bitset.c (bitset_print): Likewise.
9606 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9607 putc and puts.
9608 * lib/lbitset.c (debug_lbitset): Likewise.
9609 * src/closure.c (print_firsts, print_fderives): Likewise.
9610 * src/gram.c (grammar_dump): Likewise.
9611 * src/lalr.c (look_ahead_tokens_print): Likewise.
9612 * src/output.c (escaped_output): Likewise.
9613 (user_actions_output): Break apart two printfs.
9614 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9615 * src/reduce.c (reduce_print): Likewise.
9616 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9617 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9618
9619 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9620 Use assignments rather than casts-to-void to suppress
9621 unused-variable warnings. This pacifies 'lint'.
9622 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9623 unused-variable warnings.
9624
9625 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9626
9627 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9628
9629 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9630
9631 Use unlocked I/O for a minor performance improvement on hosts like
9632 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9633 is to use the gnlib unlocked-io module, and to prefer putc and
9634 puts to printf when either will work (since the latter doesn't
9635 come in an unlocked flavor).
9636 * bootstrap (gnulib_modules): Add unlocked-io.
9637 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9638 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9639 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9640 and similarly for puts and putc and printf.
9641 * data/yacc.c: Likewise.
9642 * lib/bitset.c (bitset_print): Likewise.
9643 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9644 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9645 to printf.
9646 * lib/lbitset.c (debug_lbitset): Likewise.
9647 * src/closure.c (print_firsts, print_fderives): Likewise.
9648 * src/gram.c (grammar_dump): Likewise.
9649 * src/lalr.c (look_ahead_tokens_print): Likewise.
9650 * src/output.c (escaped_output): Likewise.
9651 (user_actions_output): Coalesce two printfs.
9652 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
9653 * src/reduce.c (reduce_print): Likewise.
9654 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9655 * src/system.h: Include unlocked-io.h rather than stdio.h.
9656
9657 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9658 this confuses xgettext.
9659
9660 2005-10-02 Akim Demaille <akim@epita.fr>
9661
9662 * bootstrap (gnulib_modules): Add strverscmp.
9663 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9664 * m4/.cvsignore: Add strverscmp.m4.
9665 * src/parse-gram.y (%require): New token, new rule.
9666 (version_check): New.
9667 * src/scan-gram.l (%require): Adjust.
9668 * tests/input.at (AT_REQUIRE): New.
9669 Use it.
9670 * doc/bison.texinfo (Require Decl): New.
9671 (Calc++ Parser): Use %require.
9672
9673 2005-10-02 Akim Demaille <akim@epita.fr>
9674
9675 * data/location.cc: New.
9676
9677 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9678 Akim Demaille <akim@epita.fr>
9679
9680 Make sure -odir/foo.cc creates dir/location.hh etc.
9681 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9682 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9683 (spec_defines_file): Now const.
9684 (dir_prefix): New.
9685 (short_base_name): Remove.
9686 * src/files.c: Adjust.
9687 (dirname.h): Include.
9688 (base_name): Don't prototype it.
9689 (finput): Remove, duplicates gram_in.
9690 (full_base_name, short_base_name): Replace by...
9691 (all_but_ext, all_but_tab_ext): these.
9692 (compute_base_names): Rename as...
9693 (compute_file_name_parts): this.
9694 Update to compute the new variables, including dir_prefix.
9695 Adjust dependencies.
9696 * src/output.c (prepare): Output them.
9697 * src/reader.c: Adjust to use gram_in, not finput.
9698 * src/scan-skel.l (@dir_prefix@): New.
9699
9700 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9701
9702 * lib/subpipe.c: New function end_of_output_subpipe() added
9703 to allow support for non-posix systems. This is a no-op function
9704 for posix systems.
9705
9706 * lib/subpipe.h: New function end_of_output_subpipe() added
9707 to allow support for non-posix systems. This is a no-op function
9708 for posix systems.
9709
9710 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9711 handle the lack of pipe/fork functionality on non-posix systems.
9712
9713 * djgpp/Makefile.maint: DJGPP specific file.
9714
9715 * djgpp/README.in: DJGPP specific file.
9716
9717 * djgpp/config.bat: DJGPP specific configuration file.
9718
9719 * djgpp/config.sed: DJGPP specific configuration file.
9720
9721 * djgpp/config.site: DJGPP specific configuration file.
9722
9723 * djgpp/config_h.sed: DJGPP specific configuration file.
9724
9725 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9726
9727 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9728
9729 2005-10-02 Akim Demaille <akim@epita.fr>
9730
9731 * data/location.cc: New, extract from...
9732 * data/lalr1.cc: here.
9733 (location.hh): Include it after the user prologue, in case the
9734 filename type is defined by the user.
9735 Forward declation location and position before the pre-prologue.
9736 (yyresult_): Rename as...
9737 (yyresult): this, it's a local variable, not an attribute.
9738 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9739
9740 2005-10-01 Akim Demaille <akim@epita.fr>
9741
9742 * examples/extexi: Restore the #line generation.
9743
9744 2005-09-30 Akim Demaille <akim@epita.fr>,
9745 Alexandre Duret-Lutz <adl@gnu.org>
9746
9747 Move the token type and YYSTYPE in the parser class.
9748 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9749 (parser::token): New, from the moved free definition of tokens.
9750 (parser::semantic_value): Now a full definition instead of an
9751 indirection to YYSTYPE.
9752 (b4_post_prologue): No longer included in the header file, but
9753 in the implementation file.
9754 * doc/bison.texi (C+ Language Interface): Update.
9755 * src/parse-gram.y: Support unary %define.
9756 * tests/actions.at: Define global_tokens_and_yystype for backward
9757 compatibility until we update the tests.
9758 * tests/calc.at: Idem.
9759 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9760 to simplify the code.
9761
9762 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9763
9764 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9765 Ah, the good old days! Problem reported by Peter Klein.
9766 * bootstrap (gnulib_modules): Add strerror, strtoul.
9767 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9768 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9769
9770 2005-09-29 Akim Demaille <akim@epita.fr>
9771
9772 * data/c.m4 (b4_error_verbose_if): New.
9773 * data/lalr1.cc: Use it.
9774 (YYERROR_VERBOSE_IF): Remove.
9775 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9776 parser members, replaced by...
9777 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9778 local variables.
9779 (yysyntax_error_): Takes the state number as argument.
9780 (yyreduce_print_): Use the argument yyrule, not the former
9781 attribute yyn_.
9782
9783 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9784
9785 * bootstrap (gnulib_modules): Add verify.
9786 * lib/.cvsignore: Add verify.h.
9787 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9788 * src/system.h (verify): Remove.
9789 Include verify.h instead.
9790 * src/tables.c (tables_generate): Use new API for 'verify'.
9791
9792 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9793
9794 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9795 local variables whose names begin with 'yy'.
9796 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9797 Trivial changes from Joel E. Denny.
9798
9799 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
9800 it itself.
9801 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
9802 don't use alloca any more.
9803
9804 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
9805 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
9806 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
9807 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
9808 to match yacc.c, to test more hosts.
9809
9810 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
9811
9812 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
9813 doesn't affect behavior.
9814 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
9815 Solaris, AIX, MSC.
9816 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
9817 This works a bit better with glibc, if user code has already included
9818 stdlib.h.
9819 * doc/bison.texinfo (Bison Parser): Document that users can't
9820 arbitrarily use malloc and free for other purposes. Document
9821 that <alloca.h> and <malloc.h> might be included.
9822 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
9823 user must declare alloca.
9824
9825 * HACKING (release): Forwarn the Translation Project about
9826 stable releses.
9827
9828 2005-09-20 Akim Demaille <akim@epita.fr>
9829
9830 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
9831
9832 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
9833
9834 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
9835 (YYSTACK_ALLOC_MAXIMUM): Use it.
9836 (yysyntax_error): New function.
9837 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
9838 multiple syntax errors are reported, and alloca is being used.
9839 Instead, reallocate buffers twice as big each time, so that
9840 we waste at most half the allocated memory. Start with a small
9841 (128-byte) buffer that will suffice in most cases anyway.
9842 Use yysyntax_error to do most of the work.
9843
9844 * doc/bison.texinfo (Error Reporting, Table of Symbols):
9845 yynerrs is the number of errors reported, not the number of
9846 errors encountered.
9847
9848 * tests/glr-regression.at (Duplicated user destructor for lookahead):
9849 Mark it as expected to fail.
9850 Cast result of malloc; problem reported by twlevo@xs4all.nl.
9851 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
9852 Don't start user-code symbols with "yy", to avoid name space problems.
9853
9854 2005-09-19 Akim Demaille <akim@epita.fr>
9855
9856 Remove the traits, failed experiment.
9857 It never proved useful, and anyway because of the current
9858 definition, it was not possible to have several specialization of
9859 this traits, making it useless.
9860 * data/lalr1.cc (yy:traits): Remove.
9861 Inline its definitions in the parser class.
9862
9863 2005-09-19 Akim Demaille <akim@epita.fr>
9864
9865 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
9866 least Mac OSX with a /usr/local install of gettext.
9867
9868 2005-09-19 Akim Demaille <akim@epita.fr>
9869
9870 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
9871 and yytoken for similarity with the other skeletons.
9872
9873 2005-09-19 Akim Demaille <akim@epita.fr>
9874
9875 * NEWS, configure.ac: update version number to 2.1a.
9876
9877 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
9878
9879 * NEWS: Version 2.1.
9880
9881 * NEWS: Remove notice of yytname change, since it was never in an
9882 official release.
9883 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
9884 diagnostic.
9885 * src/output.c (prepare): Likewise.
9886 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
9887 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
9888 is not defined. This is an awful hack, but it's enough for now.
9889 All callers changed.
9890 * tests/glr-regression-at (make_value): Args are const pointers now,
9891 to avoid GCC warning.
9892 (Duplicated user destructor for lookahead): New test. Currently
9893 skipped. It fails on my host but I'm not sure it'll always fail.
9894
9895 2005-09-16 Akim Demaille <akim@epita.fr>
9896
9897 * src/symtab.h (struct symbol): Declare the printer and destructor
9898 as const, to avoid accidental calls to free.
9899 (symbol_destructor_set, symbol_printer_set): Adjust.
9900 * src/symtab.c: Adjust.
9901
9902 2005-09-16 Akim Demaille <akim@epita.fr>
9903
9904 * data/c.m4 (b4_token_enums): New.
9905 (b4_token_defines): Rename as...
9906 (b4_token_enums_defines): this.
9907 (b4_token_defines): New, output only the #defines.
9908 * data/yacc.c, data/glr.c: Adjust.
9909 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
9910 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
9911 as default values.
9912
9913 2005-09-16 Akim Demaille <akim@epita.fr>
9914
9915 * data/lalr1.cc (yylex_): Remove, inline its code.
9916 (yyreport_syntax_error_): Remove, replaced by...
9917 (yysyntax_error_): this which returns a string and leaves to the
9918 caller the call to the users' error function.
9919 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
9920 Move from members of the parser object...
9921 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
9922 to local variables of the parse function.
9923
9924 2005-09-16 Akim Demaille <akim@epita.fr>
9925
9926 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
9927 since it's in Bison's name space.
9928
9929 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
9930
9931 * data/glr.c (yyresolveValue): Add default case to pacify
9932 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
9933
9934 * NEWS: Document when yyparse started to return 2.
9935 * doc/bison.texinfo (Parser Function): Document when yyparse
9936 returns 2.
9937
9938 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
9939 (b4_filename_type): Renamed back from b4_file_name_type. All uses
9940 changed.
9941 (class position): file_name -> filename (reverting). All uses changed.
9942
9943 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
9944
9945 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
9946 do anything if $@ exists. This reverts part of the 2005-07-07
9947 patch.
9948
9949 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
9950
9951 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
9952 contains obsolete information and isn't worth distributing as a
9953 separate file anyway.
9954 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
9955 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
9956 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
9957 (yyparse): Abort if user code uses longjmp to throw an unexpected
9958 value.
9959
9960 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
9961
9962 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
9963 Suggested by twlevo@xs4all.nl.
9964
9965 * data/glr.c (YYCHK1): Do not assume YYE is in range.
9966 This avoids a diagnostic from gcc -Wswitch-enum.
9967 Problem reported by twlevo@xs4all.nl.
9968
9969 * doc/bison.texinfo: Don't use "filename", as per GNU coding
9970 standards. Use "file name" or "file" or "name", depending on
9971 the context.
9972 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
9973 not to hack/foo.tab.c.
9974 (Calc++ Top Level): 2nd arg of main is not const.
9975 * data/glr.c: b4_filename -> b4_file_name.
9976 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
9977 All uses changed.
9978 (class position): filename -> file_name. All uses changed.
9979 * data/yacc.c: b4_filename -> b4_file_name.
9980 * lib/bitset.h: filename -> file_name in local vars.
9981 * lib/bitset_stats.c: Likewise.
9982 * src/files.c: Likewise.
9983 * src/scan-skel.l ("@output ".*\n): Likewise.
9984 * src/files.c (file_name_split): Renamed from filename_split.
9985 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
9986
9987 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
9988
9989 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
9990 to accommodate latest gnulib.
9991
9992 * tests/glr-regression.at (Duplicate representation of merged trees):
9993 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
9994
9995 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
9996 needed.
9997
9998 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
9999
10000 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
10001 All uses changed. Invoke user destructor after an error during a
10002 split parse (trivial change from Joel E. Denny).
10003
10004 * tests/glr-regression.at
10005 (User destructor after an error during a split parse): New test case.
10006 Problem reported by Joel E. Denny in:
10007 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
10008
10009 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
10010
10011 * README-cvs: Give URLs for recommended tools.
10012 Mention Gzip version problem, and bootstrapping issues.
10013 Remove troubleshooting section, as it's somewhat obsolete.
10014
10015 * bootstrap (no_cache): New var, to accommodate different wget
10016 variants. Use it instead of '-C off'. Problem reported by
10017 twlevo@xs4all.nl.
10018
10019 * data/glr.c (yydestroyStackItem): New function.
10020 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
10021 debugging information. Problem reported by Joel E. Denny.
10022
10023 2005-08-25 Akim Demaille <akim@epita.fr>
10024
10025 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
10026
10027 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10028
10029 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10030 Don't invoke destructor on unresolved entries.
10031 * tests/glr-regression.at
10032 (User destructor for unresolved GLR semantic value): New test case.
10033 Problem reported by Joel E. Denny in:
10034 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10035
10036 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10037
10038 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10039 Add strnlen.c.
10040 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10041 lib-prefix.m4, po.m4.
10042
10043 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10044 in yydestruct diagnostic, since it might not be an error.
10045 Problem reported by Joel Denny near end of
10046 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10047 * data/lalr1.cc (yyerturn): Likewise.
10048 * data/yacc.c (yyreturn): Likewise.
10049 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10050
10051 * src/files.c: Remove obsolete FIXME comment.
10052
10053 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10054 with the other templates, and to fix bogus run-on messages such
10055 as the one reported at the end of
10056 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10057 All callers changed to avoid the newline.
10058 (yyprocessOneStack): Output two lines rather than one, to accommodate
10059 the above change. This changes the debug output format slightly.
10060
10061 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10062 reported by Joel E. Denny in
10063 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10064 (trivial change).
10065 * tests/glr-regression.at (Duplicate representation of merged trees):
10066 New test, from Joel E. Denny in:
10067 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10068 * THANKS: Add Joel E. Denny.
10069
10070 * configure.ac (AC_INIT): Bump to 2.0c.
10071
10072 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10073
10074 * NEWS: Version 2.0b.
10075
10076 * Makefile.am (SUBDIRS): Put examples before tests, so that
10077 "make check" doesn't finish with "All 1 tests passed".
10078
10079 * tests/regression.at (Token definitions): Don't rely on
10080 AT_PARSER_CHECK for data that contains backslashes. It currently
10081 uses 'echo', and 'echo' isn't portable if its argument contains
10082 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10083 that the byte '\0xff' is not printable in the C locale; it is,
10084 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10085 not printable, so use '\0x81' to test.
10086
10087 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10088 version of GCC, since the macro is used with non-GCC compilers.
10089
10090 Fix core dump reported by Pablo De Napoli in
10091 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10092 * tests/regression.at (Invalid inputs with {}): New test.
10093 * src/parse-gram.y (token_name): Translate type before using
10094 it as an index.
10095
10096 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10097 the user's name space. All uses changed to __attribute__
10098 ((__unused__)).
10099 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10100 Add __attribute__ ((__noreturn__)).
10101
10102 * etc/clcommit: Remove. We weren't using it, and it failed
10103 "make maintainer-distcheck".
10104 * Makefile.maint: Merge from coreutils.
10105 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10106 (syntax-check-rules): Change list of rules as described below.
10107 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10108 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10109 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10110 (sc_trailing_space): New rules.
10111 (sc_xalloc_h_in_src): Remove.
10112 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
10113 (sc_space_tab, sc_error_exit_success, sc_changelog):
10114 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
10115 (makefile-check, po-check, author_mark_check):
10116 (makefile_path_separator_check, copyright-check):
10117 Use grep -n, to make it easier to find violations.
10118 Use CVS_LIST and CVS_LIST_EXCEPT.
10119 (header_regexp, h_re): Remove.
10120 (dd_c): New macro.
10121 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
10122 (my-distcheck): Use more-modern GCC flags.
10123 (signatures, %.asc): Remove.
10124 (rel-files, announcement): Remove signatures.
10125 Restore old updating code, even though we don't use it, so
10126 that we're the same as coreutils.
10127 (alpha, beta, major): Depend on news-date-check.
10128 Make the upload commands.
10129
10130 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
10131 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
10132 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
10133 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
10134 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
10135 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
10136 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
10137 * tests/sets.at: Likewise.
10138
10139 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
10140 we comment out the Autoconf version number.
10141 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
10142 it's error-prone and "make maintainer-distcheck" rejects it.
10143
10144 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
10145 Indent calls to "error" to pacify "make maintainer-distcheck",
10146 when the calls are not intended to be translated.
10147 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
10148
10149 * src/Makefile.am (DEFS): Use +=, to pacify
10150 "make maintainer-distcheck".
10151 (bison_SOURCES): Add scan-skel.h.
10152 (sc_tight_scope): New rule, from coreutils.
10153
10154 * src/files.c (src_extension, header_extension):
10155 Now static, not extern.
10156 * src/getargs.c (short_options): Likewise.
10157 * src/muscle_tab.c (muscle_table): Likewise.
10158 * src/parse-gram.y (current_class, current_type, current_prec):
10159 Likewise.
10160 * src/reader.c (grammar_end, previous_rule_end): Likewise.
10161 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
10162 * src/main.c (main): Cast bindtextdomain and textdomain calls to
10163 void, to avoid warning when NLS is disabled.
10164 * src/output.c: Include scan-skel.h.
10165 (scan_skel): Remove decl, since scan-skel.h does this.
10166 (output_skeleton):
10167 Indent calls to "error" to pacify "make maintainer-distcheck".
10168 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
10169 * src/reader.h (gram_end, gram_lineno): New decls to pacify
10170 "make maintainer-distcheck".
10171 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
10172 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
10173 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
10174 (skel_lex_destroy, scan_skel): Move these decls to...
10175 * src/scan-skel.h: New file.
10176 * src/uniqstr.c (uniqstr_assert):
10177 Indent calls to "error" to pacify "make maintainer-distcheck".
10178
10179 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
10180 not @VAR@.
10181
10182 * tests/torture.at: Revamp to avoid misuse of atoi that
10183 "make maintainer-distcheck" complained about.
10184
10185 * examples/extexi (message): Don't print a message more than once,
10186 and omit line-number decoration that makes Emacs compile think
10187 that informative messages are worth worrying about.
10188
10189 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
10190
10191 * configure.ac: Update version number.
10192
10193 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
10194 accidentally.
10195 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
10196 autogenerated by the maintainer.
10197 * examples/calc++/.cvsignore: Add *.yy.
10198
10199 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
10200 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10201 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10202
10203 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
10204
10205 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
10206 from maintainer-distcheck about casting the argument of 'free'.
10207
10208 * NEWS: Mention recent yytname changes.
10209 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
10210
10211 * bootstrap: For translations that have not yet been upgraded to
10212 the new runtime-po domain, prime the pump by extracting the
10213 relevant strings from the obsolete translations. This code can be
10214 removed once the bison-runtime domain has been translated by each
10215 team.
10216
10217 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
10218 now that token names are already quoted.
10219
10220 Fix problem reported by Anthony Heading.
10221 * data/glr.c (YYTOKEN_TABLE): New macro.
10222 (yytname): Define if YYTOKEN_TABLE.
10223 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
10224 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
10225 (YYERROR_VERBOSE): Define the same way the other skeletons do.
10226 * src/output.c (prepare_symbols): Output token_table_flag.
10227
10228 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
10229
10230 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
10231 again if the first call fails.
10232
10233 * data/glr.c (yytnamerr): New function.
10234 (yyreportSyntaxError): Use it to dequote most string literals.
10235 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
10236 with other skeletons. All uses changed.
10237 (yytnameerr_): New function.
10238 (yyreport_syntax_error): Use it to dequote most string literals.
10239 * data/yacc.c (yytnamerr): New function.
10240 (yyerrlab): Use it to decode most string literals.
10241 * doc/bison.texinfo (Decl Summary, Calling Convention):
10242 Clarify quoting convention of yytname.
10243 * src/output.c (prepare_symbols): Quote all names. This undoes
10244 the 2005-04-17 change, which is now accomplished (mostly) via
10245 changes in the parsers as described above.
10246 * tests/regression.at (Token definitions, Web2c Actions):
10247 Undo most 2005-04-17 change here, too.
10248
10249 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
10250
10251 Fix more problems reported by twlevo@xs4all.nl.
10252 * tests/cxx-type.at: Don't pipe output of ./types through sed to
10253 remove trailing spaces. This loses the exit status of ./types,
10254 and isn't needed since ./types shouldn't be emitting trailing
10255 spaces.
10256 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
10257 as the stack isn't valid in that case.
10258
10259 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10260 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10261 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10262 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10263 is used.
10264 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10265 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10266 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10267 Likewise.
10268
10269 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10270 overly-picky compilers that reject 'char *foo = "bar";'.
10271
10272 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10273 to FILE * parameter, not to stderr. This fixes a typo introduced
10274 in the 2005-07-12 change.
10275
10276 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10277 warnings from GCC 4.
10278
10279 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10280 (yyglrShiftDefer, yysplitStack):
10281 Remove unused parameters b4_pure_formals. All uses changed.
10282 (yyglrShift): Remove unused parameters b4_user_formals.
10283 All uses changed.
10284 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10285
10286 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10287
10288 Destructor cleanups and regularization among the three skeletons.
10289 * NEWS: Document the behavior changes.
10290 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10291 stack before failing, as the cleanup code will do it for us now.
10292 * data/lalr1.cc (yyerrlab): Likewise.
10293 * data/glr.c (yyparse): Pop everything off the stack before
10294 freeing it, so that destructors get called properly.
10295 * data/lalr1.cc (yyreturn): Likewise.
10296 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10297 This is more consistent.
10298 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10299 why destructors might be called. 1.875 -> 2.1.
10300 (Destructor Decl, Decl Summary, Table of Symbols):
10301 Some English-language cleanups for %destructor.
10302 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10303 Add output line for destructor of start symbol.
10304 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10305 because of that same extra output line.
10306
10307 * NEWS: Document minor wording changes in diagnostics of
10308 Bison-generated parsers.
10309 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10310 Remove unused formals. All uses changed.
10311 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10312 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10313 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10314 Rename yyoverflowab to yyexhaustedlab.
10315 When memory exhaustion occurs during syntax-error reporting,
10316 report it separately rather than in a single diagnostic; this
10317 eases translation.
10318 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10319 (Memory Exhausted): Renamed from Parser Stack Overflow.
10320 Revamp wording slightly to prefer "memory exhaustion".
10321 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10322
10323 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10324
10325 Add i18n support to the GLR skeleton. Partially fix the C++
10326 skeleton; a C++ expert needs to finish this. Remove debugging
10327 msgids; there's little point to having them translated, since they
10328 can be understood only by someone who can read the
10329 (English-language) source code.
10330
10331 Generate runtime-po/bison-runtime.pot automatically, so that we
10332 don't have to worry about garbage getting in that file. We'll
10333 make sure after the next official release that old msgids don't
10334 get lost. See
10335 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10336
10337 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10338 Now auto-generated.
10339 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10340 Fix typos in explanations of the runtime file.
10341 * bootstrap: Change gettext keyword from YYI18N to YY_.
10342 Use standard Makefile.in.in in runtime-po, since we'll arrange
10343 for backward-compatible bison-runtime.po files in a different way.
10344 * data/glr.c (YY_): New macro, from yacc.c.
10345 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10346 Translate messages intended for users.
10347 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10348 the wording in the other skeletons. We don't know that the memory
10349 is virtual.
10350 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10351 Use same method that yacc.c uses.
10352 Don't translate debugging messages.
10353 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10354 it doesn't work (yet), and requires C++ expertise to fix.
10355 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10356 Move defn to a more logical place, to be consistent with other
10357 skeletons.
10358 Don't translate debugging messages.
10359 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10360 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10361 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10362 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10363
10364 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10365 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10366 void, not int.
10367 * tests/glr-regression.at (Badly Collapsed GLR States):
10368 Likewise.
10369 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10370 yylex should return 0 at EOF rather than aborting.
10371
10372 Improve tests for stack overflow in GLR parser.
10373 Problem reported by twlevo@xs4all.nl.
10374 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10375 All uses removed.
10376 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10377 can handle the problem.
10378 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10379 (yyparse): New local variable yyresult to record the result.
10380 Use result of setjmp to set it, rather than storing itinto
10381 struct.
10382 (yyDone): Remove label.
10383 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10384 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10385 if YYABORT is used).
10386 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10387 yyparse status; put status > 1 into diagnostic.
10388 Check that status==2 works.
10389 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10390 Use exit status 3 for failure to open (which shouldn't happen).
10391
10392 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10393
10394 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10395 1 on syntax error; just let yyparse do its thing.
10396 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10397 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10398 (Exploding the Stack Size with Alloca):
10399 (Exploding the Stack Size with Malloc):
10400 Expect exit status 2, not 1, since the parser is supposed to blow
10401 its stack. Problem reported by twlevo@xs4all.nl.
10402
10403 * data/glr.c (yyparse): Don't assume that the initial calls
10404 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10405 Print a stack-overflow message and fail instead.
10406 Initialize the line-number information before creating the stack,
10407 so that the stack-overflow message can report line zero safely.
10408
10409 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10410
10411 Fix problems reported by twlevo@xs4all.nl.
10412 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10413 (yyuserMerge): Provide a default case if b4_mergers is empty.
10414 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10415 * tests/glr-regression.at
10416 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10417 Add casts to pacify C++ compilers.
10418 * tests/glr-regression.at (Improper merging of GLR delayed action
10419 sets): Declare yylex before using it.
10420 * tests/Makefile.am (maintainer-check-g++): Fix a stray
10421 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10422 test for valgrind; valgrind is independent of g++.
10423 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10424 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10425 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10426 Use a destructor, so that we can expand the stack. Change
10427 YYSTYPE to char * so that we can free it. Cast result of malloc.
10428
10429 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10430
10431 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10432 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10433
10434 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10435
10436 * PACKAGING: New file, suggested by Bruno Haible and taken from
10437 similar wording in gettext's PACKAGING file.
10438 * NEWS: Mention PACKAGING.
10439 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10440
10441 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10442
10443 * NEWS: Document recent i18n improvements.
10444 * bootstrap: Get runtime translations into runtime-po.
10445 Create runtime-po files automatically, if possible.
10446 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10447 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10448 does not infringe on the user's name space.
10449 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10450 * doc/bison.texinfo (Internationalization): Revamp the English
10451 and Texinfo syntax a bit, to try to make it clearer.
10452 (Bison Options, Option Cross Key): Mention --print-localedir.
10453 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10454 YYENABLE_NLS. Quote a bit more.
10455 * runtime-po/.cvsignore: New file.
10456 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10457 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10458 * runtime-po/quot.sed: Likewise.
10459 * runtime-po/boldquot.sed: Likewise.
10460 * runtime-po/en@quot.header: Likewise.
10461 * runtime-po/en@boldquot.header: Likewise.
10462 * runtime-po/insert-header.sin: Likewise.
10463 * runtime-po/remove-potcdate.sin: Likewise.
10464 * runtime-po/Makevars: Likewise.
10465 * runtime-po/LINGUAS: Likewise.
10466 * runtime-po/de.po: Likewise; we will rely on the translation project
10467 to maintain this, so "bootstrap" should get it.
10468 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
10469 its value.
10470 * src/main.c (main): Bind the bison-runtime domain, too.
10471
10472 2005-07-12 Bruno Haible <bruno@clisp.org>
10473
10474 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10475 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10476 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10477 * runtime-po: New directory.
10478 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10479 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10480 * runtime-po/Rules-quot: New file, copied from po/.
10481 * runtime-po/quot.sed: Likewise.
10482 * runtime-po/boldquot.sed: Likewise.
10483 * runtime-po/en@quot.header: Likewise.
10484 * runtime-po/en@boldquot.header: Likewise.
10485 * runtime-po/insert-header.sin: Likewise.
10486 * runtime-po/remove-potcdate.sin: Likewise.
10487 * runtime-po/Makevars: New file.
10488 * runtime-po/POTFILES.in: New file.
10489 * runtime-po/LINGUAS: New file.
10490 * runtime-po/bison-runtime.pot: New file.
10491 * runtime-po/de.po: New file.
10492 * m4/bison.m4: New file.
10493 * Makefile.am (SUBDIRS): Add runtime-po.
10494 (aclocaldir, aclocal_DATA): New variables.
10495 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10496 Define aclocaldir.
10497 * src/getargs.c (usage): Document --print-localedir option.
10498 (PRINT_LOCALEDIR_OPTION): New enum item.
10499 (long_options): Add --print-localedir option.
10500 (getargs): Handle --print-localedir option.
10501 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10502 (Internationalization): New section.
10503
10504 2005-07-12 Akim Demaille <akim@epita.fr>
10505
10506 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10507 for consistency with the rest of the code.
10508 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10509 Add separators.
10510
10511 2005-07-12 Akim Demaille <akim@epita.fr>
10512
10513 * src/parse-gram.y: Use %printer instead of YYPRINT.
10514
10515 2005-07-12 Akim Demaille <akim@epita.fr>
10516
10517 * src/symtab.h, src/symtab.c (symbol_print): New.
10518 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10519 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10520
10521 2005-07-12 Akim Demaille <akim@epita.fr>
10522
10523 * data/glr.c (b4_syncline): Fix (swap) the definitions of
10524 b4_at_dollar and b4_dollar_dollar.
10525
10526 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10527
10528 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10529 and Pennello's paper.
10530
10531 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10532
10533 * data/yacc.c (yyparse): Undo previous patch. Instead,
10534 set yylsp[0] and yyvsp[0] only if the initial action
10535 sets yylloc and yylval, respectively.
10536
10537 * data/yacc.c (yyparse): In the initial action, set
10538 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10539 This avoids the use of undefined variables if the initial
10540 action does not set yylloc and/or yylval.
10541
10542 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10543
10544 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10545 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10546 Remove from CVS. These files are automatically generated.
10547 * examples/extexi: Clarify that this file is now part of Bison,
10548 not GNU M4, and that it works with any POSIX-compatible Awk.
10549 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10550 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10551 so that we also get calc++-parser.yy. Geneate it.
10552 Use $(AWK), not gawk, since any conforming Awk will do.
10553 Put comment before action, since older 'make' can't handle comment
10554 in action.
10555 $(BUILT_SOURCES): List all built sources, not just some of them.
10556 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10557 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10558 $($(calc_sources_generated)): Remove unnecessary test for existence
10559 of target. (This had a shell syntax error anyway; a stray "x".)
10560 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10561 calc++-parser.yy.
10562 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10563
10564 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10565 implied by the other modules.
10566
10567 2005-07-06 Akim Demaille <akim@epita.fr>
10568
10569 Bind examples/calc++ to the package.
10570 * examples/calc++/Makefile: Remove, replaced by...
10571 * examples/calc++/Makefile.am: ... this new file.
10572 * examples/calc++/test: Remove input.
10573 * examples/calc++/compile: Remove.
10574 * examples/Makefile.am: New.
10575 * configure.ac, Makefile.am: Adjust.
10576 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10577
10578 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10579
10580 * data/glr.c (yyFail): Drastically simplify; since the format argument
10581 never had any % directives, we can simply pass it to yyerror.
10582 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10583 be modified later, as that is the usual style in glr.c.
10584 Problems reported by Paul Hilfinger.
10585
10586 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10587 and size overflow errors.
10588 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10589 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10590 (YYSIZEMAX): New macro.
10591 (yystpcpy): New function, taken from yacc.c.
10592 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10593 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10594 so that we don't have to maintain their signatures.
10595 (yyFail): Check for buffer overflow, by using vsnprintf rather
10596 than vsprintf. Allocate a bigger buffer if possible.
10597 Report an error if buffer allocation fails.
10598 (yyStackOverflow): New function.
10599 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10600 the initialization was successful. It might fail if storage was
10601 exhausted.
10602 (yyexpandGLRStack): Add more checks for storage allocation failure.
10603 Use yyStackOverflow to report failures.
10604 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10605 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10606 Don't assume stack number fits in int.
10607 (yysplitStack): Check for storage allocation failure.
10608 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10609 can print diagnostics on storage allocation failure. All callers
10610 changed.
10611 (yyresolveValue): Use yybool for boolean.
10612 (yyreportSyntaxError): Check for size-calculation overflow.
10613 This code is taken from yacc.c.
10614 (yyparse): Check for storage allocation errors when allocating
10615 the initial stack.
10616
10617 2005-07-05 Akim Demaille <akim@epita.fr>
10618
10619 Extract calc++ from the documentation.
10620 * doc/bison.texinfo (Calc++): Add the extraction marks.
10621 * examples/extexi: New, from the aborted GNU Programming 2E.
10622 Separate the different paragraph of a file with empty lines.
10623 * examples/Makefile: Use it to extract the whole calc++ example.
10624
10625 2005-06-24 Akim Demaille <akim@epita.fr>
10626
10627 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10628 class typedefs.
10629
10630 2005-06-22 Akim Demaille <akim@epita.fr>
10631
10632 * doc/bison.texinfo (C++ Language Interface): First stab.
10633 (C++ Parsers): Remove.
10634
10635 2005-06-22 Akim Demaille <akim@epita.fr>
10636
10637 * data/lalr1.cc (yylex_): Honor %lex-param.
10638
10639 2005-06-22 Akim Demaille <akim@epita.fr>
10640
10641 Start a set of simple examples.
10642 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10643 * examples/calc++/calc++-driver.hh,
10644 * examples/calc++/calc++-parser.yy,
10645 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10646 * examples/calc++/compile, examples/calc++/test: New.
10647
10648 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10649
10650 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10651 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10652 which stems from the 2005-05-27 patch.
10653
10654 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10655
10656 * data/glr.c: Modify treatment of unused parameters to permit use
10657 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10658
10659 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10660
10661 Fix infringement on user name space reported by Janos Zoltan Szabo.
10662 * data/yacc.c (yyparse): strlen -> yystrlen.
10663
10664 2005-05-30 Akim Demaille <akim@epita.fr>
10665
10666 * data/lalr1.cc (_): New.
10667 Translate the various messages.
10668
10669 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10670
10671 Fix infringement on user name space reported by Bruno Haible.
10672 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10673 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10674 the user's name space.
10675 (alloca): Include <stdlib.h> to get it, if it's not built in.
10676 (YYMALLOC, YYFREE): Define only if needed.
10677 (malloc, free): Declare, but only if needed, as this infringes on
10678 the user name space.
10679
10680 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10681
10682 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10683 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10684 with %d format.
10685 * lib/ebitset.c (min, max): Undef before defining.
10686 * lib/vbitset.c (min, max): Likewise.
10687 * lib/subpipe.c (create_subpipe): Save local variables in case
10688 vfork clobbers them.
10689
10690 2005-05-24 Bruno Haible <bruno@clisp.org>
10691
10692 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10693 error message syntax used by gcc-4.0.
10694
10695 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10696
10697 * README: Mention m4 1.4.3. Remove obsolete advice about
10698 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10699
10700 * bootstrap: Remove workaround for problem I encountered with
10701 gettext 0.14.1; it seems to be fixed now.
10702
10703 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10704
10705 * NEWS: Version 2.0a.
10706
10707 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10708 the previous change.
10709
10710 Various maintainer cleanups.
10711 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10712 conftest*, for benefit of CVS commands run at the same time as
10713 "configure". Add build-aux, since "bootstrap" now creates it and
10714 its subfiles.
10715 * Makefile.cfg (move_if_change): Remove.
10716 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10717 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10718 (po_repo, do-po-update, po-update, wget_files, get-targets):
10719 (config.guess-url_prefix, config.sub-url_prefix):
10720 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10721 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10722 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10723 Remove.
10724 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10725 this is now the recommended name.
10726 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10727 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10728 ylwrap. These files now go into build-aux.
10729 * config/move-if-change: Remove.
10730 * config/prev-version.txt: Bump from 1.75 to 2.0.
10731
10732 * bootstrap: Add stdio-safer, unistd-safer modules.
10733 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10734 we don't need it).
10735 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10736 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10737 * lib/subpipe.c: Include "unistd-safer.h".
10738 (create_subpipe): Make sure all the newly-created
10739 file descriptors are > 2, so that diagnostics don't
10740 get sent down them (which might cause Bison to hang, in theory).
10741 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10742 * src/files.c (xfopen): Use fopen_safer, not fopen.
10743
10744 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10745 yesterday's yacc.c fix.
10746
10747 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10748
10749 * data/glr.c, data/lalr1.cc: Update copyright date.
10750
10751 Fix a destructor bug reported by Wolfgang Spraul in
10752 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10753 * data/yacc.c (yyabortlab): Don't call destructor, and
10754 don't set yychar to EMPTY.
10755 (yyoverflowlab): Don't call destructor.
10756 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10757 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10758 since we no longer output the message "discarding lookahead token
10759 end of input ()".
10760
10761 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10762
10763 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10764 fix a small glitch in debugging output.
10765 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10766 after YY_SYMBOL_PRINT where needed.
10767
10768 (struct yyGLRState): Add some comments.
10769 (struct yySemanticOption): Add some comments.
10770 (union yyGLRStackItem): Add comment.
10771
10772 (yymergeOptionSets): Correct this to properly perform the union,
10773 avoiding infinite reported by Michael Rosien.
10774 Update comment.
10775
10776 * tests/glr-regression.at: Add test for GLR merging error reported
10777 by M. Rosien.
10778
10779 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10780
10781 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10782 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10783 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10784 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10785 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10786 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10787 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10788 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10789 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10790 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10791 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10792 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10793 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10794 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10795 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10796 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
10797 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
10798 src/derives.h, src/files.c, src/files.h, src/getargs.c,
10799 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
10800 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
10801 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
10802 src/output.h, src/parse-gram.c, src/parse-gram.h,
10803 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
10804 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
10805 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
10806 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
10807 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
10808 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
10809 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
10810 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
10811 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
10812 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
10813 tests/reduce.at, tests/regression.at, tests/sets.at,
10814 tests/synclines.at, tests/testsuite.at, tests/torture.at:
10815 Update FSF postal mail address.
10816
10817 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
10818
10819 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
10820 Problem reported by Ralf Menzel.
10821
10822 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
10823
10824 * tests/actions.at: Test that stack overflow invokes destructors.
10825 From Marcus Holland-Moritz.
10826 * data/yacc.c (yyerrlab): Move the code that destroys the stack
10827 from here....
10828 (yyreturn): to here. That way, destructors are called properly
10829 even if the stack overflows, or the user calls YYACCEPT or
10830 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
10831 (yyoverflowlab): Destroy the lookahead.
10832
10833 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
10834
10835 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
10836
10837 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
10838
10839 * NEWS: Bison-generated C parsers no longer quote literal strings
10840 associated with tokens.
10841 * src/output.c (prepare_symbols): Don't escape strings,
10842 since users don't want to see C escapes.
10843 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
10844 in diagnostics.
10845 * tests/input.at (Torturing the Scanner): Likewise.
10846 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
10847
10848 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
10849
10850 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
10851 the data size is known to be too small and we can't increase it.
10852 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
10853
10854 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
10855
10856 * src/parse-gram.y: Include quotearg.h.
10857 (string_as_id): Quote $1 before using it as a key, since the
10858 lexer no longer quotes it for us.
10859 (string_content): Don't strip quotes, since lexer no longer
10860 quotes it for us.
10861 * src/scan-gram.l: Include quotearg.h.
10862 ("\""): Omit quote.
10863 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
10864 a key, since the rest of the lexer doesn't quote it.
10865 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
10866 * tests/regression.at (Token definitions): Check for backslashes
10867 in token strings.
10868
10869 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
10870 (YYSIZE_T): Define to unsigned long int when using an older compiler.
10871 (yyparse): Revamp code to generate long syntax error message, to
10872 make it easier to translate, and to avoid problems with arithmetic
10873 overflow. Change "virtual memory" to "memory" in diagnostic, since
10874 we don't know whether the memory is virtual.
10875
10876 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
10877
10878 * NEWS: Bison-generated C parsers now use the _ macro to
10879 translate strings.
10880 * data/yacc.c (_) [!defined _]: New macro.
10881 All English strings wrapped inside this macro.
10882 * doc/bison.texinfo (Bison Parser): Document _.
10883 * po/POTFILES.in: Include src/parse-gram.c, since it now
10884 includes translateable strings that parse-gram.y doesn't.
10885
10886 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
10887
10888 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
10889 reverting the 2004-10-11 change to this function.
10890 (symbol_check_alias_consistency): Don't call symbol_type_set
10891 if the type name is already correct.
10892 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
10893
10894 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
10895
10896 * tests/regression.at (Token definitions): Don't use a token named
10897 c, as that generates a "#define c ..." that runs afoul of buggy
10898 stdlib.h that uses the identifier c as a member of struct
10899 drand48_data. Problem reported by Horst Wente.
10900
10901 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
10902
10903 * bootstrap: Change translation URL from
10904 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
10905 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
10906 redirection glitches. Problem reported by twlevo@xs4all.nl.
10907
10908 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
10909
10910 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
10911 after operands; POSIX says this isn't portable for the c99 command.
10912
10913 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
10914
10915 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
10916 immediately if a data overrun has occurred; this may help us track
10917 down what may be a spurious failure on MacOS.
10918
10919 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
10920
10921 Respond to problems reported by twlevo@xs4all.nl.
10922
10923 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
10924
10925 * src/vcg.h: Comment fix.
10926 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
10927 (G_CMAX): Change to -1 instead of INT_MAX.
10928
10929 * data/yacc.c (yyparse): Omit spaces before #line.
10930
10931 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
10932
10933 * src/tables.c (state_number_to_vector_number): Put it inside an
10934 "#if 0", since it's not currently used. Problem reported by
10935 Roland McGrath.
10936
10937 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
10938
10939 * src/output.c (escaped_output): Renamed from
10940 escaped_file_name_output, since we now use it for symbol tags as
10941 well. All uses changed.
10942 (symbol_destructors_output, symbol_printers_output):
10943 Escape symbol tags too.
10944 Problem reported by Matyas Forstner in
10945 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
10946
10947 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
10948 not needed.
10949 * src/output.c (user_actions_output, token_definitions_output,
10950 symbol_destructors_output, symbol_printers_output): Likewise.
10951 * src/reader.c (prologue_augment): Likewise.
10952 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
10953
10954 * src/vcg.c (output_edge): Don't quote linestyle arg.
10955 Problem reported by twlevo@xs4all.nl.
10956
10957 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
10958
10959 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
10960 example, reported by Derek M Jones. Also, make the example even
10961 more outrageous, to better illustrate how bad the problem is.
10962
10963 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
10964
10965 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
10966 putsym. Typo reported by Sebastian Piping.
10967
10968 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
10969
10970 * doc/bison.texinfo (Language and Grammar): some -> same
10971 (Epilogue): int he -> in the
10972 Typos reported by Sebastian Piping via Justin Pence.
10973
10974 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
10975
10976 * tests/glr-regression.at (Improper handling of embedded actions
10977 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
10978 embedded actions and $-N in GLR parsers", work around an Autoconf bug
10979 with dollar signs in test names.
10980 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
10981 for a similar reason.
10982
10983 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
10984
10985 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
10986 wants to redefine G_VIEW.
10987
10988 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
10989
10990 * src/vcg.c (get_view_str): Remove case for normal_view.
10991 Problem reported by twlevo@xs4all.nl.
10992
10993 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
10994
10995 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
10996 Problem reported by twlevo@xs4all.nl.
10997
10998 * doc/bison.texinfo: Change @dircategory from "GNU programming
10999 tools" to "Software development". Requested by Richard Stallman
11000 via Karl Berry.
11001
11002 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
11003
11004 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
11005 Problem reported by twlevo@xs4all.nl.
11006
11007 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
11008
11009 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
11010 keyword; it's not needed with modern compilers, and it doesn't
11011 affect correctness with older compilers. Suggested by
11012 twlevo@xs4all.nl.
11013
11014 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
11015
11016 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
11017 gcc -Wswitch-default.
11018 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11019 * data/yacc.c (yyparse): Likewise.
11020
11021 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
11022
11023 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
11024 already. Let config.h define any nonstandard values.
11025
11026 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
11027
11028 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11029 for the benefit of slower hosts. Problem reported by
11030 Nelson H. F. Beebe.
11031
11032 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11033
11034 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11035 being defined and not used.
11036 * data/lalr1.cc (yyparse): Likewise.
11037 Use "if (false)" rather than "if (0)".
11038
11039 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11040
11041 * TODO: Mention that we should allow NUL bytes in tokens.
11042
11043 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11044
11045 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11046 Problem reported by Hans Aberg.
11047
11048 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11049
11050 * src/getargs.c (version): Happy new year; update overall
11051 program copyright date from 2004 to 2005.
11052
11053 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11054 Problem reported by Hans Aberg.
11055 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11056 (Output file names.): Add a test for the case when standard output
11057 is closed.
11058
11059 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11060
11061 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11062 to fix an oversight in the Bison 2.0 manual.
11063
11064 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11065
11066 * NEWS: Version 2.0. Reformat the existing news items since
11067 1.875, so that related items are grouped together.
11068 * configure.ac (AC_INIT): Bump version to 2.0.
11069 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11070
11071 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11072 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11073 otherwise, we're not testing alloca. Unfortunately there's no
11074 simple way to consult HAVE_ALLOCA here.
11075
11076 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11077 for yymsg, too.
11078
11079 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11080 hand. This avoids a warning about comparing int to size_t when
11081 GCC warnings are enabled.
11082
11083 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11084
11085 * NEWS: Bison-generated parsers no longer default to using the
11086 alloca function (when available) to extend the parser stack, due
11087 to widespread problems in unchecked stack-overflow detection.
11088 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11089 responsibility to set it to a positive value. This lets the user
11090 specify a value that is not a preprocessor constant.
11091 * data/yacc.c (YYMAXDEPTH): Likewise.
11092 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11093 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11094 to be a compile-time constant. However, explain the constraints on it.
11095 Also, explain the constraints on YYINITDEPTH.
11096 (Table of Symbols): Explain that alloca is no longer the default.
11097 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11098 to 1.
11099
11100 * doc/bison.texinfo (Location Default Action): Mention that n must
11101 be zero when k is zero. Suggested by Frank Heckenbach.
11102
11103 2004-12-22 Akim Demaille <akim@epita.fr>
11104
11105 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11106 (parser::state_type, parser::semantic_type, parser::location_type):
11107 Private, not public.
11108 (parser::parse): Return ints, not bool.
11109 Returning a bool introduces a problem: 0 corresponds to false, and
11110 it seems weird to return false on success. Returning true changes
11111 the conventions for yyparse.
11112 Alternatively we could return void and send an exception.
11113 There is no clear consensus (yet?).
11114 (state_stack, semantic_stack, location_stack): Rename as...
11115 (state_stack_type, semantic_stack_type, location_stack_type): these.
11116 Private, not public.
11117 * tests/c++.at: New.
11118 * tests/testsuite.at, tests/Makefile.am: Adjust.
11119
11120 2004-12-21 Akim Demaille <akim@epita.fr>
11121
11122 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
11123
11124 2004-12-21 Akim Demaille <akim@epita.fr>
11125
11126 Don't impose std::string for filenames.
11127
11128 * data/lalr1.cc (b4_filename_type): New.
11129 (position::filename): Use it.
11130 (parser.hh): Move the inclusion of stack.hh and location.hh below
11131 the user code, so that needed headers for the filename type can be
11132 included first.
11133 Forward declare them before the user code.
11134 * tests/Makefile.am (check-local, installcheck-local): Pass
11135 TESTSUITEFLAGS to the TESTSUITE.
11136
11137 2004-12-20 Akim Demaille <akim@epita.fr>
11138
11139 Use more STL like names: my_class instead of MyClass.
11140
11141 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
11142 (SemanticStack, SemanticType, StateStack, StateType)
11143 (TokenNumberType, Stack, Slice, Traits, Parser::location)
11144 (Parser::value): Rename as...
11145 (location_stack, location_type, rhs_number_type, semantic_stack)
11146 (semantic_type, state_stack, state_type, token_number_type, stack)
11147 (slice, traits, parser::yylloc, parser::yylval): these.
11148
11149 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
11150
11151 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
11152
11153 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
11154 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11155
11156 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
11157
11158 Remove uses of 'short int' and 'unsigned short int'. This raises
11159 some arbitrary limits. It uses more memory but nowadays that's
11160 not much of an issue.
11161
11162 This change does not affect the generated parsers; that's a different
11163 task, as some users will want to conserve memory there.
11164
11165 Ideally we should use size_t to represent all object counts, and
11166 something like ptrdiff_t to represent signed differences of object
11167 counts; but that will require more code-cleanup than I have the
11168 time to do right now.
11169
11170 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
11171 Use size_t, not int or short int, to count objects.
11172 * src/closure.c (nritemset, closure): Likewise.
11173 * src/closure.h (nritemset, closure): Likewise.
11174 * src/nullable.c (nullable_compute): Likewise.
11175 * src/print.c (print_core): Likewise.
11176 * src/print_graph.c (print_core): Likewise.
11177 * src/state.c (state_compare, state_hash): Likewise.
11178 * src/state.h (struct state): Likewise.
11179 * src/tables.c (default_goto, goto_actions): Likewise.
11180
11181 * src/gram.h (rule_number, rule): Use int, not short int.
11182 * src/output.c (prepare_rules): Likewise.
11183 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
11184 errs, reductions): Likewise.
11185 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
11186 Likewise.
11187 * src/tables.c (vector_number, tally, action_number,
11188 ACTION_NUMBER_MINIMUM): Likewise.
11189 * src/output.c (muscle_insert_short_int_table): Remove.
11190
11191 2004-12-17 Akim Demaille <akim@epita.fr>
11192
11193 * data/lalr1.cc: Extensive Doxygenation.
11194 (error_): Rename as...
11195 (error): this, since it is visible to the user.
11196 Adjust callers.
11197 (Parser::message): Now an automatic variable from...
11198 (Parser::yyreport_syntax_error_): here.
11199 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
11200 Parser::error.
11201 * tests/input.at: Escape $.
11202
11203 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
11204
11205 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
11206 Parenthesize rhs to avoid obscure problems with mistakes like
11207 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
11208 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11209 b4_rhs_location): Likewise.
11210 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11211 b4_rhs_location): Likewise.
11212
11213 2004-12-16 Akim Demaille <akim@epita.fr>
11214
11215 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
11216 yacc.c: be sure to stay within yycheck_.
11217 * tests/actions.at: Re-enable C++ tests.
11218
11219 2004-12-16 Akim Demaille <akim@epita.fr>
11220
11221 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
11222 real.
11223
11224 2004-12-16 Akim Demaille <akim@epita.fr>
11225
11226 Use #define to handle the %name-prefix.
11227
11228 * data/glr.c, data/yacc.c: Comment changes.
11229 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
11230 so that one can refer to yylex in the parser file, and have it
11231 renamed, as is the case with other skeletons.
11232
11233 2004-12-16 Akim Demaille <akim@epita.fr>
11234
11235 Move lalr1.cc internals into yy*.
11236
11237 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
11238 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
11239 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
11240 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
11241 (empty_, final_, terror_, errcode_, ntokens_)
11242 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
11243 (looka_, ilooka_, error_range_, nerrs_):
11244 Rename as...
11245 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
11246 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
11247 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
11248 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
11249 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
11250 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
11251 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
11252 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
11253 these.
11254
11255 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
11256
11257 Fix some problems reported by twlevo at xs4all.
11258 * src/symtab.c (symbol_new): Report an error if the input grammar
11259 contains too many symbols. This is better than calling abort() later.
11260 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
11261 (struct node, struct graph):
11262 Rename member expand to stretch. All uses changed.
11263 (struct graph): Remove member layoutalgorithm. All uses removed.
11264 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11265 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11266 All uses changed.
11267 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11268
11269 2004-12-15 Akim Demaille <akim@epita.fr>
11270
11271 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11272 Add more Doxygen comments.
11273 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11274 (report_syntax_error_, translate_): Rename as...
11275 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11276 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11277
11278 2004-12-15 Akim Demaille <akim@epita.fr>
11279
11280 * data/lalr1.cc (lex_): Rename as...
11281 (yylex_): this.
11282 Move the trace here.
11283 Take the %name-prefix into account.
11284 Reported by Alexandre Duret-Lutz.
11285
11286 2004-12-15 Akim Demaille <akim@epita.fr>
11287
11288 Simplify the C++ parser constructor.
11289
11290 * data/lalr1.cc (debug_): Rename as...
11291 (yydebug_): so that the parser's internals are always in the yy*
11292 pseudo namespace.
11293 Adjust uses.
11294 (b4_parse_param_decl): Remove the leading comma as it is now only
11295 called as unique argument list.
11296 (Parser::Parser): Remove the constructor accepting a location and
11297 an initial debugging level.
11298 Remove from the other ctor the argument for the debugging level.
11299 (debug_level_type, debug_level, set_debug_level): New.
11300
11301 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11302 constructor calls.
11303
11304 2004-12-15 Akim Demaille <akim@epita.fr>
11305
11306 Remove b4_root related material: failure experiment
11307 (which goal was to allow to derive from a class).
11308
11309 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11310 definitions and uses.
11311
11312 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11313
11314 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11315 not 2, since it's not portable to subtract 1 from the start of an
11316 array. The new item 0 is never set or used. All uses changed.
11317
11318 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11319 the default definition of YYLLOC_DEFAULT. Problem reported
11320 by Frank Heckenbach.
11321
11322 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11323
11324 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11325 the normal case and one for the error case. Just use the
11326 first one uniformly. Problem reported by Frank Heckenbach.
11327 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11328 use exactly the same macro in both places.
11329 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11330 so that the normal-case YYRHSLOC works for the error case too.
11331 All uses changed.
11332 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11333 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11334 * doc/bison.texinfo (Location Default Action): Don't claim that
11335 we have an array of locations. Use the same macro for both glr
11336 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11337 the index is 0.
11338
11339 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11340
11341 * HACKING: Update email addresses to send announcements to.
11342
11343 * configure.ac (AC_INIT): Bump version to 1.875f.
11344
11345 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11346
11347 * NEWS: Version 1.875e.
11348 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11349
11350 * src/scan-skel.l: Include "complain.h", for "fatal".
11351
11352 * src/relation.h (relation_print, relation_digraph):
11353 Relation sizes are of type relation_node, not size_t (this is
11354 merely a doc fix, since the two types are equivalent).
11355 (relation_transpose): Relation sizes are of type relation_node,
11356 not int.
11357 * src/relation.c: Likewise.
11358 (top, infinity): Now of type relation_node, not int.
11359 (traverse, relation_transpose): Use relation_node, not int.
11360
11361 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11362 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11363 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11364
11365 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
11366 specifying whether the test should be skipped. Use it tp
11367 specify that the [%defines %skeleton "lalr1.cc"] tests currently
11368 fail on some hosts, and should be skipped.
11369
11370 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11371
11372 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11373 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11374 unless otherwise specified below.
11375
11376 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11377 to allocate kernel_base, kernel_items, kernel_size, since
11378 they needn't be initialized to 0.
11379 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11380 * src/closure.c (new_closure): Likewise, for itemset.
11381 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11382 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11383 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11384 (build_relations): Likewise for edge, states1, includes.
11385 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11386 * src/reader.c (packgram): Likewise, for ritem, rules.
11387 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11388 * src/relation.c (relation_digraph): Likewise for VERTICES.
11389 (relation_transpose): Likewise for new_R, end_R.
11390 * src/symtab.c (symbols_token_translations_init): Likewise for
11391 token_translations.
11392 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11393 (token_actions): Likewise for yydefact, actrow, conflrow,
11394 conflict_list.
11395 (save_column): Likewise for froms[symno], tos[symno].
11396 (goto_actions): Likewise for state_count.
11397 (pack_table): Likewise for base, pos, check.
11398 (tables_generate): Likewise for width.
11399
11400 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11401 for initial core. Just have a separate core, so we needn't worry
11402 about whether kernel_size and kernel_base are initialized.
11403
11404 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11405 kernel_size, kernel_items): Remove unnecessary initialization.
11406 * src/conflicts.c (conflicts): Likewise.
11407 * src/derives.c (derives): Likewise.
11408 * src/muscle_tablc (muscle_insert): Likewise.
11409 * src/relation.c (relation_digraph): Likewise.
11410 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11411 conflrow, conflict_table, conflict_list, table, check):
11412 Likewise.
11413
11414 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11415 This is because all callers pass unsigned int.
11416 * src/closure.h (new_closure): Likewise.
11417
11418 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11419 (build_relations): Initialize includes[i] in all cases.
11420 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11421 and rules[ruleno].precsym. Initialize members in order.
11422 * src/relation.c (relation_transpose): Always initialize new_R[i]
11423 and end_R[i].
11424 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11425
11426 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11427 conflict_list[0] was always 0, but now it isn't initialized.
11428
11429 * src/table.c (table_grow): When conflict_table grew, the grown
11430 area wasn't cleared. Fix this.
11431
11432 * lib/.cvsignore: Add strdup.c, strdup.h.
11433 * m4/.cvsignore: Add strdup.m4.
11434
11435 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11436
11437 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11438 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11439 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11440 ngotos + 1 without checking for overflow.
11441 (build_relations): Use END_NODE, not -1, to denote end of edges.
11442 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11443 build_relations): Use goto_number, not int, for goto numbers.
11444 * src/tables.c (save_column, default_goto): Likewise.
11445
11446 2004-11-23 Akim Demaille <akim@epita.fr>
11447
11448 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11449 of #defining from yystype.
11450 Don't typedef yystype, C++ does not need it.
11451 This lets it possible to forward declare it as union.
11452
11453 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11454
11455 * bootstrap (gnulib_modules): Add extensions.
11456 Problem reported by Jim Meyering.
11457
11458 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11459
11460 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11461 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11462 src/system.h, src/tables.c: XFREE -> free, to accommodate
11463 recent change to gnulib xalloc.h.
11464 Problem reported by Jim Meyering.
11465
11466 2004-11-17 Akim Demaille <akim@epita.fr>
11467
11468 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11469
11470 2004-11-17 Akim Demaille <akim@epita.fr>,
11471 Alexandre Duret-Lutz <adl@gnu.org>
11472
11473 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11474 changes.
11475 (YYCDEBUG): Adjust.
11476 Use it instead of cdebug_.
11477 (Parser::debug_stream, Parser::set_debug_stream): New.
11478 (Parser::symprint_): Define cdebug_ for temporary backward
11479 compatibility.
11480 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11481 debug_stream ().
11482
11483 2004-11-17 Akim Demaille <akim@epita.fr>
11484
11485 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11486 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11487 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11488 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11489
11490 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11491
11492 * data/glr.c (yyloc_default): Remove; not used.
11493 Problem reported by Frank Heckenbach.
11494
11495 2004-10-25 Akim Demaille <akim@epita.fr>
11496
11497 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11498 Introduce another definition to address simple location arrays.
11499 (yyGLRStack): New member: yyerror_range.
11500 (yyrecoverSyntaxError, yyparse): Update it.
11501 (yyrecoverSyntaxError): Use it when shifting the error token to
11502 have an accurate range, equivalent to the one computed by both
11503 yacc.c and lalr1.cc.
11504 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11505 that column numbers start at column 0, as per GNU Coding
11506 Standards, the others tests, and the doc.
11507 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11508 Adjust to the above change (first column is 0).
11509 And adjust the location of the "<error>", now covering the whole
11510 line.
11511
11512 2004-10-22 Akim Demaille <akim@epita.fr>
11513 and Paul Eggert <eggert@cs.ucla.edu>
11514
11515 Remove some arbitrary limits on goto numbers and relations.
11516 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11517 initial values, since they're never used.
11518 (set_goto_map): ngotos is now unsigned, so test for overflow
11519 by seeing whether it wraps around to zero.
11520 * src/lalr.h (goto_number): Now size_t, not short int.
11521 (GOTO_NUMBER_MAXIMUM): Remove.
11522 * src/relation.c (relation_print, traverse, relation_transpose):
11523 Check for END_NODE rather than looking at sign.
11524 * src/relation.h (END_NODE): New macro.
11525 (relation_node): Now size_t, not short int.
11526
11527 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11528
11529 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11530 keyword, not an identifier. Problem reported by Baron Schwartz in
11531 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11532
11533 2004-10-11 Akim Demaille <akim@epita.fr>
11534
11535 * src/symtab.c (symbol_check_alias_consistency): Also check
11536 type names, destructors, and printers.
11537 Reported by Alexandre Duret-Lutz.
11538 Recode the handling of associativity and precedence in terms
11539 of symbol_precedence_set.
11540 Accept no redeclaration at all, not even equal to the previous
11541 value.
11542 (redeclaration): New.
11543 Use it to factor redeclaration complaints.
11544 (symbol_make_alias): Don't set the type of the alias, let
11545 symbol_check_alias_consistency do it as for other features.
11546 * src/symtab.h (symbol): Add new member prec_location, and
11547 type_location.
11548 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11549 * tests/input.at (Incompatible Aliases): New.
11550
11551 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11552
11553 .cvsignore fixes to accommodate gnulib changes,
11554 and the practice of naming build directories "_build".
11555 * .cvsignore: Add "_*". Sort.
11556 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11557 * m4/.cvsignore: Add "*_gl.m4".
11558
11559 2004-10-06 Akim Demaille <akim@epita.fr>
11560
11561 * src/parse-gram.y (add_param): Fix the truncation of trailing
11562 spaces.
11563
11564 2004-10-05 Akim Demaille <akim@epita.fr>
11565
11566 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11567 whether the reducion was empty or not. This leaves room to
11568 improve the use of YYLLOC_DEFAULT in such a case.
11569 lalr1.cc is still experimental, so changing this is acceptable.
11570 And finally, there are probably not many users who changed the
11571 handling of locations in GLR, so changing is admissible too.
11572
11573 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11574 empty reduction, set @$ to an empty location ending the previously
11575 stacked symbol.
11576 Adjust uses to make sure the code is triggered on empty
11577 reductions.
11578 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11579 expected output: empty reductions have empty locations.
11580
11581 2004-09-29 Akim Demaille <akim@epita.fr>
11582
11583 * data/lalr1.cc: Move towards a more standard C++ coding style
11584 for templates: Class < T > -> Class<T>.
11585
11586 2004-09-29 Akim Demaille <akim@epita.fr>
11587
11588 * data/lalr1.cc: Reinstall the former ctor, for sake of
11589 compatibility, but warn it will be removed.
11590 Move towards a more standard C++ coding style (i.e., type *var ->
11591 type* var).
11592
11593 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11594
11595 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11596 since it's less likely to work if NULs are involved in the future.
11597
11598 2004-09-27 Akim Demaille <akim@epita.fr>
11599
11600 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11601
11602 2004-09-27 Akim Demaille <akim@epita.fr>
11603
11604 * data/lalr1.cc (b4_parse_param_decl_1): New.
11605 (b4_parse_param_decl): Use it to have different names between attribute
11606 and argument names.
11607 (b4_cc_constructor_call): Likewise.
11608
11609 2004-09-24 Akim Demaille <akim@epita.fr>
11610
11611 * src/parse-gram.y (add_param): Strip the leading and trailing
11612 blanks from a formal argument declaration.
11613 (YY_LOCATION_PRINT): New.
11614
11615 2004-09-24 Akim Demaille <akim@epita.fr>
11616
11617 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11618 after the location.
11619
11620 2004-09-24 Akim Demaille <akim@epita.fr>
11621
11622 * doc/bison.texinfo (Table of Symbols): Sort.
11623
11624 2004-09-21 Akim Demaille <akim@epita.fr>
11625
11626 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11627 the useless parentheses.
11628 Suggested by Paul Eggert.
11629
11630 2004-09-20 Akim Demaille <akim@epita.fr>
11631
11632 Let the initial-action act on the look-ahead, and use it for the
11633 "initial push" (corresponding to an hypothetical beginning-of-file).
11634 And let lalr1.cc honor %initial-action.
11635
11636 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11637 example.
11638 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11639 (Parser::Parser): Remove the ctor that used to initialize it.
11640 (Parser::parse): Like in the other skeletons, issue the "starting
11641 parse" message before any action.
11642 Honor %initial-action.
11643 Initialize the stacks with the lookahead.
11644 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11645 look-ahead.
11646 Push them in the stacks.
11647 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11648
11649 2004-09-20 Akim Demaille <akim@epita.fr>
11650
11651 * doc/bison.texinfo (Initial Action Decl): New.
11652
11653 2004-09-20 Akim Demaille <akim@epita.fr>
11654
11655 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11656 clearer criterion to define it.
11657 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11658 When reducing on an empty RHS, use the latest stacked location as
11659 location.
11660 yylloc is not always available.
11661 * data/glr.c: Likewise.
11662 Also, honor initial-actions.
11663
11664 2004-09-20 Akim Demaille <akim@epita.fr>
11665
11666 * data/yacc.c (YY_LOCATION_PRINT): New.
11667 Define when we know YYLTYPE's structure, i.e., when the default
11668 YYLLOC_DEFAULT is used.
11669 * data/c.m4 (b4_yysymprint_generate): Use it.
11670 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11671 value of the result.
11672 (error_start_): Replace with...
11673 (error_range_): this location array.
11674 This allows to replace code relying on the implementation of
11675 locations by portable code.
11676 * data/yacc.c (yylerrsp): Replace with...
11677 (yyerror_range): this.
11678 Every time a token is popped, update yyerror_range[0], to have an
11679 accurate location for the error token.
11680 * data/glr.c (YY_LOCATION_PRINT): New.
11681 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11682 deference a pointer.
11683 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11684 report the location in %printers.
11685
11686 * src/scan-skel.l: Instead of abort, report error messages to ease
11687 understanding skeleton scanning failures.
11688
11689 2004-09-16 Akim Demaille <akim@epita.fr>
11690
11691 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11692 (iterator, const_iterator): these, to be more in the C++ spirit.
11693 Also, return reverse iterators so that when displaying the stack
11694 we display its bottom first.
11695 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11696 from yacc.c.
11697 We should probably use vector here though.
11698
11699 2004-09-16 Akim Demaille <akim@epita.fr>
11700
11701 Have more complete shift traces.
11702
11703 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11704 to report Shifts instead of ad hoc YYDPRINTF invocations,
11705 including for the error token.
11706 * data/lalr1.cc (symprint_): Output the location.
11707 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11708 output the location within the %printer.
11709 Activate GLR tests, at least to make sure they compile properly.
11710 They still don't pass though.
11711 * tests/calc.at: Adjust expect verbose output, since now "Entering
11712 state..." is on a different line than the "Shifting" message.
11713
11714 2004-09-08 Akim Demaille <akim@epita.fr>
11715
11716 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11717 Bison directive from the Bison file to the invocation of this
11718 macro, so that these directives are passed to
11719 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11720 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11721 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11722 the extra Bison directives instead of the whole series.
11723 Change the grammar so that there are recoverable errors, and
11724 unrecoverable errors. Now we can have the parser give up before
11725 consuming the whole input. As a result we now can observe that
11726 the lookahead is freed when needed.
11727 Change the parser source to parse argv[1] instead of a hard coded
11728 string.
11729 Simplify yylex, and give a value and location to EOF.
11730 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11731 passed directives already coded in the file.
11732 Add some tests to check the location of "error".
11733 For some tests, the C++ parser is correct, and not yacc.c.
11734 For other tests, they provide different, but unsatisfying, values,
11735 so keep the C++ value so that at least one parser is "correct"
11736 according to the test suite.
11737 (Actions after errors): Remove, this is subsumed by the
11738 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11739
11740 2004-09-06 Akim Demaille <akim@epita.fr>
11741
11742 * data/lalr1.cc: Adjust the indentation of the labels.
11743 (Parser::pop): New.
11744 Use it.
11745
11746 2004-09-06 Akim Demaille <akim@epita.fr>
11747
11748 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11749 argument, an informative message.
11750 Call YY_SYMBOL_PRINT.
11751 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11752 * data/lalr1.cc (destruct_): Likewise.
11753 In addition, no longer depend on b4_yysymprint_generate and
11754 b4_yydestruct_generate to generate these functions, do it "by
11755 hand".
11756
11757 2004-09-03 Akim Demaille <akim@epita.fr>
11758
11759 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11760 invoked, yydestruct the lookahead.
11761 * tests/calc.at (Calculator $1): Update the expected lengths of
11762 traces: there is an added line for the discarded lookahead.
11763 * doc/bison.texinfo (Destructor Decl): Some rewording.
11764 Define "discarded" symbols.
11765
11766 2004-09-02 Akim Demaille <akim@epita.fr>
11767
11768 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11769
11770 2004-09-02 Akim Demaille <akim@epita.fr>
11771
11772 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11773 (YYDSYMPRINTF): Rename as...
11774 (YY_SYMBOL_PRINT): this.
11775 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11776 two.
11777 Use it instead of direct symprint_ calls.
11778 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11779 one.
11780
11781 2004-09-02 Akim Demaille <akim@epita.fr>
11782
11783 * data/lalr1.cc (b4_yysymprint_generate): New.
11784 (symprint_): New member function, defined when YYDEBUG.
11785 Use it consistently instead of token/nterm debugging output by
11786 hand.
11787 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11788 %printer calls to use cdebug_ when using lalr1.cc.
11789
11790 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11791
11792 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11793 with #ifdef YYDEBUG.
11794
11795 2004-08-26 Akim Demaille <akim@epita.fr>
11796
11797 * doc/bison.texinfo (Implementing Loops): Rename as...
11798 (Implementing Gotos/Loops): this.
11799
11800 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
11801
11802 Adjust to latest gnulib.
11803 * bootstrap (gnulib_modules): Add xalloc-die.
11804 Set LC_ALL=C so that file names sort consistently.
11805 Prefer the gnulib copies of gettext.m4, glibc21.m4,
11806 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
11807 uintmax_t.m4, ulonglong.m4.
11808 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
11809 po.m4 since we are now using _gl.m4 instead.
11810
11811 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
11812
11813 * src/scan-action.l: Remove. Scanning of semantic actions is
11814 handled in scan-gram.l.
11815
11816 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
11817
11818 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
11819
11820 * src/location.h (struct): The file member is a uniqstr.
11821 (equal_boundaries): Use UNIQSTR_EQ for comparison.
11822
11823 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
11824
11825 Fix bug with non-%union parsers that have printers or destructors,
11826 which led to a Bison core dump. Reported by Peter Fales in
11827 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
11828
11829 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
11830 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
11831 not to our own type.
11832 * src/output.c (symbol_destructors_output, symbol_printers_output):
11833 Don't assume %union.
11834 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
11835 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
11836 UNION-FLAG. All callers changed.
11837 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
11838 Use type char, not unsigned int, when declaring an array of char;
11839 this lets us remove a cast.
11840 (Printers and Destructors): Add non-%union test cases.
11841
11842 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11843
11844 * doc/bison.texinfo: Minor editorial changes, mostly to the new
11845 GLR writeups. E.g., avoid frenchspacing and the future tense,
11846 change "lookahead" to "look-ahead", and change "wrt" to "with
11847 respect to".
11848
11849 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11850
11851 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
11852 New sections, split off from the GLR Parsers section. Put the new
11853 Simple GLR Parser near the start of the GLR section, for clarity.
11854 Rewrite connective text.
11855
11856 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
11857
11858 * doc/bison.texinfo (Simple GLR Parsers): New section.
11859
11860 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
11861
11862 * NEWS, TODO, doc/bison.texinfo:
11863 Use "look-ahead" instead of "lookahead", to be consistent.
11864 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
11865 while we're fixing "look-ahead".
11866 * src/conflicts.c (shift_set): Renamed from shiftset.
11867 (look_ahead_set): Renamed from lookaheadset.
11868 * src/print.c: Likewise.
11869 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
11870 name for "lookahead".
11871 (report_types, usage): Likewise.
11872 * src/getargs.h (report_look_ahead_tokens): Renamed from
11873 report_lookaheads.
11874 * src/lalr.c (compute_look_ahead_tokens): Renamed from
11875 compute_lookaheads.
11876 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
11877 (look_ahead_tokens_print): Renamed from lookaheads_print.
11878 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
11879 state_rule_lookaheads_print.
11880 * src/state.h: Likewise.
11881 (reductions.look_ahead_tokens): Renamed from lookaheads.
11882 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
11883 AT_DATA_LOOKAHEADS_GRAMMAR.
11884
11885 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
11886
11887 * README: Update location of patched M4 distribution.
11888
11889 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
11890
11891 Don't assume the C++ compiler takes the same arguments as the C compiler
11892 (trivial change).
11893 * configure.ac (O0CXXFLAGS): New var.
11894 * tests/atlocal.in (CXXFLAGS): Use it.
11895
11896 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
11897
11898 Fix some "make check" problems with C++ reported by
11899 Albert Chin-A-Young for Tru64 C++ in this thread:
11900 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
11901
11902 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
11903 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
11904 Output to a .cc file for C++, not to a .c file.
11905 * tests/calc.at (AT_CHECK_CALC): Likewise.
11906 * tests/regression.at (AT_CHECK_DANCER): Likewise.
11907 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
11908
11909 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
11910
11911 * tests/calc.at, tests/actions.at: Workaround for SGI
11912 C++ compiler. (trivial change)
11913
11914 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
11915
11916 Spent a few hours checking out which prerequisite versions the
11917 current sources actually require. I went all the way back to
11918 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
11919 a seemingly endless set of combinations of versions more recent
11920 than that. The bottom line is that the current sources require
11921 fairly recent versions of the build tools, and it'll be some work
11922 to change this.
11923 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
11924 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
11925 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
11926 Add comments explaining why those particular versions are
11927 currently needed.
11928
11929 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
11930 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
11931 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
11932
11933 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
11934 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
11935
11936 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
11937
11938 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
11939 0.11.5. Suggested by Bruno Haible.
11940 * bootstrap: Remove gettext version checking.
11941
11942 * doc/bison.texinfo (Decl Summary): Also mention that %union
11943 can depend on prerequisite types. Problem reported by Tim
11944 Van Holder.
11945
11946 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
11947
11948 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
11949 * README-alpha: Don't tell people not to package this.
11950
11951 * bootstrap: Don't assume $(...) works; use `...` instead.
11952 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
11953 gettext better.
11954
11955 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
11956 put into the -d output file, and mention what to do if YYSTYPE is
11957 defined as a macro.
11958
11959 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
11960
11961 Undo change made earlier today: it caused autopoint to not bring
11962 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
11963 autopoint's.
11964
11965 * bootstrap: Check that gettext version matches what's in
11966 configure.ac. Warn users to ignore robots.txt ERROR 404.
11967 * bootstrap: Undo today's earlier change (logged below).
11968 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
11969
11970 The gettext version checking is causing more trouble than it's
11971 curing; remove it. Problem reported by Paul Hilfinger.
11972
11973 * bootstrap: Issue a warning that one can expect a message
11974 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
11975 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
11976
11977 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
11978
11979 Ensure that the C++ compiler used for testing actually works on a
11980 simple test program; if not, skip the C++-related tests. Problem
11981 reported by Vin Shelton in:
11982 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
11983
11984 * m4/cxx.m4: New file.
11985 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
11986 * tests/atlocal.in (BISON_CXX_WORKS): Add.
11987 * tests/local.at (AT_COMPILE_CXX): Use it.
11988
11989 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11990
11991 * data/glr.c (yylloc): Output this macro even if locations are not
11992 being generated, as the GLR parser needs it even in that case.
11993 Problem reported by Troy A. Johnson
11994 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
11995
11996 * configure.ac (AC_INIT): Update to 1.875e.
11997
11998 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
11999
12000 * NEWS: Version 1.875d.
12001 * configure.ac (AC_INIT): Likewise.
12002 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
12003
12004 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
12005 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
12006 lalr1.cc runs afoul of the first, and the last two are no longer
12007 supported by GCC 3.4.0.
12008 * README: Mention GNU m4 1.4 or later; mention m4 patches.
12009 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
12010
12011 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
12012
12013 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
12014 unsigned int, for compatibility with latest gnulib hash module.
12015 * src/state.c (state_hash, state_hasher): Likewise.
12016 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
12017 * src/uniqstr.c (hash_uniqstr): Likewise.
12018
12019 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
12020
12021 * NEWS: Unescaped newlines are no longer allowed in char & strings.
12022
12023 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
12024 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
12025 character and string literals.
12026 (unexpected_end): New function.
12027 (unexpected_eof): Use it.
12028 (unexpected_newline): New function.
12029 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12030 actions.
12031
12032 * NEWS: Document %expect-rr.
12033
12034 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12035 Fix typo by replacing $1 with $option.
12036 Remove more 'intl'-related files.
12037 Don't DEFUN AM_INTL_SUBDIR twice.
12038
12039 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12040 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12041 strtoul.c.
12042 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12043 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12044 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12045 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12046 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12047 * src/.cvsignore: Add *.output.
12048
12049 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12050 gets copied to the output file.
12051
12052 2004-04-28 Paul Eggert <eggert@twinsun.com>
12053
12054 Get files from the gnulib and po repositories, instead of relying
12055 on them being in our CVS. Upgrade to latest versions of gnulib
12056 and Automake.
12057
12058 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12059 * bootstrap: Bootstrap from gnulib and po repositories.
12060 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12061 * README-cvs: Document these changes. Remove version numbers from
12062 mentions of build tools, since they change so often. Mention Flex.
12063
12064 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12065 (gl_USE_SYSTEM_EXTENSIONS): Add.
12066 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12067 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
12068 does this for us.
12069 (AC_ISC_POSIX): Remove; we no longer support this
12070 ancient OS, as it gets in the way of latest Autoconf & gnulib.
12071 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12072 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12073 Do not check for C89 headers, except for locale.h which is used
12074 by the Yacc library and must port to K&R hosts.
12075 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12076 Do not check for C89 functions, except for setlocale which is
12077 used by the Yacc library.
12078 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12079 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12080 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12081 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12082 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12083 AM_GNU_GETTEXT): Remove; now done by:
12084 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12085 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12086 for us.
12087
12088 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12089 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12090 Define to empty, as gnulib.mk will do the rest for us.
12091 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12092 for us.
12093 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12094 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12095
12096 * src/files.c: Include gnulib's xstrndup.h.
12097
12098 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12099 (REALLOC): Use xnrealloc, for likewise.
12100 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12101 (strnlen, memrchr): Remove decls; functions no longer used.
12102 Include <stpcpy.h>.
12103
12104 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12105 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12106 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12107 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12108 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12109 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12110 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12111 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
12112 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
12113 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
12114 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
12115 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12116 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
12117 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
12118 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
12119 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
12120 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
12121 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
12122 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
12123 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
12124 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
12125 Remove, as these files are now generated automatically
12126 by bootstrap or automake.
12127
12128 * po/ChangeLog: Remove: all but one entry was a duplicate
12129 of this file, and I moved that 2000-11-02 entry here.
12130
12131 * config/.cvsignore: Add Makefile, depcomp, install-sh.
12132 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
12133 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
12134 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
12135 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
12136 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
12137 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
12138 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
12139 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
12140 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
12141 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
12142 xstrndup.h.
12143 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
12144 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
12145 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
12146 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
12147 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
12148 * src/.cvsignore: Remove *_.c.
12149
12150
12151 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
12152 support it. (The latest stable gzip doesn't.)
12153
12154 2004-04-27 Paul Eggert <eggert@twinsun.com>
12155
12156 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
12157 case, as stos_ is now used by destructors due to the 2004-02-09
12158 change.
12159
12160 Remove more K&R C support.
12161 * lib/libiberty.y (PARAMS): Remove. All uses removed.
12162 * lib/subpipe.c (errno): Remove decl.
12163 Include <stdlib.h> unconditionally.
12164 (EXIT_FAILURE): Remove macro.
12165 * src/complain.c (vfprintf, strerror): Remove.
12166 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
12167 unconditionally.
12168 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
12169 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
12170 (strchr, strspn, memchr): Remove decls.
12171 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
12172 unconditionally. Do not declare perror.
12173 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
12174 unconditionally.
12175
12176 * src/complain.c (_): Remove useless defn, as system.h defines this.
12177
12178 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
12179 with latest obstack.h.
12180 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
12181 to procedure types, as obstack.h now does that for us.
12182 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
12183
12184 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
12185 so that this include file can stand alone.
12186 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
12187 does this now. Include subpipe.h first after config.h, to
12188 test whether it can stand alone.
12189
12190 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
12191 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
12192 unused declaration.
12193
12194 * tests/synclines.at (%union synch line): Put a dummy member in
12195 the union, because empty unions aren't allowed in C. Caught
12196 by GCC 3.4.0.
12197
12198 2004-04-13 Jim Meyering <jim@meyering.net>
12199
12200 * src/conflicts.c (conflicts_print): Correct format string typo:
12201 use `%%' to produce literal `%'. (trivial change)
12202
12203 2004-03-30 Paul Eggert <eggert@twinsun.com>
12204
12205 * src/getargs.c (version): Update copyright year to 2004.
12206
12207 * data/c.m4 (b4_int_type): Use 'short int' rather than
12208 'short', and similarly for 'long', 'unsigned', etc.
12209 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
12210 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
12211 yy_yypstack, yydumpstack): Likewise.
12212 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
12213 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
12214 Likewise.
12215 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
12216 yy_stack_print, yyparse): Likewise.
12217 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
12218 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
12219 * lib/bitset.c (bitset_print): Likewise.
12220 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
12221 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12222 * lib/bitsetv.c (bitsetv_dump): Likewise.
12223 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
12224 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
12225 Likewise.
12226 * src/LR0.c (allocate_itemsets): Likewise.
12227 * src/gram.h (rule_number, rule): Likewise.
12228 * src/lalr.h (goto_number): Likewise.
12229 * src/nullable.c (nullable_compute): Likewise.
12230 * src/output.c (prepare_rules): Likewise.
12231 * src/relation.c (relation_print, relation_digraph): Likewise.
12232 * src/relation.h (relation_node): Likewise.
12233 * src/state.h (state_number, transitions, errs, reductions,
12234 struct state): Likewise.
12235 * src/symtab.h (symbol_number, struct symbol): Likewise.
12236 * src/tables.c (vector_number, tally, action_number,
12237 default_goto, goto_actions): Likewise.
12238 * tests/existing.at (GNU Cim Grammar): Likewise.
12239 * tests/regression.at (Web2c Actions): Likewise.
12240
12241 * src/output.c (muscle_insert_short_int_table): Renamed from
12242 muscle_insert_short_table. All uses changed.
12243
12244 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12245
12246 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
12247 (declaration): Replace expected_conflicts with expected_sr_conflicts.
12248 Add %expect-rr rule.
12249
12250 * src/scan-gram.l: Recognize %expect-rr.
12251
12252 * src/conflicts.h (expected_sr_conflicts): Rename from
12253 expected_conflicts.
12254 (expected_rr_conflicts): Declare.
12255
12256 * src/conflicts.c (expected_sr_conflicts): Rename from
12257 expected_conflicts.
12258 (expected_rr_conflicts): Define.
12259 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
12260 for GLR parsers.
12261 Use expected_sr_conflicts in place of expected_conflicts.
12262 Warn if expected_rr_conflicts used in non-GLR parser.
12263
12264 * doc/bison.texinfo: Add documentation for %expect-rr.
12265
12266 2004-03-08 Paul Eggert <eggert@gnu.org>
12267
12268 Add support for hex token numbers. Suggested by Odd Arild Olsen in
12269 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
12270
12271 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12272 in lalr1.cc.
12273 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12274 * src/scan-gram.l (scan_integer): New function.
12275 ({int}): Use it.
12276 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12277 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12278 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12279 Say "long int", not "long", for uniformity with GNU style.
12280
12281 2004-02-25 Paul Eggert <eggert@twinsun.com>
12282
12283 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12284 compilers. This fixes a problem with Intel's C++ compiler being
12285 chatty, reported by Guido Trentalancia in
12286 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
12287
12288 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12289
12290 Support %destructor and merge error locations in lalr1.cc.
12291
12292 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12293 (Parser::stos_): Define unconditionally.
12294 (Parser::destruct_): New method. Generate its body with
12295 b4_yydestruct_generate.
12296 (Parser::error_start_): New attribute.
12297 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12298 token which are discarded.
12299 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12300 error_start_ when erroneous token are discarded.
12301 (Parser::parse) <yyerrlab1>: Compute the location of the error
12302 token so that it covers all the discarded tokens.
12303 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12304 it can be called with `%skeleton "lalr1.cc"', and do that.
12305
12306 2004-02-02 Paul Eggert <eggert@twinsun.com>
12307
12308 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12309 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12310 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12311 There's no need to mention top_builddir since Automake does that
12312 for us.
12313 (INCLUDES): Remove, as Automake says it's obsolescent.
12314 Contents migrated into AM_CPPFLAGS as described above.
12315 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12316
12317 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12318
12319 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12320 (yyreportSyntaxError): Handle case where lookahead token is
12321 YYEMPTY.
12322
12323 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12324
12325 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12326 resulting parsers are compilable with C++.
12327
12328 2003-12-23 Paul Eggert <eggert@twinsun.com>
12329
12330 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12331 * src/output.c (output_skeleton): Rename local var.
12332 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12333 Bison tokens, as this runs afoul of the 2003-10-07 change that
12334 disallowed NUL bytes in character constants or string literals.
12335
12336 * tests/local.at: Require Autoconf 2.59's Autotest.
12337 * tests/testsuite.at: Don't include local.at, since we now assume
12338 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12339 including it.
12340 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12341 multiple inclusion warnings.
12342
12343 2003-12-02 Akim Demaille <akim@epita.fr>
12344
12345 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12346 conditions.
12347 From Bruno Haible.
12348
12349 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12350
12351 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12352
12353 2003-10-07 Paul Eggert <eggert@twinsun.com>
12354
12355 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12356 if testsuite doesn't exist.
12357
12358 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12359 literals, unfortunately.
12360 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12361 Complain about NUL bytes in character constants or string literals.
12362
12363 2003-10-05 Paul Eggert <eggert@twinsun.com>
12364
12365 * NEWS: Don't document %no-default-prec, as it's still
12366 too experimental.
12367 * doc/bison.texinfo: Document %no-default-prec only if
12368 the defaultprec flag is set. Normally it's not.
12369
12370 2003-10-04 Paul Eggert <eggert@twinsun.com>
12371
12372 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12373 non-modifiable lvalue, instead of a modifiable one.
12374 * doc/bison.texinfo (Actions): Document that $$ can
12375 be assigned to. Do not claim that $$ and $N are
12376 array element references: user code should not rely on this.
12377
12378 2003-10-01 Paul Eggert <eggert@twinsun.com>
12379
12380 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12381 (grammar_declaration): Use it.
12382 * src/scan-gram.l: New token %no-default-prec.
12383 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12384 * NEWS, doc/bison.texinfo: Document the above.
12385
12386 2003-10-01 Akim Demaille <akim@epita.fr>
12387
12388 VCG no longer supports long_straight_phase.
12389
12390 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12391 * src/print_graph.c (print_graph): Adjust.
12392
12393 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
12394 and Paul Eggert <eggert@twinsun.com>
12395
12396 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12397 Table of Symbols): Document %default-prec.
12398 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12399 (grammar_declaration): Set default_prec on %default-prec.
12400 * src/scan-gram.l (%default-prec): New token.
12401 * src/reader.h (default_prec): New flag.
12402 * src/reader.c: Likewise.
12403 (packgram): Handle it.
12404 * tests/conflicts.at (%default-prec without %prec,
12405 %default-prec with %prec, %default-prec 1): New tests.
12406
12407 2003-09-30 Paul Eggert <eggert@twinsun.com>
12408
12409 * tests/testsuite.at: Include local.at, not input.at, fixing
12410 a typo in the 2003-08-25 patch.
12411
12412 2003-08-27 Akim Demaille <akim@epita.fr>
12413
12414 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12415 GCC warnings.
12416
12417 2003-08-26 Akim Demaille <akim@epita.fr>
12418
12419 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12420 "<\#" to avoid magic from Gnus when posting parts of this script.
12421
12422 2003-08-26 Akim Demaille <akim@epita.fr>
12423
12424 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12425 (Parser::parse): here.
12426 Adjust: nerrs and errstatus is now replaced by...
12427 (Parser::nerrs_, Parser::errstatus_): New.
12428
12429 2003-08-25 Akim Demaille <akim@epita.fr>
12430
12431 * config/announce-gen, Makefile.cfg: New.
12432 * Makefile.am: Adjust.
12433 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12434 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12435
12436 2003-08-25 Akim Demaille <akim@epita.fr>
12437
12438 When reducing initial empty rules, Bison parser read an initial
12439 location that is not defined. This results in garbage, and that
12440 affects Bison's own parser. Therefore we need (i) to extend Bison
12441 to support a means to initialize this location, and (ii) to use
12442 this CVS Bison to fix CVS Bison's parser.
12443
12444 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12445 with...
12446 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12447 * src/parse-gram.y: Adjust.
12448 (%initial-action): New.
12449 (%error-verbose): Since we require CVS Bison, there is no reason
12450 not to use it.
12451 * src/scan-gram.l: Adjust.
12452 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12453 * data/yacc.c (yyparse): Use b4_initial_action.
12454
12455 2003-08-25 Akim Demaille <akim@epita.fr>
12456
12457 * doc/bison.texinfo: Don't promote stdout for error messages.
12458
12459 2003-08-25 Akim Demaille <akim@epita.fr>
12460
12461 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12462 From Alexandre Duret-Lutz.
12463
12464 2003-08-25 Akim Demaille <akim@epita.fr>
12465
12466 Version 1.875c.
12467
12468 2003-08-25 Akim Demaille <akim@epita.fr>
12469
12470 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12471 Use them.
12472
12473 2003-08-25 Akim Demaille <akim@epita.fr>
12474
12475 * data/lalr1.cc (Parser::reduce_print_): New.
12476 Use it.
12477
12478 2003-08-25 Akim Demaille <akim@epita.fr>
12479
12480 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12481 error recovery loops. This patch is based on
12482 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
12483 Also, augment the similarity between lalr1.cc and yacc.c.
12484 Note: the locations of error recovery rules are not correct yet.
12485
12486 * data/lalr1.cc: Comment changes to augment the similarity between
12487 lalr1.cc and yacc.c.
12488 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12489 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12490 yyerrlab), when hitting EOF, pop the whole stack here instead of
12491 merely falling thru the default error handling mechanism.
12492 (yyerrorlab): New label, with the old contents of YYERROR,
12493 plus the following change: pop the stack of rhs corresponding
12494 to the production that invoked YYERROR. That is how Yacc
12495 behaves (required by POSIX).
12496 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12497 fail.
12498
12499 2003-08-25 Akim Demaille <akim@epita.fr>
12500
12501 Tune local.at so that people can "autom4te -l autotest calc.at -o
12502 calc" for instance, to extract a sub test suite.
12503
12504 * tests/testsuite.at: Move the initialization, Autotest version
12505 requirement, and AT_TESTED invocation into...
12506 * tests/local.at: here.
12507 * tests/testsuite.at: Include it for compatibility with Autoconf
12508 2.57.
12509 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12510 be ignore.
12511
12512 2003-08-04 Paul Eggert <eggert@twinsun.com>
12513
12514 Rework code slightly to avoid gcc -Wtraditional warnings.
12515 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12516 The returned value is now stored in *YY0. All callers changed.
12517 * src/output.c (merge_output): Adjust to the above change.
12518
12519 2003-07-26 Paul Eggert <eggert@twinsun.com>
12520
12521 * data/glr.c (YYASSERT): New macro.
12522 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12523 yyresolveStates, yyprocessOneStack):
12524 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12525 Derived from a suggestion by Frank Heckenbach.
12526
12527 2003-07-25 Paul Eggert <eggert@twinsun.com>
12528
12529 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12530 for portability to K&R C (after ansi2knr, presumably). See
12531 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
12532 by Frank Heckenbach, though I have omitted the structure-initialization
12533 part of his glr-knr.diff patch since I recall that the Portable
12534 C Compiler didn't require that change.
12535
12536 Let the user specify how to allocate and free memory.
12537 Derived from a suggestion by Frank Heckenbach in
12538 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
12539 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12540 All uses of free, malloc, realloc changed to use these macros,
12541 and unnecessary casts removed.
12542 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12543
12544 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12545
12546 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12547 use s.empty() rather than s == "" to test for empty string; see
12548 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
12549 (trivial change)
12550
12551 2003-06-25 Akim Demaille <akim@epita.fr>
12552
12553 * config/depcomp, config/install-sh: Update from masters.
12554
12555 2003-06-20 Paul Eggert <eggert@twinsun.com>
12556
12557 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12558 and return properly parenthesized result.
12559 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12560 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12561 Remove unnecessary parentheses from uses.
12562 * doc/bison.texinfo (Location Default Action): Describe the
12563 conventions for parentheses.
12564
12565 2003-06-19 Paul Eggert <eggert@twinsun.com>
12566
12567 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12568 yyreportTree): Do not assume that size_t is the same width as int,
12569 when printing sizes. Print sizes using an unsigned format.
12570 Problem reported by Frank Heckenbach in
12571 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
12572
12573 Port to Forte Developer 7 C compiler.
12574 * data/glr.c (struct YYLTYPE): If locations are not being used,
12575 declare a single dummy member, as empty structs do not conform
12576 to the C standard.
12577 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12578 the Forte Developer 7 C compiler complains that end-of-loop
12579 code is not reached.
12580
12581 2003-06-17 Paul Eggert <eggert@twinsun.com>
12582
12583 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12584 avoid warnings from picky compilers about redefinition of PARAMS.
12585
12586 2003-06-17 Paul Eggert <eggert@twinsun.com>
12587
12588 Version 1.875b.
12589
12590 * NEWS: Document 1.875b.
12591
12592 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12593 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12594 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12595 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12596 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12597 per recent gettext manual's suggestion.
12598 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12599 Use prototypes, not old-style definitions.
12600 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12601 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12602 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12603 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12604 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12605 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12606 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12607 vbitset_or_and_cmp, vbitset_copy): Likewise.
12608
12609 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12610 Do not include <stdlib.h>.
12611 (PARAMS): Define unconditionally for C89.
12612 (ATTRIBUTE_NORETURN): Remove.
12613 (ATTRIBUTE_UNUSED): Define unconditionally.
12614
12615 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
12616 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
12617 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12618 * lib/vbitset.c, lib/vbitset.h: New files.
12619 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12620 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12621 from libbitset.
12622
12623 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12624 `How Can I Reset @code{yyparse}', since texinfo does not allow
12625 arbitrary @ in node names.
12626
12627 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12628 shouldn't be needed according to the gettext 0.12.1 documentation
12629 but which seem to be needed anyway: codeset.m4 glibc21.m4
12630 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
12631 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
12632 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
12633
12634 * lib/.cvsignore: Add stdbool.h.
12635 * m4/.cvsignore: Add nls.m4, po.m4.
12636
12637 Upgrade to CVS gnulib.
12638 * stdbool_.h: File renamed from stdbool.h.in.
12639 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12640 AC_HEADER_STDBOOL.
12641 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12642 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12643 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12644 (MOSTLYCLEANFILES): New var.
12645 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12646 (stdbool.h): New rule.
12647 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12648 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12649 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12650 m4/quote.m4: Upgrade to today's gnulib.
12651
12652 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12653 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12654 the tests right now.
12655 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12656 yyerror are declared before use; C99 requires this.
12657
12658 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12659
12660 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12661 first.
12662 (yyrecoverSyntaxError): Correct the logic for setting and testing
12663 yyerrState.
12664 Correct comment on handling EOF.
12665 Allow states with only a default reduction, rather than failing
12666 (I can't quite reconstruct why these were not allowed before).
12667
12668 Fixes to avoid problem that $-N rules in GLR parsers can cause
12669 buffer overruns, corrupting state.
12670
12671 * src/output.c (prepare_rules): Output max_left_semantic_context
12672 definition.
12673 * src/reader.h (max_left_semantic_context): New variable declaration.
12674 * src/scan-gram.l (max_left_semantic_context): Define.
12675 (handle_action_dollar): Update max_left_semantic_context.
12676 * data/glr.c (YYMAXLEFT): New definition.
12677 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12678 (yyresolveAction): Ditto.
12679
12680 Fixes to problems with location handling in GLR parsers reported by
12681 Frank Heckenbach (2003/06/05).
12682
12683 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12684 (YYRHSLOC): Add parentheses, and define only if locations used.
12685 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12686 locations not used.
12687 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12688 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
12689
12690 * tests/cxx-type.at: Exercise location information; update tests
12691 to differentiate output with and without locations.
12692 Remove forward declarations of yylex and yyerror---caused errors
12693 because default YYLTYPE not yet defined.
12694 Change semantic actions to compute strings, rather than printing
12695 them directly (to test proper passing of semantics values). Change
12696 output to prefix notation and update test data and expected results.
12697 (yylex): Track locations.
12698 (stmtMerge): Return value rather than printing, and include arguments
12699 in value.
12700
12701 2003-06-03 Paul Eggert <eggert@twinsun.com>
12702
12703 Avoid warnings generated by GCC 2.95.4 when Bison is
12704 configured with --enable-gcc-warnings.
12705 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12706 yy::]b4_parser_class_name[::translate_,
12707 yy::Stack::operator[] (unsigned),
12708 yy::Stack::operator[] (unsigned) const,
12709 yy::Slice::operator[] (unsigned),
12710 yy::Slice::operator[] (unsigned) const):
12711 Rename local vars to avoid warnings.
12712 * tests/glr-regression.at (Improper handling of embedded actions
12713 and $-N in GLR parsers): Remove unused local variable from yylex.
12714 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12715 (void) as arg when not pure, since we now assume C89 when building
12716 Bison. Pacify GCC by using parameter.
12717
12718 2003-06-02 Paul Eggert <eggert@twinsun.com>
12719
12720 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12721 yy::Location::lines, yy::Location::columns): Rename arguments
12722 to avoid shadowing; this removes a warning generated by GCC 3.3.
12723
12724 2003-06-01 Paul Eggert <eggert@twinsun.com>
12725
12726 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12727 to g++, as GCC 3.3 complains if you do it.
12728 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12729 everything that WARNING_CFLAGS has, except omit warnings
12730 not suitable for C++.
12731 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12732 * tests/atlocal.in (CXXFLAGS): New var.
12733 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12734
12735 Fix a GLR parser bug I reported in February; see
12736 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
12737 The problem was that GLR parsers did not conform to the C standard,
12738 because actions like { $1 = $2 + $3; } expanded to expressions
12739 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12740 to a local variable. The C standard says that expressions
12741 like (var = f ()) + (var = f ()) have undefined behavior.
12742 Another problem was that GCC sometimes issues warnings that
12743 yyfill and its parameters are unused.
12744
12745 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12746 as possibly unused.
12747 (yyfill): New function.
12748 (YYFILL): Use it.
12749 (yyuserAction): Change type of yynormal to bool, so that it matches
12750 the new yyfill signature. Mark it as possibly unused.
12751
12752
12753 Follow up on a bug I reported in February, where a Bison-generated
12754 parser can loop. Provide a test case and a fix for yacc.c. I
12755 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12756 The original bug report is in:
12757 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
12758
12759 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12760 macro's size was becoming unwieldy.
12761 (yyerrlab): Do not discard an empty lookahead symbol, as this
12762 might destroy garbage.
12763 (yyerrorlab): New label, with the old contents of YYERROR,
12764 plus the following change: pop the stack of rhs corresponding
12765 to the production that invoked YYERROR. That is how Yacc
12766 behaves, and POSIX requires this behavior.
12767 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12768 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12769 Define 'alarm' to do nothing if unistd.h is not available.
12770 Add a new rule "exp: '-' error;" to test the above change to
12771 data/yacc.c. Use 'alarm' to abort any test taking longer than
12772 10 seconds, as it's probably looping.
12773 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12774 Also, the new yacc.c generates two fewer diagnostics for an
12775 existing test.
12776
12777 2003-05-24 Paul Eggert <eggert@twinsun.com>
12778
12779 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12780 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12781 This fixes a problem reported by John Bowman when the Compaq/HP
12782 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12783 -ansi -Wall -gall).
12784 * data/yacc.c (union yyalloc): Likewise.
12785 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
12786
12787 Switch from 'int' to 'bool' where that makes sense.
12788
12789 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12790 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12791 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12792 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12793 Return or accept bool, not int. All callers changed.
12794 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12795 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12796 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
12797 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
12798 bitset_or_and_cmp_): Likewise.
12799 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
12800 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
12801 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
12802 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
12803 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
12804 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
12805 bitset_stats_or_and_cmp): Likewise.
12806 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
12807 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
12808 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
12809 ebitset_xor_cmp): Likewise.
12810 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
12811 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
12812 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
12813 lbitset_xor_cmp): Likewise.
12814 * lib/bbitset.h: Include <stdbool.h>.
12815 (struct bitset_vtable): The following members now return bool, not
12816 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
12817 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
12818 or_and_cmp).
12819 * src/conflicts.c (count_rr_conflicts): Likewise.
12820 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
12821 All uses changed.
12822 * lib/ebitset.c (ebitset_obstack_init): Likewise.
12823 * lib/lbitset.c (lbitset_obstack_init): Likewise.
12824 * src/getargs.c (debug_flag, defines_flag, locations_flag,
12825 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12826 graph_flag): Likewise.
12827 * src/getargs.h (debug_flag, defines_flag, locations_flag,
12828 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
12829 graph_flag): Likewise.
12830 * src/output.c (error_verbose): Likewise.
12831 * src/output.h (error_verbose): Likewise.
12832 * src/reader.c (start_flag, typed): Likewise.
12833 * src/reader.h (typed): Likewise.
12834 * src/getargs.c (LOCATIONS_OPTION): New constant.
12835 (long_options, getargs): Use it.
12836 * src/lalr.c (build_relations): Use bool, not int.
12837 * src/nullable.c (nullable_compute): Likewise.
12838 * src/print.c (print_reductions): Likewise.
12839 * src/tables.c (action_row, pack_vector): Likewise.
12840 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
12841 * src/output.c (prepare): Use it.
12842 * src/output.c (token_definitions_output,
12843 symbol_destructors_output, symbol_destructors_output): Use string,
12844 not boolean integer, to keep track of whether to output separator.
12845 * src/print_graph.c (print_core): Likewise.
12846 * src/state.c (state_rule_lookaheads_print): Likewise.
12847
12848 * config/install-sh: Sync from automake 1.7.5.
12849
12850 2003-05-14 Paul Eggert <eggert@twinsun.com>
12851
12852 * src/parse-gram.y (rules_or_grammar_declaration): Require a
12853 semicolon after a grammar declaration, in the interest of possible
12854 future changes to the Bison input language.
12855 Do not allow a stray semicolon at the start of the grammar.
12856 (rhses.1): Allow one or more semicolons after any rule, including
12857 just before "|" as required by POSIX.
12858 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
12859 grammar.
12860
12861 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
12862
12863 %parse-param support for lalr1.cc.
12864
12865 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
12866 b4_cc_constructor_calls, b4_cc_constructor_call,
12867 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
12868 definitions.
12869 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
12870 parse-param arguments.
12871 (yy::b4_parser_class_name): Declare instance variables to
12872 hold parse-param arguments.
12873 * tests/calc.at: s/value/semantic_value/ because value clashes
12874 with a member of yy::b4_parser_class_name. Adjust C++ code
12875 to handle %parse-param. Enable %parse-param test in C++.
12876
12877 2003-05-12 Paul Eggert <eggert@twinsun.com>
12878
12879 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
12880 English a bit. Fix fclose typo. Change "const char" to "char
12881 const", and use ANSI C rather than K&R for "main". Suggest
12882 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
12883 and suggest yy_switch_to_buffer.
12884
12885 2003-05-05 Paul Eggert <eggert@twinsun.com>
12886
12887 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
12888 C89. This avoids a diagnostic on compilers that define __STDC__
12889 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
12890 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12891
12892 2003-05-03 Paul Eggert <eggert@twinsun.com>
12893
12894 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
12895 Do not overrun array bounds.
12896 This should fix a bug reported today by Olatunji Oluwabukunmi in
12897 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
12898
12899 2003-04-29 Akim Demaille <akim@epita.fr>
12900
12901 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
12902 * src/getargs.c, src/getargs.h: here, as bool, not int.
12903 (nondeterministic_parser): New.
12904 * src/parse-gram.y, src/scan-gram.l: Support
12905 %nondeterministic-parser.
12906 * src/output.c (prepare): Use nondeterministic_parser instead
12907 of glr_parser where appropriate.
12908 * src/tables.c (conflict_row, action_row, save_row)
12909 (token_actions, token_actions, pack_vector): Ditto.
12910
12911 2003-04-29 Akim Demaille <akim@epita.fr>
12912
12913 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
12914
12915 2003-04-29 Akim Demaille <akim@epita.fr>
12916
12917 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
12918 with %pure-parser and %locations to exercise the patch from Yakov
12919 Markovitch below.
12920
12921 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
12922
12923 * data/yacc.c: (b4_lex_param): Corrected for the case where
12924 %lex-param is provided and %pure-parser isn't.
12925
12926 2003-04-27 Paul Eggert <eggert@twinsun.com>
12927
12928 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
12929 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
12930 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
12931 if it is not defined.
12932 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
12933
12934 2003-04-26 Paul Eggert <eggert@twinsun.com>
12935
12936 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
12937 Declare to be of type suitable for the ninf value itself, not of
12938 type suitable for the corresponding table, since the latter might
12939 be unsigned but the ninf value might be negative. This fixes a
12940 bug reported by Alexandre Duret-Lutz in
12941 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
12942
12943 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
12944 invokes it. We shouldn't invoke it twice because it will attempt
12945 to put error.o in the archive twice. This fixes a glitch reported
12946 by Martin Mokrejs in
12947 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
12948
12949 2003-04-21 Paul Eggert <eggert@twinsun.com>
12950
12951 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
12952 to gnulib.
12953
12954 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
12955
12956 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
12957 Fix obvious typo that results in uncompilable GLR parsers
12958 when both %pure-parser and %locations are used. (trivial change)
12959
12960 2003-04-17 Paul Eggert <eggert@twinsun.com>
12961
12962 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
12963 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
12964 Do not insert the expected token via unput, as this runs afoul
12965 of a POSIX-compatibility bug in flex 2.5.31.
12966 All uses changed to BEGIN the parent state,
12967 since we no longer insert the expected token via unput.
12968 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
12969 that is no longer emitted after the above change.
12970
12971 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
12972 the first one. This change is from Paul Hilfinger, and it fixes
12973 regression reported by Werner Lemberg in
12974 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
12975
12976 (resolve_sr_conflict): Don't invoke state_errs_set
12977 unless one or more tokens have been explicitly made errors.
12978 Otherwise, the above change causes Bison to abort.
12979
12980 * tests/existing.at (GNU pic Grammar): New test case, taken from
12981 Lemberg's email.
12982
12983 2003-03-31 Akim Demaille <akim@epita.fr>
12984
12985 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
12986
12987 2003-03-31 Akim Demaille <akim@epita.fr>
12988
12989 * src/output.c (prepare_symbols): Avoid trailing spaces in the
12990 output.
12991
12992 2003-03-31 Akim Demaille <akim@epita.fr>
12993
12994 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
12995 From Paul Hilfinger.
12996
12997 2003-03-29 Akim Demaille <akim@epita.fr>
12998
12999 * m4/error.m4: Do not put under dynamic conditions some code which
13000 expansion is under static control.
13001
13002 2003-03-29 Akim Demaille <akim@epita.fr>
13003
13004 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
13005
13006 2003-03-29 Akim Demaille <akim@epita.fr>
13007
13008 * doc/bison.texinfo (Strings are Destroyed): New.
13009
13010 2003-03-13 Paul Eggert <eggert@twinsun.com>
13011
13012 * .cvsignore: Add configure.lineno.
13013 * src/.cvsignore: Add yacc.
13014 * tests/.cvsignore: Add testsuite.log.
13015 * doc/fdl.texi: Sync with latest FSF version.
13016
13017 2003-03-12 Paul Eggert <eggert@twinsun.com>
13018
13019 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
13020 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
13021 cursor, instead of leaving it undefined. This fixes a bug
13022 reported by Tim Van Holder in
13023 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
13024 * tests/input.at (Torturing the Scanner): Test the scanner on
13025 an empty input file, which was Tim Van Holder's test case.
13026
13027 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13028 <sys/resource.h> can be included, include sys/time.h and
13029 sys/times.h first, if available. This works around the SunOS
13030 4.1.4 porting bug reported by Bruce Becker in
13031 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
13032
13033 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13034 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13035 AC_HEADER_SYS_WAIT.
13036
13037 Merge changes from gnulib. This was prompted because the CVS
13038 snapshot didn't build on Solaris 7 due to strnlen problems.
13039
13040 These changes need to be merged back into gnulib:
13041 * lib/hash.c: Include <stdbool.h> unconditionally.
13042 * m4/onceonly.m4 (m4_quote): New macro.
13043 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13044 Quote AC_FOREACH variable-expansions properly.
13045 The 2003-01-03 obstack.h change also needs merging.
13046 {end of changes requiring merging}
13047
13048 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13049 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13050 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13051 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13052 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13053 New files, imported from gnulib.
13054 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13055 above.
13056
13057 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13058 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13059 gnulib sources.
13060
13061 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13062 Add.
13063 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13064 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13065 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13066 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13067 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13068 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13069 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13070 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13071 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13072 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13073 (jm_PREREQ_ARGMATCH): Remove.
13074 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13075 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13076
13077 * src/system.h: Include <stdbool.h> unconditionally.
13078
13079 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13080 assuming at least C89 in the bitset code for some time now.
13081
13082 2003-03-03 Akim Demaille <akim@epita.fr>
13083
13084 * ro.po: New.
13085
13086 2003-03-02 Akim Demaille <akim@epita.fr>
13087
13088 * doc/bison.texinfo (Table of Symbols): Reactivate the
13089 documentation for %lex-param, and %parse-param.
13090
13091 2003-03-02 Akim Demaille <akim@epita.fr>
13092
13093 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13094 generate verbose error messages.
13095 Use the number of tokens as an upper bound in yytname, as it
13096 cannot be a non terminal.
13097
13098 2003-03-02 Akim Demaille <akim@epita.fr>
13099
13100 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13101 message.
13102
13103 2003-03-02 Akim Demaille <akim@epita.fr>
13104
13105 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13106 Use them to exercise yycheck overrun.
13107 Based on Andrew Suffield's grammar.
13108
13109 2003-03-02 Akim Demaille <akim@epita.fr>
13110
13111 Create tests/local.at for Bison generic testing macros.
13112
13113 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
13114 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
13115 This new file.
13116 * tests/calc.at (AT_CHECK_CALC): Adjust.
13117 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
13118 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
13119 * tests/local.at: here.
13120 (AT_COMPILE_CXX): Tags the tests using it as c++.
13121 Ignore the test if CXX is not functional.
13122
13123 2003-03-01 Paul Eggert <eggert@twinsun.com>
13124
13125 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
13126 not loc->end, since loc->end might contain garbage and this leads
13127 to undefined behavior on some platforms.
13128 (id_loc, token_start): Use (IF_LINTed) initial values that do not
13129 depend on *loc, so that the reader doesn't give the the false
13130 impression that *loc is initialized.
13131 (<INITIAL>"%%"): Do not bother setting code_start, since its value
13132 does not survive the return.
13133
13134 2003-03-01 Akim Demaille <akim@epita.fr>
13135
13136 * src/scan-gram.l (code_start): Always initialize it when entering
13137 into yylex, as SC_EPILOGUE is activated *before* the corresponding
13138 yylex invocation. An alternative would be making it static, but
13139 then it starts with the second %%'s beginning, instead of its end.
13140
13141 2003-02-28 Paul Eggert <eggert@twinsun.com>
13142
13143 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
13144 around a UnixWare 7.1.1 porting bug reported by John Hughes in
13145 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
13146
13147 2003-02-26 Paul Eggert <eggert@twinsun.com>
13148
13149 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
13150 Remove Sequent/Pyramid discussion (nobody uses them any more).
13151 Merge VMS and MS-DOS discussion; these ports may well be dead
13152 but let's keep mentioning them for now. Put <> around email
13153 addresses. Add copyright notice.
13154
13155 2003-02-24 Paul Eggert <eggert@twinsun.com>
13156
13157 * data/glr.c (yy_reduce_print): yylineno -> yylno,
13158 to avoid collision with flex use of yylineno.
13159 Problem reported by Bruce Lilly in
13160 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
13161 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13162 * data/yacc.c (yy_reduce_print): Likewise.
13163
13164 * config/depcomp: Sync with Automake 1.7.3.
13165
13166 2003-02-21 Akim Demaille <akim@epita.fr>
13167
13168 * data/lalr1.cc: Use temporary variables instead of casts to
13169 change integer types.
13170 Suggested by Paul Eggert.
13171
13172 2003-02-21 Akim Demaille <akim@epita.fr>
13173
13174 * doc/bison.texinfo: Use "location" consistently to refer to @n,
13175 to avoid confusions with lalr1.cc's notion of Position.
13176 Suggested by Paul Eggert.
13177
13178 2003-02-20 Akim Demaille <akim@epita.fr>
13179
13180 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
13181 before initial_columns.
13182 (location.hh): Use consistent variable names when defining the
13183 operator<<.
13184 Use "last" so that we subtract from Positions, not from unsigned.
13185
13186 2003-02-20 Akim Demaille <akim@epita.fr>
13187
13188 * data/lalr1.cc (position.hh): New subfile, including the extended
13189 and Doxygen'ed documentation of class Position.
13190 (location.hh): Use it.
13191 Document a` la Doxygen.
13192 With the help of Benoit Perrot.
13193
13194 2003-02-20 Akim Demaille <akim@epita.fr>
13195
13196 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
13197 AT_YACC_IF.
13198 Redefine AT_YYERROR_SEES_LOC_IF using it.
13199 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
13200 not defined.
13201 Don't use the location in yy::Parser::error_ and
13202 yy::Parser::print_ when not %locations.
13203 Activate more lalr1.cc tests.
13204
13205 2003-02-19 Akim Demaille <akim@epita.fr>
13206
13207 * data/lalr1.cc: When displaying a line number, be sure to make it
13208 an int.
13209
13210 2003-02-19 Akim Demaille <akim@epita.fr>
13211
13212 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
13213 Remove, useless.
13214 (YYABORT, YYACCEPT, YYERROR): New.
13215 * tests/calc.at: Renable the lalr1.cc test.
13216
13217 2003-02-19 Akim Demaille <akim@epita.fr>
13218
13219 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
13220 error recovery, mixing with/without pops and discarding of the
13221 lookahead.
13222 Exercise YYERROR.
13223 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
13224
13225 2003-02-17 Paul Eggert <eggert@twinsun.com>
13226
13227 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
13228 * tests/testsuite.at (AT_COMPILE): Use them.
13229 This fixes the testsuite problem reported by Robert Lentz in
13230 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
13231
13232 2003-02-12 Paul Eggert <eggert@twinsun.com>
13233
13234 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
13235 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
13236 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
13237 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
13238 Check for malloc failure, for consistency with yacc.c.
13239 (yytname_size): Remove, for consistency with yacc.c.
13240
13241 The bug still remains in data/lalr1.cc, as I didn't have time
13242 to fix it there.
13243
13244 2003-02-06 Akim Demaille <akim@epita.fr>
13245
13246 * configure.ac (GXX): Rename as...
13247 (CXX): this, to keep the original Autoconf semantics.
13248 Require 2.57.
13249 * data/lalr1.cc: Fix b4_copyright invocations.
13250 If YYDEBUG is not defined, don't depend upon name_ being defined.
13251 (location.hh): Include string and iostream.
13252 (Position::filename): New member.
13253 (Position::Position ()): New.
13254 (operator<< (Position)): New.
13255 (operator- (Position, int)): New.
13256 (Location::first, Location::last): Rename as...
13257 (Location::begin, Location::end): these, to mock the conventional
13258 iterator names.
13259 (operator<< (Location)): New.
13260 * tests/atlocal.in (CXX): New.
13261 * tests/testsuite.at (AT_COMPILE_CXX): New.
13262 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13263 locations in a more synthetic way.
13264 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13265 lalr1.cc is used.
13266 Adjust the C locations to match those from Emacs: first column is
13267 column 0.
13268 Change all the expected results.
13269 Conform to the GCS: simplify the locations when applicable.
13270 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13271 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13272 these CPP macros with the m4 macros new defined by...
13273 (AT_CHECK_PUSHDEFS): this, i.e.:
13274 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
13275 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
13276 New macros.
13277 (AT_CHECK_POPDEFS): Undefine them.
13278 (AT_CHECK_CALC_LALR1_CC): New.
13279 Use it for the first lalr1.cc test.
13280
13281 2003-02-04 Akim Demaille <akim@epita.fr>
13282
13283 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13284 Location as is defined.
13285
13286 2003-02-04 Akim Demaille <akim@epita.fr>
13287
13288 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13289 name_ being defined.
13290
13291 2003-02-03 Paul Eggert <eggert@twinsun.com>
13292
13293 * src/gram.h (start_symbol): Remove unused decl.
13294
13295 Use more-consistent naming conventions for local vars.
13296
13297 * src/derives.c (derives_compute): Change type of local var from
13298 int to rule_number.
13299 * src/gram.c (grammar_rules_partial_print): Likewise.
13300 * src/print.c (print_core): Likewise.
13301 * src/reduce.c (reduce_grammar_tables): Likewise.
13302
13303 * src/gram.c (grammar_dump): Change name of item_number *
13304 local var from r to rp.
13305 * src/nullable.c (nullable_compute): Likewise.
13306
13307 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13308
13309 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13310 for symbol or symbol_number var.
13311 * src/reader.c (grammar_start_symbol_set): Likewise.
13312 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13313 Likewise.
13314 * src/state.c (transitions_to): Likewise.
13315 * src/state.h: Likewise.
13316 * src/tables.c (symbol_number_to_vector_number): Likewise.
13317
13318 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13319 char * var.
13320
13321 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13322 var.
13323
13324 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13325 var.
13326
13327 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13328 Use str, not s, for char * var. Use ch, not c, for character var.
13329 Use size for size var.
13330
13331 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13332 char * var.
13333 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13334 uniqstr var.
13335 * src/uniqstr.h: Likewise.
13336
13337 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13338 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13339 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13340 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13341 param to have same name as that of enum, so that we don't use
13342 "s" to stand for a non-state.
13343
13344 2003-02-02 Akim Demaille <akim@epita.fr>
13345
13346 * src/scan-skel.l: Scan more than one inert character per yylex
13347 invocation.
13348
13349 2003-02-01 Paul Eggert <eggert@twinsun.com>
13350
13351 Version 1.875a.
13352
13353 * po/LINGUAS: Add ms.
13354
13355 2003-01-30 Akim Demaille <akim@epita.fr>
13356
13357 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13358
13359 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13360
13361 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13362 of $1.
13363
13364 Changes in response to error report by S. Eken: GLR mode does not
13365 handle negative $ indices or $ indices in embedded rules correctly.
13366 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
13367
13368 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13369 (b4_rhs_location): Ditto.
13370 (yyfill): New function to copy from stack tree into array
13371 incrementally.
13372 (yyuserAction): Modify to allow incremental move of semantic values
13373 to rhs array when in GLR mode.
13374 Define YYFILL to use in user-defined actions to fill semantic array
13375 as needed.
13376 Remove dummy use of yystack, as there is now a guaranteed use.
13377 (yydoAction): Modify to allow incremental move of semantic values
13378 to rhs array when in GLR mode.
13379 (yyresolveAction): Ditto.
13380 (yyglrShiftDefer): Update comment.
13381 (yyresolveStates): Use X == NULL for pointers, not !X.
13382 (yyglrReduce): Ditto.
13383 (yydoAction): Ditto
13384
13385 * tests/glr-regr1.at: Rename to ...
13386 * tests/glr-regression.at: Add new regression test for the problems
13387 described above (adapted from S. Eken).
13388 Update copyright notice.
13389 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13390 * tests/Makefile.am: Ditto.
13391
13392 2003-01-28 Paul Eggert <eggert@twinsun.com>
13393
13394 * data/lalr1.cc: Do not use @output_header_name@ unless
13395 b4_defines_flag is set. This fixes two bugs reported by
13396 Tim Van Holder in
13397 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13398 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
13399
13400 2003-01-21 Paul Eggert <eggert@twinsun.com>
13401
13402 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13403 we don't need to worry about yyerrlab1 being reported as an
13404 "unused label" by non-GCC C compilers. The downside is that if
13405 locations are used then a couple of statements are duplicated each
13406 time YYERROR is invoked, but the upside is that the warnings
13407 should vanish.
13408 (yyerrlab1): Move code to YERROR.
13409 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13410 This reverts some of the 2002-12-27 change.
13411
13412 2003-01-17 Paul Eggert <eggert@twinsun.com>
13413
13414 * src/output.c (symbol_printers_output): Fix typo that led
13415 to core dump. Problem reported by Antonio Rus in
13416 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
13417
13418 2003-01-13 Akim Demaille <akim@epita.fr>,
13419 Quoc Peyrot <chojin@lrde.epita.fr>,
13420 Robert Anisko <anisko_r@lrde.epita.fr>
13421
13422 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13423 when the stacks contain one element, as the loop would otherwise
13424 free the last state, and then use the top state (the one we just
13425 popped). This means that the initial elements will not be freed
13426 explicitly, as is the case in yacc.c; it is not a problem, as
13427 these elements have fake values.
13428
13429 2003-01-11 Paul Eggert <eggert@twinsun.com>
13430
13431 * NEWS: %expect-violations are now just warnings, reverting
13432 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13433 bootstrapping problem reported by Matthias Klose; see
13434 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
13435 * src/conflicts.c (conflicts_print): Likewise.
13436 * tests/conflicts.at (%expect not enough, %expect too much,
13437 %expect with reduce conflicts): Likewise.
13438 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13439 that the warning is enabled if the number of conflicts changes
13440 (not necessarily increases).
13441
13442 * src/getargs.c (version): Update copyright year.
13443
13444 2003-01-09 Akim Demaille <akim@epita.fr>
13445
13446 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13447
13448 2003-01-08 Paul Eggert <eggert@twinsun.com>
13449
13450 * Makefile.maint (WGETFLAGS):
13451 New macro, containing "-C off" to disable proxy caches.
13452 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13453 (rel-check): Use $(WGET) instead of wget.
13454
13455 2003-01-06 Paul Eggert <eggert@twinsun.com>
13456
13457 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13458 the GLR paper of Scott, Johnstone and Hussain.
13459
13460 2003-01-04 Paul Eggert <eggert@twinsun.com>
13461
13462 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13463 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13464 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13465 (EXTRA_LIBRARIES): New var, for liby.a.
13466 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13467 (EXTRA_SCRIPTS): New var, for yacc.
13468
13469 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13470 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13471 Problem reported by Nelson H. F. Beebe.
13472
13473 2003-01-03 Paul Eggert <eggert@twinsun.com>
13474
13475 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13476 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13477 when compiling Bison 1.875's `bitset bset = obstack_alloc
13478 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13479
13480 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13481 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13482 grow to a huge size with typical invocation.
13483
13484 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13485 Use the pattern recommended by Autoconf 2.57, except also protect
13486 against double-definition.
13487 * src/system.h: Likewise.
13488 Portability issues reported by Nelson H. F. Beebe.
13489
13490 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13491 All uses changed. Provide a definition in both C and C++.
13492 (yytrue, yyfalse): Define even if defined (__cplusplus).
13493
13494 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13495 Reported by Nelson H. F. Beebe.
13496
13497 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13498
13499 2003-01-02 Paul Eggert <eggert@twinsun.com>
13500
13501 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13502 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13503 Bug reported by Nelson H. F. Beebe.
13504
13505 2003-01-01 Paul Eggert <eggert@twinsun.com>
13506
13507 * Version 1.875.
13508
13509 2002-12-30 Paul Eggert <eggert@twinsun.com>
13510
13511 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13512 Moved here from...
13513 (<INITIAL>","): Here. This causes stray "," to be treated
13514 more uniformly.
13515
13516 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
13517 last brace in braced code when not in Yacc mode, for compatibility
13518 with Bison 1.35. This resurrects the 2001-12-15 patch to
13519 src/reader.c.
13520
13521 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13522 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13523
13524 2002-12-28 Paul Eggert <eggert@twinsun.com>
13525
13526 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13527 that of SYM's type. This fixes Debian bug 168069, reported by
13528 Thomas Olsson.
13529
13530 2002-12-28 Paul Eggert <eggert@twinsun.com>
13531
13532 Version 1.75f.
13533
13534 Switch back to the Yacc style of conflict reports, undoing some
13535 of the 2002-07-30 change.
13536 * doc/bison.texinfo (Understanding): Use Yacc style for
13537 conflict reports. Also, use new way of locating rules.
13538 * src/conflicts.c (conflict_report):
13539 Renamed from conflict_report_yacc, removing the old
13540 'conflict_report'. Translate the entire conflict report at once,
13541 so that we don't assume that "," has the same interpretation in
13542 all languages.
13543 (conflicts_output): Use Yacc-style conflict report for each state,
13544 instead of our more-complicated style.
13545 (conflicts_print): Use Yacc-style conflict report, except print
13546 the input file name when not emulating Yacc.
13547 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13548 Conflicted Reduction, %expect not enough, %expect too much,
13549 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13550 * tests/existing.at (GNU Cim Grammar): Likewise.
13551 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13552
13553 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13554 fatal): Don't invoke fflush; it's not needed and it might even be
13555 harmful for stdout, as stdout might not be open.
13556 * src/reduce.c (reduce_print): Likewise.
13557
13558 2002-12-27 Paul Eggert <eggert@twinsun.com>
13559
13560 Fix a bug where error locations were not being recorded correctly.
13561 This problem was originally reported by Paul Hilfinger in
13562 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
13563
13564 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13565 top of the location stack's error locations.
13566 (yyerrlab): Set it. When discarding a token, push its location
13567 onto yylerrsp so that we don't lose track of the error's end.
13568 (yyerrlab1): Now is only the target of YYERROR, so that we can
13569 properly record the location of the action that failed. For GCC
13570 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13571 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13572 (yyerrlab2): New label, which yyerrlab now falls through to.
13573 Compute the error's location by applying YYLLOC_DEFAULT to
13574 the locations of all the symbols that went into the error.
13575 * doc/bison.texinfo (Location Default Action): Mention that
13576 YYLLOC_DEFAULT is also invoked for syntax errors.
13577 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13578 Error locations include the locations of all the tokens that were
13579 discarded, not just the last token.
13580
13581 2002-12-26 Paul Eggert <eggert@twinsun.com>
13582
13583 * src/files.c: Include quote.h.
13584 (compute_output_file_names): Warn if we detect conflicting
13585 outputs to the same file. This should catch the misunderstanding
13586 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13587
13588 * src/conflicts.c (conflicts_print): If the user specifies
13589 "%expect N", report an error if there are any reduce/reduce
13590 conflicts. This is what the manual says should happen.
13591 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13592 * tests/conflicts.at (%expect with reduce conflicts): New test.
13593
13594 Don't use m4_include on relative file names, as it doesn't work as
13595 desired if there happens to be a file with that name under ".".
13596
13597 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13598 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13599 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13600 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13601 * src/output.c (output_skeleton): Use full path names when
13602 specifying a file to include; don't rely on include path, as
13603 it's unreliable when the working file contains a file with
13604 that name.
13605
13606 2002-12-25 Paul Eggert <eggert@twinsun.com>
13607
13608 Remove obsolete references to bison.simple and bison.hairy.
13609 Problem mentioned by Aubin Mahe in
13610 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
13611 * data/glr.c: Comment fix.
13612 * doc/bison.1: Remove references. Also, mention "yacc".
13613
13614 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13615 with -g option.
13616
13617 * src/parse-gram.y (declaration): Use enum "report_states" rather
13618 than its numeric value 1.
13619
13620 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13621 opening a new one. This fixes Debian bug 165349, reported by
13622 Bruce Stephens.
13623
13624 2002-12-24 Paul Eggert <eggert@twinsun.com>
13625
13626 Version 1.75e.
13627
13628 * Makefile.maint (cvs-update): Don't assume that the shell
13629 supports $(...), as Solaris sh doesn't.
13630
13631 * src/parse-gram.y (lloc_default): Remove test for empty
13632 nonterminals at the end, since it didn't change the result.
13633
13634 2002-12-24 Paul Eggert <eggert@twinsun.com>
13635
13636 If the user does not define YYSTYPE as a macro, Bison now declares it
13637 using typedef instead of defining it as a macro. POSIX requires this.
13638 For consistency, YYLTYPE is also declared instead of defined.
13639
13640 %union directives can now have a tag before the `{', e.g., the
13641 directive `%union foo {...}' now generates the C code
13642 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13643 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13644 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13645 instead of `yyltype'.
13646
13647 `yystype' and `yyltype' are now obsolescent macros instead of being
13648 typedefs or tags; they are no longer documented and will be
13649 withdrawn in a future release.
13650
13651 * data/glr.c (b4_location_type): Remove.
13652 (YYSTYPE): Renamed from yystype.
13653 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13654 (struct YYLTYPE): Renamed from struct yyltype.
13655 (YYLTYPE): Renamed from yyltype.
13656 (yyltype, yystype): New (and obsolescent) macros,
13657 for backward compatibility.
13658 * data/yacc.c: Likewise.
13659
13660 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13661 does not specify a union tag. This is for compatibility with
13662 Solaris 9 yacc.
13663
13664 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13665 const *, since it is now modified by stripping surrounding { }.
13666 (current_braced_code): Remove.
13667 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13668 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13669 trailing " {...}". Now of type <chars>.
13670 (grammar_declaration): Adjust to bundled tokens.
13671 (code_content): Remove; stripping is now done by add_param.
13672 (print_token_value): Print contents of bundled tokens.
13673 (token_name): New function.
13674
13675 * src/reader.h (braced_code, current_braced_code): Remove.
13676 (token_name): New decl.
13677
13678 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13679 token_type, not braced_code code_kind. All uses changed.
13680 (SC_PRE_CODE): New state, for scanning after a keyword that
13681 has (or usually has) an immediately-following braced code.
13682 (token_type): New local var, to keep track of which token type
13683 to return when scanning braced code.
13684 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
13685 <INITIAL>"%parse-param", <INITIAL>"%printer",
13686 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13687 instead of returning a token type immediately.
13688 (<INITIAL>"{"): Set token type.
13689 (<SC_BRACED_CODE>"}"): Use it.
13690 (handle_action_dollar, handle_action_at): Now returns bool
13691 indicating success. Fail if ! current_rule; this prevents a core dump.
13692 (handle_symbol_code_dollar, handle_symbol_code_at):
13693 Remove; merge body into caller.
13694 (handle_dollar, handle_at): Complain in invalid contexts.
13695
13696 * NEWS, doc/bison.texinfo: Document the above.
13697 * NEWS: Fix years and program names in copyright notice.
13698
13699 2002-12-17 Paul Eggert <eggert@twinsun.com>
13700
13701 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13702 Reporting, Table of Symbols): Omit mentions of %lex-param and
13703 %parse-param from the documentation for now.
13704
13705 2002-12-15 Paul Eggert <eggert@twinsun.com>
13706
13707 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13708 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13709 lookahead symbol, and which sets yychar in parser actions) and it
13710 disagreed with the Bison documentation. Bug
13711 reported by Andrew Walrond.
13712
13713 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13714 as the caller now does that.
13715 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13716 (YYEMPTY): Parenthesize right hand side, since others use it.
13717 (yyparse): Don't assume that our generated code is the only code
13718 that sets yychar.
13719
13720 2002-12-13 Paul Eggert <eggert@twinsun.com>
13721
13722 Version 1.75d.
13723
13724 POSIX requires a "yacc" command.
13725 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13726 (MOSTLYCLEANFILES): Add yacc.
13727 (yacc): New rule.
13728 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
13729 as an alias for bison y.
13730
13731 * po/LINGUAS: Add da.
13732
13733 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13734 problem with latest <getopt.h>.
13735 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13736
13737 * doc/fdl.texi: Upgrade to 1.2.
13738 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13739 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13740 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13741 gnulib.
13742 * config/install-sh: Sync with autotools.
13743
13744 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
13745 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
13746 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13747 locations are requested.
13748 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13749 locations are requested.
13750
13751 2002-12-12 Paul Eggert <eggert@twinsun.com>
13752
13753 Remove unportable casts and storage allocation tricks.
13754 While we're at it, remove almost all casts, since they
13755 usually aren't needed and are a sign of trouble.
13756
13757 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13758
13759 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13760 the pointer DSET returned by malloc; this isn't portable.
13761 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13762 Similarly for DERIVES.
13763 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13764 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13765 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13766
13767 * src/derives.c (derives_compute): Do not bother invoking
13768 int_of_rule_number, since rule numbers are integers.
13769
13770 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13771 rather than XMALLOC (char, N).
13772
13773 * src/files.c (filename_split): Rewrite to avoid cast.
13774
13775 * src/gram.h (symbol_number_as_item_number,
13776 item_number_as_symbol_number, rule_number_as_item_number,
13777 item_number_as_rule_number):
13778 Now inline functions rather than macros, to avoid casts.
13779 * src/state.h (state_number_as_int): Likewise.
13780 * src/tables.c (state_number_to_vector_number,
13781 symbol_number_to_vector_number): Likewise.
13782
13783 * src/gram.h (int_of_rule_number): Remove; no longer used.
13784
13785 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13786 since the resulting storage is always stored into.
13787
13788 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13789 where it's needed.
13790
13791 * src/muscle_tab.c (muscle_m4_output):
13792 Now inline. Return bool, not int.
13793 * src/state.c (state_compare): Likewise.
13794 * src/symtab.c (symbol_check_defined,
13795 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13796 hash_compare_symbol, hash_symbol):
13797 Likewise.
13798 * src/uniqstr.c (uniqstr_print): Likewise.
13799 * src/muscle_tab.c (muscle_m4_output_processor):
13800 New function, to avoid casts.
13801 * src/state.c (state_comparator, stage_hasher): Likewise.
13802 * src/symtab.c (symbol_check_defined_processor,
13803 symbol_check_alias_consistency_processor, symbol_pack_processor,
13804 symbol_translation_processor, hash_symbol_comparator,
13805 hash_symbol_hasher): Likewise.
13806 * src/uniqstr.c (uniqstr_print_processor): Likewise.
13807 * src/muscle_tab.c (muscles_m4_output):
13808 Use new functions instead of casting old functions unportably.
13809 * src/state.c (state_hash_new): Likewise.
13810 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
13811 symbols_token_translations_init):
13812 Likewise.
13813 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
13814
13815 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
13816 var instead of casting to long, to avoid casts.
13817 (prepare_states): Use MALLOC rather than alloca, so that we don't
13818 have to worry about alloca.
13819 * src/state.c (state_hash_lookup): Likewise.
13820
13821 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
13822 local var instead of casting to unsigned char, to avoid casts.
13823
13824 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
13825 STATE_ALLOC): Remove.
13826 (transitions_new, errs_new, reductions_new, state_new): Use malloc
13827 rather than calloc, and use offsetof to avoid allocating slightly
13828 too much storage.
13829 (state_new): Initialize all members.
13830
13831 * src/state.c (state_hash): Use unsigned accumulator, not signed.
13832
13833 * src/symtab.c (symbol_free): Remove; unused.
13834 (symbol_get): Remove cast in lhs of assignment.
13835 (symbols_do): Now static. Accept generic arguments, not
13836 hashing-related ones.
13837
13838 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
13839 (symbol_processor): Remove.
13840 (symbols_do): Remove decl; now static.
13841
13842 * src/system.h (alloca): Remove; decl no longer needed.
13843 (<stddef.h>): Include, for offsetof.
13844 (<inttypes.>, <stdint.h>): Include if available.
13845 (uintptr_t): New type, if system lacks it.
13846 (CALLOC, MALLOC, REALLOC): New macros.
13847 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
13848 new macros.
13849
13850 * src/tables.c (table_size): Now int, to pacify GCC.
13851 (table_grow, table_ninf_remap): Use signed table size.
13852 (save_row): Don't bother initializing locals when not needed.
13853 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
13854 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
13855
13856 * src/vcg.h: Correct misspellings.
13857
13858 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
13859
13860
13861 * src/getargs.c (getargs): Don't assume EOF == -1.
13862
13863 2002-12-09 Paul Eggert <eggert@twinsun.com>
13864
13865 Change identifier spellings to avoid collisions with names
13866 that are reserved by POSIX.
13867
13868 Don't use names ending in _t, since POSIX reserves them.
13869 For consistency, remove _e and _s endings -- they're weren't
13870 needed to remove ambiguity. All uses changed.
13871 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
13872 turn was just renamed from struniq_t.
13873 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
13874 which in turn was just renamed from struniq_processor_t.
13875 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
13876 in turn was renamed from hash_compare_struniq_t.
13877 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
13878 (state_list): Renamed from state_list_t.
13879 * src/assoc.h (assoc): Renamed from assoc_t.
13880 * src/conflicts.c (enum conflict_resolution): Renamed from
13881 enum conflict_resolution_e.
13882 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
13883 (rule_list): Renamed from rule_list_t.
13884 * src/getargs.h (enum trace): Renamed from enum trace_e.
13885 (enum report): Renamed from enum report_e.
13886 * src/gram.h (item_number): Renamed from item_number_t.
13887 (rule_number): Renamed from rule_number_t.
13888 (struct rule_s): Remove the "rule_s" part; not used.
13889 (rule): Renamed from rule_t.
13890 (rule_filter): Renamed from rule_filter_t.
13891 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
13892 (goto_list): Renamed from goto_list_t.
13893 * src/lalr.h (goto_number): Renamed from goto_number_t.
13894 * src/location.h (location): Renamed from location_t.
13895 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
13896 and moved here from:
13897 * src/muscle_tab.h (muscle_entry_t): here.
13898 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
13899 (rule_list): Renamed from rule_list_t.
13900 * src/print_graph.c (static_graph): Renamed from graph.
13901 * src/reader.h (braced_code): Renamed from braced_code_t.
13902 Remove brace_code_e tag.
13903 * src/relation.h (relation_node): Renamed from relation_node_t.
13904 (relation_nodes): Renamed from relation_nodes_t.
13905 (relation): Renamed from relation_t.
13906 * src/state.h (state_number): Renamed from state_number_t.
13907 (struct state): Renamed from struct state_s.
13908 (state): Renamed from state_t.
13909 (transitions): Renamed from transitions_t. Unused (and
13910 misspelled) transtion_s tag removed.
13911 (errs): Renamed from errs_t. Unused errs_s tag removed.
13912 (reductions): Renamed from reductions_t. Unused tag
13913 reductions_s removed.
13914 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
13915 (struct symbol_list): Renamed from struct symbol_list_s.
13916 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
13917 (struct symbol): Renamed from struct symbol_s.
13918 (symbol): Renamed from symbol_t.
13919 * src/tables.c (vector_number): Renamed from vector_number_t.
13920 (action_number): Renamed from action_t.
13921 * src/tables.h (base_number): Renamed from base_t.
13922 * src/vcg.h (enum color): Renamed from enum color_e.
13923 (enum textmode): Renamed from enum textmode_e.
13924 (enum shape): Renamed from enum shape_e.
13925 (struct colorentry): Renamed from struct colorentry_s.
13926 (struct classname): Renamed from struct classname_s.
13927 (struct infoname): Renamed from struct infoname_s.
13928 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
13929 (enum decision): Renamed from enum decision_e.
13930 (enum orientation): Renamed from enum orientation_e.
13931 (enum alignment): Renamed from enum alignment_e.
13932 (enum arrow_mode): Renamed from enum arrow_mode_e.
13933 (enum crossing_type): Renamed from enum crossing_type_e.
13934 (enum view): Renamed from enum view_e.
13935 (struct node): Renamed from struct node_s.
13936 (node): Renamed from node_t.
13937 (enum linestyle): Renamed from enum linestyle_e.
13938 (enum arrowstyle): Renamed from enum arrowstyle_e.
13939 (struct edge): Renamed from struct edge.
13940 (edge): Renamed from edge_t.
13941 (struct graph): Renamed from struct graph_s.
13942 (graph): Renamed from graph_t.
13943 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
13944 Rename value_t -> value.
13945 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
13946 value_t_as_yystype -> value_as_yystype.
13947
13948 Don't include <errno.h> in the mainstream code, since it
13949 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
13950 * lib/get-errno.c, lib/get-errno.h: New files.
13951 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
13952 get-errno.c.
13953 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
13954 * src/output.c (output_skeleton): Likewise.
13955 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
13956 instead of errno.
13957 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
13958 Likewise.
13959 (handle_action_dollar, handle_action_at): Likewise.
13960 * src/system.h: Do not include <errno.h>.
13961 (TAB_EXT): Renamed from EXT_TAB.
13962 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
13963
13964 Avoid str[a-z]*, since <string.h> reserves that name space.
13965 Change all instances of "struniq" in names to "uniqstr", and
13966 likewise for "STRUNIQ" and "UNIQSTR".
13967 * src/uniqstr.c: Renamed from src/struniq.c.
13968 * src/uniqstr.h: Renamed from src/struniq.h.
13969 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
13970 * src/files.c (strsuffix): Remove; unused.
13971 (concat2): Renamed from stringappend. Now static.
13972 * src/files.h (strsuffix, stringappend): Remove; unused.
13973 * src/parse-gram.y (<chars>): Renamed from <string>.
13974 (<uniqstr>): Renamed from <struniq>.
13975 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
13976 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
13977 (struct graph_s.expand): Renamed from struct graph_s.stretch.
13978 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
13979 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
13980 (N_EXPAND): Renamed from N_STRETCH.
13981
13982 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
13983 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
13984 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
13985 Remove; unused.
13986 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
13987 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
13988 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
13989 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
13990 (BASE_MAXIMUM): Renamed from BASE_MAX.
13991 (BASE_MINIMUM): Renamed from BASE_MIN.
13992 (ACTION_MAX): Remove; unused.
13993 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
13994 Unnecessary casts removed from above defines.
13995
13996
13997 Fix misspelling in names.
13998 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
13999 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
14000 G_NODE_ALIGNEMENT.
14001
14002
14003 * lib/timevar.c (timevar_report): Renamed from time_report,
14004 for consistency with other names.
14005 * lib/timevar.h (timevar_report): New decl.
14006 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
14007
14008
14009 Sort include-file uses.
14010
14011 Reorder all include files under src to be in the order "system.h".
14012 then the ../lib include files in angle brackets (alphabetized),
14013 then the . include files in double-quotes (alphabetized). Fix
14014 dependency breakages encountered in this process, as follows:
14015 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
14016 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
14017 * src/state.h: Include "symtab.h".
14018
14019 2002-12-08 Paul Eggert <eggert@twinsun.com>
14020
14021 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
14022 since this causes problems when __file__ contains character
14023 sequences like "@" that are treated specially by src/scan-skel.l.
14024 Instead, just use the file's basename. This fixes the bug
14025 reported by Martin Mokrejs in
14026 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
14027
14028 2002-12-06 Paul Eggert <eggert@twinsun.com>
14029
14030 Add support for rules that do not have trailing semicolons, as
14031 POSIX requires. Improve the quality of locations in Bison
14032 diagnostics.
14033
14034 * src/location.c: Include <quotearg.h>.
14035 (empty_location): Now const.
14036 (location_print): New function. Follow the recommendation of the
14037 GNU Coding Standards for locations that span file boundaries.
14038 * src/location.h: Do not include <quotearg.h>; no longer needed.
14039 (boundary): New type.
14040 (location_t): Use it. This allows locations to span file boundaries.
14041 All member uses changed: file -> start.file or end.file (as needed),
14042 first_line -> start.line, first_column -> start.column,
14043 last_line -> end.line, last_column -> end.column.
14044 (equal_boundaries): New function.
14045 (LOCATION_RESET, LOCATION_STEP): Remove.
14046 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14047 (empty_location): Now const.
14048 (location_print): New decl.
14049 * src/parse-gram.y (lloc_default): New function, which handles
14050 empty locations more accurately.
14051 (YYLLOC_DEFAULT): Use it.
14052 (%token COLON): Remove.
14053 (%token ID_COLON): New token.
14054 (rules): Use it.
14055 (declarations, rules): Remove trailing semicolon.
14056 (declaration, rules_or_grammar_declaration):
14057 Allow empty (";") declaration.
14058 (symbol_def): Remove empty actions; no longer needed.
14059 (rules_or_grammar_declaration): Remove trailing semicolon.
14060 (semi_colon.opt): Remove.
14061 * src/reader.h: Include location.h.
14062 (scanner_cursor): New decl.
14063 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14064 rolling our own.
14065 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14066 of *loc.
14067 (STEP): Remove. No longer needed, now that adjust_location does
14068 the work. All uses removed.
14069 (scanner_cursor): New var.
14070 (adjust_location): Renamed from extend_location. It now sets
14071 *loc and adjusts the scanner cursor. All uses changed.
14072 Don't bother testing for CR.
14073 (handle_syncline): Remove location arg; now updates scanner cursor.
14074 All callers changed.
14075 (unexpected_end_of_file): Now accepts start boundary of token or
14076 comment, not location. All callers changed. Update scanner cursor,
14077 not the location.
14078 (SC_AFTER_IDENTIFIER): New state.
14079 (context_state): Renamed from c_context. All uses changed.
14080 (id_loc, code_start, token_start): New local vars.
14081 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14082 processing of Yacc white space and equivalents here.
14083 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14084 instead of returning ID immediately, since we need to search for
14085 a subsequent colon.
14086 (<INITIAL>"'", "\""): Save token_start.
14087 (<INITIAL>"%{", "{", "%%"): Save code_start.
14088 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14089 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14090 BEGIN context_state at end, not INITIAL.
14091 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14092 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14093 Return correct token start.
14094 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14095 the start of a character, string or multiline comment is found.
14096 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14097 Reduction): Adjust reported locations to match the more-precise
14098 results now expected.
14099 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14100 * tests/reduce.at (Useless Rules, Reduced Automaton,
14101 Underivable Rules): Likewise.
14102 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14103 or "|"' now that so many other tokens are allowed by the new grammar.
14104
14105 * src/complain.h (current_file): Remove duplicate decl;
14106 current_file is now owned by files.h.
14107 * src/complain.c, src/scan-gram.l: Include files.h.
14108
14109 2002-12-06 Paul Eggert <eggert@twinsun.com>
14110
14111 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
14112 promotes to int; it might be unsigned int.
14113 * data/yacc.c (yy_reduce_print): Likewise.
14114
14115 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
14116 be #defined in the prologue, not in the Bison declarations.
14117 This fixes Debian Bug 102878, reported by Shaul Karl.
14118
14119 2002-12-02 Paul Eggert <eggert@twinsun.com>
14120
14121 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
14122 * lib/strtoul.c: New file, from gnulib.
14123 This fixes a porting bug reported by Peter Klein in
14124 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
14125
14126 2002-11-30 Paul Eggert <eggert@twinsun.com>
14127
14128 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
14129 and put only a forward declaration in the prologue. This is for
14130 consistency with the other scanner helper functions.
14131
14132 Type clashes now generate warnings, not errors, since it
14133 appears that POSIX may allow some grammars with type clashes.
14134 * src/reader.c (grammar_current_rule_check): Warn about
14135 type clashes instead of complaining.
14136 * tests/input.at (Type Clashes): Expect warnings, not complaints.
14137
14138 Add Yacc library, since POSIX requires it.
14139 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
14140 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
14141 * lib/main.c, lib/yyerror.c: New files.
14142
14143 gram_error can be static; it need not be extern.
14144 * src/reader.h (gram_error): Remove decl.
14145 * src/parse-gram.y (gram_error): Now static. Add static decl.
14146 (print_token_value): Omit parameter names from forward decl,
14147 for consistency.
14148
14149 2002-11-29 Paul Eggert <eggert@twinsun.com>
14150
14151 * doc/bison.texinfo: Emphasize that yylex and yyerror must
14152 be declared before being used. E.g., one should typically
14153 declare them in the prologue. Use GNU coding style in examples.
14154 Put "const" consistently after the type it modifies. Mention
14155 that C99 supports "inline". Mention that yyerror traditionally
14156 returns "int".
14157
14158 %parse-param and %lex-param now take just one argument, the
14159 declaration; the argument name is deduced from the declaration.
14160
14161 * doc/bison.texinfo (Parser Function, Pure Calling, Error
14162 Reporting, Table of Symbols): Document this.
14163 * src/parse-gram.y (add_param): New function.
14164 (COMMA): Remove.
14165 (declaration): Implement new rule for %parse-param and %lex-param.
14166 * src/scan-gram.l: "," now elicits a warning, rather than being
14167 a token; this is more compatible with byacc.
14168 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
14169
14170 2002-11-27 Paul Eggert <eggert@twinsun.com>
14171
14172 Rename identifiers to avoid real and potential collisions.
14173
14174 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
14175 to avoid collision with lex macro described by Bruce Lilly in
14176 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
14177 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
14178 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
14179 * src/parse-gram.y (print_token_value): Renamed from yyprint.
14180 All uses changed.
14181 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
14182 The name "yycontrol" violates the name space rules, and this stuff
14183 wasn't being used anyway.
14184 (input): Remove action; this stuff wasn't being used.
14185 (gram_error): Rename local variable yylloc -> loc.
14186 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
14187 (YY_DECL): Don't use "yy" at start of local variables.
14188 All uses changed, e.g., yylloc -> loc.
14189 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
14190 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
14191 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
14192 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
14193
14194 * src/parse-gram.y (gram_error): loc is now const *.
14195 * src/reader.h (gram_error): Likewise.
14196
14197 2002-11-24 Paul Eggert <eggert@twinsun.com>
14198
14199 Version 1.75c.
14200
14201 * tests/actions.at (Actions after errors): Use an output format
14202 more similar to that of the Printers and Destructors test.
14203 Test the position of the ';' token too.
14204 (Printers and Destructors): Likewise.
14205 (Printers and Destructors: %glr-parser): Remove for now, to avoid
14206 unnecessarily alarming people when the test fails.
14207
14208 * data/yacc.c (yyerrlab1): Move this label down, so that the
14209 parser does not discard the lookahead token if the user code
14210 invokes YYERROR. This change is required for POSIX conformance.
14211
14212 * lib/error.c: Sync with gnulib.
14213
14214 2002-11-22 Paul Eggert <eggert@twinsun.com>
14215
14216 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
14217 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
14218 * lib/xmalloc.c: Likewise.
14219
14220 2002-11-20 Paul Eggert <eggert@twinsun.com>
14221
14222 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
14223
14224 2002-11-20 Paul Eggert <eggert@twinsun.com>
14225
14226 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
14227 should use `if (! x) abort ();' rather than `assert (x);', and
14228 anyway it's one less thing to worry about configuring.
14229
14230 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
14231 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
14232 and replace all instances of assert with abort.
14233 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
14234 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
14235
14236 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
14237 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
14238 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
14239 hash_find_entry, hash_rehash, hash_insert): Likewise.
14240 * src/conflicts.c (resolve_sr_conflict): Likewise.
14241 * src/lalr.c (set_goto_map, map_goto): Likewise.
14242 * src/nullable.c (nullable_compute): Likewise.
14243 * src/output.c (prepare_rules, token_definitions_output): Likewise.
14244 * src/reader.c (packgram, reader): Likewise.
14245 * src/state.c (state_new, state_free, state_transitions_set,
14246 state_reduction_find): Likewise.
14247 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
14248 symbol_pack): Likewise.
14249 * src/tables.c (conflict_row, pack_vector): Likewise.
14250 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14251 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14252 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
14253 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
14254
14255 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
14256 (ARGMATCH_CONSTRAINT): New macro.
14257 (ARGMATCH_ASSERT): Use it.
14258
14259 * src/system.h (verify): New macro.
14260 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
14261 rather than assert.
14262 * src/tables.c (tables_generate): Likewise.
14263
14264 * src/struniq.c (struniq_assert): Now returns void, and aborts
14265 if the assertion is false.
14266 (struniq_assert_p): Remove.
14267 * src/struniq.h: Likewise.
14268
14269 2002-11-18 Paul Eggert <eggert@twinsun.com>
14270
14271 * data/glr.c (yygetLRActions): Replace `yyindex' with
14272 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14273 This fixes the regression with Sun ONE Studio 7 cc that I reported in
14274 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
14275
14276 2002-11-18 Akim Demaille <akim@epita.fr>
14277
14278 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14279 space.
14280 From Tim Van Holder.
14281
14282 2002-11-17 Paul Eggert <eggert@twinsun.com>
14283
14284 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14285 to "SyntaxError" for consistency with my 2002-11-15 change.
14286
14287 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14288 not define to {}, since this breaks the common use of `YYDPRINTF
14289 ((...));' if a single statement is desired (e.g. before `else').
14290 Work around GCC warnings by surrounding corresponding calls with
14291 {} if needed.
14292 (yyhasResolvedValue): Remove unused function.
14293 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14294 loop body.
14295 (yyreportSyntaxError): Renamed from yyreportParseError.
14296 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14297 All uses changed.
14298 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14299 extern when possible. Remove unused initializations.
14300
14301 2002-11-16 Akim Demaille <akim@epita.fr>
14302
14303 Augment the similarity between GLR and LALR traces.
14304
14305 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14306 (YY_REDUCE_PRINT): New.
14307 (yyparse): Use them.
14308 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14309 YYDPRINT here.
14310 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14311 state reached after the reduction/recovery, since...
14312 (yyparse, yyprocessOneStack): Report the state we are entering in.
14313
14314 2002-11-16 Akim Demaille <akim@epita.fr>
14315
14316 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14317 Add support for --trace=skeleton.
14318 * src/scan-skel.l: %option debug.
14319 Scan strings of non-@ or \n instead of character by character.
14320 (scan_skel): Handle trace_skeleton.
14321 (QPUTS): New.
14322 (@output_parser_name@, @output_header_name@): ``Restore'' their
14323 support (used to be M4 macros).
14324 * data/yacc.c: Quote larger chunks, a la glr.c.
14325 * data/lalr1.cc: Likewise.
14326 The header guards are no longer available, so use some other
14327 string than `YYLSP_NEEDED'.
14328
14329 2002-11-16 Akim Demaille <akim@epita.fr>
14330
14331 Make the ``Printers and Destructors'' test more verbose, taking
14332 `yacc.c''s behavior as (possibly wrong) reference.
14333
14334 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14335 instead of fprint on stdout.
14336 Set and report the last_line of the symbols.
14337 Consistently display values and locations.
14338
14339 2002-11-16 Paul Eggert <eggert@twinsun.com>
14340
14341 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14342
14343 2002-11-15 Paul Eggert <eggert@twinsun.com>
14344
14345 * tests/actions.at (Actions after errors): New test case.
14346
14347 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14348 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14349 tests/action.at, tests/calc.at, tests/conflicts.at,
14350 tests/cxx-type.at, tests/regression.at:
14351 "parse error" -> "syntax error" for POSIX compatibility.
14352 "parsing stack overflow..." -> "parser stack overflow" so
14353 that code matches Bison documentation.
14354
14355 2002-11-15 Akim Demaille <akim@epita.fr>
14356
14357 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14358 take two BRACED_CODE, not two string_content.
14359 Free the scanner's obstack when we are done.
14360 (code_content): New.
14361 * tests/calc.at: Adjust.
14362 * doc/bison.texinfo: Adjust.
14363 Also, make sure to include the `,' for these declarations.
14364
14365 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14366
14367 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14368 definition; avoids potential autoreconf problems.
14369
14370 2002-11-15 Akim Demaille <akim@epita.fr>
14371
14372 Always check the value returned by yyparse.
14373
14374 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14375 returned by yyparse.
14376 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14377 Adjust calls.
14378 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14379 returned by yyparse.
14380
14381 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14382
14383 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14384 on input.at test.
14385
14386 2002-11-14 Paul Eggert <eggert@twinsun.com>
14387
14388 * src/output.c (output_skeleton): Call xfopen instead of
14389 duplicating xfopen's body.
14390
14391 Fix bugs reported by Nelson H. F. Beebe in
14392 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
14393
14394 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14395 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14396 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14397 file twice in the grammar, as an extra check.
14398
14399 * tests/input.at (Torturing the Scanner): Surround the
14400 backslash-newline tests with "#if 0", to make it less likely that
14401 we'll run into compiler bugs. Bring back solitary \ inside
14402 comment, but add a closing comment to work around HP C bug. Don't
14403 test backslash-newline in C character constant.
14404
14405 2002-11-14 Akim Demaille <akim@epita.fr>
14406
14407 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14408 status of the compiler.
14409 Calling `exit 1' is no longer needed.
14410 Reported by Nelson H. F. Beebe.
14411
14412 2002-11-14 Akim Demaille <akim@epita.fr>
14413
14414 * tests/atlocal.in (CPPFLAGS): We have config.h.
14415 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14416 New.
14417 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14418 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14419 * tests/regression.at, tests/torture.at: Use them for all the
14420 grammars that are to be compiled.
14421 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14422 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14423 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14424
14425 2002-11-14 Akim Demaille <akim@epita.fr>
14426
14427 * doc/bison.texinfo: Various formatting changes (alignments in
14428 samples, additional @group/@end group, GCS in samples.
14429 Use @deffn instead of simple @table to define the directives,
14430 macros, variables etc.
14431
14432 2002-11-13 Paul Eggert <eggert@twinsun.com>
14433
14434 Fix some bugs reported by Albert Chin-A-Young in
14435 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
14436
14437 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
14438 -o c"; the HP C compiler chatters during compilation.
14439 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14440 * tests/headers.at (export YYLTYPE): Likewise.
14441
14442 * tests/input.at (Torturing the Scanner): Remove lines containing
14443 solitary backslashes, as they tickle a bug in the HP C compiler.
14444
14445 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14446 comments, since they're not portable. Use GNU coding style.
14447
14448 2002-11-13 Akim Demaille <akim@epita.fr>
14449
14450 * data/yacc.c: Leave bigger chunks of quoted text.
14451 (YYDSYMPRINTF): New.
14452 Use it to report symbol activities.
14453 * data/glr.c (YYDSYMPRINTF): New.
14454 Use it.
14455
14456 2002-11-12 Paul Eggert <eggert@twinsun.com>
14457
14458 Version 1.75b.
14459
14460 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14461 (yyglrReduce): Return yyok, not 0.
14462 This should avoid the enumerated-type warnings reported
14463 by Nelson H. F. Beebe in
14464 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
14465
14466 * lib/bbitset.h (BITSET_INLINE): Remove.
14467 * lib/bitset.h [! BITSET_INLINE]: Remove.
14468 (bitset_set, bitset_reset, bitset_test): Rename local vars
14469 to avoid shadowing warnings by GCC.
14470
14471 * data/glr.c (inline): Remove #define. It's the user's
14472 responsibility to #define it away, just like 'const'.
14473 This fixes one of the bugs reported by Nelson H. F. Beebe in
14474 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
14475
14476 * Makefile.maint (po-check): Scan .l and .y files instead of the
14477 .c and the .h files that they generate. This fixes the bug
14478 reported by Tim Van Holder in:
14479 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
14480 Look for N_ as well as for _. Try to avoid matching #define for
14481 N_ and _.
14482 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14483 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14484 * src/scan-gram.l: Revamp regular expressions so that " and '
14485 do not confuse xgettext.
14486
14487 * src/struniq.h (struniq_new): Do not declare the return type
14488 to be 'const'; this violates the C standard.
14489 * src/struniq.c (struniq_new): Likewise.
14490
14491 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14492
14493 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14494 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14495 linker.
14496
14497 2002-11-12 Akim Demaille <akim@epita.fr>
14498
14499 * Makefile.maint: Sync with Autoconf:
14500 (local_updates): New.
14501
14502 2002-11-12 Akim Demaille <akim@epita.fr>
14503
14504 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14505
14506 2002-11-12 Akim Demaille <akim@epita.fr>
14507
14508 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14509 locations.
14510
14511 2002-11-12 Akim Demaille <akim@epita.fr>
14512
14513 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14514 not yyvalue.
14515
14516 2002-11-12 Akim Demaille <akim@epita.fr>
14517
14518 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14519 Use it to test the GLR parser.
14520
14521 2002-11-12 Akim Demaille <akim@epita.fr>
14522
14523 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14524 defines it.
14525 * data/glr.c (yystos): New.
14526 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14527 (YYDSYMPRINT): New.
14528 (yyval): Don't define it, it is handled via M4.
14529 (yyrecoverParseError): Free verbosely the discarded symbols.
14530 * data/yacc.c (yysymprint): Remove, rather...
14531 (b4_yysymprint_generate): invoke.
14532 * data/c.m4 (b4_yysymprint_generate): New.
14533 Accept pointers as arguments, as opposed to the version from
14534 yacc.c.
14535 (b4_yydestruct_generate): Likewise.
14536 * tests/cations.at (Printers and Destructors): Use Bison directives
14537 instead of CPP macros.
14538 Don't rely on internal details.
14539
14540 2002-11-12 Akim Demaille <akim@epita.fr>
14541
14542 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14543 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14544 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14545 it against YYEMPTY and so forth), work on yytoken (i.e., set
14546 it to YYEMPTY etc.).
14547 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14548 (b4_symbol_actions): Remove.
14549 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14550 for 0, end-of-input.
14551
14552 2002-11-12 Akim Demaille <akim@epita.fr>
14553
14554 * doc/bison.texinfo (Destructor Decl): New.
14555
14556 2002-11-12 Akim Demaille <akim@epita.fr>
14557
14558 * src/tables.c (tables_generate): Use free for pointers that
14559 cannot be NULL, not XFREE.
14560 (pack_vector): Use assert, not fatal, for bound violations.
14561 * src/state.c (state_new): Likewise.
14562 * src/reader.c (reader): Likewise.
14563 * src/lalr.c (set_goto_map): Likewise.
14564 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
14565 the file name.
14566
14567 2002-11-12 Akim Demaille <akim@epita.fr>
14568
14569 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14570 Restore.
14571 * src/scan-gram.l (last_string): Is global to the file, not to
14572 yylex.
14573 * src/parse-gram.y (input): Don't append the epilogue here,
14574 (epilogue.opt): do it here, and free the scanner's obstack.
14575 * src/reader.c (epilogue_set): Rename as...
14576 (epilogue_augment): this.
14577 * data/c.m4 (b4_epilogue): Defaults to empty.
14578
14579 2002-11-12 Akim Demaille <akim@epita.fr>
14580
14581 * src/getargs.c (long_options): Remove duplicates.
14582 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14583 Remove.
14584 * doc/bison.rnh: Remove.
14585 * doc/bison.texinfo (VMS Invocation): Remove.
14586
14587 2002-11-12 Akim Demaille <akim@epita.fr>
14588
14589 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14590 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14591
14592 Use struniq for symbols.
14593
14594 * src/symtab.h (symbol_t): The tag member is a struniq.
14595 (symbol_type_set): Adjust.
14596 * src/symtab.c (symbol_new): Takes a struniq.
14597 (symbol_free): Don't free the tag member.
14598 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14599 (hash_compare_symbol, hash_symbol): these.
14600 Use the fact that tags as struniqs.
14601 (symbol_get): Use struniq_new.
14602 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14603 Returns a strniq.
14604 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14605 and type members are struniqs.
14606 * src/reader.c (get_merge_function)
14607 (grammar_current_rule_merge_set): Adjust.
14608 (TYPE, current_type): Are struniq.
14609
14610 Use struniq for file names.
14611
14612 * src/files.h, src/files.c (infile): Split into...
14613 (grammar_file, current_file): these.
14614 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14615 * src/reduce.c (reduce_print): Likewise.
14616 * src/getargs.c (getargs): Likewise.
14617 * src/complain.h, src/complain.c: Likewise.
14618 * src/main.c (main): Call struniqs_new early enough to use it for
14619 file names.
14620 Don't free the input file name.
14621
14622 2002-11-12 Akim Demaille <akim@epita.fr>
14623
14624 * src/symtab.c (symbol_free): Remove dead deactivated code:
14625 type_name are properly removed.
14626 Don't use XFREE to free items that cannot be NULL.
14627 * src/struniq.h, src/struniq.c: New.
14628 * src/main.c (main): Initialize/free struniqs.
14629 * src/parse-gram.y (%union): Add astruniq member.
14630 (yyprint): Adjust.
14631 * src/scan-gram.l (<{tag}>): Return a struniq.
14632 Free the obstack bit that used to store it.
14633 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14634
14635 2002-11-11 Paul Eggert <eggert@twinsun.com>
14636
14637 Revamp to fix many (but not all) of the C- and M4-related quoting
14638 problems. Among other things, this fixes the Bison bug reported
14639 by Jan Hubicka when processing the Bash grammar; see:
14640 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
14641
14642 Use new @ escapes consistently. Represent brackets with @{ and @}
14643 rather than @<:@ and @:>@, since this works a bit better with dumb
14644 editors like vi. Represent @ with @@, since @ is now consistently
14645 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14646 __ofile__, to avoid unexpected expansions. Similarly, use @output
14647 rather than #output.
14648
14649 * data/c.m4 (b4_copyright): Omit file name from comment, since
14650 the file name could contain "*/".
14651 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14652 be quoted. All uses changed.
14653
14654 * data/glr.c: Use new @ escapes consistently.
14655 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14656 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14657 Remove, since they couldn't handle arbitrary characters in file
14658 names.
14659 * data/lalr1.cc: Likewise.
14660 * data/yacc.c: Likewise.
14661
14662 * src/files.c (output_infix): Remove; all uses removed.
14663 * src/files.h: Likewise.
14664
14665 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14666 mishandled funny characters in file names, and anyway it isn't
14667 needed any more.
14668 * data/yacc.c: Likewise.
14669 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14670
14671 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14672 * data/yacc.c: Likewise.
14673
14674 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14675 strings now.
14676 (muscle_init): Quote filename as a C string.
14677 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14678 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14679 * src/output.c (escaped_file_name_output): New function.
14680 (prepare_symbols): Quote tokens for M4.
14681 (prepare): Don't insert output_infix, output_prefix,
14682 output_parser_name, output_header_name; this is now down by scan-skel.
14683 Insert skeleton as a C string.
14684
14685 * src/output.c (user_actions_output, symbol_destructors_output,
14686 symbol_printers_output): Quote filenames for C and M4.
14687 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14688
14689 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14690 escapes other than \\ and \'; this simplifies the code.
14691 (<SC_STRING>): Likewise, for \\ and \".
14692 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14693 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14694 Use new escapes @{ and @} for [ and ].
14695
14696 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14697 them with auto vars.
14698 Switch to new escape scheme, where @ is the escape character uniformly.
14699 Abort if a stray escape character is found. Avoid unbounded input
14700 buffer when parsing non-escaped text.
14701
14702 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14703 __oline__, #output, $@, and @{ do not have unintended meanings.
14704
14705 2002-11-09 Paul Eggert <eggert@twinsun.com>
14706
14707 Fix the test failure due to GCC warnings described in
14708 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
14709 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14710 evaluate to 0 if it's impossible for NINF to be in the respective
14711 table.
14712 (yygetLRActions, yyrecoverParseError): Use them.
14713
14714 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14715 counted in the token inserted at end of file. Now takes
14716 location_t *, not location_t, so that the location can be
14717 adjusted. All uses changed.
14718
14719 * tests/regression.at (Invalid inputs): Adjust wording in
14720 diagnostic to match the new behavior.
14721
14722 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14723 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14724 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14725 abort ();'. This reduces the runtime of the "Many lookaheads"
14726 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14727 GCC 3.2.
14728
14729 2002-11-07 Paul Eggert <eggert@twinsun.com>
14730
14731 * src/parse-gram.y (CHARACTER): Remove unused token.
14732 All uses removed.
14733
14734 * src/scan-gram.l: Remove stack option. We no longer use the
14735 stack, since the stack was never deeper than 1; instead, use the
14736 new auto var c_context to record the stacked value.
14737
14738 Remove nounput option. At an unexpected end of file, we now unput
14739 the minimal input necessary to end cleanly; this simplifies the
14740 code.
14741
14742 Avoid unbounded token sizes where this is easy.
14743
14744 (unexpected_end_of_file): New function.
14745 Use it to systematize the error message on unexpected EOF.
14746 (last-string): Now auto, not static.
14747 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14748 (scanner_last_string_free): Remove; not used.
14749 (percent_percent_count): Move decl to just before use.
14750 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14751 not the (never otherwised-used) CHARACTER.
14752
14753 2002-11-07 Akim Demaille <akim@epita.fr>
14754
14755 Let yyerror always receive the msg as last argument, so that
14756 yyerror can be variadic.
14757
14758 * data/yacc.c (b4_yyerror_args): New.
14759 Use it when calling yyerror.
14760 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14761 Use it when calling yyerror.
14762 * doc/bison.texinfo (Error Reporting): Adjust.
14763 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14764 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14765
14766 2002-11-06 Akim Demaille <akim@epita.fr>
14767
14768 #line should have quoted strings.
14769 Ideally, this should be done by m4_quotearg.
14770
14771 * src/scan-skel.l: Include quotearg.h.
14772 Quote __ofile__.
14773 * src/output.c (symbol_printers_output)
14774 (symbol_destructors_output): Quote the file name.
14775
14776 2002-11-06 Akim Demaille <akim@epita.fr>
14777
14778 * tests/regression.at (Invalid inputs): Adjust to the recent
14779 messages.
14780
14781 2002-11-06 Akim Demaille <akim@epita.fr>
14782
14783 Restore --no-lines.
14784 Reported by Jim Kent.
14785
14786 * data/c.m4 (b4_syncline): New.
14787 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14788 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14789 * src/output.c (user_actions_output): Likewise.
14790 (prepare): Define 'b4_synclines_flag'.
14791 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
14792
14793 2002-11-06 Akim Demaille <akim@epita.fr>
14794
14795 * src/main.c (main): Free `infile'.
14796 * src/scan-gram.l (handle_syncline): New.
14797 Recognize `#line'.
14798 * src/output.c (user_actions_output, symbol_destructors_output)
14799 (symbol_printers_output): Use the location's file name, not
14800 infile.
14801 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14802
14803 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14804
14805 * src/tables.c (matching_state): Don't allow states to match if
14806 either has GLR conflict entries.
14807
14808 2002-11-05 Paul Eggert <eggert@twinsun.com>
14809
14810 * src/scan-gram.l: Use more accurate diagnostics, e.g.
14811 "integer out of range" rather than "invalid value".
14812 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
14813 accordingly.
14814
14815 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
14816 Also, remove one static variable in the scanner.
14817
14818 * src/scan-gram.l (braces_level): Now auto, not static.
14819 Initialize to zero if the compiler is being picky.
14820 (INITIAL): Clear braces_level instead of incrementing it.
14821 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
14822 as POSIX 1003.1-2001 requires.
14823 * src/system.h (IF_LINT): New macro, taken from coreutils.
14824 * configure.ac: Define "lint" if --enable-gcc-warnings.
14825
14826 2002-11-05 Akim Demaille <akim@epita.fr>
14827
14828 * src/scan-gram.l: When it starts with `%', complain about the
14829 whole directive, not just that `invalid character: %'.
14830
14831 2002-11-04 Akim Demaille <akim@epita.fr>
14832
14833 * Makefile.maint: Update from Autoconf.
14834 (update, cvs-update, po-update, do-po-update): New.
14835
14836 2002-11-04 Akim Demaille <akim@epita.fr>
14837
14838 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
14839 and yyerror.
14840 Have yyerror `use' its arguments.
14841 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
14842 returns true when location & yacc & pure & parse-param.
14843 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
14844
14845 2002-11-04 Akim Demaille <akim@epita.fr>
14846
14847 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
14848 clashes.
14849 * src/scan-gram.l: Use [\'] instead of ['] to pacify
14850 font-lock-mode.
14851 Use complain_at.
14852 Use quote, not quote_n since LOCATION_PRINT no longer uses the
14853 slot 0.
14854
14855 2002-11-03 Paul Eggert <eggert@twinsun.com>
14856
14857 * src/reader.c (get_merge_function, grammar_current_rule_check):
14858 Use consistent diagnostics for reporting type name clashes.
14859 Quote the types with <>, for consistency with Yacc.
14860 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
14861
14862 2002-11-03 Akim Demaille <akim@epita.fr>
14863
14864 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
14865 New.
14866 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
14867 (b4_parse_param): Remove.
14868 Use b4_identification.
14869 Propagate b4_pure_args where needed to pass them to yyerror.
14870 * data/glr.m4 (b4_parse_param): Remove.
14871 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
14872 (b4_lpure_formals): New.
14873 Use b4_identification.
14874 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
14875 b4_user_formals and b4_user_args.
14876 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
14877 (yyreportAmbiguity): When using a pure parser, also need
14878 the location, and the parse-params.
14879 Adjust callers.
14880 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
14881 When using a pure parser, also need the parse-params.
14882 Adjust callers.
14883 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
14884 (%pure-parser + %parse-param) LALR and GLR parsers.
14885 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
14886 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
14887 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
14888 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
14889 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
14890 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
14891 * doc/bison.texinfo: Untabify the whole file.
14892 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
14893 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
14894 (Error Reporting): Adjust to these new directives.
14895 Document %error-verbose, deprecate YYERROR_VERBOSE.
14896
14897 2002-11-03 Akim Demaille <akim@epita.fr>
14898
14899 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
14900 AT_CHECK_CALC_GLR invocations to use % directives, instead of
14901 command line options.
14902 * tests/cxx-type.at: Formatting changes.
14903
14904 2002-11-03 Paul Eggert <eggert@twinsun.com>
14905
14906 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
14907 to count columns correctly, and to check for invalid inputs.
14908
14909 Use mbsnwidth to count columns correctly. Account for tabs, too.
14910 Include mbswidth.h.
14911 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
14912 (extend_location): New function.
14913 (YY_LINES): Remove.
14914
14915 Handle CRLF in C code rather than in Lex code.
14916 (YY_INPUT): New macro.
14917 (no_cr_read): New function.
14918
14919 Scan UCNs, even though we don't fully handle them yet.
14920 (convert_ucn_to_byte): New function.
14921
14922 Handle backslash-newline correctly in C code.
14923 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
14924 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
14925 all uses changed.
14926 (tag, splice): New EREs. Do not allow NUL or newline in tags.
14927 Use {splice} wherever C allows backslash-newline.
14928 YY_STEP after space, newline, vertical-tab.
14929 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
14930
14931 (letter, id): Don't assume ASCII; e.g., spell out a-z.
14932
14933 ({int}, handle_action_dollar, handle_action_at): Check for integer
14934 overflow.
14935
14936 (YY_STEP): Omit trailing semicolon, so that it's more like C.
14937
14938 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
14939 as well as \000. Check for UCHAR_MAX, not 255.
14940 Allow \x with an arbitrary positive number of digits, as in C.
14941 Check for overflow here.
14942 Allow \? and UCNs, for compatibility with C.
14943
14944 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
14945 with quote slot used by complain_at.
14946
14947 * tests/input.at: Add tests for backslash-newline, m4 quotes
14948 in symbols, long literals, and funny escapes in strings.
14949
14950 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
14951 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
14952 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
14953 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
14954 * m4/mbswidth.m4: New file, from GNU coreutils.
14955
14956 * doc/bison.texinfo (Grammar Outline): Document // comments.
14957 (Symbols): Document that trigraphs have no special meaning in Bison,
14958 nor is backslash-newline allowed.
14959 (Actions): Document that trigraphs have no special meaning.
14960
14961 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
14962 no longer used.
14963
14964 2002-11-02 Paul Eggert <eggert@twinsun.com>
14965
14966 * src/reader.c: Don't include quote.h; not needed.
14967 (get_merge_function): Reword warning to be consistent with
14968 type clash diagnostic in grammar_current_rule_check.
14969
14970 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
14971 bug in trigraph handling.
14972
14973 * src/output.c (prepare_symbols): When printing token names,
14974 escape "[" as "@<:@" and likewise for "]".
14975
14976 * src/system.h (errno): Remove declaration, as we are now
14977 assuming C89 or better, and C89 guarantees errno.
14978
14979 2002-10-30 Paul Eggert <eggert@twinsun.com>
14980
14981 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
14982 Check for close failures.
14983 * src/files.h (xfclose): Return void, not int, since it always
14984 returned zero.
14985 * src/files.c (xfclose): Likewise. Report I/O error if ferror
14986 indicates one.
14987 * src/output.c (output_skeleton): Use xfclose rather than fclose
14988 and ferror. xfclose now checks ferror.
14989
14990 * data/glr.c (YYLEFTMOST_STATE): Remove.
14991 (yyreportTree): Use a stack-based leftmost state. This avoids
14992 our continuing battles with bogus warnings about initializers.
14993
14994 2002-10-30 Akim Demaille <akim@epita.fr>
14995
14996 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
14997 #if.
14998
14999 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15000
15001 * tests/glr-regr1.at: New test for reported regressions.
15002 * tests/testsuite.at: Add glr-regr1.at test.
15003 * tests/Makefile.am: Add glr-regr1.at test.
15004
15005 2002-10-24 Paul Eggert <eggert@twinsun.com>
15006
15007 Version 1.75a.
15008
15009 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
15010 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
15011 we use malloc. Don't assume 'A' through 'Z' are contiguous.
15012 Don't assume strdup exists; POSIX says its an XSI extension.
15013 Check for buffer overflow on input.
15014
15015 2002-10-24 Akim Demaille <akim@epita.fr>
15016
15017 * src/output.c (output_skeleton): Don't disable M4sugar comments
15018 too soon: it results in comments being expanded.
15019 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
15020 first output.
15021
15022 2002-10-24 Akim Demaille <akim@epita.fr>
15023
15024 * data/yacc.c (m4_int_type): New.
15025 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
15026 char' as only yacc.c wants K&R portability.
15027 * data/glr.c (yysigned_char): Remove.
15028 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15029 Reported by Quoc Peyrot.
15030
15031 2002-10-23 Paul Eggert <eggert@twinsun.com>
15032
15033 * src/main.c (main): With --trace=time, report times even if a
15034 non-fatal error occurs. Formerly, the times were reported in some
15035 such cases but not in others.
15036 * src/reader.c (reader): Just return if a complaint has been issued,
15037 instead of exiting, so that 'main' can report times.
15038
15039 2002-10-22 Akim Demaille <akim@epita.fr>
15040
15041 * src/system.h: Include sys/types.
15042 Reported by Bert Deknuydt.
15043
15044 2002-10-23 Paul Eggert <eggert@twinsun.com>
15045
15046 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15047 Suggested by Art Haas.
15048
15049 2002-10-22 Paul Eggert <eggert@twinsun.com>
15050
15051 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15052 decl; not needed any more.
15053 * src/main.c (main): Use return to exit, undoing yesterday's change.
15054 The last OS that we could find where this wouldn't work is
15055 SunOS 3.5, and that's too old to worry about now.
15056
15057 * data/glr.c (struct yyltype): Define members even when not
15058 doing locations. This is more consistent with yacc.c, and it
15059 works around the following bug reports:
15060 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15061 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
15062
15063 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15064 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15065 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15066
15067 2002-10-22 Akim Demaille <akim@epita.fr>
15068
15069 * data/README: New.
15070
15071 2002-10-21 Paul Eggert <eggert@twinsun.com>
15072
15073 Be consistent about 'bool'; the old code used an enum in one
15074 module and an int in another, and this violates the C standard.
15075 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15076 * configure.ac (AC_HEADER_STDBOOL): Add.
15077 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15078 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15079 * src/symtab.c (hash_compare_symbol_t): Likewise.
15080 * src/system.h (bool, false, true): Use a definition consistent
15081 with ../lib/hash.c. All uses changed.
15082
15083 * src/complain.c (warning_issued): Renamed from warn_message_count,
15084 so that we needn't worry about integer overflow (!).
15085 Now of type bool. All uses changed.
15086 (complaint_issued): Renamed from complain_message_count; likewise.
15087
15088 * src/main.c (main): Use exit to exit with failure.
15089
15090 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15091 rather than 1 and 0.
15092 * src/main.c (main): Likewise.
15093 * src/getargs.c (getargs): Likewise.
15094 * src/reader.c (reader): Likewise.
15095
15096 * src/getarg.c (getargs): Remove duplicate code for
15097 "Try `bison --help'".
15098
15099 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15100 What was that "2" for?
15101
15102 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15103 * src/getargs.c (usage): Likewise.
15104
15105 * src/getargs.c (getargs): When there are too few operands, report
15106 the last one. When there are too many, report the first extra
15107 one. This is how diffutils does it.
15108
15109 2002-10-20 Paul Eggert <eggert@twinsun.com>
15110
15111 Remove K&R vestiges.
15112 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
15113 * src/complain.c (VA_START): Remove. Assume prototypes.
15114 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
15115 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
15116 fatal): Assume prototypes.
15117 * src/complain.h: Assume prototypes.
15118 * src/system.h (PARAMS): Remove.
15119 Include <limits.h> unconditionally, since it's guaranteeed even
15120 for a freestanding C89 compiler.
15121 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
15122 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
15123
15124 2002-10-20 Akim Demaille <akim@epita.fr>
15125
15126 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
15127 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
15128 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
15129 (yyresolveStates, yyresolveAction, yyresolveStack)
15130 (yyprocessOneStack): Use them.
15131 (yy_reduce_print): New.
15132 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
15133
15134 2002-10-20 Akim Demaille <akim@epita.fr>
15135
15136 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
15137 arguments and output `void'.
15138 (b4_c_function): Rename as...
15139 (b4_c_function_def): this.
15140 (b4_c_function_decl, b4_c_ansi_function_def)
15141 (b4_c_ansi_function_decl): New.
15142 Change the interpretation of the arguments: before `int, foo', now
15143 `int foo, foo'.
15144 * data/yacc.c (yyparse): Prototype and define thanks to these.
15145 Adjust b4_c_function_def uses.
15146 * data/glr.c (yyparse): Likewise, but ANSI only.
15147
15148 2002-10-20 Akim Demaille <akim@epita.fr>
15149
15150 * src/output.c (prepare): Move the definition of `tokens_number',
15151 `nterms_number', `undef_token_number', `user_token_number_max'
15152 to...
15153 (prepare_tokens): Here.
15154 (prepare_tokens): Rename as...
15155 (prepare_symbols): this.
15156 (prepare): Move the definition of `rules_number' to...
15157 (prepare_rules): here.
15158 (prepare): Move the definition of `last', `final_state_number',
15159 `states_number' to...
15160 (prepare_states): here.
15161 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
15162
15163 2002-10-20 Akim Demaille <akim@epita.fr>
15164
15165 * src/tables.h, src/tables.c, src/output.c: Comment changes.
15166
15167 2002-10-20 Akim Demaille <akim@epita.fr>
15168
15169 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
15170 * data/c.m4: here.
15171
15172 2002-10-20 Akim Demaille <akim@epita.fr>
15173
15174 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
15175 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
15176 `pair'.
15177 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
15178 `name' to...
15179 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
15180 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
15181 These.
15182
15183 2002-10-19 Paul Eggert <eggert@twinsun.com>
15184
15185 Do not create a temporary file, as that involves security and
15186 cleanup headaches. Instead, use a pair of pipes.
15187 Derived from a suggestion by Florian Krohm.
15188 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
15189 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
15190 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
15191 (BISON_PREREQ_SUBPIPE): Add.
15192 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
15193 Add subpipe.h, subpipe.c.
15194 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
15195 * po/POTFILES.in: Add lib/subpipe.c.
15196 * src/output.c: Include "subpipe.h".
15197 (m4_invoke): Remove decl.
15198 (scan_skel): New decl.
15199 (output_skeleton): Use pipe rather than temporary file for m4 input.
15200 Check that m4sugar.m4 is readable, to avoid deadlock.
15201 Check for pipe I/O error.
15202 * src/scan-skel.l (readpipe): Remove decl.
15203 (scan_skel): New function, to be used in place of m4_invoke.
15204 Read from stream rather than file.
15205
15206 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
15207 float, as this generates a warning on Solaris 8 + GCC 3.2 with
15208 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
15209 this generates a more-accurate value anyway.
15210
15211 * lib/timevar.c (timervar_accumulate): Rename locals to
15212 avoid confusion with similarly-named more-global.
15213 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
15214
15215 * src/output.c (prepare): Use xstrdup to convert char const *
15216 to char *, to avoid GCC warning.
15217
15218 2002-10-19 Akim Demaille <akim@epita.fr>
15219
15220 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
15221 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
15222 Use them to have `calc.y' ready for %pure-parser.
15223 * data/yacc.c (YYLEX): Pass a yylex return type to
15224 b4_c_function_call.
15225
15226 2002-10-19 Akim Demaille <akim@epita.fr>
15227
15228 Prototype support of %lex-param and %parse-param.
15229
15230 * src/parse-gram.y: Add the definition of the %lex-param and
15231 %parse-param tokens, plus their rules.
15232 Drop the `_' version of %glr-parser.
15233 Add the "," token.
15234 * src/scan-gram.l (INITIAL): Scan them.
15235 * src/muscle_tab.c: Comment changes.
15236 (muscle_insert, muscle_find): Rename `pair' as `probe'.
15237 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
15238 (muscle_entry_s): The `value' member is no longer const.
15239 Adjust all dependencies.
15240 * src/muscle_tab.c (muscle_init): Adjust: use
15241 MUSCLE_INSERT_STRING.
15242 Initialize the obstack earlier.
15243 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
15244 (muscle_pair_list_grow): New.
15245 * data/c.m4 (b4_c_function_call, b4_c_args): New.
15246 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
15247 * tests/calc.at: Use %locations, not --locations.
15248 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
15249
15250 2002-10-19 Akim Demaille <akim@epita.fr>
15251
15252 * src/getargs.c (usage): Take status as argument and exit
15253 accordingly.
15254 Report the traditional `Try ... --help' message when status != 0.
15255 (usage, version): Don't take a FILE * as arg, it is pointless.
15256 (getargs): When there is an incorrect number of arguments, make it
15257 an error, and report it GNUlically thanks to `usage ()'.
15258
15259 2002-10-18 Paul Eggert <eggert@twinsun.com>
15260
15261 * data/glr.c (yyreportParseError): Don't assume that sprintf
15262 yields the length of the printed string, as this is not true
15263 on SunOS 4.1.4. Reported by Peter Klein.
15264
15265 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15266 * tests/conflicts.at (%nonassoc and eof): Likewise.
15267 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15268
15269 2002-10-17 Akim Demaille <akim@epita.fr>
15270
15271 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15272 * src/getargs.c (trace_types, trace_args): Adjust.
15273 * src/reader.c (grammar_current_rule_prec_set)
15274 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15275 Standardize error messages.
15276 And s/@prec/%prec/!
15277 (reader): Use trace_flag to enable scanner/parser debugging,
15278 instead of an adhoc scheme.
15279 * src/scan-gram.l: Remove trailing debugging code.
15280
15281 2002-10-16 Paul Eggert <eggert@twinsun.com>
15282
15283 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15284 MUSCLE_TAB_H.
15285
15286 * NEWS: Officially drop support for building Bison with K&R C,
15287 since it didn't work anyway and it's not worth worrying about.
15288 * Makefile.maint (wget_files): Remove ansi2knr.c.
15289 (ansi2knr.c-url_prefix): Remove.
15290 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15291 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15292 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15293
15294 2002-10-15 Paul Eggert <eggert@twinsun.com>
15295
15296 Stop using the "enum_" trick for K&R-style function definitions;
15297 it confused me, and I was the author! Instead, assume that people
15298 who want to use K&R C compilers (when using these modules in GCC,
15299 perhaps?) will run ansi2knr.
15300
15301 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15302 All uses of "enum_" changed to "enum ".
15303 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15304 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15305
15306 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15307 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15308 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15309 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15310 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15311 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15312 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15313 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15314 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15315 Use function prototypes; this removes the need for declaring
15316 static functions simply to provide their prototypes.
15317 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15318 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15319 bitset_count_, bitset_create, bitset_dump, bitset_first,
15320 bitset_free, bitset_init, bitset_last, bitset_next,
15321 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15322 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15323 bitset_print, bitset_release_memory, bitset_toggle_,
15324 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15325 debug_bitset): Likewise.
15326 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15327 * lib/bitset_stats.c (bitset_log_histogram_print,
15328 bitset_percent_histogram_print, bitset_stats_and,
15329 bitset_stats_and_cmp, bitset_stats_and_or,
15330 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15331 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15332 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15333 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15334 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15335 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15336 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15337 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15338 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15339 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15340 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15341 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15342 bitset_stats_zero): Likewise.
15343 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15344 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15345 bitsetv_dump, debug_bitsetv): Likewise.
15346 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15347 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15348 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15349 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15350 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15351 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15352 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15353 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15354 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15355 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15356 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15357 Likewise.
15358 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15359 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15360 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15361 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15362 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15363 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15364 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15365 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15366 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15367 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15368 lbitset_xor_cmp, lbitset_zero): Likewise.
15369
15370 2002-10-14 Akim Demaille <akim@epita.fr>
15371
15372 Version 1.75.
15373
15374 2002-10-14 Akim Demaille <akim@epita.fr>
15375
15376 * tests/Makefile.am (maintainer-check-posix): New.
15377
15378 2002-10-14 Akim Demaille <akim@epita.fr>
15379
15380 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15381 member.
15382
15383 2002-10-14 Akim Demaille <akim@epita.fr>
15384
15385 * src/tables.c (table_ninf_remap): base -> tab.
15386 Reported by Matt Rosing.
15387
15388 2002-10-14 Paul Eggert <eggert@twinsun.com>
15389
15390 * tests/action.at, tests/calc.at, tests/conflicts.at,
15391 tests/cxx-type.at, tests/headers.at, tests/input.at,
15392 tests/regression.at, tests/synclines.at, tests/torture.at:
15393 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15394 so that the tests still work even if POSIXLY_CORRECT is set.
15395 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
15396
15397 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15398 for portability to K&R hosts. Fix typo: signed char is guaranteed
15399 only to 127, not to 128.
15400 * data/glr.c (yysigned_char): New type.
15401 * data/yacc.c (yysigned_char): Likewise.
15402 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15403
15404 2002-10-13 Paul Eggert <eggert@twinsun.com>
15405
15406 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15407 true due to limited range of data type" warning from GCC.
15408
15409 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15410 by wrapping enum yytokentype's definition inside #ifndef
15411 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15412
15413 2002-10-13 Akim Demaille <akim@epita.fr>
15414
15415 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15416 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15417
15418 2002-10-13 Akim Demaille <akim@epita.fr>
15419
15420 * Makefile.maint: Update from Autoconf 2.54.
15421 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15422
15423 2002-10-13 Akim Demaille <akim@epita.fr>
15424
15425 * src/print.c (print_state): Separate the list of solved conflicts
15426 from the other items.
15427 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15428
15429 2002-10-13 Akim Demaille <akim@epita.fr>
15430
15431 Let nondeterministic skeletons be usable with deterministic
15432 tables.
15433
15434 With the patch, GAWK compiled by GCC without -O2 passes its test
15435 suite using a GLR parser driven by LALR tables. It fails with -O2
15436 because `struct stat' gives two different answers on my machine:
15437 88 (definition of an auto var) and later 96 (memset on this var).
15438 Hence the stack is badly corrumpted. The headers inclusion is to
15439 blame: if I move the awk.h inclusion before GLR's system header
15440 inclusion, the two struct stat have the same size.
15441
15442 * src/tables.c (pack_table): Always create conflict_table.
15443 (token_actions): Always create conflict_list.
15444 * data/glr.c (YYFLAG): Remove, unused.
15445
15446 2002-10-13 Akim Demaille <akim@epita.fr>
15447
15448 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15449 (O0FLAGS): New.
15450 (VALGRIND, GXX): New.
15451 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15452 * tests/bison.in: Run $PREBISON a pre-command.
15453 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15454 (maintainer-check-g++): New.
15455 * Makefile.am (maintainer-check): New.
15456
15457 2002-10-13 Akim Demaille <akim@epita.fr>
15458
15459 * data/glr.c: Formatting changes.
15460 Tweak some trace messages to match yacc.c's.
15461
15462 2002-10-13 Akim Demaille <akim@epita.fr>
15463
15464 GLR parsers sometimes raise parse errors instead of performing the
15465 default reduction.
15466 Reported by Charles-Henry de Boysson.
15467
15468 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
15469 check the length of the traces when %glr.
15470 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15471 GLR's traces.
15472 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15473 Test GLR parsers.
15474 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15475 (yyltype): Remove the yy prefix from the member names.
15476 (yytable): Complete its comment.
15477 (yygetLRActions): Map error action number from YYTABLE from
15478 YYTABLE_NINF to 0.
15479 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15480 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15481 not satisfying as we could compare an YYACTION computed from
15482 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15483 only value for error actions.
15484 (yyreportParseError): In verbose parse error messages, don't issue
15485 `error' in the list of expected tokens.
15486 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15487 next action to perform to match glr.c's decoding.
15488 (yytable): Complete its comment.
15489
15490 2002-10-13 Paul Eggert <eggert@twinsun.com>
15491
15492 Fix problem reported by Henrik Grubbstroem in
15493 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
15494 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15495 because the Bison parser reads the second action before reducing
15496 the first one.
15497 * src/scan-gram.l (rule_length): New static var.
15498 Use it to keep track of the rule length in the scanner, since
15499 we can't expect the parser to be in lock-step sync with the scanner.
15500 (handle_action_dollar, handle_action_at): Use this var.
15501 * tests/actions.at (Exotic Dollars): Test for the problem.
15502
15503 2002-10-12 Paul Eggert <eggert@twinsun.com>
15504
15505 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15506 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15507 Include <sys/time.h> when checking for clock_t and struct tms.
15508 Use same include order as source.
15509 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
15510 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
15511
15512 * lib/timevar.c: Update copyright date and clarify comments.
15513 (get_time) [IN_GCC]: Keep the GCC version for reference.
15514
15515 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15516 GCC version as of today, then merge Bison's changes.
15517 Change "GCC" to "Bison" in copyright notice. timevar.def's
15518 author is Akim, so change that too.
15519
15520 * src/reader.c (grammar_current_rule_check):
15521 Don't worry about the default action if $$ is untyped.
15522 Prevents bogus warnings reported by Jim Gifford in
15523 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
15524
15525 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15526 * data/glr.c, data/lalr1.cc, data/yacc.c:
15527 Output token definitions before the first part of user declarations.
15528 Fixes compatibility problem reported by Jim Gifford for kbd in
15529 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
15530
15531 2002-10-11 Paul Eggert <eggert@twinsun.com>
15532
15533 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15534 (yyparse): here. This undoes some of the 2002-07-25 change.
15535 Compatibility problem reported by Ralf S. Engelschall with
15536 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15537
15538 2002-10-11 Akim Demaille <akim@epita.fr>
15539
15540 * tests/regression.at Characters Escapes): New.
15541 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15542 characters.
15543 Reported by Jan Nieuwenhuizen.
15544
15545 2002-10-11 Akim Demaille <akim@epita.fr>
15546
15547 * po/id.po: New.
15548
15549 2002-10-10 Paul Eggert <eggert@twinsun.com>
15550
15551 Portability fixes for bitsets; this also avoids several GCC
15552 warnings.
15553
15554 * lib/abitset.c: Include <stddef.h>, for offsetof.
15555 * lib/lbitset.c: Likewise.
15556
15557 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15558 properly for vectors of objects. Do not assume that adding a
15559 header size to a multiple of a word size yields a value that is
15560 properly aligned for the whole union.
15561 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15562
15563 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15564 unique names for structures.
15565 * lib/ebitset.c (ebitset_bytes): Likewise.
15566 * lib/lbitset.c (lbitset_bytes): Likewise.
15567
15568 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15569 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15570 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15571 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15572 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15573 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15574 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15575 to improve the type-checking that GCC can do.
15576 * lib/bitset.c (bitset_op4_cmp): Likewise.
15577 * lib/bitset_stats.c (bitset_stats_count,
15578 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15579 bitset_stats_copy, bitset_stats_disjoint_p,
15580 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15581 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15582 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15583 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15584 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15585 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15586 bitset_stats_or_and_cmp): Likewise.
15587 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15588 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15589 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15590 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15591
15592 * lib/abitset.h: Include bitset.h, not bbitset.h.
15593 * lib/ebitset.h: Likewise.
15594 * lib/lbitset.h: Likewise.
15595
15596 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15597 All instances of parameters of type enum bitset_opts are now of
15598 type enum_bitset_opts, to conform to the C Standard, and similarly
15599 for enum_bitset_type.
15600 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15601 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15602
15603 Do not use "struct bitset_struct" to mean different things in
15604 different modules. Not only is this confusing, it violates
15605 the C Standard, which requires that structure types in different
15606 modules must be compatible if one is to be passed to the other.
15607 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15608 All instances of "struct bitset_struct *" replaced with "bitset".
15609 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15610 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15611 struct lbitset_struct, struct bitset_stats_struct): New types.
15612 All uses of struct bitset_struct changed to union bitset_union,
15613 etc.
15614 * lib/abitset.c (struct abitset_struct, abitset,
15615 struct bitset_struct): Remove.
15616 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15617 struct bitset_struct): Remove.
15618 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15619 bitset_struct): Remove.
15620 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15621 Likewise.
15622
15623 Do not call a function of type T using a call that assumes the
15624 function is of a different type U. Standard C requires that a
15625 function must be called with a type that is compatible with its
15626 definition.
15627 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15628 New decls.
15629 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15630 New functions.
15631 * lib/ebitset.c (PFV): Remove.
15632 * lib/lbitset.c (PFV): Likewise.
15633 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15634 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15635 decls.
15636 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15637 (ebitset_vtable): Use them.
15638 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15639 lbitset_xor): New functions.
15640 (lbitset_vtable): Use them.
15641
15642 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15643 Declare.
15644
15645 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15646 GCC warning.
15647 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15648 Use offsetof, for simplicity.
15649
15650 2002-10-06 Paul Eggert <eggert@twinsun.com>
15651
15652 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15653 the same width as int. This reapplies a hunk of the 2002-08-12 patch
15654 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
15655 which was inadvertently undone by the 2002-09-30 patch.
15656 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15657 the same width as int.
15658
15659 2002-10-04 Paul Eggert <eggert@twinsun.com>
15660
15661 Version 1.50.
15662
15663 * configure.ac (AC_INIT), NEWS: Increment version number.
15664
15665 * doc/bison.texinfo: Minor spelling, grammar, and white space
15666 fixes.
15667 (Symbols): Mention that any negative value returned from yylex
15668 signifies end-of-input. Warn about negative chars. Mention
15669 the portable Standard C character set.
15670
15671 The GNU coding standard says CFLAGS and YFLAGS are reserved
15672 for the installer to set.
15673 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15674 * src/Makefile.am (AM_CFLAGS): Likewise.
15675 (AM_YFLAGS): Renamed from YFLAGS.
15676
15677 Fix some MAX and MIN problems.
15678 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15679 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15680 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15681 * src/reader.c (reader): Use it.
15682
15683 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15684 POSIX 1003.1-2001 has removed fgrep.
15685
15686 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15687
15688 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15689 interpreted as signed.
15690 * lib/ebitset.c (ebitset_list): Fix bug.
15691
15692 2002-10-01 Paul Eggert <eggert@twinsun.com>
15693
15694 More fixes for 64-bit hosts and large bitsets.
15695
15696 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15697 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15698 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15699 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15700 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15701 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15702 bitset_count_): Likewise.
15703 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15704 bitset_first, bitset_last): Likewise.
15705 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15706 bitset_stats_list_reverse, bitset_stats_size,
15707 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15708 Likewise.
15709 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15710 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15711 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15712 bitsetv_reflexive_transitive_closure): Likewise.
15713 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15714 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15715 Likewise.
15716 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15717 Likewise.
15718
15719 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15720 Use size_t, not unsigned int, to count bytes.
15721 * lib/abitset.h (abitset_bytes): Likewise.
15722 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15723 Likewise.
15724 * lib/bitset.h (bitset_bytes): Likewise.
15725 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15726 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15727 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15728 * lib/ebitset.c (ebitset_bytes): Likewise.
15729 * lib/ebitset.h (ebitset_bytes): Likewise.
15730 * lib/lbitset.c (lbitset_bytes): Likewise.
15731 * lib/lbitset.h (lbitset_bytes): Likewise.
15732
15733 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15734 abitset_subset_p, abitset_disjoint_p, abitset_and,
15735 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15736 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15737 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15738 abitset_or_and, abitset_or_and_cmp):
15739 Use bitset_windex instead of unsigned int.
15740 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15741 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15742 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15743 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15744 Likewise.
15745 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
15746
15747 * lib/bitset.c (bitset_print):
15748 Use proper printf formats for widths of integer types.
15749 * lib/bitset_stats.c (bitset_percent_histogram_print,
15750 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15751 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15752 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15753 * lib/lbitset.c (lbitset_bytes): Likewise.
15754
15755 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15756 BITSET_SIZE_MAX): New macros.
15757 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15758 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15759 to BITSET_WINDEX_MAX.
15760
15761 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15762 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15763 since we now return the bitset_bindex type (not int).
15764
15765 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15766 when computing sizes.
15767 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15768
15769 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15770 and avoid cast to unsigned.
15771
15772 2002-09-30 Akim Demaille <akim@epita.fr>
15773
15774 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15775 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15776 Updates from Michael Hayes.
15777
15778 2002-09-30 Art Haas <ahaas@neosoft.com>
15779
15780 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15781 invocations.
15782 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15783 defined.
15784
15785 2002-09-27 Akim Demaille <akim@epita.fr>
15786
15787 Version 1.49c.
15788
15789 2002-09-27 Akim Demaille <akim@epita.fr>
15790
15791 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15792 (Because of AC_LIBSOURCE).
15793
15794 2002-09-27 Akim Demaille <akim@epita.fr>
15795
15796 Playing with Autoscan.
15797
15798 * configure.ac: Remove the old LIBOBJ tweaks.
15799 (AC_REPLACE_FUNCS): Add strrchr and strtol.
15800 * lib/strrchr.c: New.
15801 * lib/strtol.c: New, from the Coreutils 4.5.1.
15802
15803 2002-09-27 Akim Demaille <akim@epita.fr>
15804
15805 Playing with Autoscan.
15806
15807 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
15808 * lib/Makefile.am (libbison_a_SOURCES): No longer include
15809 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
15810 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
15811 Coreutils 4.5.1.
15812
15813 2002-09-24 Akim Demaille <akim@epita.fr>
15814
15815 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
15816 (Frequently Asked Questions, Parser Stack Overflow): New.
15817
15818 2002-09-13 Akim Demaille <akim@epita.fr>
15819
15820 Playing with autoscan.
15821
15822 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
15823 * src/files.c (skeleton_find): Remove, unused.
15824 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
15825 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
15826
15827 2002-09-13 Akim Demaille <akim@epita.fr>
15828
15829 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
15830 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
15831
15832 2002-09-13 Akim Demaille <akim@epita.fr>
15833
15834 * configure.ac: Require 2.54.
15835 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
15836 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
15837 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
15838 Remove, provided by Autoconf macros.
15839
15840 2002-09-12 Akim Demaille <akim@epita.fr>
15841
15842 * m4/prereq.m4: Update, from Coreutils 4.5.1.
15843
15844 2002-09-12 Akim Demaille <akim@epita.fr>
15845
15846 * m4/prereq.m4: Update, from Fileutils 4.1.5.
15847 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
15848 Reported by Martin Mokrejs.
15849
15850 2002-09-10 Akim Demaille <akim@epita.fr>
15851
15852 * src/parse-gram.y: Associate a human readable string to each
15853 token type.
15854 * tests/regression.at (Invalid inputs): Adjust.
15855
15856 2002-09-10 Gary V. Vaughan <gary@gnu.org>
15857
15858 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
15859 with an Autoconf-2.5x style configure.ac.
15860
15861 2002-09-06 Paul Eggert <eggert@twinsun.com>
15862
15863 * doc/bison.texinfo (Conditions): Make explicit that the GPL
15864 exception applies only to yacc.c. This is a modification of a
15865 patch originally suggested by Akim Demaille.
15866
15867 2002-09-06 Akim Demaille <akim@epita.fr>
15868
15869 * data/c.m4 (b4_copyright): Move the GPL exception comment from
15870 here to...
15871 * data/yacc.c: here.
15872
15873 * data/lalr1.cc (struct yyltype): Don't define it, since we use
15874 LocationType.
15875 (b4_ltype): Default to yy::Location from location.hh.
15876
15877 2002-09-04 Jim Meyering <jim@meyering.net>
15878
15879 * data/yacc.c: Guard the declaration of yytoknum also with
15880 `#ifdef YYPRINT', so it is declared only when used.
15881
15882 2002-09-04 Akim Demaille <akim@epita.fr>
15883
15884 * configure.in: Rename as...
15885 * configure.ac: this.
15886 Bump to 1.49c.
15887
15888 2002-09-04 Akim Demaille <akim@epita.fr>
15889
15890 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
15891 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
15892 translate maintainer only messages.
15893
15894 2002-08-12 Paul Eggert <eggert@twinsun.com>
15895
15896 Version 1.49b.
15897
15898 * Makefile.am (SUBDIRS): Remove intl.
15899 (DISTCLEANFILES): Remove.
15900 * NEWS: Mention that GNU M4 is now required. Clarify what is
15901 meant by "larger grammars". Mention the pt_BR translation.
15902 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
15903 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
15904 Bump version from 0.11.2 to 0.11.5.
15905 (BISON_PREREQ_STAGE): Remove.
15906 (AM_GNU_GETTEXT): Use external gettext.
15907 (AC_OUTPUT): Remove intl/Makefile.
15908
15909 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
15910
15911 * data/glr.c: Include string.h, for strlen.
15912 (yyreportParseError): Use size_t for yysize.
15913 (yy_yypstack): No longer nested inside yypstates, as nested
15914 functions are not portable. Do not assume size_t is the
15915 same width as int.
15916 (yypstates): Do not assume that ptrdiff_t is the same width
15917 as int, and similarly for yyposn and YYINDEX.
15918
15919 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
15920
15921 * lib/Makefile.am (INCLUDES): Do not include from the intl
15922 directory, which has been removed.
15923 * src/Makefile.am (INCLUDES): Likewise.
15924
15925 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
15926 (bitsets_sources, additional_bitsets_sources, timevars_sources):
15927 New vars.
15928
15929 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
15930 * tests/Makefile.am (EXTRA_DIST): Likewise.
15931
15932 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
15933 Do not assume that bitset_windex is the same width as unsigned.
15934
15935 * lib/abitset.c (abitset_unused_clear): Do not assume that
15936 bitset_word is the same width as int.
15937 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
15938 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
15939 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
15940 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
15941 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
15942
15943 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
15944 portability to one's complement hosts!).
15945 * lib/ebitset.c (ebitset_op1): Likewise.
15946 * lib/lbitset.c (lbitset_op1): Likewise.
15947
15948 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
15949 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
15950 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
15951 Sync with fileutils.
15952 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
15953 lib/gettext.h: Sync with diffutils.
15954
15955 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
15956 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
15957
15958 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
15959 PROTOTYPES to check for prototypes, and "defined __STDC__" to
15960 check for void *.
15961
15962 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
15963 size_t; the old version tried to do this but casted improperly.
15964 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
15965 (bitset_test): Now returns int, not unsigned long.
15966
15967 * lib/bitset_stats.c: Include "gettext.h".
15968 (_): New macro.
15969 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
15970 name locals "index", as it generates unnecessary warnings on some
15971 hosts that have an "index" function.
15972
15973 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
15974 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
15975 they need translation.
15976 * src/LR0.c (state_list_append, new_itemsets, get_state,
15977 append_states, generate_states): Likewise.
15978 * src/assoc.c (assoc_to_string): Likewise.
15979 * src/closure.c (print_closure, set_firsts, closure): Likewise.
15980 * src/gram.c (grammar_dump): Likewise.
15981 * src/injections.c (injections_compute): Likewise.
15982 * src/lalr.c (lookaheads_print): Likewise.
15983 * src/relation.c (relation_transpose): Likewise.
15984 * src/scan-gram.l: Likewise.
15985 * src/tables.c (table_grow, pack_vector): Likewise.
15986
15987 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
15988 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
15989 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
15990 * m4/mbstate_t.m4: Sync with fileutils.
15991 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
15992
15993 * po/LINGUAS: Add pt_BR.
15994 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
15995 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
15996 lib/timevar.c.
15997 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
15998 manual recommends.
15999 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
16000
16001 * src/complain.c (strerror_r): Remove decl; not needed.
16002 (strerror): Use same pattern as ../lib/error.c.
16003
16004 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
16005
16006 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
16007
16008 * src/main.c (main): Cast result of bindtextdomain and textdomain
16009 to void, to avoid a GCC warning when --disable-nls is in effect.
16010
16011 * src/scan-gram.l: Use strings rather than escapes when possible,
16012 to minimize the number of warnings from xgettext.
16013 (handle_action_dollar, handle_action_at): Don't use isdigit,
16014 as it mishandles negative chars and it may not work as expected
16015 outside the C locale.
16016
16017 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
16018 this is a GCC extension and is not portable to other compilers.
16019
16020 * src/system.h (alloca): Use same pattern as ../lib/error.c.
16021 Do not include <ctype.h>; no longer needed.
16022 Do not include <malloc.h>; no longer needed (and generates
16023 warnings on OpenBSD 3.0).
16024
16025 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
16026 it's not portable.
16027
16028 * tests/regression.at: Do not use 'cc -c input.c -o input';
16029 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16030
16031 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16032 exit status as failure, not just exit status 1. Sun C exits
16033 with status 2 sometimes.
16034
16035 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16036 Use it for the two large tests.
16037
16038 2002-08-02 Akim Demaille <akim@epita.fr>
16039
16040 * src/conflicts.c (conflicts_output): Don't output rules never
16041 reduced here, since anyway that computation doesn't work.
16042 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16043 (rule_useless_p, rule_never_reduced_p): New.
16044 (grammar_rules_partial_print): Use a filter instead of a range.
16045 Display the title only if needed.
16046 (grammar_rules_print): Adjust.
16047 (grammar_rules_never_reduced_report): New.
16048 * src/tables.c (action_row): Move the computation of rules never
16049 reduced to...
16050 (token_actions): here.
16051 * src/main.c (main): Make the parser before making the report, so
16052 that rules never reduced are computed.
16053 Call grammar_rules_never_reduced_report.
16054 * src/print.c (print_results): Report rules never reduced.
16055 * tests/conflicts.at, tests/reduce.at: Adjust.
16056
16057 2002-08-01 Akim Demaille <akim@epita.fr>
16058
16059 Instead of attaching lookaheads and duplicating the rules being
16060 reduced by a state, attach the lookaheads to the reductions.
16061
16062 * src/state.h (state_t): Remove the `lookaheads',
16063 `lookaheads_rule' member.
16064 (reductions_t): Add a `lookaheads' member.
16065 Use a regular array for the `rules'.
16066 * src/state.c (reductions_new): Initialize the lookaheads member
16067 to 0.
16068 (state_rule_lookaheads_print): Adjust.
16069 * src/state.h, src/state.c (state_reductions_find): New.
16070 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16071 (count_rr_conflicts): Adjust.
16072 * src/lalr.c (LArule): Remove.
16073 (add_lookback_edge): Adjust.
16074 (state_lookaheads_count): New.
16075 (states_lookaheads_initialize): Merge into...
16076 (initialize_LA): this.
16077 (lalr_free): Adjust.
16078 * src/main.c (main): Don't free nullable and derives too early: it
16079 is used by --verbose.
16080 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16081
16082 2002-08-01 Akim Demaille <akim@epita.fr>
16083
16084 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16085 `rule_number_t**'.
16086 (set_derives, free_derives): Rename as...
16087 (derives_compute, derives_free): this.
16088 Adjust all dependencies.
16089 * src/nullable.c (set_nullable, free_nullable): Rename as...
16090 (nullable_compute, nullable_free): these.
16091 (rule_list_t): Store rule_t *, not rule_number_t.
16092 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16093 pointers, instead of their numbers.
16094 * src/main.c (main): Call nullable_free, and derives_free earlier,
16095 as they were lo longer used.
16096
16097 2002-08-01 Akim Demaille <akim@epita.fr>
16098
16099 * lib/timevar.c (get_time): Include children time.
16100 * src/lalr.h (LA, LArule): Don't export them: used with the
16101 state_t.
16102 * src/lalr.c (LA, LArule): Static.
16103 * src/lalr.h, src/lalr.c (lalr_free): New.
16104 * src/main.c (main): Call it.
16105 * src/tables.c (pack_vector): Check whether loc is >= to the
16106 table_size, not >.
16107 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16108 (tables_generate): do it, since that's also it which allocates
16109 them.
16110 Don't free LA and LArule, main does.
16111
16112 2002-07-31 Akim Demaille <akim@epita.fr>
16113
16114 Separate parser tables computation and output.
16115
16116 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
16117 (conflict_list, conflict_list_cnt, table, check, table_ninf)
16118 (yydefgoto, yydefact, high): Move to...
16119 * src/tables.h, src/tables.c: here.
16120 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16121 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16122 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
16123 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
16124 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
16125 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
16126 (action_row, save_row, token_actions, save_column, default_goto)
16127 (goto_actions, sort_actions, matching_state, pack_vector)
16128 (table_ninf_remap, pack_table, prepare_actions): Move to...
16129 * src/tables.c: here.
16130 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
16131 * src/output.c (token_actions, output_base, output_conflicts)
16132 (output_check): Merge into...
16133 (prepare_actions): this.
16134 (actions_output): Rename as...
16135 (user_actions_output): this.
16136 * src/main.c (main): Call tables_generate and tables_free.
16137
16138 2002-07-31 Akim Demaille <akim@epita.fr>
16139
16140 Steal GCC's --time-report support.
16141
16142 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
16143 stolen/adjusted from GCC.
16144 * m4/stage.m4: Remove time related checks.
16145 * m4/timevar.m4: New.
16146 * configure.in: Adjust.
16147 * src/system.h: Adjust to using timevar.h.
16148 * src/getargs.h, src/getargs.c: Support trace_time for
16149 --trace=time.
16150 * src/main.c (stage): Remove.
16151 (main): Replace `stage' invocations with timevar calls.
16152 * src/output.c: Insert pertinent timevar calls.
16153
16154 2002-07-31 Akim Demaille <akim@epita.fr>
16155
16156 Let --trace have arguments.
16157
16158 * src/getargs.h (enum trace_e): New.
16159 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
16160 (long_options, short_options): --trace/-T takes an optional
16161 argument.
16162 Change all the uses of trace_flag to reflect the new flags.
16163 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
16164
16165 Strengthen `stage' portability.
16166
16167 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
16168 * configure.in: Use it.
16169 Don't check for malloc.h and sys/times.h.
16170 * src/system.h: Include them when appropriate.
16171 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
16172 times and struct tms are available.
16173
16174 2002-07-30 Akim Demaille <akim@epita.fr>
16175
16176 In verbose parse error message, don't report `error' as an
16177 expected token.
16178 * tests/actions.at (Printers and Destructors): Adjust.
16179 * tests/calc.at (Calculator $1): Adjust.
16180 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
16181 error message, do not report the parser accepts the error token in
16182 that state.
16183
16184 2002-07-30 Akim Demaille <akim@epita.fr>
16185
16186 Normalize conflict related messages.
16187
16188 * src/complain.h, src/complain.c (warn, complain): New.
16189 * src/conflicts.c (conflicts_print): Use them.
16190 (conflict_report_yacc): New, extracted from...
16191 (conflicts_print): here.
16192 * tests/conflicts.at, tests/existing.at: Adjust.
16193
16194 2002-07-30 Akim Demaille <akim@epita.fr>
16195
16196 Report rules which are never reduced by the parser: those hidden
16197 by conflicts.
16198
16199 * src/LR0.c (save_reductions): Don't make the final state too
16200 different: save its reduction (accept) instead of having a state
16201 without any action (no shift or goto, no reduce).
16202 Note: the final state is now a ``regular'' state, i.e., the
16203 parsers now contain `reduce 0' as default reduction.
16204 Nevertheless, since they decide to `accept' when yystate =
16205 final_state, they still will not reduce rule 0.
16206 * src/print.c (print_actions, print_reduction): Adjust.
16207 * src/output.c (action_row): Track reduced rules.
16208 (token_actions): Report rules never reduced.
16209 * tests/conflicts.at, tests/regression.at: Adjust.
16210
16211 2002-07-30 Akim Demaille <akim@epita.fr>
16212
16213 `stage' was accidently included in a previous patch.
16214 Initiate its autoconfiscation.
16215
16216 * configure.in: Look for malloc.h and sys/times.h.
16217 * src/main.c (stage): Adjust.
16218 Report only when trace_flag.
16219
16220 2002-07-29 Akim Demaille <akim@epita.fr>
16221
16222 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
16223 state_number_t.
16224 (errs_t): symbol_t*, not symbol_number_t.
16225 (reductions_t): rule_t*, not rule_number_t.
16226 (FOR_EACH_SHIFT): New.
16227 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
16228 * src/print.c, src/print_graph.c: Adjust.
16229
16230 2002-07-29 Akim Demaille <akim@epita.fr>
16231
16232 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
16233
16234 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
16235 (endtoken, accept): these.
16236 * src/reader.c (reader): Set endtoken's default tag to "$end".
16237 Set undeftoken's tag to "$undefined" instead of "$undefined.".
16238 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
16239 Adjust.
16240
16241 2002-07-29 Akim Demaille <akim@epita.fr>
16242
16243 * src/reduce.c (reduce_grammar): When the language is empty,
16244 complain about the start symbol, not the axiom.
16245 Use its location.
16246 * tests/reduce.at (Empty Language): New.
16247
16248 2002-07-26 Akim Demaille <akim@epita.fr>
16249
16250 * src/reader.h, src/reader.c (gram_error): ... can't get
16251 yycontrol without making too strong assumptions on the parser
16252 itself.
16253 * src/output.c (prepare_tokens): Use the real 0th value of
16254 token_translations instead of `0'.
16255 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
16256 visible here.
16257 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
16258 for the time being: %locations ought to provide it to yyerror.
16259
16260 2002-07-25 Akim Demaille <akim@epita.fr>
16261
16262 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16263 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16264 * tests/regression.at (Web2c Actions): Adjust.
16265
16266 2002-07-25 Akim Demaille <akim@epita.fr>
16267
16268 Stop storing rules from 1 to nrules + 1.
16269
16270 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16271 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16272 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16273 Iterate from 0 to nrules.
16274 Use rule_number_as_item_number and item_number_as_rule_number.
16275 Adjust to `derive' now containing possibly 0.
16276 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16277 Handle the `- 1' part in rule numbers from/to item numbers.
16278 * src/conflicts.c (log_resolution): Fix the message which reversed
16279 shift and reduce.
16280 * src/output.c (action_row): Initialize default_rule to -1.
16281 (token_actions): Adjust.
16282 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16283 expected output.
16284 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16285
16286 2002-07-25 Akim Demaille <akim@epita.fr>
16287
16288 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16289 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16290 (b4_c_knr_arg_decl): New.
16291 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16292 yyreport_parse_error.
16293
16294 2002-07-25 Akim Demaille <akim@epita.fr>
16295
16296 * data/yacc.c (yyreport_parse_error): New, extracted from...
16297 (yyparse): here.
16298 (yydestruct, yysymprint): Move above yyparse.
16299 Be K&R compliant.
16300
16301 2002-07-25 Akim Demaille <akim@epita.fr>
16302
16303 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16304 replace...
16305 (b4_sint_type, b4_uint_type): these.
16306 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16307 * tests/regression.at (Web2c Actions): Adjust.
16308
16309 2002-07-25 Akim Demaille <akim@epita.fr>
16310
16311 * src/gram.h (TIEM_NUMBER_MAX): New.
16312 (item_number_of_rule_number, rule_number_of_item_number): Rename
16313 as...
16314 (rule_number_as_item_number, item_number_as_rule_number): these.
16315 Adjust dependencies.
16316 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16317 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16318 (symbol_number_to_vector_number): New.
16319 (order): Of vector_number_t* type.
16320 (base_t, BASE_MAX, BASE_MIN): New.
16321 (froms, tos, width, pos, check): Of base_t type.
16322 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16323 (actrow): Of action_number_t type.
16324 (conflrow): Of unsigned int type.
16325 (table_ninf, base_ninf): New.
16326 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16327 (muscle_insert_int_table, muscle_insert_base_table)
16328 (muscle_insert_rule_number_table): New.
16329 (prepare_tokens): Output `toknum' as int_table.
16330 (action_row): Returns a rule_number_t.
16331 Use ACTION_MIN, not SHRT_MIN.
16332 (token_actions): yydefact is rule_number_t*.
16333 (table_ninf_remap): New.
16334 (pack_table): Use it for `base' and `table'.
16335 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16336 replaced with...
16337 (YYPACT_NINF, YYTABLE_NINF): these.
16338 (yypact, yytable): Compute their types instead of hard-coded
16339 `short'.
16340 * tests/regression.at (Web2c Actions): Adjust.
16341
16342 2002-07-19 Akim Demaille <akim@epita.fr>
16343
16344 * src/scan-gram.l (id): Can start with an underscore.
16345
16346 2002-07-16 Akim Demaille <akim@epita.fr>
16347
16348 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16349 Adjust all former `associativity' dependencies.
16350 * src/symtab.c (symbol_new): Default associativity is `undef', not
16351 `right'.
16352 (symbol_check_alias_consistence): Adjust.
16353
16354 2002-07-09 Akim Demaille <akim@epita.fr>
16355
16356 * doc/bison.texinfo: Properly set the ``header'' part.
16357 Use @dircategory ``GNU programming tools'' as per Texinfo's
16358 documentation.
16359 Use @copying.
16360
16361 2002-07-09 Akim Demaille <akim@epita.fr>
16362
16363 * lib/quotearg.h: Protect against multiple inclusions.
16364 * src/location.h (location_t): Add a `file' member.
16365 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16366 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16367 `error_one_per_line' support.
16368
16369 2002-07-09 Akim Demaille <akim@epita.fr>
16370
16371 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16372 * src/reader.c (lineno): Remove.
16373 Adjust all dependencies.
16374 (get_merge_function): Take a location and use complain_at.
16375 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16376 * tests/regression.at (Invalid inputs, Mixing %token styles):
16377 Adjust.
16378
16379 2002-07-09 Akim Demaille <akim@epita.fr>
16380
16381 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16382 recovery rule, and forbid extensions when --yacc.
16383 (gram_error): Use complain_at.
16384 * src/reader.c (reader): Exit if there were parse errors.
16385
16386 2002-07-09 Akim Demaille <akim@epita.fr>
16387
16388 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16389 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16390 Reported by R Blake <blakers@mac.com>.
16391
16392 2002-07-09 Akim Demaille <akim@epita.fr>
16393
16394 * data/yacc.c: Output the copyright notive in the header.
16395
16396 2002-07-03 Akim Demaille <akim@epita.fr>
16397
16398 * src/output.c (froms, tos): Are state_number_t.
16399 (save_column): sp, sp1, and sp2 are state_number_t.
16400 (prepare): Rename `final' as `final_state_number', `nnts' as
16401 `nterms_number', `nrules' as `rules_number', `nstates' as
16402 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16403 unused.
16404 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16405 * data/lalr1.cc (nsym_): Remove, unused.
16406
16407 2002-07-03 Akim Demaille <akim@epita.fr>
16408
16409 * src/lalr.h, src/lalr.c (goto_number_t): New.
16410 * src/lalr.c (goto_list_t): New.
16411 Propagate them.
16412 * src/nullable.c (rule_list_t): New.
16413 Propagate.
16414 * src/types.h: Remove.
16415
16416 2002-07-03 Akim Demaille <akim@epita.fr>
16417
16418 * src/closure.c (print_fderives): Use rule_rhs_print.
16419 * src/derives.c (print_derives): Use rule_rhs_print.
16420 (rule_list_t): New, replaces `shorts'.
16421 (set_derives): Add comments.
16422 * tests/sets.at (Nullable, Firsts): Adjust.
16423
16424 2002-07-03 Akim Demaille <akim@epita.fr>
16425
16426 * src/output.c (prepare_actions): Free `tally' and `width'.
16427 (prepare_actions): Allocate and free `order'.
16428 * src/symtab.c (symbols_free): Free `symbols'.
16429 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16430 * src/output.c (m4_invoke): Move to...
16431 * src/scan-skel.l: here.
16432 (<<EOF>>): Close yyout, and free its name.
16433
16434 2002-07-03 Akim Demaille <akim@epita.fr>
16435
16436 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16437
16438 * src/LR0.c (new_state): Merge into...
16439 (state_list_append): this.
16440 (new_states): Merge into...
16441 (generate_states): here.
16442 (set_states): Don't ensure a proper `errs' state member here, do it...
16443 * src/conflicts.c (conflicts_solve): here.
16444 * src/state.h, src/state.c: Comment changes.
16445 (state_t): Rename member `shifts' as `transitions'.
16446 Adjust all dependencies.
16447 (errs_new): For consistency, also take the values as argument.
16448 (errs_dup): Remove.
16449 (state_errs_set): New.
16450 (state_reductions_set, state_transitions_set): Assert that no
16451 previous value was assigned.
16452 (state_free): New.
16453 (states_free): Use it.
16454 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16455 temporary storage: use `errs' and `nerrs' as elsewhere.
16456 (set_conflicts): Allocate and free this `errs'.
16457
16458 2002-07-02 Akim Demaille <akim@epita.fr>
16459
16460 * lib/libiberty.h: New.
16461 * lib: Update the bitset implementation from upstream.
16462 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16463 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16464 * src/main.c: Adjust bitset stats calls.
16465
16466 2002-07-01 Paul Eggert <eggert@twinsun.com>
16467
16468 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16469 char, so that negative chars don't collide with $.
16470
16471 2002-06-30 Akim Demaille <akim@epita.fr>
16472
16473 Have the GLR tests be `warning' checked, and fix the warnings.
16474
16475 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16476 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16477 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16478 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16479 (yyaddDeferredAction): static.
16480 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16481 (yyreportParseError): yyprefix is const.
16482 yytokenp is used only when verbose.
16483 (yy__GNUC__): Replace with __GNUC__.
16484 (yypdumpstack): yyi is size_t.
16485 (yypreference): Un-yy local variables and arguments, to avoid
16486 clashes with `yyr1'. Anyway, we are not in the user name space.
16487 (yytname_size): be an int, as is compared with ints.
16488 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16489 Use them.
16490 * tests/cxx-gram.at: Use quotation to protect $1.
16491 Use AT_COMPILE to enable warnings hunts.
16492 Prototype yylex and yyerror.
16493 `Use' argc.
16494 Include `string.h', not `strings.h'.
16495 Produce and prototype stmtMerge only when used.
16496 yylex takes a location.
16497
16498 2002-06-30 Akim Demaille <akim@epita.fr>
16499
16500 We spend a lot of time in quotearg, in particular when --verbose.
16501
16502 * src/symtab.c (symbol_get): Store a quoted version of the key.
16503 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16504 Adjust all callers.
16505
16506 2002-06-30 Akim Demaille <akim@epita.fr>
16507
16508 * src/state.h (reductions_t): Rename member `nreds' as num.
16509 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16510 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16511
16512 2002-06-30 Akim Demaille <akim@epita.fr>
16513
16514 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16515 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16516 (shifts_to): Rename as...
16517 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16518 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16519 (TRANSITION_IS_DISABLED, transitions_to): these.
16520
16521 2002-06-30 Akim Demaille <akim@epita.fr>
16522
16523 * src/print.c (print_shifts, print_gotos): Merge into...
16524 (print_transitions): this.
16525 (print_transitions, print_errs, print_reductions): Align the
16526 lookaheads columns.
16527 (print_core, print_transitions, print_errs, print_state,
16528 print_grammar): Output empty lines separator before, not after.
16529 (state_default_rule_compute): Rename as...
16530 (state_default_rule): this.
16531 * tests/conflicts.at (Defaulted Conflicted Reduction),
16532 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16533 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16534
16535 2002-06-30 Akim Demaille <akim@epita.fr>
16536
16537 Display items as we display rules.
16538
16539 * src/gram.h, src/gram.c (rule_lhs_print): New.
16540 * src/gram.c (grammar_rules_partial_print): Use it.
16541 * src/print.c (print_core): Likewise.
16542 * tests/conflicts.at (Defaulted Conflicted Reduction),
16543 (Unresolved SR Conflicts): Adjust.
16544 (Unresolved SR Conflicts): Adjust and rename as...
16545 (Resolved SR Conflicts): this, as was meant.
16546 * tests/regression.at (Web2c Report): Adjust.
16547
16548 2002-06-30 Akim Demaille <akim@epita.fr>
16549
16550 * src/print.c (state_default_rule_compute): New, extracted from...
16551 (print_reductions): here.
16552 Pessimize, but clarify the code.
16553 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16554
16555 2002-06-30 Akim Demaille <akim@epita.fr>
16556
16557 * src/output.c (action_row): Let default_rule be always a rule
16558 number.
16559
16560 2002-06-30 Akim Demaille <akim@epita.fr>
16561
16562 * src/closure.c (print_firsts, print_fderives, closure):
16563 Use BITSET_EXECUTE.
16564 * src/lalr.c (lookaheads_print): Likewise.
16565 * src/state.c (state_rule_lookaheads_print): Likewise.
16566 * src/print_graph.c (print_core): Likewise.
16567 * src/print.c (print_reductions): Likewise.
16568 * src/output.c (action_row): Likewise.
16569 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16570
16571 2002-06-30 Akim Demaille <akim@epita.fr>
16572
16573 * src/print_graph.c: Use report_flag.
16574
16575 2002-06-30 Akim Demaille <akim@epita.fr>
16576
16577 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16578 to...
16579 * src/relation.h, src/relation.c (traverse, relation_digraph)
16580 (relation_print, relation_transpose): New.
16581
16582 2002-06-30 Akim Demaille <akim@epita.fr>
16583
16584 * src/state.h, src/state.c (shifts_to): New.
16585 * src/lalr.c (build_relations): Use it.
16586
16587 2002-06-30 Akim Demaille <akim@epita.fr>
16588
16589 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16590 (item_number_of_rule_number, rule_number_of_item_number): New.
16591 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16592 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16593 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16594 Propagate their use.
16595 Much remains to be done, in particular wrt `shorts' from types.h.
16596
16597 2002-06-30 Akim Demaille <akim@epita.fr>
16598
16599 * src/symtab.c (symbol_new): Initialize the `printer' member.
16600
16601 2002-06-30 Akim Demaille <akim@epita.fr>
16602
16603 * src/LR0.c (save_reductions): Remove, replaced by...
16604 * src/state.h, src/state.c (state_reductions_set): New.
16605 (reductions, errs): Rename as...
16606 (reductions_t, errs_t): these.
16607 Adjust all dependencies.
16608
16609 2002-06-30 Akim Demaille <akim@epita.fr>
16610
16611 * src/LR0.c (state_list_t, state_list_append): New.
16612 (first_state, last_state): Now symbol_list_t.
16613 (this_state): Remove.
16614 (new_itemsets, append_states, save_reductions): Take a state_t as
16615 argument.
16616 (set_states, generate_states): Adjust.
16617 (save_shifts): Remove, replaced by...
16618 * src/state.h, src/state.c (state_shifts_set): New.
16619 (shifts): Rename as...
16620 (shifts_t): this.
16621 Adjust all dependencies.
16622 * src/state.h (state_t): Remove the `next' member.
16623
16624 2002-06-30 Akim Demaille <akim@epita.fr>
16625
16626 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16627 escaped in slot 0.
16628
16629 2002-06-30 Akim Demaille <akim@epita.fr>
16630
16631 Use hash.h for the state hash table.
16632
16633 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16634 (allocate_storage): Use state_hash_new.
16635 (free_storage): Use state_hash_free.
16636 (new_state, get_state): Adjust.
16637 * src/lalr.h, src/lalr.c (states): Move to...
16638 * src/states.h (state_t): Remove the `link' member, no longer
16639 used.
16640 * src/states.h, src/states.c: here.
16641 (state_hash_new, state_hash_free, state_hash_lookup)
16642 (state_hash_insert, states_free): New.
16643 * src/states.c (state_table, state_compare, state_hash): New.
16644 * src/output.c (output_actions): Do not free states now, since we
16645 still need to know the final_state number in `prepare', called
16646 afterwards. Do it...
16647 * src/main.c (main): here: call states_free after `output'.
16648
16649 2002-06-30 Akim Demaille <akim@epita.fr>
16650
16651 * src/state.h, src/state.c (state_new): New, extracted from...
16652 * src/LR0.c (new_state): here.
16653 * src/state.h (STATE_ALLOC): Move to...
16654 * src/state.c: here.
16655 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16656 * src/state.h, src/state.c: here.
16657
16658 2002-06-30 Akim Demaille <akim@epita.fr>
16659
16660 * src/reader.c (gensym): Rename as...
16661 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16662 (getsym): Rename as...
16663 (symbol_get): this.
16664
16665 2002-06-30 Akim Demaille <akim@epita.fr>
16666
16667 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16668 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16669 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16670 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16671
16672 2002-06-30 Akim Demaille <akim@epita.fr>
16673
16674 Make the test suite pass with warnings checked.
16675
16676 * tests/actions.at (Printers and Destructors): Improve.
16677 Avoid unsigned vs. signed issues.
16678 * tests/calc.at: Don't exercise the scanner here, do it...
16679 * tests/input.at (Torturing the Scanner): here.
16680
16681 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16682
16683 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
16684 reorganize first lines parallel to yacc.c.
16685
16686 2002-06-28 Akim Demaille <akim@epita.fr>
16687
16688 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16689 (b4_token_enum, b4_token_defines): New, factored from...
16690 * data/lalr1.cc, data/yacc.c, glr.c: here.
16691
16692 2002-06-28 Akim Demaille <akim@epita.fr>
16693
16694 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16695 unused variables.
16696 * src/output.c (merger_output): static.
16697
16698 2002-06-28 Akim Demaille <akim@epita.fr>
16699
16700 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
16701 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16702 pacify GCC.
16703 * src/output.c (save_row): Initialize all the variables to pacify GCC.
16704
16705 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16706
16707 Accumulated changelog for new GLR parsing features.
16708
16709 * src/conflicts.c (count_total_conflicts): Change name to
16710 conflicts_total_count.
16711 * src/conflicts.h: Ditto.
16712 * src/output.c (token_actions): Use the new name.
16713 (output_conflicts): Change conflp => conflict_list_heads, and
16714 confl => conflict_list for better readability.
16715 * data/glr.c: Use the new names.
16716 * NEWS: Add self to GLR announcement.
16717
16718 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16719
16720 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16721 Akim Demaille.
16722
16723 * data/bison.glr: Change name to glr.c
16724 * data/glr.c: Renamed from bison.glr.
16725 * data/Makefile.am: Add glr.c
16726
16727 * src/getargs.c:
16728
16729 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
16730 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
16731
16732 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16733
16734 * data/bison.glr: Be sure to restore the
16735 current #line when returning to the skeleton contents after having
16736 exposed the input file's #line.
16737
16738 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16739
16740 * data/bison.glr: Bring up to date with changes to bison.simple.
16741
16742 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16743
16744 * data/bison.glr: Correct definitions that use b4_prefix.
16745 Various reformatting.
16746 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16747 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16748 yytokenp argument; now part of stack.
16749 (yychar): Define to behave as documented.
16750 (yyclearin): Ditto.
16751
16752 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16753
16754 * src/reader.h: Add declaration for free_merger_functions.
16755
16756 * src/reader.c (merge_functions): New variable.
16757 (get_merge_function): New function.
16758 (free_merger_functions): New function.
16759 (readgram): Check for %prec that is not followed by a symbol.
16760 Handle %dprec and %merge declarations.
16761 (packgram): Initialize dprec and merger fields in rules array.
16762
16763 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16764 conflict_list_cnt, conflict_list_free): New variables.
16765 (table_grow): Also grow conflict_table.
16766 (prepare_rules): Output dprec and merger tables.
16767 (conflict_row): New function.
16768 (action_row): Output conflict lists for GLR parser. Don't use
16769 default reduction in conflicted states for GLR parser so that there
16770 are spaces for the conflict lists.
16771 (save_row): Also save conflict information.
16772 (token_actions): Allocate conflict list.
16773 (merger_output): New function.
16774 (pack_vector): Pack conflict table, too.
16775 (output_conflicts): New function to output yyconflp and yyconfl.
16776 (output_check): Allocate conflict_tos.
16777 (output_actions): Output conflict tables, also.
16778 (output_skeleton): Output b4_mergers definition.
16779 (prepare): Output b4_max_rhs_length definition.
16780 Use 'bison.glr' as default skeleton for GLR parsers.
16781
16782 * src/gram.c (glr_parser): New flag.
16783 (grammar_free): Call free_merger_functions.
16784
16785 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16786 all pairs of conflicting reductions, rather than just all tokens
16787 causing conflicts. Needed to size conflict tables.
16788 (conflicts_output): Modify call to count_rr_conflicts for new
16789 interface.
16790 (conflicts_print): Ditto.
16791 (count_total_conflicts): New function.
16792
16793 * src/reader.h (merger_list): New type.
16794 (merge_functions): New variable.
16795
16796 * src/lex.h (tok_dprec, tok_merge): New token types.
16797
16798 * src/gram.h (rule_s): Add dprec and merger fields.
16799 (glr_parser): New flag.
16800
16801 * src/conflicts.h (count_total_conflicts): New function.
16802
16803 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
16804
16805 * doc/bison.texinfo (Generalized LR Parsing): New section.
16806 (GLR Parsers): New section.
16807 (Language and Grammar): Mention GLR parsing.
16808 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
16809 Correct typo ("tge" -> "the").
16810
16811 * data/bison.glr: New skeleton for GLR parsing.
16812
16813 * tests/cxx-gram.at: New tests for GLR parsing.
16814
16815 * tests/testsuite.at: Include cxx-gram.at.
16816
16817 * tests/Makefile.am: Add cxx-gram.at.
16818
16819 * src/parse-gram.y:
16820
16821 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
16822
16823 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
16824
16825 2002-06-27 Akim Demaille <akim@epita.fr>
16826
16827 * src/options.h, src/options.c: Remove.
16828 * src/getargs.c (short_options, long_options): New.
16829
16830 2002-06-27 Akim Demaille <akim@epita.fr>
16831
16832 * data/bison.simple, data/bison.c++: Rename as...
16833 * data/yacc.c, data/lalr1.cc: these.
16834 * doc/bison.texinfo (Environment Variables): Remove.
16835
16836 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
16837
16838 * src/getargs.c (report_argmatch): Initialize strtok().
16839
16840 2002-06-20 Akim Demaille <akim@epita.fr>
16841
16842 * data/bison.simple (b4_symbol_actions): New, replaces...
16843 (b4_symbol_destructor, b4_symbol_printer): these.
16844 (yysymprint): Be sure to call YYPRINT only for tokens, and using
16845 user token numbers.
16846
16847 2002-06-20 Akim Demaille <akim@epita.fr>
16848
16849 * data/bison.simple (yydestructor): Rename as...
16850 (yydestruct): this.
16851
16852 2002-06-20 Akim Demaille <akim@epita.fr>
16853
16854 * src/symtab.h, src/symtab.c (symbol_type_set)
16855 (symbol_destructor_set, symbol_precedence_set): The location is
16856 the last argument.
16857 Adjust all callers.
16858
16859 2002-06-20 Akim Demaille <akim@epita.fr>
16860
16861 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
16862 internals.
16863 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
16864 Takes a location.
16865 * src/symtab.h, src/symtab.c (symbol_class_set)
16866 (symbol_user_token_number_set): Likewise.
16867 Adjust all callers.
16868 Promote complain_at.
16869 * tests/input.at (Type Clashes): Adjust.
16870
16871 2002-06-20 Akim Demaille <akim@epita.fr>
16872
16873 * data/bison.simple (YYLEX): Fix the declaration when
16874 %pure-parser.
16875
16876 2002-06-20 Akim Demaille <akim@epita.fr>
16877
16878 * data/bison.simple (yysymprint): Don't print the token number,
16879 just its name.
16880 * tests/actions.at (Destructors): Rename as...
16881 (Printers and Destructors): this.
16882 Also exercise %printer.
16883
16884 2002-06-20 Akim Demaille <akim@epita.fr>
16885
16886 * data/bison.simple (YYDSYMPRINT): New.
16887 Use it to remove many of the #if YYDEBUG/if (yydebug).
16888
16889 2002-06-20 Akim Demaille <akim@epita.fr>
16890
16891 * src/symtab.h, src/symtab.c (symbol_t): printer and
16892 printer_location are new members.
16893 (symbol_printer_set): New.
16894 * src/parse-gram.y (PERCENT_PRINTER): New token.
16895 Handle its associated rule.
16896 * src/scan-gram.l: Adjust.
16897 (handle_destructor_at, handle_destructor_dollar): Rename as...
16898 (handle_symbol_code_at, handle_symbol_code_dollar): these.
16899 * src/output.c (symbol_printers_output): New.
16900 (output_skeleton): Call it.
16901 * data/bison.simple (yysymprint): New. Cannot be named yyprint
16902 since there are already many grammar files with a user `yyprint'.
16903 Replace the calls to YYPRINT to calls to yysymprint.
16904 * tests/calc.at: Adjust.
16905 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
16906 taking advantage of parser very internal details (stack size!).
16907
16908 2002-06-20 Akim Demaille <akim@epita.fr>
16909
16910 * src/scan-gram.l: Complete the scanner with the missing patterns
16911 to pacify Flex.
16912 Use `quote' and `symbol_tag_get' where appropriate.
16913
16914 2002-06-19 Akim Demaille <akim@epita.fr>
16915
16916 * tests/actions.at (Destructors): Augment to test locations.
16917 * data/bison.simple (yydestructor): Pass it the current location
16918 if locations are enabled.
16919 Prototype only when __STDC__ or C++.
16920 Change the argument names to move into the yy name space: there is
16921 user code here.
16922
16923 2002-06-19 Akim Demaille <akim@epita.fr>
16924
16925 * data/bison.simple (b4_pure_if): New.
16926 Use it instead of #ifdef YYPURE.
16927
16928 2002-06-19 Akim Demaille <akim@epita.fr>
16929
16930 * data/bison.simple (b4_location_if): New.
16931 Use it instead of #ifdef YYLSP_NEEDED.
16932
16933 2002-06-19 Akim Demaille <akim@epita.fr>
16934
16935 Prepare @$ in %destructor, but currently don't bind it in the
16936 skeleton, as %location use is not cleaned up yet.
16937
16938 * src/scan-gram.l (handle_dollar, handle_destructor_at)
16939 (handle_action_at): New.
16940 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
16941 a braced_code_t and a location as additional arguments.
16942 (handle_destructor_dollar): Instead of requiring `b4_eval', just
16943 unquote one when outputting `b4_dollar_dollar'.
16944 Adjust callers.
16945 * data/bison.simple (b4_eval): Remove.
16946 (b4_symbol_destructor): Adjust.
16947 * tests/input.at (Invalid @n): Adjust.
16948
16949 2002-06-19 Zack Weinberg <zack@codesourcery.com>
16950
16951 * doc/bison.texinfo: Document ability to have multiple
16952 prologue sections.
16953
16954 2002-06-18 Akim Demaille <akim@epita.fr>
16955
16956 * src/files.c (compute_base_names): When computing the output file
16957 names from the input file name, strip the directory part.
16958
16959 2002-06-18 Akim Demaille <akim@epita.fr>
16960
16961 * data/bison.simple.new: Comment changes.
16962 Reported by Andreas Schwab.
16963
16964 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
16965
16966 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
16967 there are no `label `yyoverflowlab' defined but not used' warnings
16968 when yyoverflow is defined.
16969
16970 2002-06-18 Akim Demaille <akim@epita.fr>
16971
16972 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
16973 new member.
16974 (symbol_destructor_set): Adjust.
16975 * src/output.c (symbol_destructors_output): Output the destructor
16976 locations.
16977 Output the symbol name.
16978 * data/bison.simple (b4_symbol_destructor): Adjust.
16979
16980 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
16981 and Akim Demaille <akim@epita.fr>
16982
16983 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
16984 what's left on the stack when the error recovery hits EOF.
16985 * tests/actions.at (Destructors): Complete to exercise this case.
16986
16987 2002-06-17 Akim Demaille <akim@epita.fr>
16988
16989 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
16990 arguments is really empty, not only equal to `[]'.
16991 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
16992 member.
16993 (symbol_destructor_set): New.
16994 * src/output.c (symbol_destructors_output): New.
16995 * src/reader.h (brace_code_t, current_braced_code): New.
16996 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
16997 (handle_dollar): Rename as...
16998 (handle_action_dollar): this.
16999 (handle_destructor_dollar): New.
17000 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
17001 (grammar_declaration): Use it.
17002 * data/bison.simple (yystos): Is always defined.
17003 (yydestructor): New.
17004 * tests/actions.at (Destructors): New.
17005 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
17006
17007 2002-06-17 Akim Demaille <akim@epita.fr>
17008
17009 * src/symlist.h, src/symlist.c (symbol_list_length): New.
17010 * src/scan-gram.l (handle_dollar, handle_at): Compute the
17011 rule_length only when needed.
17012 * src/output.c (actions_output, token_definitions_output): Output
17013 the full M4 block.
17014 * src/symtab.c: Don't access directly to the symbol tag, use
17015 symbol_tag_get.
17016 * src/parse-gram.y: Use symbol_list_free.
17017
17018 2002-06-17 Akim Demaille <akim@epita.fr>
17019
17020 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
17021 (symbol_list_prepend, get_type_name): Move to...
17022 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
17023 (symbol_list_prepend, symbol_list_n_type_name_get): here.
17024 Adjust all callers.
17025 (symbol_list_free): New.
17026 * src/scan-gram.l (handle_dollar): Takes a location.
17027 * tests/input.at (Invalid $n): Adjust.
17028
17029 2002-06-17 Akim Demaille <akim@epita.fr>
17030
17031 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17032 (symbol_list_prepend): New.
17033 * src/parse-gram.y (%union): `list' is a new member.
17034 (symbols.1): New, replaces...
17035 (terms_to_prec.1, nterms_to_type.1): these.
17036 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17037 Take a location as additional argument.
17038 Adjust all callers.
17039
17040 2002-06-15 Akim Demaille <akim@epita.fr>
17041
17042 * src/parse-gram.y: Move %token in the declaration section so that
17043 we don't depend upon CVS Bison.
17044
17045 2002-06-15 Akim Demaille <akim@epita.fr>
17046
17047 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17048 * src/print.c (print_core): Use it.
17049
17050 2002-06-15 Akim Demaille <akim@epita.fr>
17051
17052 * src/conflicts.c (log_resolution): Accept the rule involved in
17053 the sr conflicts instead of the lookahead number that points to
17054 that rule.
17055 (flush_reduce): Accept the current lookahead vector as argument,
17056 instead of the index in LA.
17057 (resolve_sr_conflict): Accept the current number of lookahead
17058 bitset to consider for the STATE, instead of the index in LA.
17059 (set_conflicts): Adjust.
17060 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17061
17062 2002-06-15 Akim Demaille <akim@epita.fr>
17063
17064 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17065 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17066 Adjust all dependencies.
17067 * src/lalr.c (initialize_lookaheads): Split into...
17068 (states_lookaheads_count, states_lookaheads_initialize): these.
17069 (lalr): Adjust.
17070
17071 2002-06-15 Akim Demaille <akim@epita.fr>
17072
17073 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17074 out of...
17075 (grammar_rules_print): here.
17076 * src/reduce.c (reduce_output): Use it.
17077 * tests/reduce.at (Useless Rules, Reduced Automaton)
17078 (Underivable Rules): Adjust.
17079
17080 2002-06-15 Akim Demaille <akim@epita.fr>
17081
17082 Copy BYacc's nice way to report the grammar.
17083
17084 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17085 New.
17086 Don't print the rules' location, it is confusing and useless.
17087 (rule_print): Use grammar_rhs_print.
17088 * src/print.c (print_grammar): Use grammar_rules_print.
17089
17090 2002-06-15 Akim Demaille <akim@epita.fr>
17091
17092 Complete and rationalize `useless thing' warnings.
17093
17094 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17095 (symbol_tag_print): New.
17096 Use them everywhere in place of accessing directly the tag member.
17097 * src/gram.h, src/gram.c (rule_print): New.
17098 Use it where a rule used to be printed `by hand'.
17099 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17100 (reduce_grammar_tables): Report the useless rules.
17101 (reduce_print): Useless things are a warning, not an error.
17102 Report it as such.
17103 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17104 (Reduced Automaton, Underivable Rules): Adjust.
17105 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17106 * tests/conflicts.at (Unresolved SR Conflicts)
17107 (Solved SR Conflicts): Adjust.
17108
17109 2002-06-15 Akim Demaille <akim@epita.fr>
17110
17111 Let symbols have a location.
17112
17113 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
17114 (getsym): Adjust.
17115 Adjust all callers.
17116 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
17117 Use location_t, not int.
17118 * src/symtab.c (symbol_check_defined): Take advantage of the
17119 location.
17120 * tests/regression.at (Invalid inputs): Adjust.
17121
17122 2002-06-15 Akim Demaille <akim@epita.fr>
17123
17124 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
17125 (input): Don't try to initialize yylloc here, do it in the
17126 scanner.
17127 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
17128 * src/gram.h (rule_t): Change line and action_line into location
17129 and action_location, of location_t type.
17130 Adjust all dependencies.
17131 * src/location.h, src/location.c (empty_location): New.
17132 * src/reader.h, src/reader.c (grammar_start_symbol_set)
17133 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
17134 (grammar_current_rule_symbol_append)
17135 (grammar_current_rule_action_append): Expect a location as argument.
17136 * src/reader.c (grammar_midrule_action): Adjust to attach an
17137 action's location as dummy symbol location.
17138 * src/symtab.h, src/symtab.c (startsymbol_location): New.
17139 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
17140 the line numbers.
17141
17142 2002-06-14 Akim Demaille <akim@epita.fr>
17143
17144 Grammar declarations may be found in the grammar section.
17145
17146 * src/parse-gram.y (rules_or_grammar_declaration): New.
17147 (declarations): Each declaration may end with a semicolon, not
17148 just...
17149 (grammar_declaration): `"%union"'.
17150 (grammar): Branch to rules_or_grammar_declaration.
17151
17152 2002-06-14 Akim Demaille <akim@epita.fr>
17153
17154 * src/main.c (main): Invoke scanner_free.
17155
17156 2002-06-14 Akim Demaille <akim@epita.fr>
17157
17158 * src/output.c (m4_invoke): Extracted from...
17159 (output_skeleton): here.
17160 Free tempfile.
17161
17162 2002-06-14 Akim Demaille <akim@epita.fr>
17163
17164 * src/parse-gram.y (directives, directive, gram)
17165 (grammar_directives, precedence_directives, precedence_directive):
17166 Rename as...
17167 (declarations, declaration, grammar, grammar_declaration)
17168 (precedence_declaration, precedence_declarator): these.
17169 (symbol_declaration): New.
17170
17171 2002-06-14 Akim Demaille <akim@epita.fr>
17172
17173 * src/files.c (action_obstack): Remove, unused.
17174 (output_obstack): Remove it, and all its dependencies, as it is no
17175 longer needed.
17176 * src/reader.c (epilogue_set): Build the epilogue in the
17177 muscle_obstack.
17178 * src/output.h, src/output.c (muscle_obstack): Move to...
17179 * src/muscle_tab.h, src/muscle_tab.h: here.
17180 (muscle_init): Initialize muscle_obstack.
17181 (muscle_free): New.
17182 * src/main.c (main): Call it.
17183
17184 2002-06-14 Akim Demaille <akim@epita.fr>
17185
17186 * src/location.h: New, extracted from...
17187 * src/reader.h: here.
17188 * src/Makefile.am (noinst_HEADERS): Merge into
17189 (bison_SOURCES): this.
17190 Add location.h.
17191 * src/parse-gram.y: Use location_t instead of Bison's.
17192 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
17193 Use location_t instead of ints.
17194
17195 2002-06-14 Akim Demaille <akim@epita.fr>
17196
17197 * data/bison.simple, data/bison.c++: Be sure to restore the
17198 current #line when returning to the skeleton contents after having
17199 exposed the input file's #line.
17200
17201 2002-06-12 Akim Demaille <akim@epita.fr>
17202
17203 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
17204 eager.
17205 * tests/actions.at (Exotic Dollars): New.
17206
17207 2002-06-12 Akim Demaille <akim@epita.fr>
17208
17209 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
17210 ['"/] too eagerly.
17211 * tests/input.at (Torturing the Scanner): New.
17212
17213 2002-06-11 Akim Demaille <akim@epita.fr>
17214
17215 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
17216 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
17217 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
17218 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
17219 * src/reader.c (reader): Use it.
17220
17221 2002-06-11 Akim Demaille <akim@epita.fr>
17222
17223 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
17224 Adjust all callers.
17225 (scanner_last_string_free): New.
17226
17227 2002-06-11 Akim Demaille <akim@epita.fr>
17228
17229 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
17230 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
17231 (last_string, YY_OBS_FREE): New.
17232 Use them when returning an ID.
17233
17234 2002-06-11 Akim Demaille <akim@epita.fr>
17235
17236 Have Bison grammars parsed by a Bison grammar.
17237
17238 * src/reader.c, src/reader.h (prologue_augment): New.
17239 * src/reader.c (copy_definition): Remove.
17240
17241 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
17242 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
17243 (grammar_current_rule_prec_set, grammar_current_rule_check)
17244 (grammar_current_rule_symbol_append)
17245 (grammar_current_rule_action_append): Export.
17246 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
17247 (symbol_list_action_append): Remove.
17248 Hook the routines from reader.
17249 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17250 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
17251
17252 * src/reader.c (read_declarations): Remove, unused.
17253
17254 * src/parse-gram.y: Handle the epilogue.
17255 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
17256 (grammar_start_symbol_set): this.
17257 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
17258 * src/reader.c (readgram): Remove, unused.
17259 (reader): Adjust to insert eoftoken and axiom where appropriate.
17260
17261 * src/reader.c (copy_dollar): Replace with...
17262 * src/scan-gram.h (handle_dollar): this.
17263 * src/parse-gram.y: Remove `%thong'.
17264
17265 * src/reader.c (copy_at): Replace with...
17266 * src/scan-gram.h (handle_at): this.
17267
17268 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17269 New.
17270
17271 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17272 time being.
17273
17274 * src/reader.h, src/reader.c (grammar_rule_end): New.
17275
17276 * src/parse.y (current_type, current_class): New.
17277 Implement `%nterm', `%token' support.
17278 Merge `%term' into `%token'.
17279 (string_as_id): New.
17280 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17281 type name.
17282
17283 * src/parse-gram.y: Be sure to handle properly the beginning of
17284 rules.
17285
17286 * src/parse-gram.y: Handle %type.
17287 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17288
17289 * src/parse-gram.y: More directives support.
17290 * src/options.c: No longer handle source directives.
17291
17292 * src/parse-gram.y: Fix %output.
17293
17294 * src/parse-gram.y: Handle %union.
17295 Use the prologue locations.
17296 * src/reader.c (parse_union_decl): Remove.
17297
17298 * src/reader.h, src/reader.c (epilogue_set): New.
17299 * src/parse-gram.y: Use it.
17300
17301 * data/bison.simple, data/bison.c++: b4_stype is now either not
17302 defined, then default to int, or to the contents of %union,
17303 without `union' itself.
17304 Adjust.
17305 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17306
17307 * src/output.c (actions_output): Don't output braces, as they are
17308 already handled by the scanner.
17309
17310 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17311 characters to themselves.
17312
17313 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17314 that the epilogue has a proper #line.
17315
17316 * src/parse-gram.y: Handle precedence/associativity.
17317
17318 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17319 a terminal.
17320 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17321 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17322 at all to define terminals that cannot be emitted.
17323
17324 * src/scan-gram.l: Escape M4 characters.
17325
17326 * src/scan-gram.l: Working properly with escapes in user
17327 strings/characters.
17328
17329 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17330 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17331 grammar.
17332 Use more modest sizes, as for the time being the parser does not
17333 release memory, and therefore the process swallows a huge amount
17334 of memory.
17335
17336 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17337 stricter %token grammar.
17338
17339 * src/symtab.h (associativity): Add `undef_assoc'.
17340 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17341 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17342
17343 * tests/regression.at (Invalid %directive): Remove, as it is now
17344 meaningless.
17345 (Invalid inputs): Adjust to the new error messages.
17346 (Token definitions): The new grammar doesn't allow too many
17347 eccentricities.
17348
17349 * src/lex.h, src/lex.c: Remove.
17350 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17351 (copy_character, copy_string2, copy_string, copy_identifier)
17352 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17353 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17354 (parse_action): Remove.
17355 * po/POTFILES.in: Adjust.
17356
17357 2002-06-11 Akim Demaille <akim@epita.fr>
17358
17359 * src/reader.c (parse_action): Don't store directly into the
17360 rule's action member: return the action as a string.
17361 Don't require `rule_length' as an argument: compute it.
17362 (grammar_current_rule_symbol_append)
17363 (grammar_current_rule_action_append): New, eved out from
17364 (readgram): here.
17365 Remove `action_flag', `rulelength', unused now.
17366
17367 2002-06-11 Akim Demaille <akim@epita.fr>
17368
17369 * src/reader.c (grammar_current_rule_prec_set).
17370 (grammar_current_rule_check): New, eved out from...
17371 (readgram): here.
17372 Remove `xaction', `first_rhs': useless.
17373 * tests/input.at (Type clashes): New.
17374 * tests/existing.at (GNU Cim Grammar): Adjust.
17375
17376 2002-06-11 Akim Demaille <akim@epita.fr>
17377
17378 * src/reader.c (grammar_midrule_action): New, Eved out from
17379 (readgram): here.
17380
17381 2002-06-11 Akim Demaille <akim@epita.fr>
17382
17383 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17384 New.
17385 (readgram): Use them as replacement of inlined code, crule and
17386 crule1.
17387
17388 2002-06-11 Akim Demaille <akim@epita.fr>
17389
17390 * src/reader.c (grammar_end, grammar_symbol_append): New.
17391 (readgram): Use them.
17392 Make the use of `p' as local as possible.
17393
17394 2002-06-10 Akim Demaille <akim@epita.fr>
17395
17396 GCJ's parser requires the tokens to be defined before the prologue.
17397
17398 * data/bison.simple: Output the token definition before the user's
17399 prologue.
17400 * tests/regression.at (Braces parsing, Duplicate string)
17401 (Mixing %token styles): Check the output from bison.
17402 (Early token definitions): New.
17403
17404 2002-06-10 Akim Demaille <akim@epita.fr>
17405
17406 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17407 assigning twice the same user number to a token, so that we can
17408 use it in...
17409 * src/lex.c (lex): here.
17410 Also use `symbol_class_set' instead of hand written code.
17411 * src/reader.c (parse_assoc_decl): Likewise.
17412
17413 2002-06-10 Akim Demaille <akim@epita.fr>
17414
17415 * src/symtab.c, src/symtab.c (symbol_class_set)
17416 (symbol_user_token_number_set): New.
17417 * src/reader.c (parse_token_decl): Use them.
17418 Use a switch instead of ifs.
17419 Use a single argument.
17420
17421 2002-06-10 Akim Demaille <akim@epita.fr>
17422
17423 Remove `%thong' support as it is undocumented, unused, duplicates
17424 `%token's job, and creates useless e-mail traffic with people who
17425 want to know what it is, why it is undocumented, unused, and
17426 duplicates `%token's job.
17427
17428 * src/reader.c (parse_thong_decl): Remove.
17429 * src/options.c (option_table): Remove "thong".
17430 * src/lex.h (tok_thong): Remove.
17431
17432 2002-06-10 Akim Demaille <akim@epita.fr>
17433
17434 * src/symtab.c, src/symtab.c (symbol_type_set)
17435 (symbol_precedence_set): New.
17436 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17437 (value_components_used): Remove, unused.
17438
17439 2002-06-09 Akim Demaille <akim@epita.fr>
17440
17441 Move symbols handling code out of the reader.
17442
17443 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17444 (axiom): Move to...
17445 * src/symtab.h, src/symtab.c: here.
17446
17447 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17448 * src/reader.c (startval): Rename as...
17449 * src/symtab.h, src/symtab.c (startsymbol): this.
17450 * src/reader.c: Adjust.
17451
17452 * src/reader.c (symbol_check_defined, symbol_make_alias)
17453 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17454 (token_translations_init)
17455 Move to...
17456 * src/symtab.c: here.
17457 * src/reader.c (packsymbols): Move to...
17458 * src/symtab.h, src/symtab.c (symbols_pack): here.
17459 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17460 argument.
17461
17462 2002-06-03 Akim Demaille <akim@epita.fr>
17463
17464 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17465 then statements.
17466
17467 2002-06-03 Akim Demaille <akim@epita.fr>
17468
17469 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17470 structs with non literals.
17471 * src/scan-skel.l: never-interactive.
17472 * src/conflicts.c (enum conflict_resolution_e): No trailing
17473 comma.
17474 * src/getargs.c (usage): Split long literal strings.
17475 Reported by Hans Aberg.
17476
17477 2002-05-28 Akim Demaille <akim@epita.fr>
17478
17479 * data/bison.c++: Use C++ ostreams.
17480 (cdebug_): New member.
17481
17482 2002-05-28 Akim Demaille <akim@epita.fr>
17483
17484 * src/output.c (output_skeleton): Be sure to allocate enough room
17485 for `/' _and_ for `\0' in full_skeleton.
17486
17487 2002-05-28 Akim Demaille <akim@epita.fr>
17488
17489 * data/bison.c++: Catch up with bison.simple:
17490 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17491 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17492 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17493 and popping traces.
17494
17495 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17496
17497 * src/output.c (output_skeleton): Put an explicit path in front of
17498 the skeleton file name, rather than relying on the -I directory,
17499 to partially alleviate effects of having a skeleton file lying around
17500 in the current directory.
17501
17502 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17503
17504 * src/conflicts.c (log_resolution): Correct typo:
17505 obstack_printf should be obstack_fgrow1.
17506
17507 2002-05-26 Akim Demaille <akim@epita.fr>
17508
17509 * src/state.h (state_t): `solved_conflicts' is a new member.
17510 * src/LR0.c (new_state): Set it to 0.
17511 * src/conflicts.h, src/conflicts.c (print_conflicts)
17512 (free_conflicts, solve_conflicts): Rename as...
17513 (conflicts_print, conflicts_free, conflicts_solve): these.
17514 Adjust callers.
17515 * src/conflicts.c (enum conflict_resolution_e)
17516 (solved_conflicts_obstack): New, used by...
17517 (log_resolution): this.
17518 Adjust to attach the conflict resolution to each state.
17519 Complete the description with the precedence/associativity
17520 information.
17521 (resolve_sr_conflict): Adjust.
17522 * src/print.c (print_state): Output its solved_conflicts.
17523 * tests/conflicts.at (Unresolved SR Conflicts)
17524 (Solved SR Conflicts): Exercise --report=all.
17525
17526 2002-05-26 Akim Demaille <akim@epita.fr>
17527
17528 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17529 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17530 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17531 (token_number_t, item_number_as_token_number)
17532 (token_number_as_item_number, muscle_insert_token_number_table):
17533 Rename as...
17534 (symbol_number_t, item_number_as_symbol_number)
17535 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17536 these, since it is more appropriate.
17537
17538 2002-05-26 Akim Demaille <akim@epita.fr>
17539
17540 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17541 `Error:' lines.
17542 * data/bison.simple (yystos) [YYDEBUG]: New.
17543 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17544 error recovery.
17545 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17546
17547 2002-05-25 Akim Demaille <akim@epita.fr>
17548
17549 * doc/bison.texinfo (Debugging): Split into...
17550 (Tracing): this new section, its former contents, and...
17551 (Understanding): this new section.
17552 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17553 by...
17554 (report_flag): this.
17555 Adjust all dependencies.
17556 (report_args, report_types, report_argmatch): New.
17557 (usage, getargs): Report/support -r, --report.
17558 * src/options.h
17559 (struct option_table_struct): Rename as..,
17560 (struct option_table_s): this.
17561 Rename the `set_flag' member to `flag' to match with getopt_long's
17562 struct.
17563 * src/options.c (option_table): Split verbose into an entry for
17564 %verbose, and another for --verbose.
17565 Support --report/-r, so remove -r from the obsolete --raw.
17566 * src/print.c: Attach full item sets and lookaheads reports to
17567 report_flag instead of trace_flag.
17568 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17569
17570 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17571 and Paul Eggert <eggert@twinsun.com>
17572
17573 * data/bison.simple (yyparse): Correct error handling to conform to
17574 POSIX and yacc. Specifically, after syntax error is discovered,
17575 do not reduce further before shifting the error token.
17576 Clean up the code a bit by removing the labels yyerrdefault,
17577 yyerrhandle, yyerrpop.
17578 * NEWS: Document the above.
17579
17580 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17581
17582 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17583 type; it isn't always big enough, since it doesn't necessarily
17584 include non-terminals.
17585 (yytranslate): Expand definition of yy_token_number_type, so that
17586 the latter can be removed.
17587 (yy_token_number_type): Remove, only one use.
17588 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17589 don't use TokenNumberType as element type.
17590
17591 * tests/regression.at: Modify expected output to agree with change
17592 to yyr1 and yytranslate.
17593
17594 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17595
17596 * src/reader.c (parse_action): Use copy_character instead of
17597 obstack_1grow.
17598
17599 2002-05-13 Akim Demaille <akim@epita.fr>
17600
17601 * tests/regression.at (Token definitions): Prototype yylex and
17602 yyerror.
17603
17604 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17605
17606 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
17607 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17608 32-bit arithmetic.
17609 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17610
17611 2002-05-07 Akim Demaille <akim@epita.fr>
17612
17613 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17614 avoid GCC warnings.
17615
17616 2002-05-07 Akim Demaille <akim@epita.fr>
17617
17618 Kill GCC warnings.
17619
17620 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17621 over the RHS of each rule.
17622 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17623 * src/state.h (state_t): Member `nitems' is unsigned short.
17624 * src/LR0.c (get_state): Adjust.
17625 * src/reader.c (packgram): Likewise.
17626 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17627 `Type'.
17628 (muscle_insert_int_table): Remove, unused.
17629 (prepare_rules): Remove `max'.
17630
17631 2002-05-06 Akim Demaille <akim@epita.fr>
17632
17633 * src/closure.c (print_firsts): Display of the symbol tags.
17634 (bitmatrix_print): Move to...
17635 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17636 here.
17637 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17638
17639 2002-05-06 Akim Demaille <akim@epita.fr>
17640
17641 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17642 hash_do_for_each.
17643
17644 2002-05-06 Akim Demaille <akim@epita.fr>
17645
17646 * src/LR0.c (new_state, get_state): Instead of using the global
17647 `kernel_size' and `kernel_base', have two new arguments:
17648 `core_size' and `core'.
17649 Adjust callers.
17650
17651 2002-05-06 Akim Demaille <akim@epita.fr>
17652
17653 * src/reader.c (packgram): No longer end `ritem' with a 0
17654 sentinel: it is not used.
17655
17656 2002-05-05 Akim Demaille <akim@epita.fr>
17657
17658 New experimental feature: display the lookaheads in the report and
17659 graph.
17660
17661 * src/print (print_core): When --trace-flag, display the rules
17662 lookaheads.
17663 * src/print_graph.c (print_core): Likewise.
17664 Swap the arguments.
17665 Adjust caller.
17666
17667 2002-05-05 Akim Demaille <akim@epita.fr>
17668
17669 * tests/torture.at (Many lookaheads): New test.
17670
17671 2002-05-05 Akim Demaille <akim@epita.fr>
17672
17673 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17674 (GENERATE_MUSCLE_INSERT_TABLE): this.
17675 (output_int_table, output_unsigned_int_table, output_short_table)
17676 (output_token_number_table, output_item_number_table): Replace with...
17677 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17678 (muscle_insert_short_table, muscle_insert_token_number_table)
17679 (muscle_insert_item_number_table): these.
17680 Adjust all callers.
17681 (prepare_tokens): Don't free `translations', since...
17682 * src/reader.h, src/reader.c (grammar_free): do it.
17683 Move to...
17684 * src/gram.h, src/gram.c (grammar_free): here.
17685 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17686 b4_translate_max.
17687
17688 2002-05-05 Akim Demaille <akim@epita.fr>
17689
17690 * src/output.c (output_unsigned_int_table): New.
17691 (prepare_rules): `i' is unsigned.
17692 `prhs', `rline', `r2' are unsigned int.
17693 Rename muscle `rhs_number_max' as `rhs_max'.
17694 Output muscles `prhs_max', `rline_max', and `r2_max'.
17695 Free rline and r1.
17696 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17697 to compute types instead of constant types.
17698 * tests/regression.at (Web2c Actions): Adjust.
17699
17700 2002-05-04 Akim Demaille <akim@epita.fr>
17701
17702 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17703 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17704 Adjust dependencies.
17705 * src/output.c (token_definitions_output): Be sure not to output a
17706 `#define 'a'' when fed with `%token 'a' "a"'.
17707 * tests/regression.at (Token definitions): New.
17708
17709 2002-05-03 Paul Eggert <eggert@twinsun.com>
17710
17711 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17712 for K&R C.
17713
17714 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17715
17716 * Makefile.am (SUBDIRS): Remove intl.
17717 (EXTRA_DIST): Add config/config.rpath.
17718
17719 2002-05-03 Akim Demaille <akim@epita.fr>
17720
17721 * data/bison.simple (m4_if): Don't output empty enums.
17722 And actually, output valid enum definitions :(.
17723
17724 2002-05-03 Akim Demaille <akim@epita.fr>
17725
17726 * configure.bat: Remove, completely obsolete.
17727 * Makefile.am (EXTRA_DIST): Adjust.
17728 Don't distribute config.rpath...
17729 * config/Makefile.am (EXTRA_DIST): Do it.
17730
17731 2002-05-03 Akim Demaille <akim@epita.fr>
17732
17733 * configure.in (GETTEXT_VERSION): New.
17734 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17735
17736 2002-05-03 Akim Demaille <akim@epita.fr>
17737
17738 * data/bison.simple (b4_token_enum): New.
17739 (b4_token_defines): Use it to output tokens both as #define and
17740 enums.
17741 Suggested by Paul Eggert.
17742 * src/output.c (token_definitions_output): Don't output spurious
17743 white spaces.
17744
17745 2002-05-03 Akim Demaille <akim@epita.fr>
17746
17747 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17748
17749 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
17750
17751 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17752 Update the stack class, give a try to deque as the default container.
17753
17754 2002-05-02 Akim Demaille <akim@epita.fr>
17755
17756 * data/bison.simple (yyparse): Do not implement @$ = @1.
17757 (YYLLOC_DEFAULT): Adjust to do it.
17758 * doc/bison.texinfo (Location Default Action): Fix.
17759
17760 2002-05-02 Akim Demaille <akim@epita.fr>
17761
17762 * src/reader.c (parse_braces): Merge into...
17763 (parse_action): this.
17764
17765 2002-05-02 Akim Demaille <akim@epita.fr>
17766
17767 * configure.in (ALL_LINGUAS): Remove.
17768 * po/LINGUAS, hr.po: New.
17769
17770 2002-05-02 Akim Demaille <akim@epita.fr>
17771
17772 Remove the so called hairy (semantic) parsers.
17773
17774 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17775 * src/gram.h, src/gram.c (semantic_parser): Remove.
17776 (rule_t): Remove the guard and guard_line members.
17777 * src/lex.h (token_t): remove tok_guard.
17778 * src/options.c (option_table): Remove %guard and %semantic_parser
17779 support.
17780 * src/output.c, src/output.h (guards_output): Remove.
17781 (prepare): Adjust.
17782 (token_definitions_output): Don't output the `T'
17783 tokens (???).
17784 (output_skeleton): Don't output the guards.
17785 * src/files.c, src/files.c (attrsfile): Remove.
17786 * src/reader.c (symbol_list): Remove the guard and guard_line
17787 members.
17788 Adjust dependencies.
17789 (parse_guard): Remove.
17790 * data/bison.hairy: Remove.
17791 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17792 BISON_HAIRY.
17793
17794 2002-05-02 Akim Demaille <akim@epita.fr>
17795
17796 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
17797 (parse_guard): Rename the formal argument `stack_offset' as
17798 `rule_length', which is more readable.
17799 Adjust callers.
17800 (copy_at, copy_dollar): Instead of outputting the hard coded
17801 values of $$, $n and so forth, output invocation to b4_lhs_value,
17802 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
17803 Note: this patch partially drops `semantic-parser' support: it
17804 always does `rule_length - n', where semantic parsers ought to
17805 always use `-n'.
17806 * data/bison.simple, data/bison.c++ (b4_lhs_value)
17807 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
17808
17809 2002-05-02 Akim Demaille <akim@epita.fr>
17810
17811 * configure.in (AC_INIT): Bump to 1.49b.
17812 (AM_INIT_AUTOMAKE): Short invocation.
17813
17814 2002-05-02 Akim Demaille <akim@epita.fr>
17815
17816 Version 1.49a.
17817
17818 2002-05-01 Akim Demaille <akim@epita.fr>
17819
17820 * src/skeleton.h: Remove.
17821
17822 2002-05-01 Akim Demaille <akim@epita.fr>
17823
17824 * src/skeleton.h: Fix the #endif.
17825 Reported by Magnus Fromreide.
17826
17827 2002-04-26 Paul Eggert <eggert@twinsun.com>
17828
17829 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
17830 Define if we define YYSTYPE and YYLTYPE, respectively.
17831 (YYCOPY): Fix [] quoting problem in the non-GCC case.
17832
17833 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
17834
17835 * src/scan-skel.l: Postprocess quadrigraphs.
17836
17837 * src/reader.c (copy_character): New function, used to output
17838 single characters while replacing `[' and `]' with quadrigraphs, to
17839 avoid troubles with M4 quotes.
17840 (copy_comment): Output characters with copy_character.
17841 (read_additionnal_code): Likewise.
17842 (copy_string2): Likewise.
17843 (copy_definition): Likewise.
17844
17845 * tests/calc.at: Exercise M4 quoting.
17846
17847 2002-04-25 Akim Demaille <akim@epita.fr>
17848
17849 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
17850 between `!' and the command.
17851 Reported by Paul Eggert.
17852
17853 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
17854
17855 * tests/calc.at: Exercise prologue splitting.
17856
17857 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
17858 `b4_post_prologue' instead of `b4_prologue'.
17859
17860 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
17861 muscles.
17862 (output): Free pre_prologue_obstack and post_prologue_obstack.
17863 * src/files.h, src/files.c (attrs_obstack): Remove.
17864 (pre_prologue_obstack, post_prologue_obstack): New.
17865 * src/reader.c (copy_definition): Add a parameter to specify the
17866 obstack to fill, instead of using attrs_obstack unconditionally.
17867 (read_declarations): Pass pre_prologue_obstack to copy_definition if
17868 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
17869
17870 2002-04-23 Paul Eggert <eggert@twinsun.com>
17871
17872 * data/bison.simple: Remove unnecessary commentary and white
17873 space differences from 1_29-branch.
17874 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
17875
17876 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
17877 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
17878 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
17879 constructors or destructors.
17880
17881 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
17882
17883 2002-04-23 Akim Demaille <akim@epita.fr>
17884
17885 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
17886 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
17887 location with columns.
17888 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
17889 All reported by Paul Eggert.
17890
17891 2002-04-22 Akim Demaille <akim@epita.fr>
17892
17893 * src/reduce.c (dump_grammar): Move to...
17894 * src/gram.h, src/gram.c (grammar_dump): here.
17895 Be sure to separate long item numbers.
17896 Don't read the members of a rule's prec if its nil.
17897
17898 2002-04-22 Akim Demaille <akim@epita.fr>
17899
17900 * src/output.c (table_size, table_grow): New.
17901 (MAXTABLE): Remove, replace uses with table_size.
17902 (pack_vector): Instead of dying when the table is too big, grow it.
17903
17904 2002-04-22 Akim Demaille <akim@epita.fr>
17905
17906 * data/bison.simple (yyr1): Its type is that of a token number.
17907 * data/bison.c++ (r1_): Likewise.
17908 * tests/regression.at (Web2c Actions): Adjust.
17909
17910 2002-04-22 Akim Demaille <akim@epita.fr>
17911
17912 * src/reader.c (token_translations_init): 256 is now the default
17913 value for the error token, i.e., it will be assigned another
17914 number if the user assigned 256 to one of her tokens.
17915 (reader): Don't force 256 to error.
17916 * doc/bison.texinfo (Symbols): Adjust.
17917 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
17918 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
17919 etc. instead of 10, 20, 30 (which was used to `jump' over error
17920 (256) and undefined (2)).
17921
17922 2002-04-22 Akim Demaille <akim@epita.fr>
17923
17924 Propagate more token_number_t.
17925
17926 * src/gram.h (token_number_as_item_number)
17927 (item_number_as_token_number): New.
17928 * src/output.c (GENERATE_OUTPUT_TABLE): New.
17929 Use it to create output_item_number_table and
17930 output_token_number_table.
17931 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17932 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
17933 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
17934 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
17935
17936 2002-04-22 Akim Demaille <akim@epita.fr>
17937
17938 * src/output.h, src/output.c (get_lines_number): Remove.
17939
17940 2002-04-19 Akim Demaille <akim@epita.fr>
17941
17942 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
17943 as Lex/Flex'.
17944 (Debugging): More details about enabling the debugging features.
17945 (Table of Symbols): Describe $$, $n, @$, and @n.
17946 Suggested by Tim Josling.
17947
17948 2002-04-19 Akim Demaille <akim@epita.fr>
17949
17950 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
17951
17952 2002-04-10 Akim Demaille <akim@epita.fr>
17953
17954 * src/system.h: Rely on HAVE_LIMITS_H.
17955 Suggested by Paul Eggert.
17956
17957 2002-04-09 Akim Demaille <akim@epita.fr>
17958
17959 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
17960 full stderr, and strip it according to the bison options, instead
17961 of composing the error message from different bits.
17962 This makes it easier to check for several error messages.
17963 Adjust all the invocations.
17964 Add an invocation exercising the error token.
17965 Add an invocation demonstrating a stupid error message.
17966 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
17967 Adjust the tests.
17968 Error message are for stderr, not stdout.
17969
17970 2002-04-09 Akim Demaille <akim@epita.fr>
17971
17972 * src/gram.h, src/gram.c (error_token_number): Remove, use
17973 errtoken->number.
17974 * src/reader.c (reader): Don't specify the user token number (2)
17975 for $undefined, as it uselessly prevents using it.
17976 * src/gram.h (token_number_t): Move to...
17977 * src/symtab.h: here.
17978 (state_t.number): Is a token_number_t.
17979 * src/print.c, src/reader.c: Use undeftoken->number instead of
17980 hard coded 2.
17981 (Even though this 2 is not the same as above: the number of the
17982 undeftoken remains being 2, it is its user token number which
17983 might not be 2).
17984 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
17985 `user_token_number_max'.
17986 Output `undef_token_number'.
17987 * data/bison.simple, data/bison.c++: Use them.
17988 Be sure to map invalid yylex return values to
17989 `undef_token_number'. This saves us from gratuitous SEGV.
17990
17991 * tests/conflicts.at (Solved SR Conflicts)
17992 (Unresolved SR Conflicts): Adjust.
17993 * tests/regression.at (Web2c Actions): Adjust.
17994
17995 2002-04-08 Akim Demaille <akim@epita.fr>
17996
17997 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
17998 Adding #line.
17999 Remove the duplicate `typedefs'.
18000 (RhsNumberType): Fix the declaration and various other typos.
18001 Use __ofile__.
18002 * data/bison.simple: Use __ofile__.
18003 * src/scan-skel.l: Handle __ofile__.
18004
18005 2002-04-08 Akim Demaille <akim@epita.fr>
18006
18007 * src/gram.h (item_number_t): New, the type of item numbers in
18008 RITEM. Note that it must be able to code symbol numbers as
18009 positive number, and the negation of rule numbers as negative
18010 numbers.
18011 Adjust all dependencies (pretty many).
18012 * src/reduce.c (rule): Remove this `short *' pointer: use
18013 item_number_t.
18014 * src/system.h (MINSHORT, MAXSHORT): Remove.
18015 Include `limits.h'.
18016 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
18017 (shortcpy): Remove.
18018 (MAXTABLE): Move to...
18019 * src/output.c (MAXTABLE): here.
18020 (prepare_rules): Use output_int_table to output rhs.
18021 * data/bison.simple, data/bison.c++: Adjust.
18022 * tests/torture.at (Big triangle): Move the limit from 254 to
18023 500.
18024 * tests/regression.at (Web2c Actions): Ajust.
18025
18026 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
18027 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18028 passes, but produces negative #line number, once fixed, GCC is
18029 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18030 C), it passes.
18031 * src/state.h (state_h): Code input lines on ints, not shorts.
18032
18033 2002-04-08 Akim Demaille <akim@epita.fr>
18034
18035 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18036 and then the grammar.
18037
18038 2002-04-08 Akim Demaille <akim@epita.fr>
18039
18040 * src/system.h: No longer using strndup.
18041
18042 2002-04-07 Akim Demaille <akim@epita.fr>
18043
18044 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18045 * src/output.c (output_table_data): Return the longest number.
18046 (prepare_tokens): Output `token_number_max').
18047 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18048 New.
18049 Use them to define yy_token_number_type/TokenNumberType.
18050 Use this type for yytranslate.
18051 * tests/torture.at (Big triangle): Push the limit from 124 to
18052 253.
18053 * tests/regression.at (Web2c Actions): Adjust.
18054
18055 2002-04-07 Akim Demaille <akim@epita.fr>
18056
18057 * tests/torture.at (Big triangle): New.
18058 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18059 * tests/existing.at: here.
18060
18061 2002-04-07 Akim Demaille <akim@epita.fr>
18062
18063 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18064 nritems.
18065 Adjust dependencies.
18066
18067 2002-04-07 Akim Demaille <akim@epita.fr>
18068
18069 * src/reader.c: Normalize increments to prefix form.
18070
18071 2002-04-07 Akim Demaille <akim@epita.fr>
18072
18073 * src/reader.c, symtab.c: Remove debugging code.
18074
18075 2002-04-07 Akim Demaille <akim@epita.fr>
18076
18077 Rename all the `bucket's as `symbol_t'.
18078
18079 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18080 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18081 * src/symtab.c, src/symtab.h (bucket): Rename as...
18082 (symbol_t): this.
18083 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18084 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18085 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18086 (buckets_new, buckets_free, buckets_do): Rename as...
18087 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18088 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18089 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18090 (symbols_new, symbols_free, symbols_do): these.
18091
18092 2002-04-07 Akim Demaille <akim@epita.fr>
18093
18094 Use lib/hash for the symbol table.
18095
18096 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18097 EOF.
18098 * src/lex.c (lex): Set the `number' member of new terminals.
18099 * src/reader.c (bucket_check_defined, bucket_make_alias)
18100 (bucket_check_alias_consistence, bucket_translation): New.
18101 (reader, grammar_free, readgram, token_translations_init)
18102 (packsymbols): Adjust.
18103 (reader): Number the predefined tokens.
18104 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18105 for predefined tokens.
18106 * src/symtab.h (bucket): Remove all the hash table related
18107 members.
18108 * src/symtab.c (symtab): Replace by...
18109 (bucket_table): this.
18110 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18111 (buckets_new, buckets_do): New.
18112
18113 2002-04-07 Akim Demaille <akim@epita.fr>
18114
18115 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
18116 (start_symbol, max_user_token_number, semantic_parser)
18117 (error_token_number): Initialize.
18118 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
18119 Initialize.
18120 (reader): Don't.
18121 (errtoken, eoftoken, undeftoken, axiom): Extern.
18122
18123 2002-04-07 Akim Demaille <akim@epita.fr>
18124
18125 * src/gram.h (rule_s): prec and precsym are now pointers
18126 to the bucket giving the priority/associativity.
18127 Member `associativity' removed: useless.
18128 * src/reduce.c, src/conflicts.c: Adjust.
18129
18130 2002-04-07 Akim Demaille <akim@epita.fr>
18131
18132 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
18133 Properly escape the symbols' TAG when outputting them.
18134
18135 2002-04-07 Akim Demaille <akim@epita.fr>
18136
18137 * src/lalr.h (LA): Is a bitsetv, not bitset*.
18138
18139 2002-04-07 Akim Demaille <akim@epita.fr>
18140
18141 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
18142 (LArule): this, which is an array to rule_t*.
18143 * src/print.c, src/conflicts.c: Adjust.
18144
18145 2002-04-07 Akim Demaille <akim@epita.fr>
18146
18147 * src/gram.h (rule_t): Rename `number' as `user_number'.
18148 `number' is a new member.
18149 Adjust dependencies.
18150 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
18151
18152 2002-04-07 Akim Demaille <akim@epita.fr>
18153
18154 As a result of the previous patch, it is no longer needed
18155 to reorder ritem itself.
18156
18157 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
18158
18159 2002-04-07 Akim Demaille <akim@epita.fr>
18160
18161 Be sure never to walk through RITEMS, but use only data related to
18162 the rules themselves. RITEMS should be banished.
18163
18164 * src/output.c (output_token_translations): Rename as...
18165 (prepare_tokens): this.
18166 In addition to `translate', prepare the muscles `tname' and
18167 `toknum', which were handled by...
18168 (output_rule_data): this.
18169 Remove, and move the remainder of its outputs into...
18170 (prepare_rules): this new routines, which also merges content from
18171 (output_gram): this.
18172 (prepare_rules): Be sure never to walk through RITEMS.
18173 (output_stos): Rename as...
18174 (prepare_stos): this.
18175 (output): Always invoke prepare_states, after all, just don't use it
18176 in the output if you don't need it.
18177
18178 2002-04-07 Akim Demaille <akim@epita.fr>
18179
18180 * src/LR0.c (new_state): Display `nstates' as the name of the
18181 newly created state.
18182 Adjust to initialize first_state and last_state if needed.
18183 Be sure to distinguish the initial from the final state.
18184 (new_states): Create the itemset of the initial state, and use
18185 new_state.
18186 * src/closure.c (closure): Now that the initial state has its
18187 items properly set, there is no need for a special case when
18188 creating `ruleset'.
18189
18190 As a result, now the rule 0, reducing to $axiom, is visible in the
18191 outputs. Adjust the test suite.
18192
18193 * tests/conflicts.at (Solved SR Conflicts)
18194 (Unresolved SR Conflicts): Adjust.
18195 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
18196 * tests/conflicts.at (S/R in initial): New.
18197
18198 2002-04-07 Akim Demaille <akim@epita.fr>
18199
18200 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
18201 the RHS of the rules.
18202 * src/output.c (output_gram): Likewise.
18203
18204 2002-04-07 Akim Demaille <akim@epita.fr>
18205
18206 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
18207 bucket.
18208 Adjust all dependencies.
18209 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
18210 `number' of the buckets too.
18211 * src/gram.h: Include `symtab.h'.
18212 (associativity): Move to...
18213 * src/symtab.h: here.
18214 No longer include `gram.h'.
18215
18216 2002-04-07 Akim Demaille <akim@epita.fr>
18217
18218 * src/gram.h, src/gram.c (rules_rhs_length): New.
18219 (ritem_longest_rhs): Use it.
18220 * src/gram.h (rule_t): `number' is a new member.
18221 * src/reader.c (packgram): Set it.
18222 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
18223 the end of `rules', and count them out of `nrules'.
18224 (reduce_output, dump_grammar): Adjust.
18225 * src/print.c (print_grammar): It is no longer needed to check for
18226 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
18227 * tests/reduce.at (Reduced Automaton): New test.
18228
18229 2002-04-07 Akim Demaille <akim@epita.fr>
18230
18231 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
18232 lacking `+ 1' to nrules, Bison reported as useless a token if it
18233 was used solely to set the precedence of the last rule...
18234
18235 2002-04-07 Akim Demaille <akim@epita.fr>
18236
18237 * data/bison.c++, data/bison.simple: Don't output the current file
18238 name in #line, to avoid useless diffs between two identical
18239 outputs under different names.
18240
18241 2002-04-07 Akim Demaille <akim@epita.fr>
18242
18243 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
18244 Normalize loops to using `< nrules + 1', not `<= nrules'.
18245
18246 2002-04-07 Akim Demaille <akim@epita.fr>
18247
18248 * TODO: Update.
18249
18250 2002-04-07 Akim Demaille <akim@epita.fr>
18251
18252 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
18253 bucket.value as bucket.number.
18254
18255 2002-04-07 Akim Demaille <akim@epita.fr>
18256
18257 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
18258 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18259 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
18260 RHS, instead of being an index in RITEMS.
18261
18262 2002-04-04 Paul Eggert <eggert@twinsun.com>
18263
18264 * doc/bison.texinfo: Update copyright date.
18265 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18266 (Symbols): Warn about running Bison in one character set,
18267 but compiling and/or running in an incompatible one.
18268 Warn about character code 256, too.
18269
18270 2002-04-03 Paul Eggert <eggert@twinsun.com>
18271
18272 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18273 YYERROR_VERBOSE is nonzero, not whether it is defined.
18274
18275 Merge changes from bison-1_29-branch.
18276
18277 2002-03-20 Paul Eggert <eggert@twinsun.com>
18278
18279 Merge fixes from Debian bison_1.34-1.diff.
18280
18281 * configure.in (AC_PREREQ): 2.53.
18282
18283 2002-03-20 Akim Demaille <akim@epita.fr>
18284
18285 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18286
18287 2002-03-19 Paul Eggert <eggert@twinsun.com>
18288
18289 * src/bison.simple (YYCOPY): New macro.
18290 (YYSTACK_RELOCATE): Use it.
18291 Remove Type arg; no longer needed. All callers changed.
18292 (yymemcpy): Remove; no longer needed.
18293
18294 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18295 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18296
18297 2002-03-19 Akim Demaille <akim@epita.fr>
18298
18299 Test and fix the #line outputs.
18300
18301 * tests/atlocal.at (GCC): New.
18302 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
18303 (Prologue synch line, %union synch line, Postprologue synch line)
18304 (Action synch line, Epilogue synch line): New tests.
18305 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18306 * data/bison.simple, data/bison.c++: Use it.
18307
18308 2002-03-19 Akim Demaille <akim@epita.fr>
18309
18310 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18311 (Solved SR Conflicts, %expect not enough, %expect right)
18312 (%expect too much): Move to...
18313 * tests/conflicts.at: this new file.
18314
18315 2002-03-19 Akim Demaille <akim@epita.fr>
18316
18317 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18318 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18319 that we can move to enums for instance.
18320 * src/output.c (token_definitions_output): Output a list of
18321 `token-name, token-number' instead of the #define.
18322 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18323
18324 2002-03-14 Akim Demaille <akim@epita.fr>
18325
18326 Use Gettext 0.11.1.
18327
18328 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
18329
18330 * data/bison.c++: Make the user able to add members to the generated
18331 parser by subclassing.
18332
18333 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
18334
18335 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18336 a character.
18337 Reported by Nicolas Tisserand and Nicolas Burrus.
18338
18339 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18340
18341 * src/reader.c: Warn about lacking semi-colons, do not complain.
18342
18343 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18344
18345 * data/bison.c++: Remove a debug line.
18346
18347 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18348
18349 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18350 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18351 provide a default implementation.
18352
18353 2002-03-04 Akim Demaille <akim@epita.fr>
18354
18355 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18356 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18357 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18358 * tests/semantic.at (Parsing Guards): Similarly.
18359 * src/reader.at (readgram): Complain if the last rule is not ended
18360 with a semi-colon.
18361
18362 2002-03-04 Akim Demaille <akim@epita.fr>
18363
18364 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18365 * src/closure.c: here.
18366 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18367 RTC.
18368 * src/warshall.h, src/warshall.c: Remove.
18369 * tests/sets.at (Broken Closure): Adjust.
18370
18371 2002-03-04 Akim Demaille <akim@epita.fr>
18372
18373 * src/output.c (output_skeleton): tempdir is const.
18374 bytes_read is unused.
18375
18376 2002-03-04 Akim Demaille <akim@epita.fr>
18377
18378 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18379 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18380 Update.
18381 From Michael Hayes.
18382
18383 2002-03-04 Akim Demaille <akim@epita.fr>
18384
18385 * src/closure.c (closure): `r' is unused.
18386
18387 2002-03-04 Akim Demaille <akim@epita.fr>
18388
18389 * tests/sets.at (Broken Closure): Add the ending `;'.
18390 * src/reader.at (readgram): Complain if a rule is not ended with a
18391 semi-colon.
18392
18393 2002-03-04 Akim Demaille <akim@epita.fr>
18394
18395 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18396 (count_sr_conflicts): Use bitset_count.
18397 * src/reduce.c (inaccessable_symbols): Ditto.
18398 (bits_size): Remove.
18399 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18400
18401 2002-03-04 Akim Demaille <akim@epita.fr>
18402
18403 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18404 * src/reduce.c: Remove the `bitset_zero's following the
18405 `bitset_create's, as now it is performed by the latter.
18406
18407 2002-03-04 Akim Demaille <akim@epita.fr>
18408
18409 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18410 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18411 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18412 latest sources from Michael.
18413
18414 2002-03-04 Akim Demaille <akim@epita.fr>
18415
18416 * src/output.c (output): Don't free the grammar.
18417 * src/reader.c (grammar_free): New.
18418 * src/main.c (main): Call it and don't free symtab here.
18419
18420 2002-03-04 Akim Demaille <akim@epita.fr>
18421
18422 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18423 before returning.
18424 Reported by Benoit Perrot.
18425
18426 2002-03-04 Akim Demaille <akim@epita.fr>
18427
18428 Use bitset operations when possible, not loops over bits.
18429
18430 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18431 bitset_or.
18432 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18433 * src/reduce.c (useless_nonterminals): Formatting changes.
18434 * src/warshall.c (TC): Use bitset_or.
18435
18436 2002-03-04 Akim Demaille <akim@epita.fr>
18437
18438 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18439 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18440 Ditto.
18441
18442 2002-03-04 Akim Demaille <akim@epita.fr>
18443
18444 * src/lalr.c (F): Now a bitset*.
18445 Adjust all dependencies.
18446
18447 2002-03-04 Akim Demaille <akim@epita.fr>
18448
18449 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18450 Adjust all dependencies.
18451
18452 2002-03-04 Akim Demaille <akim@epita.fr>
18453
18454 * src/L0.c, src/LR0.h (nstates): Be size_t.
18455 Adjust comparisons (signed vs unsigned).
18456 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18457 bitset*.
18458 Adjust all dependencies.
18459
18460 2002-03-04 Akim Demaille <akim@epita.fr>
18461
18462 * src/closure.c (firsts): Now, also a bitset.
18463 Adjust all dependencies.
18464 (varsetsize): Remove, now unused.
18465 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18466
18467 2002-03-04 Akim Demaille <akim@epita.fr>
18468
18469 * src/print.c: Convert to use bitset.h, not hand coded iterations
18470 over ints.
18471
18472 2002-03-04 Akim Demaille <akim@epita.fr>
18473
18474 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18475
18476 2002-03-04 Akim Demaille <akim@epita.fr>
18477
18478 * src/closure.c (ruleset): Be a bitset.
18479 (rulesetsize): Remove.
18480
18481 2002-03-04 Akim Demaille <akim@epita.fr>
18482
18483 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18484 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18485 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18486 * src/closure.c (fderives): Be an array of bitsets.
18487
18488 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
18489
18490 * data/bison.c++: Merge the two generated headers. Insert a copyright
18491 notice in each output file.
18492
18493 2002-02-28 Akim Demaille <akim@epita.fr>
18494
18495 * data/bison.c++: Copy the prologue of bison.simple to fetch
18496 useful M4 definitions, such as b4_header_guard.
18497
18498 2002-02-25 Akim Demaille <akim@epita.fr>
18499
18500 * src/getargs.c (version): Give the name of the authors, and use a
18501 translator friendly scheme for the bgr
18502 copyright notice.
18503
18504 2002-02-25 Akim Demaille <akim@epita.fr>
18505
18506 * src/output.c (header_output): Remove, now handled completely via
18507 M4.
18508
18509 2002-02-25 Akim Demaille <akim@epita.fr>
18510
18511 * m4/m4.m4: New, from CVS Autoconf.
18512 * configure.in: Invoke it.
18513 * src/output.c (output_skeleton): Use its result instead of the
18514 hard coded name.
18515
18516 2002-02-25 Akim Demaille <akim@epita.fr>
18517
18518 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18519 Fileutils 4.1.5.
18520 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18521 * src/output.c (output_skeleton): Use mkstemp to create a real
18522 temporary file.
18523 Move the filling of `skeleton' and its muscle to...
18524 (prepare): here.
18525 (output): Move the definition of the prologue muscle to...
18526 (prepare): here.
18527 * src/system.h (DEFAULT_TMPDIR): New.
18528
18529 2002-02-14 Paul Eggert <eggert@twinsun.com>
18530
18531 Remove the support for C++ namespace cleanliness; it was
18532 causing more problems than it was curing, since it didn't work
18533 properly on some nonstandard C++ compilers. This can wait
18534 for a proper C++ parser.
18535
18536 * NEWS: Document this.
18537 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18538 of C++, as it's treated like C now.
18539 * src/bison.simple (YYSTD): Remove.
18540 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18541 Treat C++ just like Standard C instead of trying to support
18542 namespace cleanliness.
18543
18544 2002-02-14 Akim Demaille <akim@epita.fr>
18545
18546 * tests/regression.at (else): Adjust to Andreas' change.
18547
18548 2002-02-14 Akim Demaille <akim@epita.fr>
18549
18550 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18551
18552 2002-02-13 Andreas Schwab <schwab@suse.de>
18553
18554 * src/output.c (output_rule_data): Don't output NULL, it might
18555 not be defined yet.
18556
18557 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
18558
18559 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18560 (Copyright notice): Update.
18561
18562 2002-02-11 Akim Demaille <akim@epita.fr>
18563
18564 * tests/regression.at (%nonassoc and eof): Don't include
18565 nonportable headers.
18566
18567 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
18568
18569 * data/bison.c++: Correct error recovery. Make the user able to
18570 initialize the starting location.
18571
18572 2002-02-07 Akim Demaille <akim@epita.fr>
18573
18574 * tests/input.at: New.
18575
18576 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
18577
18578 * data/bison.c++: Replace some direct m4 expansions by constants. Be
18579 more consistent when naming methods and variables. Put preprocessor
18580 directives around tables only needed for debugging.
18581
18582 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
18583
18584 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18585 C++ parsers.
18586 (yy::b4_name::parse): Use print_.
18587
18588 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
18589
18590 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18591
18592 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
18593
18594 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18595 C++ parsers.
18596 (yy::b4_name::parse): Build verbose error messages, and use error_.
18597
18598 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
18599
18600 * data/bison.c++: Fix m4 quoting in comments.
18601
18602 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
18603
18604 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18605 not expanded by m4.
18606
18607 2002-02-05 Akim Demaille <akim@epita.fr>
18608
18609 * data/bison.c++: Adjust to the M4 back end.
18610 More is certainly needed.
18611
18612 2002-02-05 Akim Demaille <akim@epita.fr>
18613
18614 Give a try to M4 as a back end.
18615
18616 * lib/readpipe.c: New, from wdiff.
18617 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18618 BISON_HAIRY.
18619 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18620 specific values. Now it is m4 that performs the lookup.
18621 * src/parse-skel.y: Remove.
18622 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18623 * src/output.c (actions_output, guards_output)
18624 (token_definitions_output): No longer keeps track of the output
18625 line number, hence remove the second argument.
18626 (guards_output): Check against the guard member of a rule, not the
18627 action member.
18628 Adjust callers.
18629 (output_skeleton): Don't look for the skeleton location, let m4 do
18630 that.
18631 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18632 file will be used.
18633 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18634 (prepare): Given that for the time being changesyntax is not
18635 usable in M4, rename the muscles using `-' to `_'.
18636 Define `defines_flag', `output_parser_name' and `output_header_name'.
18637 * src/output.h (actions_output, guards_output)
18638 (token_definitions_output): Adjust prototypes.
18639 * src/scan-skel.l: Instead of scanning the skeletons, it now
18640 processes the output of m4: `__oline__' and `#output'.
18641 * data/bison.simple: Adjust to be used by M4(sugar).
18642 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18643 to date.
18644 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18645 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18646 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18647 shamelessly stolen from CVS Autoconf.
18648
18649 2002-02-05 Akim Demaille <akim@epita.fr>
18650
18651 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18652 * configure.in: Check for the declarations of free and malloc.
18653 * src/muscle_tab.c: Adjust.
18654
18655 2002-02-05 Akim Demaille <akim@epita.fr>
18656
18657 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18658 which have no values.
18659
18660 2002-02-05 Akim Demaille <akim@epita.fr>
18661
18662 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18663 * data/: here.
18664
18665 2002-01-29 Paul Eggert <eggert@twinsun.com>
18666
18667 * src/bison.simple (YYSIZE_T): Do not define merely because
18668 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18669 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18670
18671 2002-01-27 Akim Demaille <akim@epita.fr>
18672
18673 Fix `%nonassoc and eof'.
18674
18675 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18676 which were not properly copied! Replace
18677 memcpy (res->errs, src->errs, src->nerrs);
18678 with
18679 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18680 !!!
18681 * tests/regression.at (%nonassoc and eof): Adjust to newest
18682 Autotest: `.' is not in the PATH.
18683
18684 2002-01-27 Akim Demaille <akim@epita.fr>
18685
18686 * tests/sets.at (AT_EXTRACT_SETS): New.
18687 (Nullable): Use it.
18688 (Firsts): New.
18689
18690 2002-01-26 Akim Demaille <akim@epita.fr>
18691
18692 * tests/actions.at, tests/calc.at, tests/headers.at,
18693 * tests/torture.at: Adjust to the newest Autotest which no longer
18694 forces `.' in the PATH.
18695
18696 2002-01-25 Akim Demaille <akim@epita.fr>
18697
18698 * tests/regression.at (%nonassoc and eof): New.
18699 Suggested by Robert Anisko.
18700
18701 2002-01-24 Akim Demaille <akim@epita.fr>
18702
18703 Bison dumps core when trying to complain about broken input files.
18704 Reported by Cris van Pelt.
18705
18706 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18707 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18708 into...
18709 (Invalid inputs): Strengthen: exercise parse_percent_token.
18710
18711 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
18712
18713 * src/Makefile.am: Add bison.c++.
18714 * src/bison.c++: New skeleton.
18715
18716 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
18717
18718 * po/it.po: New.
18719
18720 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18721
18722 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18723
18724 2002-01-20 Marc Autret <marc@gnu.org>
18725
18726 * src/files.c (compute_output_file_names): Fix
18727
18728 2002-01-20 Marc Autret <marc@gnu.org>
18729
18730 * tests/output.at: New test.
18731 * src/files.c (compute_base_names): Don't map extensions when
18732 the YACC flag is set, use defaults.
18733 Reported by Evgeny Stambulchik.
18734
18735 2002-01-20 Marc Autret <marc@gnu.org>
18736
18737 * src/system.h: Need to define __attribute__ away for non-GCC
18738 compilers as well (i.e., the vendor C compiler).
18739 Suggested by Albert Chin-A-Young.
18740
18741 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18742
18743 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18744 canonical definition.
18745 * src/system.h: Use the canonical definition for PARAMS (avoids
18746 a conflict with the macro from lib/hash.h).
18747
18748 2002-01-11 Akim Demaille <akim@epita.fr>
18749
18750 * configure.in: Use AC_FUNC_STRNLEN.
18751 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
18752
18753 2002-01-09 Akim Demaille <akim@epita.fr>
18754
18755 * src/files.c, src/files.h (output_infix): New.
18756 (tab_extension): Remove.
18757 (compute_base_names): Compute the former, drop the latter.
18758 * src/output.c (prepare): Insert the muscles `output-infix', and
18759 `output-suffix'.
18760 * src/parse-skel.y (string, string.1): New.
18761 (section.header): Use it.
18762 (section.yacc): Remove.
18763 (prefix): Remove too.
18764 * src/scan-skel.l: Adjust.
18765 * src/bison.simple, src/bison.hairy: Adjust.
18766
18767 2002-01-09 Akim Demaille <akim@epita.fr>
18768
18769 * configure.in (WERROR_CFLAGS): Compute it.
18770 * src/Makefile.am (CFLAGS): Pass it.
18771 * tests/atlocal.in (CFLAGS): Idem.
18772 * src/files.c: Fix a few warnings.
18773 (get_extension_index): Remove, unused.
18774
18775 2002-01-08 Akim Demaille <akim@epita.fr>
18776
18777 * src/getargs.c (AS_FILE_NAME): New.
18778 (getargs): Use it to convert DOSish file names.
18779 * src/files.c (base_name): Rename as full_base_name to avoid
18780 clashes with `base_name ()'.
18781 (filename_split): New.
18782 (compute_base_names): N-th rewrite, using filename_split.
18783
18784 2002-01-08 Akim Demaille <akim@epita.fr>
18785
18786 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18787 New, stolen from the Fileutils 4.1.
18788 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18789 * configure.in: Check for the presence of memrchr, and of its
18790 prototype.
18791
18792 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18793
18794 * lib/hash.h (__P): Added definition for this macro.
18795 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18796 BUILT_SOURCES, to ensure they are generated first.
18797 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
18798 %error-verbose to allow bootstrapping with bison 1.30x.
18799
18800 2002-01-06 Akim Demaille <akim@epita.fr>
18801
18802 * src/reader.c (parse_braces): Don't fetch the next char, the
18803 convention is to fetch on entry.
18804 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
18805 'switch' without a following semicolon.
18806 * tests/regression.at (braces parsing): New.
18807
18808 2002-01-06 Akim Demaille <akim@epita.fr>
18809
18810 Bison is dead wrong in its RR conflict reports.
18811
18812 * tests/torture.at (GNU Cim Grammar): New.
18813 * src/conflicts.c (count_rr_conflicts): Fix.
18814
18815 2002-01-06 Akim Demaille <akim@epita.fr>
18816
18817 Creating package.m4 from configure.ac causes too many problems.
18818
18819 * tests/Makefile.am (package.m4): Create it by hand,
18820 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
18821
18822 2002-01-06 Akim Demaille <akim@epita.fr>
18823
18824 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
18825 skeleton.h.
18826
18827 2002-01-04 Paul Eggert <eggert@twinsun.com>
18828
18829 * doc/bison.texinfo (Debugging):
18830 Remove YYSTDERR; it's no longer defined or used.
18831 Also, s/cstdio.h/cstdio/.
18832
18833 2002-01-03 Akim Demaille <akim@epita.fr>
18834
18835 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
18836
18837 2002-01-03 Akim Demaille <akim@epita.fr>
18838
18839 * src/parse-skel.y (process_skeleton): Don't bind the parser's
18840 tracing code to --trace, wait for a better --trace option, with
18841 args.
18842
18843 2002-01-03 Akim Demaille <akim@epita.fr>
18844
18845 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
18846 The ISO C++ standard is extremely clear about it: stderr is
18847 considered a macro, not a regular symbol (see table 94 `Header
18848 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
18849 Therefore std:: does not apply to it. It still does with fprintf.
18850 Also, s/cstdio.h/cstdio/.
18851
18852 2002-01-03 Akim Demaille <akim@epita.fr>
18853
18854 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
18855 for non system headers.
18856
18857 2002-01-02 Akim Demaille <akim@epita.fr>
18858
18859 Equip the skeleton chain with location tracking, runtime trace,
18860 pure parser and scanner.
18861
18862 * src/parse-skel.y: Request a pure parser, locations, and prefix
18863 renaming.
18864 (%union): Having several members with the same type does not help
18865 type mismatches, simplify.
18866 (YYPRINT, yyprint): New.
18867 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
18868 (skel_error): this.
18869 Handle locations.
18870 * src/scan-skel.l: Adjust to these changes.
18871 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
18872 (LOCATION_PRINT, skel_control_t): New.
18873
18874 2001-12-30 Akim Demaille <akim@epita.fr>
18875
18876 * src/parse-skel.y: Get rid of the shift/reduce conflict:
18877 replace `gb' with BLANKS.
18878 * src/scan-skel.l: Adjust.
18879
18880 2001-12-30 Akim Demaille <akim@epita.fr>
18881
18882 * src/system.h: We don't need nor want bcopy.
18883 Throw away MS-DOS crap: we don't need getpid.
18884 * configure.in: We don't need strndup. It was even causing
18885 problems: because Flex includes the headers *before* us,
18886 _GNU_SOURCE is not defined by config.h, and therefore strndup was
18887 not visible.
18888 * lib/xstrndup.c: New.
18889 * src/scan-skel.l: Use it.
18890 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
18891 * src/parse-skel.y: Use %directives instead of #defines.
18892
18893 2001-12-30 Akim Demaille <akim@epita.fr>
18894
18895 * src/skeleton.h: New.
18896 * src/output.c (output_parser, output_master_parser): Remove, dead
18897 code.
18898 * src/output.h (get_lines_number, actions_output, guards_output)
18899 (token_definitions_output): Prototype them.
18900 * src/parse-skel.y: Add the license notice.
18901 Include output.h and skeleton.h.
18902 (process_skeleton): Returns void, and takes a single parameter.
18903 * src/scan-skel.l: Add the license notice.
18904 Include skeleton.h.
18905 Don't use %option yylineno: it seems that then Flex imagines
18906 REJECT has been used, and therefore it won't reallocate its
18907 buffers (which makes no other sense to me than a bug). It results
18908 in warnings for `unused: yy_flex_realloc'.
18909
18910 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
18911
18912 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18913 (MUSCLE_INSERT_PREFIX): ...to there.
18914 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
18915 (MUSCLE_INSERT_PREFIX): Move from here...
18916
18917 * src/bison.hairy: Add a section directive. Put braces around muscle
18918 names. This parser skeleton is still broken, but Bison should not
18919 choke on a bad muscle 'syntax'.
18920 * src/bison.simple: Add a section directive. Put braces around muscle
18921 names.
18922
18923 * src/files.h (strsuffix, stringappend): Add declarations.
18924 (tab_extension): Add declaration.
18925 (short_base_name): Add declaration.
18926
18927 * src/files.c (strsuffix, stringappend): No longer static. These
18928 functions are used in the skeleton parser.
18929 (tab_extension): New.
18930 (compute_base_names): Use the computations done in this function
18931 to guess if the generated parsers should have '.tab' in their
18932 names.
18933 (short_base_name): No longer static.
18934
18935 * src/output.c (output_skeleton): New.
18936 (output): Disable call to output_master_parser, and give a try to
18937 a new skeleton handling system.
18938 (guards_output, actions_output): No longer static.
18939 (token_definitions_output, get_lines_number): No longer static.
18940
18941 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
18942
18943 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
18944 parse-skel.y.
18945
18946 * src/parse-skel.y: New file.
18947 * src/scan-skel.l: New file.
18948
18949 2001-12-29 Akim Demaille <akim@epita.fr>
18950
18951 %name-prefix is broken.
18952
18953 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
18954 Adjust all dependencies.
18955 * tests/headers.at (export YYLTYPE): Strengthen this test: use
18956 %name-prefix.
18957
18958 Renaming yylval but not yylloc is not consistent. Now we do.
18959
18960 * src/bison.simple: Prefix yylloc if used.
18961 * doc/bison.texinfo (Decl Summary): Document that.
18962
18963 2001-12-29 Akim Demaille <akim@epita.fr>
18964
18965 * doc/bison.texinfo: Promote `%long-directive' over
18966 `%long_directive'.
18967 Remove all references to fixed-output-files, yacc is enough.
18968
18969 2001-12-29 Akim Demaille <akim@epita.fr>
18970
18971 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
18972 user prologue. These are defaults.
18973 * tests/actions.at (Mid-rule actions): Make sure the user can
18974 define YYDEBUG and YYERROR_VERBOSE.
18975
18976 2001-12-29 Akim Demaille <akim@epita.fr>
18977
18978 * src/output.c (header_output): Don't forget to export YYLTYPE and
18979 yylloc.
18980 * tests/headers.at (export YYLTYPE): New, make sure it does.
18981 * tests/regression.at (%union and --defines, Invalid CPP headers):
18982 Move to...
18983 * tests/headers.at: here.
18984
18985 2001-12-29 Akim Demaille <akim@epita.fr>
18986
18987 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
18988
18989 2001-12-29 Akim Demaille <akim@epita.fr>
18990
18991 * tests/actions.at (Mid-rule actions): Output on a single line
18992 instead of several.
18993
18994 2001-12-29 Akim Demaille <akim@epita.fr>
18995
18996 * doc/bison.texinfo: Formatting changes.
18997
18998 2001-12-29 Akim Demaille <akim@epita.fr>
18999
19000 Don't store the token defs in a muscle, just be ready to output it
19001 on command. Now possible via `symbols'. Fixes a memory leak.
19002
19003 * src/output.c (token_definitions_output): New.
19004 (output_parser, header_output): Use it.
19005 * src/reader.c (symbols_save): Remove.
19006
19007 2001-12-29 Akim Demaille <akim@epita.fr>
19008
19009 * src/bison.simple: Do not provide a default for YYSTYPE and
19010 YYLTYPE before the user's prologue. Otherwise it's hardly... a
19011 default.
19012
19013 2001-12-29 Akim Demaille <akim@epita.fr>
19014
19015 Mid-rule actions are simply... ignored!
19016
19017 * src/reader.c (readgram): Be sure to attach mid-rule actions to
19018 the empty-rule associated to the dummy symbol, not to the host
19019 rule.
19020 * tests/actions.at (Mid-rule actions): New.
19021
19022 2001-12-29 Akim Demaille <akim@epita.fr>
19023
19024 Memory leak.
19025
19026 * src/reader.c (reader): Free grammar.
19027
19028 2001-12-29 Akim Demaille <akim@epita.fr>
19029
19030 Memory leak.
19031
19032 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19033 since it allocates it for each state, although only one is needed.
19034 (allocate_storage): Do it here.
19035
19036 2001-12-29 Akim Demaille <akim@epita.fr>
19037
19038 * src/options.h, src/options.c (create_long_option_table): Rename
19039 as...
19040 (long_option_table_new): this, with a clearer prototype.
19041 (percent_table): Remove, unused,
19042 * src/getargs.c (getargs): Adjust.
19043
19044 2001-12-29 Akim Demaille <akim@epita.fr>
19045
19046 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19047 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19048 as states.
19049
19050 2001-12-29 Akim Demaille <akim@epita.fr>
19051
19052 * src/lalr.c (build_relations): Rename `states' as `states1'.
19053 Sorry, I don't understand exactly what it is, no better name...
19054
19055 2001-12-29 Akim Demaille <akim@epita.fr>
19056
19057 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19058 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19059 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19060 as rules.
19061
19062 2001-12-29 Akim Demaille <akim@epita.fr>
19063
19064 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19065 ago.
19066
19067 2001-12-29 Akim Demaille <akim@epita.fr>
19068
19069 * src/reader.c, src/reader.h (user_toknums): Remove.
19070 Adjust all users to use symbols[i]->user_token_number.
19071
19072 2001-12-29 Akim Demaille <akim@epita.fr>
19073
19074 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19075 Adjust all users to use symbols[i]->prec or ->assoc.
19076
19077 2001-12-29 Akim Demaille <akim@epita.fr>
19078
19079 * src/reader.c, src/reader.h (tags): Remove.
19080 Adjust all users to use symbols[i]->tag.
19081
19082 2001-12-29 Akim Demaille <akim@epita.fr>
19083
19084 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19085 and rule_table.
19086 * src/reader.c (packsymbols): Fill this table.
19087 Drop sprec.
19088 * src/conflicts.c (resolve_sr_conflict): Adjust.
19089 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19090 single table.
19091 Use symbols[i]->tag instead of tags[i].
19092
19093 2001-12-29 Akim Demaille <akim@epita.fr>
19094
19095 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19096 In addition, put a comment in there, to replace...
19097 * tests/regression.at (%union and C comments): Remove.
19098
19099 2001-12-29 Akim Demaille <akim@epita.fr>
19100
19101 * tests/regression.at (Web2c Actions): Blindly move the actual
19102 output as expected output. The contents *seem* right to me, but I
19103 can't pretend reading perfectly parser tables... Nonetheless, all
19104 the other tests pass correctly, the table look OK, even though the
19105 presence of `$axiom' is to be noted: AFAICS it is useless (but
19106 harmless).
19107
19108 2001-12-29 Akim Demaille <akim@epita.fr>
19109
19110 * src/reader.c (readgram): Don't add the rule 0 if there were no
19111 rules read. In other words, add it _after_ having performed
19112 grammar sanity checks.
19113 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
19114
19115 2001-12-29 Akim Demaille <akim@epita.fr>
19116
19117 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
19118 visible, and some states have now a different number.
19119
19120 2001-12-29 Akim Demaille <akim@epita.fr>
19121
19122 * src/reader.c (readgram): Bind the initial rule's lineno to that
19123 of the first rule.
19124 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
19125 (Solved SR Conflicts): Adjust rule 0's line number.
19126
19127 2001-12-29 Akim Demaille <akim@epita.fr>
19128
19129 Fix the `GAWK Grammar' failure.
19130
19131 * src/LR0.c (final_state): Initialize to -1 so that we do compute
19132 the reductions of the first state which was mistakenly confused
19133 with the final state because precisely final_state was initialized
19134 to 0.
19135 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
19136 now noticed by Bison.
19137 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
19138 have a reduction on $default.
19139
19140 2001-12-29 Akim Demaille <akim@epita.fr>
19141
19142 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
19143 rule line numbers.
19144 * src/closure.c (print_closure): Likewise.
19145 * src/derives.c (print_derives): Likewise.
19146 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
19147 now.
19148
19149 2001-12-29 Akim Demaille <akim@epita.fr>
19150
19151 * src/lalr.c (lookaheads_print): New.
19152 (lalr): Call it when --trace-flag.
19153 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
19154 are dumped.
19155
19156 2001-12-29 Akim Demaille <akim@epita.fr>
19157
19158 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
19159 when walking through ritem, even via rule->rhs.
19160 * src/reduce.c (dump_grammar, useful_production, reduce_output)
19161 (useful_production, useless_nonterminals): Likewise.
19162 (reduce_grammar_tables): Likewise, plus update nritems.
19163 * src/nullable.c (set_nullable): Likewise.
19164 * src/lalr.c (build_relations): Likewise.
19165 * tests/sets.at (Nullable): Adjust.
19166 Fortunately, now, the $axiom is no longer nullable.
19167
19168 2001-12-29 Akim Demaille <akim@epita.fr>
19169
19170 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
19171 the 0-sentinel.
19172 * src/gram.c (ritem_longest_rhs): Likewise.
19173 * src/reduce.c (nonterminals_reduce): Likewise.
19174 * src/print_graph.c (print_graph): Likewise.
19175 * src/output.c (output_rule_data): Likewise.
19176 * src/nullable.c (set_nullable): Likewise.
19177
19178 2001-12-29 Akim Demaille <akim@epita.fr>
19179
19180 * src/output.c: Comment changes.
19181
19182 2001-12-27 Paul Eggert <eggert@twinsun.com>
19183
19184 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
19185 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
19186 Sparc, as they were causing more porting problems than the
19187 (minor) performance improvement was worth.
19188
19189 Also, catch up with 1.31's YYSTD.
19190
19191 2001-12-27 Akim Demaille <akim@epita.fr>
19192
19193 * src/output.c (output_gram): Rely on nritems, not the
19194 0-sentinel. See below.
19195 Use -1 as separator, not 0.
19196 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
19197 Rely on -1 as separator in yyrhs, instead of 0.
19198 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
19199 twice `Now at end of input', therefore there are two lines less to
19200 expect.
19201
19202 2001-12-27 Akim Demaille <akim@epita.fr>
19203
19204 * tests/regression.at (Unresolved SR Conflicts):
19205 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
19206 below.
19207
19208 2001-12-27 Akim Demaille <akim@epita.fr>
19209
19210 * src/LR0.c (new_state): Recognize the final state by the fact it
19211 is reached by eoftoken.
19212 (insert_start_shifting_state, insert_eof_shifting_state)
19213 (insert_accepting_state, augment_automaton): Remove, since now
19214 these states are automatically computed from the initial state.
19215 (generate_states): Adjust.
19216 * src/print.c: When reporting a rule number to the user, substract
19217 1, so that the axiom rule is rule 0, and the first user rule is 1.
19218 * src/reduce.c: Likewise.
19219 * src/print_graph.c (print_core): For the time being, just as for
19220 the report, depend upon --trace-flags to dump the full set of
19221 items.
19222 * src/reader.c (readgram): Once the grammar read, insert the rule
19223 0: `$axiom: START-SYMBOL $'.
19224 * tests/set.at: Adjust: rule 0 is now displayed, and since the
19225 number of the states has changed (the final state is no longer
19226 necessarily the last), catch up.
19227
19228 2001-12-27 Akim Demaille <akim@epita.fr>
19229
19230 Try to make the use of the eoftoken valid. Given that its value
19231 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
19232 is used instead of > 0 where appropriate, (ii), depend upon nritems
19233 instead of the 0-sentinel.
19234
19235 * src/gram.h, src/gram.c (nritems): New.
19236 Expected to be duplication of nitems, but for the time being...
19237 * src/reader.c (packgram): Assert nritems and nitems are equal.
19238 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
19239 * src/closure.c (print_closure, print_fderives): Likewise.
19240 * src/gram.c (ritem_print): Likewise.
19241 * src/print.c (print_core, print_grammar): Likewise.
19242 * src/print_graph.c: Likewise.
19243
19244 2001-12-27 Akim Demaille <akim@epita.fr>
19245
19246 * src/main.c (main): If there are complains after grammar
19247 reductions, then output the report anyway if requested, then die.
19248 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
19249 * src/reader.c (eoftoken): New.
19250 (parse_token_decl): If the token being defined has value `0', it
19251 is the eoftoken.
19252 (packsymbols): No longer hack `tags' to insert `$' by hand.
19253 Be sure to preserve the value of the eoftoken.
19254 (reader): Make sure eoftoken is defined.
19255 Initialize nsyms to 0: now eoftoken is created just like the others.
19256 * src/print.c (print_grammar): Don't special case the eof token.
19257 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
19258 lie anyway, albeit pleasant.
19259 * tests/calc.at: Exercise error messages with eoftoken.
19260 Change the grammar so that empty input is invalid.
19261 Adjust expectations.
19262 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19263
19264 2001-12-27 Akim Demaille <akim@epita.fr>
19265
19266 * configure.in: Check the protos of strchr ans strspn.
19267 Replace strchr if needed.
19268 * src/system.h: Provide the protos of strchr, strspn and memchr if
19269 missing.
19270 * lib/strchr.c: New.
19271 * src/reader.c (symbols_save): Use strchr.
19272
19273 2001-12-27 Akim Demaille <akim@epita.fr>
19274
19275 * src/print.c, src/print_graph.c (escape): New.
19276 Use it to quote the TAGS outputs.
19277 * src/print_graph.c (print_state): Now errors are in red, and
19278 reductions in green.
19279 Prefer high to wide: output the state number on a line of its own.
19280
19281 2001-12-27 Akim Demaille <akim@epita.fr>
19282
19283 * src/state.h, src/state.c (reductions_new): New.
19284 * src/LR0.c (set_state_table): Let all the states have a
19285 `reductions', even if reduced to 0.
19286 (save_reductions): Adjust.
19287 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19288 * src/print.c (print_reductions, print_actions): Adjust.
19289 * src/output.c (action_row): Adjust.
19290
19291 2001-12-27 Akim Demaille <akim@epita.fr>
19292
19293 * src/state.h, src/state.c (errs_new, errs_dup): New.
19294 * src/LR0.c (set_state_table): Let all the states have an errs,
19295 even if reduced to 0.
19296 * src/print.c (print_errs, print_reductions): Adjust.
19297 * src/output.c (output_actions, action_row): Adjust.
19298 * src/conflicts.c (resolve_sr_conflict): Adjust.
19299
19300 2001-12-27 Akim Demaille <akim@epita.fr>
19301
19302 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19303
19304 2001-12-27 Akim Demaille <akim@epita.fr>
19305
19306 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19307 * src/print.c: here.
19308 (lookaheadset, shiftset): New, used as additional storage by
19309 print_reductions.
19310 (print_results): Adjust.
19311 (print_shifts, print_gotos, print_errs): New, extracted from...
19312 (print_actions): here.
19313 * src/print_graph.c (print_actions): Remove dead code.
19314
19315 2001-12-27 Akim Demaille <akim@epita.fr>
19316
19317 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19318 `$n' and `@n'.
19319
19320 2001-12-27 Akim Demaille <akim@epita.fr>
19321
19322 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19323 (build_relations): Adjust.
19324
19325 2001-12-27 Akim Demaille <akim@epita.fr>
19326
19327 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19328 duplication.
19329
19330 2001-12-27 Akim Demaille <akim@epita.fr>
19331
19332 * src/reader.c (packgram): Catch nitems overflows.
19333
19334 2001-12-27 Akim Demaille <akim@epita.fr>
19335
19336 * src/files.c, src/files.h (guard_obstack): Remove.
19337 * src/output.c (output): Adjust.
19338 * src/reader.c (parse_braces): New, factoring...
19339 (copy_action, copy_guard): these two which are renamed as...
19340 (parse_action, parse_guard): these.
19341 As a voluntary consequence, using braces around guards is now
19342 mandatory.
19343
19344 2001-12-27 Akim Demaille <akim@epita.fr>
19345
19346 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19347 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19348 members.
19349 (symbol_list_new): Adjust.
19350 (copy_action): action_line is the first line, not the last.
19351 (copy_guard): Just as for actions, store the `action' only, not
19352 the switch/case/break flesh.
19353 Don't parse the user action that might follow the guard, let...
19354 (readgram): do it, i.e., now, there can be an action after a
19355 guard.
19356 In other words the guard is just explicitly optional.
19357 (packgram): Adjust.
19358 * src/output.c (guards_output): New.
19359 (output_parser): Call it when needed.
19360 (output): Also free the guard and attrs obstacks.
19361 * src/files.c, src/files.h (obstack_save): Remove.
19362 (output_files): Remove.
19363 As a result, if one needs the former `.act' file, using an
19364 appropriate skeleton which requires actions and guards is now
19365 required.
19366 * src/main.c (main): Adjust.
19367 * tests/semantic.at: New.
19368 * tests/regression.at: Use `input.y' as input file name.
19369 Avoid 8+3 problems by requiring input.c when the test needs the
19370 parser.
19371
19372 2001-12-27 Akim Demaille <akim@epita.fr>
19373
19374 * src/reader.c (symbol_list_new): Be sure to initialize all the
19375 fields.
19376
19377 2001-12-27 Akim Demaille <akim@epita.fr>
19378
19379 All the hacks using a final pseudo state are now useless.
19380
19381 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19382 * src/lalr.c (nLA): New.
19383 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19384 instead of lookaheadsp from the pseudo state (nstate + 1).
19385
19386 2001-12-27 Akim Demaille <akim@epita.fr>
19387
19388 * src/output.c (action_row, token_actions): Use a state_t instead
19389 of a integer, and nlookaheads instead of the following state's
19390 lookaheadsp.
19391
19392 2001-12-27 Akim Demaille <akim@epita.fr>
19393
19394 * src/conflicts.c (log_resolution, flush_shift)
19395 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19396 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19397 (conflicts_print, print_reductions): Use a state_t instead of an
19398 integer when referring to a state.
19399 As much as possible, depend upon nlookaheads, instead of the
19400 `lookaheadsp' member of the following state (since lookaheads of
19401 successive states are successive, the difference between state n + 1
19402 and n served as the number of lookaheads for state n).
19403 * src/lalr.c (add_lookback_edge): Likewise.
19404 * src/print.c (print_core, print_actions, print_state)
19405 (print_results): Likewise.
19406 * src/print_graph.c (print_core, print_actions, print_state)
19407 (print_graph): Likewise.
19408 * src/conflicts.h: Adjust.
19409
19410 2001-12-27 Akim Demaille <akim@epita.fr>
19411
19412 * src/bison.hairy: Formatting/comment changes.
19413 ANSIfy.
19414 Remove `register' indications.
19415 Add plenty of `static'.
19416
19417 2001-12-27 Akim Demaille <akim@epita.fr>
19418
19419 * src/output.c (prepare): Drop the muscle `ntbase' which
19420 duplicates ntokens.
19421 * src/bison.simple: Formatting/comment changes.
19422 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19423 is an undocumented synonym.
19424
19425 2001-12-22 Akim Demaille <akim@epita.fr>
19426
19427 * src/output.c (output_table_data): Change the prototype to use
19428 `int' for array ranges: some invocations do pass an int, not a
19429 short.
19430 Reported by Wayne Green.
19431
19432 2001-12-22 Akim Demaille <akim@epita.fr>
19433
19434 Some actions of web2c.y are improperly triggered.
19435 Reported by Mike Castle.
19436
19437 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19438 * tests/regression.at (Web2c): Rename as...
19439 (Web2c Report): this.
19440 (Web2c Actions): New.
19441
19442 2001-12-22 Akim Demaille <akim@epita.fr>
19443
19444 Reductions in web2c.y are improperly reported.
19445 Reported by Mike Castle.
19446
19447 * src/conflicts.c (print_reductions): Fix.
19448 * tests/regression.at (Web2c): New.
19449
19450 2001-12-18 Akim Demaille <akim@epita.fr>
19451
19452 Some host fail on `assert (!"foo")', which expands to
19453 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19454 Reported by Nelson Beebee.
19455
19456 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19457 `#define it_succeeded 0' and `assert (it_succeeded)'.
19458
19459 2001-12-17 Marc Autret <autret_m@epita.fr>
19460
19461 * src/bison.simple: Don't hard code the skeleton line and filename.
19462 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19463 New line counter 'skeleton_line' (skeleton-line muscle).
19464
19465 2001-12-17 Paul Eggert <eggert@twinsun.com>
19466
19467 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19468 YYDEBUG must be defined to a nonzero value.
19469
19470 * src/bison.simple (yytname): Do not assume that the user defines
19471 YYDEBUG to a properly parenthesized expression.
19472
19473 2001-12-17 Akim Demaille <akim@epita.fr>
19474
19475 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19476 nlookaheads is a new member.
19477 Adjust all users.
19478 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19479 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19480 state.
19481
19482 2001-12-17 Akim Demaille <akim@epita.fr>
19483
19484 * src/files.h, src/files.c (open_files, close_files): Remove.
19485 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19486 let...
19487 * src/reader.c (reader): Do it.
19488
19489 2001-12-17 Akim Demaille <akim@epita.fr>
19490
19491 * src/conflicts.c (print_reductions): Formatting changes.
19492
19493 2001-12-17 Akim Demaille <akim@epita.fr>
19494
19495 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19496 (flush_reduce): New.
19497 (resolve_sr_conflict): Adjust.
19498
19499 2001-12-17 Akim Demaille <akim@epita.fr>
19500
19501 * src/output.c (output_obstack): Be static and rename as...
19502 (format_obstack): this, to avoid any confusion with files.c's
19503 output_obstack.
19504 * src/reader.h (muscle_obstack): Move to...
19505 * src/output.h: here, since it's defined in output.c.
19506
19507 2001-12-17 Akim Demaille <akim@epita.fr>
19508
19509 * src/output.c (action_row, save_column, default_goto)
19510 (sort_actions, matching_state, pack_vector): Better variable
19511 locality.
19512
19513 2001-12-17 Akim Demaille <akim@epita.fr>
19514
19515 * src/output.c: Various formatting changes.
19516
19517 2001-12-17 Akim Demaille <akim@epita.fr>
19518
19519 * src/files.c (output_files): Free the output_obstack.
19520 * src/main.c (main): Call print and print_graph conditionally.
19521 * src/print.c (print): Work unconditionally.
19522 * src/print_graph.c (print_graph): Work unconditionally.
19523 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19524
19525 2001-12-16 Marc Autret <autret_m@epita.fr>
19526
19527 * src/output.c (actions_output): Fix. When we use %no-lines,
19528 there is one less line per action.
19529
19530 2001-12-16 Marc Autret <autret_m@epita.fr>
19531
19532 * src/bison.simple: Remove a useless #line directive.
19533 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19534 * src/output.c (get_lines_number): New.
19535 (output_parser): Adjust, now takes care about the lines of a
19536 output muscles.
19537 Fix line numbering.
19538 (actions_output): Computes the number of lines taken by actions.
19539 (output_master_parser): Insert new skeleton which is the name of
19540 the output parser file name.
19541
19542 2001-12-15 Marc Autret <autret_m@epita.fr>
19543
19544 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19545
19546 2001-12-15 Marc Autret <autret_m@epita.fr>
19547
19548 * src/output.c (output_gram): Keep track of the hairy one.
19549
19550 2001-12-15 Akim Demaille <akim@epita.fr>
19551
19552 Make `make distcheck' work.
19553
19554 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19555 system.h which uses libgettext.h.
19556
19557 2001-12-15 Akim Demaille <akim@epita.fr>
19558
19559 * src/nullable.c (set_nullable): Useless rules must be skipped,
19560 otherwise, since we range over their symbols, we might look at a
19561 nonterminal which no longer ``exists'', i.e., it is not counted in
19562 `nvars', hence we overflow our arrays.
19563
19564 2001-12-15 Akim Demaille <akim@epita.fr>
19565
19566 The header can also be produced directly, without any obstack!
19567 Yahoo!
19568
19569 * src/files.c, src/files.h (defines_obstack): Remove.
19570 (compute_header_macro): Global.
19571 (defines_obstack_save): Remove.
19572 * src/reader.c (parse_union_decl): No longer output to
19573 defines_obstack: its content can be found in the `stype' muscle
19574 anyway.
19575 (output_token_translations): Merge into...
19576 (symbols_output): this.
19577 Rename as...
19578 (symbols_save): this.
19579 (reader): Adjust.
19580 * src/output.c (header_output): New.
19581 (output): Call it.
19582
19583 2001-12-15 Akim Demaille <akim@epita.fr>
19584
19585 * src/reader.c (parse_union_decl): Instead of handling two obstack
19586 simultaneously, use one to define the `stype' muscle, and use the
19587 value of the latter to fill defines_obstack.
19588 (copy_comment): Remove.
19589 (copy_comment2): Work for a single obstack.
19590 Rename as...
19591 (copy_comment): this.
19592
19593 2001-12-15 Akim Demaille <akim@epita.fr>
19594
19595 * src/lex.c, src/lex.h (xgetc): No longer static.
19596 * src/reader.c (parse_union_decl): Revamp.
19597
19598 2001-12-15 Akim Demaille <akim@epita.fr>
19599
19600 Still making progress in separating Bison into (i) input, (ii)
19601 process, (iii) output: now we can directly output the parser file
19602 without using table_obstack at all.
19603
19604 * src/files.c, src/files.h (table_obstack): Bye bye.
19605 (parser_file_name): New.
19606 * src/files.c (compute_output_file_names): Compute it.
19607 * src/output.c (actions_output, output_parser)
19608 (output_master_parser): To a file instead of an obstack.
19609
19610 2001-12-15 Akim Demaille <akim@epita.fr>
19611
19612 Attach actions to rules, instead of pre-outputting them to
19613 actions_obstack.
19614
19615 * src/gram.h (rule_t): action and action_line are new members.
19616 * src/reader.c (symbol_list): Likewise.
19617 (copy_action): Save the actions within the rule.
19618 (packgram): Save them in rule_table.
19619 * src/output.c (actions_output): New.
19620 (output_parser): Use it on `%%actions'.
19621 (output_rule_data): Don't free rule_table.
19622 (output): Do it.
19623 (prepare): Don't save the `action' muscle.
19624 * src/bison.simple: s/%%action/%%actions/.
19625
19626 2001-12-15 Akim Demaille <akim@epita.fr>
19627
19628 * src/reader.c (copy_action): When --yacc, don't append a `;'
19629 to the user action: let it fail if lacking.
19630 Suggested by Arnold Robbins and Tom Tromey.
19631
19632 2001-12-14 Akim Demaille <akim@epita.fr>
19633
19634 * src/lex.c (literalchar): Simply return the char you decoded, non
19635 longer mess around with obstacks and int pointers.
19636 Adjust all callers.
19637
19638 2001-12-14 Akim Demaille <akim@epita.fr>
19639
19640 * src/lex.c (literalchar): Don't escape the special characters,
19641 just decode them, and keep them as char (before, eol was output as
19642 the 2 char string `\n' etc.).
19643 * src/output.c (output_rule_data): Use quotearg to output the
19644 token strings.
19645
19646 2001-12-13 Paul Eggert <eggert@twinsun.com>
19647
19648 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19649 Do not infringe on the global user namespace when using C++.
19650 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19651 All uses of `fprintf' and `stderr' changed.
19652
19653 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19654
19655 2001-12-13 Akim Demaille <akim@epita.fr>
19656
19657 The computation of nullable is broken: it doesn't handle empty
19658 RHS's properly.
19659
19660 * tests/torture.at (GNU AWK Grammar): New.
19661 * tests/sets.at (Nullable): New.
19662 * src/nullable.c (set_nullable): Instead of blindly looping over
19663 `ritems', loop over the rules, and then over their rhs's.
19664
19665 Work around Autotest bugs.
19666
19667 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19668 frame, because Autotest understand lines starting with a `+' as
19669 traces from the shell. Then, they are not processed properly.
19670 Admittedly an Autotest bug, but we don't have time to wait for
19671 Autotest to catch up.
19672 * tests/regression.at (Broken Closure): Adjust to the new table
19673 frames.
19674 Move to...
19675 * tests/sets.at: here.
19676
19677 2001-12-13 Akim Demaille <akim@epita.fr>
19678
19679 * src/closure.c (closure): Use nrules instead of playing tricks
19680 with BITS_PER_WORD.
19681
19682 2001-12-13 Akim Demaille <akim@epita.fr>
19683
19684 * src/print.c (print_actions): Output the handling of `$' as the
19685 traces do: shifting the token EOF. Before EOF was treated as a
19686 nonterminal.
19687 * tests/regression.at: Adjust some tests.
19688 * src/print_graph.c (print_core): Complete the set of items via
19689 closure. The next-to-final and final states are still unsatisfying,
19690 but that's to be addressed elsewhere.
19691 No longer output the rule numbers, but do output the state number.
19692 A single loop for the shifts + gotos is enough, but picked a
19693 distinct color for each.
19694 (print_graph): Initialize and finalize closure.
19695
19696 2001-12-13 Akim Demaille <akim@epita.fr>
19697
19698 * src/reader.c (readgram): Remove dead code, an strip useless
19699 braces.
19700 (get_type): Remove, unused.
19701
19702 2001-12-12 Akim Demaille <akim@epita.fr>
19703
19704 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19705 on that of lib/error.c.
19706
19707 2001-12-12 Akim Demaille <akim@epita.fr>
19708
19709 Some hosts don't like `/' in includes.
19710
19711 * src/system.h: Include libgettext.h without qualifying the path.
19712 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19713 $(top_srcdir).
19714
19715 2001-12-11 Marc Autret <autret_m@epita.fr>
19716
19717 * src/output.c (output_parser): Remove useless muscle.
19718
19719 2001-12-11 Marc Autret <autret_m@epita.fr>
19720
19721 * src/bison.simple: Remove #line just before %%epilogue. It
19722 is now handled in ...
19723 * src/reader.c (read_additionnal_code): Add the output of a
19724 #line for the epilogue.
19725
19726 2001-12-10 Marc Autret <autret_m@epita.fr>
19727
19728 * src/reader.c (copy_definition): Re-use CPP-outed code which
19729 replace precedent remove.
19730 * src/bison.simple: Remove #line before %%prologue because
19731 %%input-line is wrong at this time.
19732
19733 2001-12-10 Marc Autret <autret_m@epita.fr>
19734
19735 * src/reader.c (symbols_output): Clean up.
19736 * src/output.c (output_gram, output): Clean up.
19737
19738 2001-12-10 Akim Demaille <akim@epita.fr>
19739
19740 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19741 * src/LR0.c (set_state_table): here.
19742 * src/lalr.c (lalr): Call it.
19743
19744 2001-12-10 Akim Demaille <akim@epita.fr>
19745
19746 * src/state.h (shifts): Remove the `number' member: shifts are
19747 attached to state, hence no longer need to be labelled with a
19748 state number.
19749
19750 2001-12-10 Akim Demaille <akim@epita.fr>
19751
19752 Now that states have a complete set of members, the linked list of
19753 shifts is useless: just fill directly the state's shifts member.
19754
19755 * src/state.h (shifts): Remove the `next' member.
19756 * src/LR0.c (first_state, last_state): Remove.
19757 Adjust the callers.
19758 (augment_automaton): Don't look for the shifts that must be added
19759 a shift on EOF: it is those of the state we looked for! But now,
19760 since shifts are attached, it is no longer needed to looking
19761 merely by its id: its number.
19762
19763 2001-12-10 Akim Demaille <akim@epita.fr>
19764
19765 * src/LR0.c (augment_automaton): Better variable locality.
19766 Remove an impossible branch: if there is a state corresponding to
19767 the start symbol being shifted, then there is shift for the start
19768 symbol from the initial state.
19769
19770 2001-12-10 Akim Demaille <akim@epita.fr>
19771
19772 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19773 only when appropriate: when insert_start_shifting_state' is not
19774 invoked.
19775 * tests/regression.at (Rule Line Numbers): Adjust.
19776
19777 2001-12-10 Akim Demaille <akim@epita.fr>
19778
19779 * src/LR0.c (augment_automaton): Now that all states have shifts,
19780 merge the two cases addition shifts to the initial state.
19781
19782 2001-12-10 Akim Demaille <akim@epita.fr>
19783
19784 * src/lalr.c (set_state_table): Move to...
19785 * src/LR0.c: here.
19786 * src/lalr.c (lalr): Don't call it...
19787 * src/LR0.c (generate_states): do it.
19788 * src/LR0.h (first_state): Remove, only the table is used.
19789
19790 2001-12-10 Akim Demaille <akim@epita.fr>
19791
19792 * src/LR0.h (first_shift, first_reduction): Remove.
19793 * src/lalr.c: Don't use first_shift: find shifts through the
19794 states.
19795
19796 2001-12-10 Akim Demaille <akim@epita.fr>
19797
19798 * src/LR0.c: Attach shifts to states as soon as they are
19799 computed.
19800 * src/lalr.c (set_state_table): Instead of assigning shifts to
19801 state, just assert that the mapping was properly done.
19802
19803 2001-12-10 Akim Demaille <akim@epita.fr>
19804
19805 * src/LR0.c (insert_start_shift): Rename as...
19806 (insert_start_shifting_state): this.
19807 (insert_eof_shifting_state, insert_accepting_state): New.
19808 (augment_automaton): Adjust.
19809 Better locality of the variables.
19810 When looking if the start_symbol is shifted from the initial
19811 state, using `while (... symbol != start_symbol ...)' sounds
19812 better than `while (... symbol < start_symbol ...)': If fail
19813 to see how the order between symbols could be relevant!
19814
19815 2001-12-10 Akim Demaille <akim@epita.fr>
19816
19817 * src/getargs.h: Don't declare `spec_name_prefix' and
19818 `spec_file_prefix', declared by src/files.h.
19819 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
19820 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
19821 * src/output.c (prepare): Adjust.
19822 * src/reader.c (symbols_output): Likewise.
19823 * src/vmsgetargs.c: Vaguely adjust, but who cares?
19824
19825 2001-12-10 Akim Demaille <akim@epita.fr>
19826
19827 * src/muscle_tab.c (muscle_init): NULL is a better default than
19828 `"0"'.
19829
19830 2001-12-10 Akim Demaille <akim@epita.fr>
19831
19832 * src/reader.c (reader): Calling symbols_output once is enough.
19833
19834 2001-12-10 Akim Demaille <akim@epita.fr>
19835
19836 Now that states have a complete set of members, the linked list of
19837 reductions is useless: just fill directly the state's reductions
19838 member.
19839
19840 * src/state.h (struct reductions): Remove member `number' and
19841 `next'.
19842 * src/LR0.c (first_reduction, last_reduction): Remove.
19843 (save_reductions): Don't link the new reductions, store them in
19844 this_state.
19845 * src/lalr.c (set_state_table): No need to attach reductions to
19846 states, it's already done.
19847 * src/output.c (output_actions): No longer free the shifts, then
19848 the reductions, then the states: free all the states and their
19849 members.
19850
19851 2001-12-10 Akim Demaille <akim@epita.fr>
19852
19853 * src/options.c (OPTN, DRTV, BOTH): New.
19854 (option_table): Use them.
19855
19856 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
19857 the job of system.h.
19858 * src/options.c: Don't include stdio.h and xalloc.h for the same
19859 reasons.
19860
19861 2001-12-10 Akim Demaille <akim@epita.fr>
19862
19863 * src/output.c (output, prepare): Make sure the values of the
19864 muscles `action' and `prologue' are 0-terminated.
19865
19866 2001-12-10 Akim Demaille <akim@epita.fr>
19867
19868 Clean up GCC warnings.
19869
19870 * src/reader.c (copy_action): `buf' is not used.
19871 (parse_skel_decl): Be static.
19872 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
19873 * src/options.h (create_long_option_table): Have a real prototype.
19874 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
19875 (hash_delete_at): Return const void *.
19876 Adjust casts to preserve the const.
19877
19878 2001-12-10 Akim Demaille <akim@epita.fr>
19879
19880 * configure.in: Require 2.52g.
19881 M4 is not needed, but AUTOM4TE is.
19882 * m4/m4.m4: Remove.
19883 * tests/Makefile.am: Adjust.
19884
19885 2001-12-10 Akim Demaille <akim@epita.fr>
19886
19887 One structure for states is enough, even though theoretically
19888 there are LR(0) states and LALR(1) states.
19889
19890 * src/lalr.h (state_t): Remove.
19891 (state_table): Be state_t **, not state_t *.
19892 * src/state.h (core, CORE_ALLOC): Rename as...
19893 (state_t, STATE_ALLOC): this.
19894 Add the LALR(1) members: shifts, reductions, errs.
19895 * src/LR0.c (state_table): Rename as...
19896 (state_hash): this, to avoid name clashes with the global
19897 `state_table'.
19898 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
19899 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
19900
19901 2001-12-10 Akim Demaille <akim@epita.fr>
19902
19903 Bison dumps core on bash.y.
19904 Reported by Pascal Bart.
19905
19906 * src/warshall.c (bitmatrix_print): New.
19907 (TC): Use it.
19908 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
19909 j must be the outer loop.
19910 * tests/regression.at (Broken Closure): New.
19911
19912 2001-12-05 Akim Demaille <akim@epita.fr>
19913
19914 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
19915 its argument.
19916 Reported by Peter Hamorsky.
19917
19918 2001-12-05 Akim Demaille <akim@epita.fr>
19919
19920 * src/conflicts.c (err_table): Remove.
19921 (resolve_sr_conflict): Adjust.
19922 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
19923 Rename as...
19924 (state_t.reductions, state_t.shifts): this.
19925
19926 2001-12-05 Akim Demaille <akim@epita.fr>
19927
19928 * src/reduce.c (reduce_grammar_tables): No longer disable the
19929 removal of useless rules via CPP but via `if (0)', so that the
19930 compiler still check the code is valid.
19931 For instance, it should have noticed `rline' no longer exists: use
19932 the `line' member of rule_t.
19933 * src/gram.c (dummy, rline): Remove, unused.
19934
19935 2001-12-05 Akim Demaille <akim@epita.fr>
19936
19937 * src/output.c (pack_vector): Use assert, not berror.
19938 * src/main.c (berror): Remove, unused.
19939
19940 2001-12-05 Akim Demaille <akim@epita.fr>
19941
19942 New experimental feature: if --verbose --trace output all the
19943 items of a state, not only its kernel.
19944
19945 * src/print.c (print_core): If `trace_flag', then invoke closure
19946 before outputting the items of the state (print_core is no longer
19947 a correct name them).
19948 (print_results): Invoke new_closure/free_closure if needed.
19949
19950 2001-12-05 Akim Demaille <akim@epita.fr>
19951
19952 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
19953 * src/closure.c, src/closure.h (itemsetsize): Rename as...
19954 (nitemset): for consistency with the rest of the project.
19955
19956 2001-12-05 Akim Demaille <akim@epita.fr>
19957
19958 * src/closure.c (print_closure): Improve.
19959 (closure): Use it for printing input and output.
19960
19961 2001-12-05 Akim Demaille <akim@epita.fr>
19962
19963 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
19964 indexed by nonterminals.
19965
19966 2001-12-05 Akim Demaille <akim@epita.fr>
19967
19968 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
19969 what it was!).
19970 * src/warshall.h: Remove accidental duplication of the content.
19971
19972 2001-12-05 Akim Demaille <akim@epita.fr>
19973
19974 * src/closure.c (set_fderives): De-obfuscate.
19975
19976 2001-12-05 Akim Demaille <akim@epita.fr>
19977
19978 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
19979
19980 2001-12-05 Akim Demaille <akim@epita.fr>
19981
19982 * src/closure.c (set_firsts): De-obfuscate.
19983
19984 2001-12-05 Akim Demaille <akim@epita.fr>
19985
19986 * src/output.c (action_row): De-obfuscate
19987 using the good o' techniques: arrays not pointers, variable
19988 locality, BITISSET, RESETBIT etc.
19989
19990 2001-12-05 Akim Demaille <akim@epita.fr>
19991
19992 Pessimize the code to simplify it: from now on, all the states
19993 have a valid SHIFTS, which NSHIFTS is possibly 0.
19994
19995 * src/LR0.c (shifts_new): Be global and move to..
19996 * src/state.c, src/state.h: here.
19997 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
19998 * src/print_graph: Adjust.
19999
20000 2001-12-05 Akim Demaille <akim@epita.fr>
20001
20002 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
20003 * src/conflicts.c: Use it.
20004 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
20005 incorrectly ``simplified''.
20006
20007 2001-12-05 Akim Demaille <akim@epita.fr>
20008
20009 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
20010 using the good o' techniques: arrays not pointers, variable
20011 locality, BITISSET, RESETBIT etc.
20012
20013 2001-12-05 Akim Demaille <akim@epita.fr>
20014
20015 * src/state.h (SHIFT_SYMBOL): New.
20016 * src/conflicts.c: Use it to deobfuscate.
20017
20018 2001-12-05 Akim Demaille <akim@epita.fr>
20019
20020 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
20021 (print_reductions): De-obfuscate using the good o' techniques:
20022 arrays not pointers, variable locality, BITISSET.
20023
20024 2001-12-05 Akim Demaille <akim@epita.fr>
20025
20026 * src/conflicts.c (print_reductions): Arrays, not pointers.
20027 Use BITISSET.
20028
20029 2001-12-05 Akim Demaille <akim@epita.fr>
20030
20031 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20032
20033 2001-12-05 Akim Demaille <akim@epita.fr>
20034
20035 * src/conflicts.c (print_reductions): Improve variable locality.
20036
20037 2001-12-05 Akim Demaille <akim@epita.fr>
20038
20039 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20040
20041 2001-12-05 Akim Demaille <akim@epita.fr>
20042
20043 * src/conflicts.c (print_reductions): Improve variable locality.
20044
20045 2001-12-05 Akim Demaille <akim@epita.fr>
20046
20047 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20048 * src/lalr.c: Use them.
20049
20050 2001-12-05 Akim Demaille <akim@epita.fr>
20051
20052 * src/LR0.c (augment_automaton): Formatting changes.
20053 Better variable locality.
20054
20055 2001-12-05 Akim Demaille <akim@epita.fr>
20056
20057 * src/lalr.c (matrix_print): New.
20058 (transpose): Use it.
20059 Use arrays instead of pointers.
20060
20061 2001-12-05 Akim Demaille <akim@epita.fr>
20062
20063 * src/lalr.c (maxrhs): Move to...
20064 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20065 * src/lalr.c (build_relations): Adjust.
20066
20067 2001-12-05 Akim Demaille <akim@epita.fr>
20068
20069 * src/lalr.c (transpose): Free the memory allocated to the
20070 argument, as it is replaced by the results by the unique caller.
20071 (build_relations): Merely invoke transpose: it handles the memory
20072 deallocation.
20073 Improve variable locality.
20074 Avoid variables used as mere abbreviations.
20075 (compute_lookaheads): Use arrays instead of pointers.
20076
20077 2001-12-05 Akim Demaille <akim@epita.fr>
20078
20079 * src/lalr.c (initialize_F): Improve variable locality.
20080 Avoid variables used as mere abbreviations.
20081
20082 2001-12-05 Akim Demaille <akim@epita.fr>
20083
20084 * src/derives.c (print_derives): Display the ruleno.
20085 * src/lalr.c (initialize_F, transpose): Better variable locality
20086 to improve readability.
20087 Avoid variables used as mere abbreviations.
20088
20089 2001-12-05 Akim Demaille <akim@epita.fr>
20090
20091 * src/lalr.c (traverse): Use arrays instead of pointers.
20092
20093 2001-12-05 Akim Demaille <akim@epita.fr>
20094
20095 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20096 the handling of squeue.
20097 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20098
20099 2001-12-05 Akim Demaille <akim@epita.fr>
20100
20101 Because useless nonterminals are now kept alive (instead of being
20102 `destroyed'), we now sometimes examine them, and store information
20103 related to them. Hence we need to know their number, and adjust
20104 memory allocations.
20105
20106 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20107 static.
20108 * src/LR0.c (allocate_itemsets): The memory allocated to
20109 `symbol_count' was used for two different purpose: once to count
20110 the number of occurrences of each symbol, and later reassigned to
20111 `shift_symbol', containing the symbol that can be shifted from a
20112 given state.
20113 Deobfuscate, i.e., allocate, use and free `symbol_count' here
20114 only, and...
20115 (new_itemsets): Allocate `shift_symbol' here.
20116 (allocate_itemsets): symbol_count includes useless nonterminals.
20117 Make room for them.
20118 (free_storage): Use `free', not `XFREE', for pointers that cannot
20119 be null.
20120
20121 2001-12-05 Akim Demaille <akim@epita.fr>
20122
20123 * src/nullable.c (set_nullable): Deobfuscate the handling of
20124 ritem.
20125 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20126
20127 2001-12-05 Akim Demaille <akim@epita.fr>
20128
20129 * src/gram.c, src/gram.h (ritem_print): New.
20130 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
20131 (This useless function was defined only to work around VMS linkers
20132 that can't handle compilation units with variables only).
20133 * src/reduce.c (dump_grammar): Use it to trace the construction of
20134 ritem.
20135
20136 2001-12-04 Paul Eggert <eggert@twinsun.com>
20137
20138 * src/bison.simple (union yyalloc): Change member names
20139 to be the same as the stack names.
20140 (yyparse): yyptr is now union yyalloc *, not char *.
20141 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
20142 and may generate better code on some machines.
20143 (yystpcpy): Use prototype if __STDC__ is defined, not just
20144 if __cplusplus is defined.
20145
20146 2001-11-30 Akim Demaille <akim@epita.fr>
20147
20148 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
20149 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
20150 Gettext doesn't compile cleanly, and dies with -Werror.
20151 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
20152 Include WARNING_CFLAGS here.
20153 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
20154 before being defined.
20155
20156 2001-11-27 Paul Eggert <eggert@twinsun.com>
20157
20158 * lib/quotearg.h (quotearg_n, quotearg_n_style):
20159 First arg is int, not unsigned.
20160 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
20161 (SIZE_MAX, UINT_MAX): New macros.
20162 (quotearg_n_options): Abort if N is negative.
20163 Avoid overflow check on hosts where size_t is 64 bits and int
20164 is 32 bits, as overflow is impossible there.
20165 Fix off-by-one typo that caused unnecessary reallocation.
20166
20167 2001-11-29 Paul Eggert <eggert@twinsun.com>
20168
20169 Name space cleanup in generated parser.
20170
20171 * doc/bison.texinfo (Bison Parser): Discuss system headers
20172 and their effect on the user name space.
20173
20174 * src/bison.simple:
20175 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
20176 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
20177 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
20178
20179 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
20180 on user names when possible.
20181
20182 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
20183 Simplify test for whather <alloca.h> exists.
20184
20185 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
20186
20187 (<stdio.h>): Include if YYDEBUG.
20188
20189 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
20190 ! defined (yyoverflow) && ! defined (yymemcpy).
20191
20192 (yymemcpy, yyparse): Rename local variables as needed so that
20193 they all begin with 'yy'.
20194
20195 (yystrlen, yystpcpy): New functions.
20196
20197 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
20198 All uses changed.
20199
20200 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
20201 instead of relying on string.h functions. Use YYSTACK_ALLOC
20202 and YYSTACK_FREE instead of malloc and free.
20203
20204 2001-11-30 Akim Demaille <akim@epita.fr>
20205
20206 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
20207 before their first uses.
20208 (YYBISON, YYPURE): Move to the top of the output.
20209
20210 2001-11-30 Akim Demaille <akim@epita.fr>
20211
20212 * tests/reduce.at (Useless Nonterminals): Fix.
20213
20214 2001-11-30 Akim Demaille <akim@epita.fr>
20215
20216 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
20217 if body instead of `;' to pacify GCC's warnings.
20218
20219 2001-11-30 Akim Demaille <akim@epita.fr>
20220
20221 Instead of mapping the LHS of unused rules to -1, keep the LHS
20222 valid, but flag the rules as invalid.
20223
20224 * src/gram.h (rule_t): `useful' is a new member.
20225 * src/print.c (print_grammar): Adjust.
20226 * src/derives.c (set_derives): Likewise.
20227 * src/reader.c (packgram, reduce_output): Likewise.
20228 * src/reduce.c (reduce_grammar_tables): Likewise.
20229 * tests/reduce.at (Underivable Rules, Useless Rules): New.
20230
20231 2001-11-30 Akim Demaille <akim@epita.fr>
20232
20233 * src/reduce.c (reduce_output): Formatting changes.
20234 * src/print.c (print_results, print_grammar): Likewise.
20235 * tests/regression.at (Rule Line Numbers)
20236 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
20237
20238 2001-11-30 Akim Demaille <akim@epita.fr>
20239
20240 * src/reduce.c (nonterminals_reduce): Instead of throwing away
20241 useless nonterminals, move them at the end of the symbol arrays.
20242 (reduce_output): Adjust.
20243 * tests/reduce.at (Useless Nonterminals): Adjust.
20244
20245 2001-11-30 Akim Demaille <akim@epita.fr>
20246
20247 * src/reduce.c: Various comment/formatting changes.
20248 (nonterminals_reduce): New, extracted from...
20249 (reduce_grammar_tables): here.
20250 (reduce_grammar): Call nonterminals_reduce.
20251
20252 2001-11-29 Paul Eggert <eggert@twinsun.com>
20253
20254 * src/bison.simple (YYSTACK_REALLOC): Remove.
20255 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
20256 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
20257 New macros.
20258 (union yyalloc): New type.
20259 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
20260 an arbitrary restriction on hosts where size_t is wider than int.
20261
20262 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20263 a parser stack overflow. Allocate just one block of memory for all
20264 three stacks, instead of allocating three blocks; this typically is
20265 faster and reduces fragmentation.
20266
20267 Do not limit the number of items in the stack to a value that fits
20268 in 'int', as this is an arbitrary limit on hosts with 64-bit
20269 size_t and 32-bit int.
20270
20271 2001-11-29 Marc Autret <autret_m@epita.fr>
20272
20273 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20274 of defining YYERROR_VERBOSE.
20275 [AT_DATA]: $4 is now out of C declarations in the prologue.
20276
20277 2001-11-28 Marc Autret <autret_m@epita.fr>
20278
20279 * src/reader.c (parse_dquoted_param): New.
20280 (parse_skel_decl): Use it.
20281 * src/lex.h: Add its prototype.
20282 * src/lex.c (literalchar): Become not static.
20283
20284 2001-11-28 Marc Autret <autret_m@epita.fr>
20285
20286 * src/output.h: And put its extern declaration here.
20287 * src/output.c (error_verbose): Define here.
20288 (prepare): Echo name modification.
20289 * src/getargs.h: Clean its extern declaration.
20290 * src/getargs.c (error_verbose_flag): Remove.
20291 (getargs): Remove case 'e'.
20292 * src/options.c (option_table): 'error-verbose' is now seen as simple
20293 percent option.
20294 Include output.h.
20295
20296 * src/reader.c (read_declarations): Remove case tok_include.
20297 (parse_include_decl): Remove.
20298 * src/lex.h (token_t): Remove tok_include.
20299 * src/options.c (option_table): 'include' is now a simple command line
20300 option.
20301
20302 2001-11-28 Marc Autret <autret_m@epita.fr>
20303
20304 * src/bison.simple: Adjust muscle names.
20305 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20306 * src/output.c (prepare): s/_/-/ for the muscles names.
20307 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20308
20309 2001-11-28 Marc Autret <autret_m@epita.fr>
20310
20311 * src/bison.simple: Fix debug.
20312 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20313
20314 2001-11-28 Akim Demaille <akim@epita.fr>
20315
20316 * src/LR0.c (shifts_new): New.
20317 (save_shifts, insert_start_shift, augment_automaton): Use it.
20318
20319 2001-11-28 Akim Demaille <akim@epita.fr>
20320
20321 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20322 keep ruleno only.
20323
20324 2001-11-28 Akim Demaille <akim@epita.fr>
20325
20326 * src/closure.c (closure): Instead of looping over word in array
20327 then bits in words, loop over bits in array.
20328
20329 2001-11-28 Akim Demaille <akim@epita.fr>
20330
20331 * src/closure.c (closure): No longer optimize the special case
20332 where all the bits of `ruleset[r]' are set to 0, to make the code
20333 clearer.
20334
20335 2001-11-28 Akim Demaille <akim@epita.fr>
20336
20337 * src/closure.c (closure): `r' and `c' are new variables, used to
20338 de-obfuscate accesses to RULESET and CORE.
20339
20340 2001-11-28 Akim Demaille <akim@epita.fr>
20341
20342 * src/reduce.c (reduce_print): Use ngettext.
20343 (dump_grammar): Improve the trace accuracy.
20344
20345 2001-11-28 Akim Demaille <akim@epita.fr>
20346
20347 * src/reduce.c (dump_grammar): Don't translate trace messages.
20348
20349 2001-11-28 Akim Demaille <akim@epita.fr>
20350
20351 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20352 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20353 as all tags are free'ed afterwards.
20354 From Enrico Scholz.
20355
20356 2001-11-27 Paul Eggert <eggert@twinsun.com>
20357
20358 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20359 use alloca when we didn't want to, and vice versa.
20360
20361 2001-11-27 Marc Autret <autret_m@epita.fr>
20362
20363 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20364 initialization.
20365 * src/output.c (prepare): Remove its update.
20366
20367 2001-11-27 Marc Autret <autret_m@epita.fr>
20368
20369 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20370 Use %error-verbose.
20371
20372 2001-11-27 Marc Autret <autret_m@epita.fr>
20373
20374 * src/bison.simple: Remove YYERROR_VERBOSE using.
20375 Use %%error_verbose.
20376 (yyparse): Likewise.
20377 * src/output.c (prepare): Give its final value.
20378 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20379 * src/getargs.h: Add its extern declaration.
20380 * src/getargs.c (error_verbose_flag): New int.
20381 (getargs): Update to catch new case.
20382 * src/options.c (option_table): 'error-verbose' is a new option.
20383 (shortopts): Update.
20384
20385 2001-11-27 Akim Demaille <akim@epita.fr>
20386
20387 * src/system.h: Use intl/libgettext.h.
20388 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20389
20390 2001-11-27 Akim Demaille <akim@epita.fr>
20391
20392 * tests/torture.at (Exploding the Stack Size with Malloc):
20393 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20394
20395 2001-11-27 Akim Demaille <akim@epita.fr>
20396
20397 * src/files.c: Include error.h.
20398 Reported by Hans Aberg.
20399
20400 2001-11-26 Marc Autret <autret_m@epita.fr>
20401
20402 * src/reader.c (parse_include_decl): New, not yet implemented.
20403 (read_declarations): Add case tok_include.
20404 * src/getargs.h (include): Add its extern definition.
20405 * src/getargs.c (include): New const char *.
20406 (getargs): Add case '-I'.
20407 * src/options.c (option_table): Add include as command line and
20408 percent option.
20409 * src/lex.h (token_t): Add tok_include.
20410
20411 2001-11-26 Akim Demaille <akim@epita.fr>
20412
20413 * src/reader.c (readgram): Make sure rules for mid-rule actions
20414 have a lineno equal to that of their host rule.
20415 Reported by Hans Aberg.
20416 * tests/regression.at (Rule Line Numbers): New.
20417
20418 2001-11-26 Akim Demaille <akim@epita.fr>
20419
20420 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20421 size_ts.
20422
20423 2001-11-26 Akim Demaille <akim@epita.fr>
20424
20425 * src/complain.c, src/complain.h (error): Remove, provided by
20426 lib/error.[ch].
20427
20428 2001-11-26 Akim Demaille <akim@epita.fr>
20429
20430 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20431 issue an error message.
20432 * tests/regression.at (Invalid %directive): New.
20433 Reported by Hans Aberg.
20434
20435 2001-11-26 Akim Demaille <akim@epita.fr>
20436
20437 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20438 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20439
20440 2001-11-26 Akim Demaille <akim@epita.fr>
20441
20442 * src/conflicts.c (conflicts_print): Don't complain at all when
20443 there are no reduce/reduce conflicts, and as many shift/reduce
20444 conflicts as expected.
20445 * tests/regression.at (%expect right): Adjust.
20446
20447 2001-11-23 Akim Demaille <akim@epita.fr>
20448
20449 * lib/alloca.c: Update, from fileutils.
20450
20451 2001-11-23 Akim Demaille <akim@epita.fr>
20452
20453 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20454
20455 2001-11-23 Akim Demaille <akim@epita.fr>
20456
20457 * src/system.h: Include alloca.h.
20458 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20459
20460 2001-11-23 Akim Demaille <akim@epita.fr>
20461
20462 * src/print_graph.c (print_actions): Remove `rule', unused.
20463 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20464 pacify GCC's signed < unsigned warnings.
20465 * src/closure.c (itemsetsize): Likewise.
20466 * src/reader.c (symbol_list_new): Static.
20467
20468 2001-11-23 Akim Demaille <akim@epita.fr>
20469
20470 Attaching lineno to buckets is stupid, since only one copy of each
20471 symbol is kept, only the line of the first occurrence is kept too.
20472
20473 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20474 * src/reader.c (rline_allocated): Remove, unused.
20475 (symbol_list): Have a `line' member.
20476 (symbol_list_new): New.
20477 (readgram): Use it.
20478 * src/print.c (print_grammar): Output the rule line numbers.
20479 * tests/regression.at (Solved SR Conflicts)
20480 (Unresolved SR Conflicts): Adjust.
20481 Reported by Hans Aberg.
20482
20483 2001-11-22 Marc Autret <autret_m@epita.fr>
20484
20485 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20486
20487 2001-11-22 Marc Autret <autret_m@epita.fr>
20488
20489 * src/muscle_tab.c (muscle_init): Remove initialization of
20490 skeleton muscle.
20491 * src/output.c (output_master_parser): Do it here.
20492
20493 2001-11-20 Akim Demaille <akim@epita.fr>
20494
20495 * po/sv.po: New.
20496 * configure.in (ALL_LINGUAS): Adjust.
20497 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20498 longer contains strings to translate.
20499
20500 2001-11-19 Akim Demaille <akim@epita.fr>
20501
20502 * src/conflicts.c (conflicts_print): Add a missing \n.
20503
20504 2001-11-19 Akim Demaille <akim@epita.fr>
20505
20506 * src/nullable.c (nullable_print): New.
20507 (set_nullable): Call it when tracing.
20508 Better locality of variables.
20509
20510 2001-11-19 Akim Demaille <akim@epita.fr>
20511
20512 * src/print.c (print_actions): Better locality of variables.
20513
20514 2001-11-19 Akim Demaille <akim@epita.fr>
20515
20516 * src/derives.c (print_derives): Fix and enrich.
20517 * src/closure.c (print_fderives): Likewise.
20518
20519 2001-11-19 Akim Demaille <akim@epita.fr>
20520
20521 * src/closure.c (itemsetend): Remove, replaced with...
20522 (itemsetsize): new.
20523
20524 2001-11-19 Akim Demaille <akim@epita.fr>
20525
20526 * src/LR0.c (kernel_end): Remove, replaced with...
20527 (kernel_size): new.
20528
20529 2001-11-19 Akim Demaille <akim@epita.fr>
20530
20531 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20532 to clarify.
20533
20534 2001-11-19 Akim Demaille <akim@epita.fr>
20535
20536 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20537
20538 2001-11-19 Akim Demaille <akim@epita.fr>
20539
20540 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20541 trace messages.
20542 * src/LR0.c: Likewise.
20543 (allocate_itemsets): Use arrays instead of pointers to clarify.
20544
20545 2001-11-19 Akim Demaille <akim@epita.fr>
20546
20547 * src/getargs.c (statistics_flag): Replace with...
20548 (trace_flag): New.
20549 (longopts): Accept --trace instead of --statistics.
20550 * src/getargs.h, src/options.c: Adjust.
20551 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20552 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20553
20554 2001-11-19 Akim Demaille <akim@epita.fr>
20555
20556 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
20557 pointers to clarify the code.
20558 (save_reductions, save_shifts): Factor common parts of alternatives.
20559
20560 2001-11-19 Akim Demaille <akim@epita.fr>
20561
20562 * src/LR0.c (new_state, get_state): Complete TRACE code.
20563 * src/closure.c: Include `reader.h' to get `tags', needed by the
20564 trace code.
20565 Rename the conditional DEBUG as TRACE.
20566 Output consistently TRACEs to stderr, not stdout.
20567 * src/derives.c: Likewise.
20568 * src/reduce.c: (inaccessable_symbols): Using if is better style
20569 than goto.
20570 Use `#if TRACE' instead of `#if 0' for tracing code.
20571
20572 2001-11-19 Akim Demaille <akim@epita.fr>
20573
20574 * src/system.h (LIST_FREE, shortcpy): New.
20575 * src/LR0.c: Use them.
20576 * src/output.c (free_itemsets, free_reductions, free_shifts):
20577 Remove, replaced by LIST_FREE.
20578
20579 2001-11-19 Akim Demaille <akim@epita.fr>
20580
20581 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20582 (REDUCTIONS_ALLOC): New.
20583 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20584 allocation.
20585
20586 2001-11-19 Akim Demaille <akim@epita.fr>
20587
20588 * src/LR0.c (new_state): Complete trace code.
20589 * src/nullable.c (set_nullable): Don't translate traces.
20590
20591 2001-11-19 Akim Demaille <akim@epita.fr>
20592
20593 * src/print_graph.c (print_core): Better locality of variables.
20594 * src/print.c (print_core): Likewise.
20595
20596 2001-11-19 Akim Demaille <akim@epita.fr>
20597
20598 * src/vcg.c: You do the output, so you are responsible of the
20599 handling of VCG syntax, in particular: use quotearg.
20600 * src/print_graph.c: Don't.
20601 (print_actions): Don't output the actions as part of the nodes,
20602 since that's the job of the edges.
20603 (print_state): Don't output by hand: fill the node description,
20604 and ask for its output.
20605
20606 2001-11-19 Akim Demaille <akim@epita.fr>
20607
20608 * src/bison.simple (yyparse): When verbosely reporting an error,
20609 no longer put additional quotes around token names.
20610 * tests/calc.at: Adjust.
20611
20612 2001-11-19 Akim Demaille <akim@epita.fr>
20613
20614 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20615 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20616 * src/output.c: Adjust.
20617
20618 2001-11-19 Akim Demaille <akim@epita.fr>
20619
20620 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20621 (rule_t): this.
20622 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20623
20624 2001-11-19 Akim Demaille <akim@epita.fr>
20625
20626 * src/gram.h (rule_t): New.
20627 (rule_table): New.
20628 (rrhs, rlhs): Remove, part of state_t.
20629 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20630 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20631 * src/reader.c, src/reduce.c: Adjust.
20632
20633 2001-11-19 Akim Demaille <akim@epita.fr>
20634
20635 * src/reader.c (symbols_output): New, extracted from...
20636 (packsymbols): Here.
20637 (reader): Call it.
20638
20639 2001-11-19 Akim Demaille <akim@epita.fr>
20640
20641 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20642 (maxrhs): this new function.
20643
20644 2001-11-19 Akim Demaille <akim@epita.fr>
20645
20646 * src/lalr.c (F): New macro to access the variable F.
20647 Adjust.
20648
20649 2001-11-19 Akim Demaille <akim@epita.fr>
20650
20651 * src/lalr.h (LA): New macro to access the variable LA.
20652 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20653 * src/lalr.c: Adjust.
20654
20655 2001-11-19 Akim Demaille <akim@epita.fr>
20656
20657 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20658 (set_state_table): handle the `lookaheads' members.
20659
20660 2001-11-19 Akim Demaille <akim@epita.fr>
20661
20662 * src/lalr.h (lookaheads): Removed array, whose contents is now
20663 a member of...
20664 (state_t): this structure.
20665 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20666 Adjust.
20667
20668 2001-11-19 Akim Demaille <akim@epita.fr>
20669
20670 * src/lalr.h (consistent): Removed array, whose contents is now
20671 a member of...
20672 (state_t): this structure.
20673 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20674 Adjust.
20675
20676 2001-11-19 Akim Demaille <akim@epita.fr>
20677
20678 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20679 contents are now members of...
20680 (state_t): this structure.
20681 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20682 Adjust.
20683
20684 2001-11-19 Akim Demaille <akim@epita.fr>
20685
20686 * src/lalr.h (state_t): New.
20687 (state_table): Be a state_t * instead of a core **.
20688 (accessing_symbol): Remove, part of state_t.
20689 * src/lalr.c: Adjust.
20690 (set_accessing_symbol): Merge into...
20691 (set_state_table): this.
20692 * src/print_graph.c, src/conflicts.c: Adjust.
20693
20694 2001-11-14 Akim Demaille <akim@epita.fr>
20695
20696 * tests/calc.at, tests/output.at, tests/regression.at,
20697 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20698 now the tests are run in private dirs, therefore AC_CLEANUP and
20699 family can be simplified to 0-ary.
20700 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20701 use abs. path to find config.h.
20702 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20703 stderr, there can be way too much random noise.
20704 Instead pass -Werror to GCC and rely on the exit status.
20705 Reported by Wolfram Wagner.
20706
20707 2001-11-14 Akim Demaille <akim@epita.fr>
20708
20709 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20710 defined only if yyoverflow is defined, to avoid `warning: unused
20711 variable `yyvs1''.
20712 Reported by The Test Suite.
20713
20714 2001-11-14 Akim Demaille <akim@epita.fr>
20715
20716 * src/print.c: Include reduce.h.
20717 Reported by Hans Aberg.
20718
20719 2001-11-14 Akim Demaille <akim@epita.fr>
20720
20721 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20722 Revert a previous patch: these are really const.
20723 * src/conflicts.c (conflict_report): Additional useless pair of
20724 braces to pacify GCC's warnings for `if () if () {} else {}'.
20725 * src/lex.c (parse_percent_token): Replace equal_offset with
20726 arg_offset.
20727 arg is const.
20728 Be sure to strdup `arg' when used, since there is no reason for
20729 token_buffer not to change.
20730
20731 2001-11-14 Akim Demaille <akim@epita.fr>
20732
20733 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20734 definition.
20735 * src/main.c (main): Use them.
20736 Suggested by Hans Aberg.
20737
20738 2001-11-12 Akim Demaille <akim@epita.fr>
20739
20740 * src/system.h (ngettext): Now that we use ngettext, be sure to
20741 provide a default definition when NLS are not used.
20742
20743 2001-11-12 Akim Demaille <akim@epita.fr>
20744
20745 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20746 Use @kbd to denote user input.
20747 (Language and Grammar): ANSIfy the example.
20748 Adjust its layout for info/notinfo.
20749 (Location Tracking Calc): Output error messages to stderr.
20750 Output locations in a more GNUtically correct way.
20751 Fix a couple of Englishos.
20752 Adjust @group/@end group pairs.
20753
20754 2001-11-12 Akim Demaille <akim@epita.fr>
20755
20756 %expect was not functioning at all.
20757
20758 * src/conflicts.c (expected_conflicts): Set to -1.
20759 (conflict_report): Use ngettext.
20760 (conflicts_print): Check %expect and make its violation an error.
20761 * doc/bison.texinfo (Expect Decl): Adjust.
20762 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20763 * tests/regression.at (%expect not enough, %expect right)
20764 (%expect too much): New.
20765
20766 2001-11-12 Akim Demaille <akim@epita.fr>
20767
20768 * tests/regression.at (Conflicts): Rename as...
20769 (Unresolved SR Conflicts): this.
20770 (Solved SR Conflicts): New.
20771
20772 2001-11-12 Akim Demaille <akim@epita.fr>
20773
20774 * src/reduce.c (print_results): Rename as...
20775 (reduce_output): This.
20776 Output to OUT, passed as argument, instead of output_obstack.
20777 (dump_grammar): Likewise.
20778 (reduce_free): New.
20779 Also free V1.
20780 (reduce_grammar): No longer call reduce_output, since...
20781 * src/print.c (print_results): do it.
20782 * src/main.c (main): Call reduce_free;
20783
20784 2001-11-12 Akim Demaille <akim@epita.fr>
20785
20786 * src/conflicts.c (print_reductions): Accept OUT as argument.
20787 Output to it, not to output_obstack.
20788 * src/print.c (print_actions): Adjust.
20789
20790 2001-11-12 Akim Demaille <akim@epita.fr>
20791
20792 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20793 the result instead of using...
20794 (src_total, rrc_total, src_count, rrc_count): Remove.
20795 (any_conflicts): Remove.
20796 (print_conflicts): Split into...
20797 (conflicts_print, conflicts_output): New.
20798 * src/conflicts.h: Adjust.
20799 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
20800 * src/print.c (print_grammar): Issue `\n' between two rules.
20801 * tests/regression.at (Conflicts): New.
20802 Reported by Tom Lane.
20803
20804 2001-11-12 Akim Demaille <akim@epita.fr>
20805
20806 * tests/regression.at (Invalid input): Remove, duplicate with
20807 ``Invalid input: 1''.
20808
20809 2001-11-12 Akim Demaille <akim@epita.fr>
20810
20811 * tests/torture.at (AT_DATA_STACK_TORTURE)
20812 (Exploding the Stack Size with Alloca)
20813 (Exploding the Stack Size with Malloc): New.
20814
20815 2001-11-12 Akim Demaille <akim@epita.fr>
20816
20817 * src/bison.simple (YYSTACK_REALLOC): New.
20818 (yyparse) [!yyoverflow]: Use it and free the old stack.
20819 Reported by Per Allansson.
20820
20821 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
20822
20823 * src/bison.simple: Define type yystype instead of YYSTYPE, and
20824 define CPP macro, which substitute YYSTYPE by yystype.
20825 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
20826 with yyltype/YYLTYPE. This allows inclusion of the generated
20827 header within the parser if the compiler, such as GGC, accepts
20828 multiple equivalent #defines.
20829 From Akim.
20830
20831 2001-11-05 Akim Demaille <akim@epita.fr>
20832
20833 * src/reader.c (symbols_output): New, extracted from...
20834 (packsymbols): here.
20835 (reader): Adjust.
20836
20837 2001-11-05 Akim Demaille <akim@epita.fr>
20838
20839 * src/lex.c (parse_percent_token): s/quotearg/quote/.
20840
20841 2001-11-05 Akim Demaille <akim@epita.fr>
20842
20843 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
20844 pattern.
20845
20846 2001-11-05 Akim Demaille <akim@epita.fr>
20847
20848 * src/options.h (struct option_table_struct): set_flags is void*.
20849 * src/options.c (longopts): Support `--output' and `%output'.
20850 (usage): Adjust.
20851 * src/lex.h (tok_setopt): Remove, replaced with...
20852 (tok_intopt, tok_stropt): these new guys.
20853 * src/lex.c (getopt.h): Not needed.
20854 (token_buffer, unlexed_token_buffer): Not const.
20855 (percent_table): Promote `-' over `_' in directive names.
20856 Active `%name-prefix', `file-prefix', and `output'.
20857 (parse_percent_token): Accept possible arguments to directives.
20858 Promote `-' over `_' in directive names.
20859
20860 2001-11-04 Akim Demaille <akim@epita.fr>
20861
20862 * doc/bison.texinfo (Decl Summary): Split the list into
20863 `directives for grammars' and `directives for bison'.
20864 Sort'em.
20865 Add description of `%name-prefix', `file-prefix', and `output'.
20866 Promote `-' over `_' in directive names.
20867 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
20868 Simplify the description of `--name-prefix'.
20869 Promote `-' over `_' in directive names.
20870 Promote `--output' over `--output-file'.
20871 Fix the description of `--defines'.
20872 * tests/output.at: Exercise %file-prefix and %output.
20873
20874 2001-11-02 Akim Demaille <akim@epita.fr>
20875
20876 * doc/refcard.tex: Update.
20877
20878 2001-11-02 Akim Demaille <akim@epita.fr>
20879
20880 * src/symtab.h (SUNDEF): New.
20881 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
20882 stand for `uninitialized', instead of 0.
20883 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
20884 * src/lex.c (lex): Adjust.
20885
20886 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
20887 Number it 0.
20888 Let yylex return it instead of a plain 0.
20889 Reported by Dick Streefland.
20890
20891 2001-11-02 Akim Demaille <akim@epita.fr>
20892
20893 * tests/regression.at (Mixing %token styles): New test.
20894
20895 2001-11-02 Akim Demaille <akim@epita.fr>
20896
20897 * src/reader.c (parse_thong_decl): Formatting changes.
20898 (token_translations_init): New, extracted from...
20899 (packsymbols): Here.
20900 Adjust.
20901
20902 2001-11-01 Akim Demaille <akim@epita.fr>
20903
20904 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
20905 Check that `9foo.y' produces correct cpp guards.
20906 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
20907 guards.
20908 Reported by Wwp.
20909
20910 2001-11-01 Akim Demaille <akim@epita.fr>
20911
20912 * tests/regression.at (Invalid input: 2): New.
20913 * src/lex.c (unlexed_token_buffer): New.
20914 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
20915 too.
20916 Reported by Wwp.
20917
20918 2001-11-01 Akim Demaille <akim@epita.fr>
20919
20920 * tests/calc.at: Catch up with 1.30.
20921 * configure.in: Bump to 1.49a.
20922 Adjust to newer Autotest.
20923
20924 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
20925
20926 * src/conflicts.c: Move global variables rrc_total and src_total ...
20927 (print_conflicts): here.
20928 * src/output.c (output): Free global variable user_toknums.
20929 * src/lex.c (token_obstack): Become static.
20930
20931 2001-10-18 Akim Demaille <akim@epita.fr>
20932
20933 * tests/atlocal.in (GCC): Add.
20934 * tests/calc.at: s/m4_match/m4_bmatch/.
20935 s/m4_patsubst/m4_bpatsubst/.
20936 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
20937 * configure.in: AC_SUBST(GCC).
20938
20939 2001-10-14 Marc Autret <autret_m@epita.fr>
20940
20941 * src/options.c (create_long_option_table): Fix.
20942
20943 2001-10-10 Akim Demaille <akim@epita.fr>
20944
20945 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
20946
20947 2001-10-04 Akim Demaille <akim@epita.fr>
20948
20949 * src/reader.c (parse_union_decl): Push the caracters in
20950 union_obstack, not attrs_obstack.
20951
20952 2001-10-04 Akim Demaille <akim@epita.fr>
20953
20954 Merge in the branch 1.29.
20955
20956 * src/reader.c (packsymbols): Use a temporary obstack for
20957 `%%tokendef', since output_stack is already used elsewhere.
20958
20959 2001-10-02 Akim Demaille <akim@epita.fr>
20960
20961 Bump 1.29d.
20962
20963 2001-10-02 Akim Demaille <akim@epita.fr>
20964
20965 Version 1.29c.
20966
20967 2001-10-02 Akim Demaille <akim@epita.fr>
20968
20969 * tests/regression.at (Invalid CPP headers): New.
20970 From Alexander Belopolsky.
20971 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
20972
20973 2001-10-02 Akim Demaille <akim@epita.fr>
20974
20975 * tests/regression.at (Invalid input): New.
20976 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
20977 Reported by Shura.
20978
20979 2001-10-02 Akim Demaille <akim@epita.fr>
20980
20981 * tests/calc.at: Now that --debug works, the tests must be adjusted.
20982
20983 2001-10-02 Akim Demaille <akim@epita.fr>
20984
20985 * src/output.c (output_parser): Assert `skeleton'.
20986 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
20987 systems.
20988 From Shura.
20989
20990 2001-10-01 Marc Autret <autret_m@epita.fr>
20991
20992 * src/lex.h: Echo modifications.
20993 * src/lex.c (unlex): Parameter is now token_t.
20994 From Hans Aberg.
20995
20996 2001-10-01 Marc Autret <autret_m@epita.fr>
20997
20998 * src/main.c: Include lex.h.
20999 From Hans Aberg.
21000
21001 2001-09-29 Akim Demaille <akim@epita.fr>
21002
21003 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
21004
21005 2001-09-28 Akim Demaille <akim@epita.fr>
21006
21007 * tests/testsuite.at: Update to newer Autotest.
21008 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
21009
21010 2001-09-27 Akim Demaille <akim@epita.fr>
21011
21012 Position independent wrapper.
21013
21014 * tests/bison: Remove.
21015 * tests/bison.in: New.
21016 * configure.in: Adjust.
21017
21018 2001-09-27 Paul Eggert <eggert@twinsun.com>
21019
21020 Port quotearg fixes from tar 1.13.24.
21021
21022 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
21023 tm to be declared.
21024 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
21025 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
21026
21027 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21028 * m4/mbrtowc.m4: New file.
21029 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21030 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21031
21032 2001-09-27 Akim Demaille <akim@epita.fr>
21033
21034 Bump to 1.29c.
21035
21036 2001-09-27 Akim Demaille <akim@epita.fr>
21037
21038 Version 1.29b.
21039
21040 2001-09-25 Akim Demaille <akim@epita.fr>
21041
21042 * src/system.h: Include `xalloc.h'.
21043 Remove it from the C files.
21044 * src/files.c (output_files): Free the obstacks.
21045 * src/lex.c (init_lex): Rename as...
21046 (lex_init): this.
21047 (lex_free): New.
21048 * src/main.c (main): Use it.
21049
21050 2001-09-24 Marc Autret <autret_m@epita.fr>
21051
21052 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21053 to output informations in fout (FILE*).
21054 (open_graph, close_graph): Likewise.
21055 (output_graph, output_edge, output_node): Likewise.
21056 * src/vcg.h: Update function prototypes.
21057 * src/print_graph.c (print_graph): Open output graph file.
21058 (print_actions): Adjust.
21059 * src/files.h: Remove extern declaration.
21060 * src/files.c: Remove graph_obstack declaration.
21061 (open_files): Remove graph_obstack initialization.
21062 (output_files): Remove graph_obstack saving.
21063
21064 2001-09-24 Marc Autret <autret_m@epita.fr>
21065
21066 * src/files.c (compute_output_file_names): Fix.
21067
21068 2001-09-24 Marc Autret <autret_m@epita.fr>,
21069 Akim Demaille <akim@epita.fr>
21070
21071 * src/reader.c (reader): Remove call to free_symtab ().
21072 * src/main.c (main): Call it here.
21073 Include symtab.h.
21074 * src/conflicts.c (initialize_conflicts): Rename as...
21075 (solve_conflicts): this.
21076 * src/print.c (print_core, print_actions, print_state)
21077 (print_grammar): Dump to a file instead a `output_obstack'.
21078 (print_results): Dump `output_obstack', and then proceed with the
21079 FILE *.
21080 * src/files.c (compute_output_file_names, close_files): New.
21081 (output_files): Adjust.
21082 * src/main.c (main): Adjust.
21083
21084 2001-09-23 Marc Autret <autret_m@epita.fr>
21085
21086 * src/files.c (compute_header_macro): Computes header macro name
21087 from spec_defines_file when given.
21088
21089 2001-09-23 Marc Autret <autret_m@epita.fr>
21090
21091 * src/files.c (output_files): Add default extensions.
21092
21093 2001-09-22 Akim Demaille <akim@epita.fr>
21094
21095 * src/conflicts.c (finalize_conflicts): Rename as...
21096 (free_conflicts): this.
21097
21098 2001-09-22 Akim Demaille <akim@epita.fr>
21099
21100 * src/gram.c (gram_free): Rename back as...
21101 (dummy): this.
21102 (output_token_translations): Free `token_translations'.
21103 * src/symtab.c (free_symtab): Free the tag field.
21104
21105 2001-09-22 Akim Demaille <akim@epita.fr>
21106
21107 Remove `translations' as it is always set to true.
21108
21109 * src/gram.h: Adjust.
21110 * src/reader.c (packsymbols, parse_token_decl): Adjust
21111 * src/print.c (print_grammar): Adjust.
21112 * src/output.c (output_token_translations): Adjust.
21113 * src/lex.c (lex): Adjust.
21114 * src/gram.c: Be sure the set pointers to NULL.
21115 (dummy): Rename as...
21116 (gram_free): this.
21117
21118 2001-09-22 Akim Demaille <akim@epita.fr>
21119
21120 * configure.in: Invoke AM_LIB_DMALLOC.
21121 * src/system.h: Use dmalloc.
21122 * src/LR0.c: Be sure to have pointers initialized to NULL.
21123 (allocate_itemsets): Allocate kernel_items only if needed.
21124
21125 2001-09-22 Akim Demaille <akim@epita.fr>
21126
21127 * configure.in: Bump to 1.29b.
21128 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
21129 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
21130 need xmalloc.c in calc.y.
21131 From Pascal Bart.
21132
21133 2001-09-21 Akim Demaille <akim@epita.fr>
21134
21135 Version 1.29a.
21136 * Makefile.maint, config/config.guess, config/config.sub,
21137 * config/missing: Update from masters.
21138 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
21139 upon package.m4.
21140 * configure.in (ALL_LINGUAS): Add `tr'.
21141
21142 2001-09-21 Akim Demaille <akim@epita.fr>
21143
21144 * tests/Makefile.am (package.m4): Move to...
21145 ($(srcdir)/$(TESTSUITE)): here.
21146
21147 2001-09-20 Akim Demaille <akim@epita.fr>
21148
21149 * src/complain.c: No longer try to be standalone: use system.h.
21150 Don't assume __STDC__ is defined to 1. Just test if it is defined.
21151 * src/complain.h: Likewise.
21152 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
21153 Remove the unused variable `n'.
21154 From Albert Chin-A-Young.
21155
21156 2001-09-18 Marc Autret <autret_m@epita.fr>
21157
21158 * doc/bison.1: Update.
21159 * doc/bison.texinfo (Bison Options): Update --defines and --graph
21160 descriptions.
21161 (Option Cross Key): Update.
21162 Add --graph.
21163
21164 2001-09-18 Marc Autret <autret_m@epita.fr>
21165
21166 * tests/regression.at: New test (comment in %union).
21167
21168 2001-09-18 Marc Autret <autret_m@epita.fr>
21169
21170 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
21171 do that.
21172 Reported by Keith Browne.
21173
21174 2001-09-18 Marc Autret <autret_m@epita.fr>
21175
21176 * tests/output.at: Add tests for --defines and --graph.
21177
21178 2001-09-18 Marc Autret <autret_m@epita.fr>
21179
21180 * tests/output.at: Removes tests of %{header,src}_extension features.
21181
21182 2001-09-18 Akim Demaille <akim@epita.fr>
21183
21184 * tests/Makefile.am (package.m4): New.
21185 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
21186 (_AT_CHECK_CALC_ERROR): Likewise.
21187 Factor the `, ' part of verbose error messages.
21188
21189 2001-09-18 Marc Autret <autret_m@epita.fr>
21190
21191 * src/getargs.c (longopts): Declare --defines and --graph as options
21192 with optional arguments.
21193 * src/files.h: Add extern declarations.
21194 * src/files.c (spec_graph_file, spec_defines_file): New.
21195 (output_files): Update.
21196 Remove CPP-outed code.
21197
21198 2001-09-18 Marc Autret <autret_m@epita.fr>
21199
21200 Turn off %{source,header}_extension feature.
21201
21202 * src/files.c (compute_exts_from_gf): Update.
21203 (compute_exts_from_src): Update.
21204 (output_files): CPP-out useless code.
21205 * src/files.h: Remove {header,source}_extension extern declarations.
21206 * src/reader.c (parse_dquoted_param): CPP-out.
21207 (parse_header_extension_decl): Remove.
21208 (parse_source_extension_decl): Remove.
21209 (read_declarations): Remove cases tok_{hdrext,srcext}.
21210 * src/lex.c (percent_table): Remove {header,source}_extension entries.
21211 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
21212
21213 2001-09-10 Akim Demaille <akim@epita.fr>
21214
21215 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
21216 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
21217 (AT_CHECK_OUTPUT): this.
21218 Merely check ls' exit status, its output is useless.
21219
21220 2001-09-10 Akim Demaille <akim@epita.fr>
21221
21222 * tests/calc.at: Use m4_match.
21223 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
21224
21225 2001-09-10 Marc Autret <autret_m@epita.fr>,
21226 Akim Demaille <akim@epita.fr>
21227
21228 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
21229 enum color_e.
21230 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
21231 to `normal'.
21232 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
21233 * src/lex.h: Adjust prototype.
21234 (token_t): Add `tok_undef'.
21235 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
21236 (parse_percent_token): Now returns token_t.
21237 Add default statement in switch.
21238 (lex): Separate `c' as an input variable, from the token_t result
21239 part.
21240 (unlexed): Is a token_t.
21241
21242 2001-09-10 Akim Demaille <akim@epita.fr>
21243
21244 * configure.in: Bump to 1.29a.
21245
21246 2001-09-07 Akim Demaille <akim@epita.fr>
21247
21248 Version 1.29.
21249
21250 2001-08-30 Akim Demaille <akim@epita.fr>
21251
21252 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
21253 * m4/atconfig.m4: Remove.
21254 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
21255 * tests/bison: New.
21256 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
21257 m4_if, m4_patsubst, and m4_regexp.
21258 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
21259 `input' file instead of echo.
21260
21261 2001-08-29 Akim Demaille <akim@epita.fr>
21262
21263 Bump to 1.28e.
21264
21265 2001-08-29 Akim Demaille <akim@epita.fr>
21266
21267 Version 1.28d.
21268
21269 2001-08-29 Paul Eggert <eggert@twinsun.com>
21270
21271 * src/bison.simple (yyparse): Don't take the address of an
21272 item before the start of an array, as that doesn't conform to
21273 the C Standard.
21274
21275 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21276
21277 * doc/bison.texinfo (Location Tracking Calc): New node.
21278
21279 2001-08-29 Paul Eggert <eggert@twinsun.com>
21280
21281 * src/output.c (output): Do not define const, as this now
21282 causes more problems than it cures.
21283
21284 2001-08-29 Akim Demaille <akim@epita.fr>
21285
21286 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21287 the nodes.
21288 Be sure to tag the `detailmenu'.
21289
21290 2001-08-29 Akim Demaille <akim@epita.fr>
21291
21292 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21293 download in a tmp dir.
21294
21295 2001-08-28 Marc Autret <autret_m@epita.fr>
21296
21297 * config/depcomp: New file.
21298
21299 2001-08-28 Marc Autret <autret_m@epita.fr>
21300
21301 * doc/bison.1 (mandoc): Adjust.
21302 From Juan Manuel Guerrero.
21303
21304 2001-08-28 Marc Autret <autret_m@epita.fr>
21305
21306 * src/print_graph.c (print_state): Fix.
21307
21308 2001-08-27 Marc Autret <autret_m@epita.fr>
21309
21310 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21311 char * members.
21312 Echo modifications to the functions prototypes.
21313 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21314
21315 2001-08-27 Marc Autret <autret_m@epita.fr>
21316
21317 * src/vcg.c: Include `xalloc.h'.
21318 (add_colorentry): New.
21319 (add_classname): New.
21320 (add_infoname): New.
21321 * src/vcg.h: Add new prototypes.
21322
21323 2001-08-27 Akim Demaille <akim@epita.fr>
21324
21325 * Makefile.maint: Sync. again with CVS Autoconf.
21326
21327 2001-08-27 Akim Demaille <akim@epita.fr>
21328
21329 * Makefile.maint: Formatting changes.
21330 (po-update, cvs-update, update): New targets.
21331 (AMTAR): Remove.
21332
21333 2001-08-27 Akim Demaille <akim@epita.fr>
21334
21335 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21336 * Makefile.maint: Sync. with CVS Autoconf.
21337
21338 2001-08-27 Marc Autret <autret_m@epita.fr>
21339
21340 * src/vcg.h (struct infoname_s): New.
21341 (struct colorentry_s): New.
21342 (graph_s): New fields {vertical,horizontal}_order in structure.
21343 Add `infoname' field.
21344 Add `colorentry' field;
21345 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21346 (G_HORIZONTAL_ORDER): New.
21347 (G_INFONAME): New.
21348 (G_COLORENTRY): New.
21349 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21350 Add output of `infoname'.
21351 Add output of `colorentry'.
21352
21353 2001-08-27 Marc Autret <autret_m@epita.fr>
21354
21355 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21356 This one shadowed a global parameter.
21357
21358 2001-08-24 Marc Autret <autret_m@epita.fr>
21359
21360 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21361 instead of `unsigned'.
21362 (print_state): Do not call obstack_object_size () in obstack_grow ()
21363 to avoid macro variables shadowing.
21364
21365 2001-08-23 Marc Autret <autret_m@epita.fr>
21366
21367 * src/lex.c (percent_table): Typo: s/naem/name/.
21368 Add graph option.
21369 Normalize new options declarations.
21370
21371 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21372
21373 * tests/suite.at: Exercise %header_extension and %source_extension.
21374
21375 2001-08-16 Marc Autret <autret_m@epita.fr>
21376
21377 * src/reader.c (parse_dquoted_param): New.
21378 (parse_header_extension_decl): Use it.
21379 (parse_source_extension_decl): Likewise.
21380
21381 2001-08-16 Marc Autret <autret_m@epita.fr>
21382
21383 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21384 (get_xxxx_str): Use assert () instead of complain ().
21385 Remove return invokations in default cases.
21386 (get_decision_str): Modify default behaviour. Remove second argument.
21387 Echo modifications on calls.
21388 (output_graph): Fix.
21389
21390 2001-08-16 Marc Autret <autret_m@epita.fr>
21391
21392 * src/getargs.c (usage): Update with ``-g, --graph''.
21393
21394 2001-08-16 Marc Autret <autret_m@epita.fr>
21395
21396 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21397 (Option Cross Key): Likewise.
21398 * doc/bison.1: Update.
21399
21400 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
21401
21402 * src/output.c (output_master_parser): Don't finish action_obstack.
21403 (output_parser): Don't care about the muscle action, here.
21404 (prepare): Copy the action_obstack in the action muscle.
21405 (output): Free action_obstack.
21406
21407 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
21408
21409 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21410 will contain `%union' declaration.
21411 (parse_union_decl): Delete #line directive output.
21412 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21413 informations about %union.
21414 (parse_union_decl): Copy the union_obstack in the muscle stype.
21415 * src/bison.simple: Add new #line directive.
21416 Add typdef %%stype YYSTYPE.
21417
21418 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
21419
21420 * src/bison.simple: Add new `#line' directive.
21421
21422 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
21423
21424 * src/bison.simple: New `#line' directive.
21425 * src/output.c (output_parser): Support new dynamic muscle input_line.
21426
21427 2001-09-22 Marc Autret <autret_m@epita.fr>
21428
21429 * src/output.c (output_master_parser): New.
21430 (output_parser): Be more re-entrant.
21431
21432 2001-09-21 Marc Autret <autret_m@epita.fr>
21433
21434 * src/reader.c (copy_definition, parse_union_decl): Update and use
21435 `linef' muscle.
21436 (copy_action): Likewise.
21437 Use obstack_1grow ().
21438 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21439
21440 2001-09-21 Marc Autret <autret_m@epita.fr>
21441
21442 * src/options.c (option_table): Adjust.
21443 * src/lex.c (parse_percent_token): Fix.
21444
21445 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
21446
21447 * src/options.c (symtab.h): Include it, need by lex.h.
21448
21449 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
21450
21451 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21452 is now an option_table_struct*.
21453 (option_strcmp): New function option_strcmp.
21454 (parse_percent_token): Call option_strcmp.
21455 * src/getargs.c (xalloc.h, options.h): Include it.
21456 (getargs): Call create_long_option_table.
21457 (getargs): Free longopts at the end of the function.
21458 (shortopts): Move in options.c.
21459 * src/options.c (create_long_option_table): New function. Convert
21460 information from option_table to option structure.
21461 * src/reader.c (options.h): Include it.
21462
21463 * src/Makefile.am: Adjust.
21464 * src/options.c (option_table): Create from longopts and percent_table.
21465 * src/getargs.c (longopts): Delete.
21466 * src/lex.c (struct percent_table_struct): Delete.
21467 (percent_table): Delete.
21468 (options.h): Include it.
21469 * src/options.c: Create.
21470 * src/options.h: Create.
21471 Declare enum opt_access_e.
21472 Define struct option_table_struct.
21473
21474 2001-09-20 Marc Autret <autret_m@epita.fr>
21475
21476 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21477 sections of Bison.
21478
21479 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
21480
21481 * src/bison.simple: s/%%filename/%%skeleton.
21482 * src/muscle_tab.c (getargs.h): Include it.
21483 (muscle_init): Insert new muscle skeleton.
21484
21485 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
21486
21487 * src/output.c (output_parser): Delete unused variable actions_dumped.
21488
21489 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
21490
21491 * src/output.c (output): Delete call to reader_output_yylsp.
21492 * src/reader.c (reader): Likewise.
21493 * src/reader.h: Delete declaration of reader_output_yylsp.
21494
21495 2001-09-02 Marc Autret <autret_m@epita.fr>
21496
21497 * src/reader.c: Include muscle_tab.h.
21498 (parse_union_decl): Update.
21499 (parse_macro_decl): Rename parse_muscle_decl.
21500 Update to use renamed functions and variable.
21501 (read_declarations, copy_action, read_additionnal_code, : Updated
21502 with correct variables and functions names.
21503 (packsymbols, reader): Likewise.
21504
21505 * src/reader.h (muscle_obstack): Extern declaration update.
21506
21507 * src/output.c: Include muscle_tab.h
21508 In all functions using macro_insert, change by using muscle_insert ().
21509 (macro_obstack): Rename muscle_obstack.
21510 Echo modifications in the whole file.
21511 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21512 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21513 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21514
21515 * src/muscle_tab.h: Update double inclusion macros.
21516 (macro_entry_s): Rename muscle_entry_s.
21517 Update prototypes.
21518
21519 * src/muscle_tab.c: Include muscle_tab.h.
21520 Rename macro_tabble to muscle_table.
21521 (mhash1, mhash2, mcmp): Use muscle_entry.
21522 (macro_init): Rename muscle_init. Update.
21523 (macro_insert): Rename muscle_insert. Update.
21524 (macro_find): Rename muscle_find. Update.
21525
21526 * src/main.c: Include muscle_tab.h.
21527 (main): Call muscle_init ().
21528 * src/Makefile.am (bison_SOURCES): Echo modifications.
21529
21530 2001-09-02 Marc Autret <autret_m@epita.fr>
21531
21532 Now the files macro_tab.[ch] are named muscle_tab.[ch].
21533
21534 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21535
21536 2001-09-02 Marc Autret <autret_m@epita.fr>
21537
21538 * src/macrotab.c, src/macrotab.h: Remove.
21539
21540 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
21541
21542 * src/reader.c (copy_guard): Use muscle to specify the `#line'
21543 filename.
21544
21545 2001-09-01 Marc Autret <autret_m@epita.fr>
21546
21547 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21548 to an explicit value to activate the feature. We do it here.
21549
21550 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
21551
21552 * src/output.c (prepare): Delete the `filename' muscule insertion.
21553 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21554 (parse_union_decl): Likewise.
21555 * src/macrotab.c (macro_init): Initialize filename by infile.
21556
21557 2001-08-31 Marc Autret <autret_m@epita.fr>
21558
21559 * src/bison.simple (YYLSP_NEEDED): New definition.
21560 * src/output.c (prepare): Add macro insertion of `locations_flag'
21561
21562 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
21563
21564 * src/output.c (prepare): Delete insertion of previous muscles,
21565 and insert the `prefix' muscles.
21566 * src/macrotab.c (macro_init): Likewise.
21567 (macro_init): Initialization prefix directive by `yy'.
21568 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
21569 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21570 yylval, yydebug, yyerror, yynerrs and yyparse.
21571 New directive `#define' to substitute yydebug, ... with option
21572 name_prefix.
21573
21574 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
21575
21576 * src/main.c (main): Standardize.
21577 * src/output.c (output_table_data, output_parser): Likewise.
21578 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21579
21580 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21581
21582 * src/reader.c (read_additionnal_code): Rename %%user_code to
21583 %%epilogue.
21584 * src/output.c (output): Rename %%declarations to %%prologue.
21585 * src/bison.simple: Echo modifications.
21586
21587 2001-08-31 Marc Autret <autret_m@epita.fr>
21588
21589 * src/reader.c (readgram): CleanUp.
21590 (output_token_defines): Likewise.
21591 (packsymbols): Likewise.
21592 (reader): Likewise.
21593 * src/output.c (output): CPP-out useless code.
21594
21595 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
21596
21597 * src/reader.c (reader): Delete obsolete call to function
21598 output_trailers and output_headers.
21599 * src/output.h: Remove obsolete functions prototypes of output_headers
21600 and output_trailers.
21601
21602 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
21603
21604 * src/main.c: Include macrotab.h.
21605 * src/macrotab.h (macro_entry_s): Constify fields.
21606 Adjust functions prototypes.
21607 * src/macrotab.c (macro_insert): Constify key and value.
21608 (macro_find): Constify key.
21609 (macro_insert): Include 'xalloc.h'
21610 (macro_insert): Use XMALLOC.
21611 (macro_find): Constify return value.
21612 * src/output.c (output_table_data): Rename table to table_data.
21613 (output_parser): Constify macro_key, macro_value.
21614
21615 2001-08-30 Marc Autret <autret_m@epita.fr>
21616
21617 * src/reader.c (parse_skel_decl): New.
21618 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
21619 * src/lex.h (token_t): New token `tok_skel'.
21620 * src/lex.c (percent_table): Add skeleton option entry.
21621 Standardize.
21622
21623 2001-08-29 Marc Autret <autret_m@epita.fr>
21624
21625 * src/bison.simple: Add %%user_code directive at the end.
21626 * src/reader.c (read_additionnal_code): New.
21627 (reader): Use it.
21628 * src/output.c (output_program): Remove.
21629 (output): Update.
21630
21631 2001-08-28 Marc Autret <autret_m@epita.fr>
21632
21633 * src/output.c (output_actions): Clean up.
21634 (output_gram): CPP-out useless code.
21635 * src/reader.c (reader): Clean up, CPP-out useless code.
21636
21637 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
21638
21639 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
21640 directive.
21641 * src/bison.simple: Add `%%definitions'.
21642
21643 2001-08-28 Marc Autret <autret_m@epita.fr>
21644
21645 * config/depcomp: New file.
21646
21647 2001-08-27 Paul Eggert <eggert@twinsun.com>
21648
21649 * src/bison.simple (yyparse): Don't take the address of an
21650 item before the start of an array, as that doesn't conform to
21651 the C Standard.
21652
21653 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
21654
21655 * src/output.c (output): Remove the initialization of the macro
21656 obstack. It was done too late here.
21657
21658 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21659 completely wrong.
21660 (reader): Initialize the macro obstack here, since we need it to grow
21661 '%define' directives.
21662
21663 * src/reader.h: Declare the macro obstack as extern.
21664
21665 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
21666
21667 * src/output.c (output_parser): Fix. Store single '%' characters in
21668 the output obstack instead of throwing them away.
21669
21670 2001-08-27 Akim Demaille <akim@epita.fr>
21671
21672 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21673
21674 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21675
21676 * lib/Makefile.am: Adjust.
21677
21678 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21679
21680 * src/bison.simple: Update and add '%%' directives.
21681
21682 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21683
21684 * src/reader.c (reader): Remove calls to 'output_headers' and
21685 'output_trailers'. Remove some C output.
21686 (readgram): Disable a piece of code that was writing a default
21687 definition for 'YYSTYPE'.
21688 (reader_output_yylsp): Remove.
21689 (packsymbols): Output token defintions to a macro.
21690 (copy_definition): Disable C output.
21691
21692 * src/reader.c (parse_macro_decl): New function used to parse macro
21693 declarations.
21694 (copy_string2): Put the body of copy_string into this new function.
21695 Add a parameter to let the caller choose whether he wants to copy the
21696 string delimiters or not.
21697 (copy_string): Be a simple call to copy_string2 with the last argument
21698 bound to true.
21699 (read_declarations): Add case for macro definition.
21700 (copy_identifier): New.
21701 (parse_macro_decl): Read macro identifiers using copy_identifier
21702 rather than lex.
21703
21704 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21705
21706 * src/output.c (prepare): Add prefixed names.
21707 (output_parser): Output semantic actions.
21708 (output_parser): Fix bug on '%%line' directives.
21709
21710 * src/output.c (output_headers): Remove. The C code printed by this
21711 function should now be in the skeletons.
21712 (output_trailers): Remove.
21713 (output): Disable call to 'reader_output_yylsp'.
21714 (output_rule_data): Do not output tables to the table obstack.
21715
21716 * src/output.c: Remove some C dedicated output.
21717 Improve the use of macro and output obstacks.
21718 (output_defines): Remove.
21719
21720 * src/output.c (output_token_translations): Associate 'translate'
21721 table with a macro. No output to the table obstack.
21722 (output_gram): Same for 'rhs' and 'prhs'.
21723 (output_stos): Same for 'stos'.
21724 (output_rule_data): Same for 'r1' and 'r2'.
21725 (token_actions): Same for 'defact'.
21726 (goto_actions): Same for 'defgoto'.
21727 (output_base): Same for 'pact' and 'pgoto'.
21728 (output_table): Same for 'table'.
21729 (output_check): Same for 'check'.
21730
21731 * src/output.c (output_table_data): New function.
21732 (output_short_table): Remove.
21733 (output_short_or_char_table): Remove.
21734
21735 * src/output.c (output_parser): Replace most of the skeleton copy code
21736 with something new. Skeletons are now processed character by character
21737 rather than line by line, and Bison looks for '%%' macros. This is the
21738 first step in making Bison's output process (a lot) more flexible.
21739 (output_parser): Use the macro table.
21740
21741 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21742
21743 * src/main.c (main): Initialize the macro table.
21744
21745 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21746
21747 * src/lex.c (percent_table): Add tok_define.
21748 * src/lex.h: Add tok_define.
21749
21750 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21751
21752 * src/macrotab.c: New file.
21753 * src/macrotab.h: New file.
21754 * src/Makefile.am: Update.
21755
21756 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
21757
21758 * lib/hash.c: New file.
21759 * lib/hash.h: New file.
21760 * lib/Makefile.am: Update.
21761
21762 2001-08-15 Akim Demaille <akim@epita.fr>
21763
21764 Version 1.28c.
21765
21766 2001-08-15 Marc Autret <autret_m@epita.fr>
21767
21768 * src/reader.c (readgram): Indent output macro YYSTYPE.
21769 (packsymbols): Likewise.
21770 (output_token_defines): Likewise.
21771 * src/files.c: Standardize.
21772 (compute_header_macro): New.
21773 (defines_obstack_save): New. Use compute_header_macro.
21774 (output_files): Update. Use defines_obstack_save.
21775
21776 2001-08-15 Akim Demaille <akim@epita.fr>
21777
21778 * doc/bison.texinfo (Table of Symbols): Document
21779 YYSTACK_USE_ALLOCA.
21780
21781 2001-08-15 Akim Demaille <akim@epita.fr>
21782
21783 * missing: Update from CVS Automake.
21784 * config/config.guess, config/config.sub, config/texinfo.tex:
21785 Update from gnu.org.
21786
21787 2001-08-15 Akim Demaille <akim@epita.fr>
21788
21789 * Makefile.maint: Sync with CVS Autoconf.
21790
21791 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
21792
21793 * doc/bison.texinfo: Include GNU Free Documentation License from
21794 `fdl.texi'.
21795 * doc/fdl.texi: Add to package.
21796
21797 2001-08-14 Marc Autret <autret_m@epita.fr>
21798
21799 Turn on %{source,header}_extension features.
21800
21801 * src/lex.c (percent_table): Un-CPP out header_extension and
21802 source_extension.
21803 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
21804 (compute_exts_from_src): Remove conditions. It restores priorities
21805 between options.
21806
21807 2001-08-14 Marc Autret <autret_m@epita.fr>
21808
21809 * src/files.c (compute_base_names): Add extensions computing when
21810 `--file-prefix' used.
21811 Standardize function calls.
21812
21813 2001-08-13 Marc Autret <autret_m@epita.fr>
21814
21815 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
21816 defining it (defined but null disables alloca).
21817
21818 2001-08-13 Marc Autret <autret_m@epita.fr>
21819
21820 * src/bison.simple (_yy_memcpy): CPP reformat.
21821
21822 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
21823
21824 * tests/atconfig.in (CPPFLAGS): Fix.
21825
21826 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
21827
21828 * doc/bison.texinfo: Include GNU General Public License from
21829 `gpl.texi'.
21830 * doc/gpl.texi: Add to package.
21831
21832 2001-08-10 Marc Autret <autret_m@epita.fr>
21833
21834 * src/print_graph.h: Fix.
21835 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
21836
21837 2001-08-10 Akim Demaille <akim@epita.fr>
21838
21839 * src/system.h: Provide default declarations for stpcpy, strndup,
21840 and strnlen.
21841
21842 2001-08-10 Robert Anisko <anisko_r@epita.fr>
21843
21844 * doc/bison.texinfo (Locations): Update @$ stuff.
21845
21846 2001-08-09 Robert Anisko <anisko_r@epita.fr>
21847
21848 * src/bison.simple (YYLLOC_DEFAULT): Update.
21849 (yyparse): Adjust.
21850
21851 2001-08-08 Marc Autret <autret_m@epita.fr>
21852
21853 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
21854 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
21855 Reported by Fabrice Bauzac.
21856
21857 2001-08-08 Marc Autret <autret_m@epita.fr>
21858
21859 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
21860 * src/vcg.c (output_node): Fix.
21861 * src/vcg.h: Cleanup.
21862 * src/print_graph.c: Add comments.
21863 (node_output_size): New global variable. Simplify the formatting of
21864 the VCG graph output.
21865 (print_actions): Unused code is now used. It notifies the final state
21866 and no action states in the VCG graph. It also give the reduce actions.
21867 The `shift and goto' edges are red and the `go to state' edges are
21868 blue.
21869 Get the current node name and node_obstack by argument.
21870 (node_obstack): New variable.
21871 (print_state): Manage node_obstack.
21872 (print_core): Use node_obstack given by argument.
21873 A node is not only computed here but in print_actions also.
21874 (print_graph): CPP out useless code instead of commenting it.
21875
21876 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
21877
21878 * tests/atconfig.in (CPPFLAGS): Fix.
21879
21880 2001-08-07 Akim Demaille <akim@epita.fr>
21881
21882 * src/print_graph.c (quote): New.
21883 (print_core): Use it.
21884
21885 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
21886
21887 * src/vcg.c (complain.h): Include it.
21888 Unepitaize `return' invocations.
21889 [NDEBUG] (main): Remove.
21890 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
21891 * src/files.c (open_files): Initialize graph_obstack.
21892 * src/print_graph.c (print_actions): CPP out useless code.
21893 (print_core): Don't output the last `\n' in labels.
21894 Use `quote'.
21895 * src/files.c (output_files): Output the VCG file.
21896 * src/main.c (main): Invoke print_graph ();
21897
21898 2001-08-06 Marc Autret <autret_m@epita.fr>
21899
21900 Automaton VCG graph output.
21901 Using option ``-g'' or long option ``--graph'', you can generate
21902 a gram_filename.vcg file containing a VCG description of the LALR (1)
21903 automaton of your grammar.
21904
21905 * src/main.c: Call to print_graph() function.
21906 * src/getargs.h: Update.
21907 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
21908 (graph_flag): New flag.
21909 (longopts): Update.
21910 (getargs): Add case `g'.
21911 * src/files.c (graph_obstack): New obstack struct.
21912 (open_files): Initialize new obstack.
21913 (output_files): Saves graph_obstack if required.
21914 * src/files.h (graph_obstack): New extern declaration.
21915 * src/Makefile.am: Add new source files.
21916
21917 2001-08-06 Marc Autret <autret_m@epita.fr>
21918
21919 * src/print_graph.c, src/print_graph.h (graph): New.
21920 * src/vcg.h: New file.
21921 * src/vcg.c: New file, VCG graph handling.
21922
21923 2001-08-06 Marc Autret <autret_m@epita.fr>
21924
21925 Add of %source_extension and %header_extension which specify
21926 the source or/and the header output file extension.
21927
21928 * src/files.c (compute_base_names): Remove initialisation of
21929 src_extension and header_extension.
21930 (compute_exts_from_gf): Update.
21931 (compute_exts_from_src): Update.
21932 (output_files): Update.
21933 * src/reader.c (parse_header_extension_decl): New.
21934 (parse_source_extension_decl): New.
21935 (read_declarations): New case statements for the new tokens.
21936 * src/lex.c (percent_table): Add entries for %source_extension
21937 and %header_extension.
21938 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
21939
21940 2001-08-06 Marc Autret <autret_m@epita.fr>
21941
21942 * configure.in: Bump to 1.28c.
21943 * doc/bison.texinfo: Texinfo thingies.
21944
21945 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
21946
21947 * tests/atconfig.in (CPPFLAGS): Add.
21948 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
21949
21950 2001-08-03 Akim Demaille <akim@epita.fr>
21951
21952 Version 1.28b.
21953
21954 2001-08-03 Akim Demaille <akim@epita.fr>
21955
21956 * tests/Makefile.am (check-local): Ship testsuite.
21957 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
21958 Include `string.h'.
21959
21960 2001-08-03 Akim Demaille <akim@epita.fr>
21961
21962 * configure.in: Try using -Wformat when compiling.
21963
21964 2001-08-03 Akim Demaille <akim@epita.fr>
21965
21966 * configure.in: Bump to 1.28b.
21967
21968 2001-08-03 Akim Demaille <akim@epita.fr>
21969
21970 * src/complain.c: Adjust strerror_r portability issues.
21971
21972 2001-08-03 Akim Demaille <akim@epita.fr>
21973
21974 Version 1.28a.
21975
21976 2001-08-03 Akim Demaille <akim@epita.fr>
21977
21978 * src/getargs.c, src/getarg.h (skeleton)): Constify.
21979 * src/lex.c (literalchar): Avoid name clashes on `buf'.
21980 * src/getargs.c: Include complain.h.
21981 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
21982 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
21983
21984 2001-08-03 Akim Demaille <akim@epita.fr>
21985
21986 * src/reader.c (readgram): Display hidden chars in error messages.
21987
21988 2001-08-03 Akim Demaille <akim@epita.fr>
21989
21990 Update to gettext 0.10.39.
21991
21992 2001-08-03 Akim Demaille <akim@epita.fr>
21993
21994 * lib/strspn.c: New.
21995
21996 2001-08-01 Marc Autret <autret_m@epita.fr>
21997
21998 * doc/bison.texinfo: Update.
21999 * doc/bison.1 (mandoc): Update.
22000 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
22001 * src/files.c: Support output files extensions computing.
22002 (src_extension): New static variable.
22003 (header_extension): New static variable.
22004 (tr): New function.
22005 (get_extension_index): New function, gets the index of an extension
22006 filename in a string.
22007 (compute_exts_from_gf): New function, computes extensions from the
22008 grammar file extension.
22009 (compute_exts_from_src): New functions, computes extensions from the
22010 C source file extension, file given by ``-o'' option.
22011 (compute_base_names): Update.
22012 (output_files): Update.
22013
22014 2001-08-01 Robert Anisko <anisko_r@epita.fr>
22015
22016 * doc/bison.texi: Document @$.
22017 (Locations): New section.
22018
22019 2001-07-18 Akim Demaille <akim@epita.fr>
22020
22021 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
22022 * config/prev-version.txt, config/move-if-change: New.
22023 * Makefile.am: Adjust.
22024
22025 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
22026
22027 * src/bison.simple (yyparse): Suppress warning `comparaison
22028 between signed and unsigned'.
22029
22030 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
22031
22032 * src/getargs.h (raw_flag): Remove.
22033 * src/getargs.c: Die on `-r'/`--raw'.
22034 * src/lex.c (parse_percent_token): Die on `%raw'.
22035 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22036 * tests/calc.at: Suppress test with option `--raw'.
22037
22038 2001-07-14 Akim Demaille <akim@epita.fr>
22039
22040 * config/: New.
22041 * configure.in: Require Autoconf 2.50.
22042 Update to gettext 0.10.38.
22043
22044 2001-03-16 Akim Demaille <akim@epita.fr>
22045
22046 * doc/bison.texinfo: ANSIfy the examples.
22047
22048 2001-03-16 Akim Demaille <akim@epita.fr>
22049
22050 * getargs.c (skeleton): New variable.
22051 (longopts): --skeleton is a new option.
22052 (shortopts, getargs): -S is a new option.
22053 * getargs.h: Declare skeleton.
22054 * output.c (output_parser): Use it.
22055
22056 2001-03-16 Akim Demaille <akim@epita.fr>
22057
22058 * m4/strerror_r.m4: New.
22059 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22060 * lib/error.h, lib/error.c: Update.
22061
22062 2001-03-16 Akim Demaille <akim@epita.fr>
22063
22064 * src/getargs.c (longopts): Clean up.
22065
22066 2001-02-21 Akim Demaille <akim@epita.fr>
22067
22068 * src/reader.c (gensym): `gensym_count' is your own.
22069 Use a static buf to create the symbol name, as token_buffer is no
22070 longer a buffer.
22071
22072 2001-02-08 Akim Demaille <akim@epita.fr>
22073
22074 * src/conflicts.c (conflict_report): Be sure not to append to res
22075 between two calls, which could happen if both first sprintf were
22076 skipped, but not the first cp += strlen.
22077
22078 2001-02-08 Akim Demaille <akim@epita.fr>
22079
22080 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22081 New, from fileutils 4.0.37.
22082 * configure.in: Require Autoconf 2.49c. I took some time before
22083 making this decision. This is the only way out for portability
22084 issues in Bison, it would mean way too much duplicate effort to
22085 import in Bison features implemented in 2.49c since 2.13.
22086 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22087
22088 2001-02-02 Akim Demaille <akim@epita.fr>
22089
22090 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
22091 * lib/xalloc.h, lib/xmalloc.c: Update.
22092
22093 2001-01-19 Akim Demaille <akim@epita.fr>
22094
22095 Get rid of the ad hoc handling of token_buffer in the scanner: use
22096 the obstacks.
22097
22098 * src/lex.c (token_obstack): New.
22099 (init_lex): Initialize it. No longer call...
22100 (grow_token_buffer): this. Remove it.
22101 Adjust all the places which used it to use the obstack.
22102
22103 2001-01-19 Akim Demaille <akim@epita.fr>
22104
22105 * src/lex.h: Rename all the tokens:
22106 s/\bENDFILE\b/tok_eof/g;
22107 s/\bIDENTIFIER\b/tok_identifier/g;
22108 etc.
22109 Let them be enums, not #define, to ease debugging.
22110 Adjust all the code.
22111
22112 2001-01-18 Akim Demaille <akim@epita.fr>
22113
22114 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
22115 * src/lex.c (maxtoken, grow_token_buffer): Static.
22116
22117 2001-01-18 Akim Demaille <akim@epita.fr>
22118
22119 Since we now use obstacks, more % directives can be enabled.
22120
22121 * src/lex.c (percent_table): Also accept `%yacc',
22122 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
22123 `%debug'.
22124 Handle the actions for `%semantic_parser' and `%pure_parser' here,
22125 instead of returning a token.
22126 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
22127 * src/reader.c (read_declarations): Adjust.
22128 * src/files.c (open_files): Don't call `compute_base_names', don't
22129 compute `attrsfile' since they depend upon data which might be
22130 *in* the input file now.
22131 (output_files): Do it here.
22132 * src/output.c (output_headers): Document the fact that this patch
22133 introduces a guaranteed SEGV for semantic parsers.
22134 * doc/bison.texinfo: Document them.
22135 * tests/suite.at: Exercise these %options.
22136
22137 2000-12-20 Akim Demaille <akim@epita.fr>
22138
22139 Also handle the output file (--verbose) with obstacks.
22140
22141 * files.c (foutput): Remove.
22142 (output_obstack): New.
22143 Adjust all dependencies.
22144 * src/conflicts.c: Return a string.
22145 * src/system.h (obstack_grow_string): Rename as...
22146 (obstack_sgrow): this. Be ready to work with non literals.
22147 (obstack_fgrow4): New.
22148
22149 2000-12-20 Akim Demaille <akim@epita.fr>
22150
22151 * src/files.c (open_files): Fix the computation of short_base_name
22152 in the case of `-o foo.tab.c'.
22153
22154 2000-12-20 Akim Demaille <akim@epita.fr>
22155
22156 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
22157 (copy_dollar): Now that everything uses obstacks, get rid of the
22158 FILE * parameters.
22159
22160 2000-12-20 Akim Demaille <akim@epita.fr>
22161
22162 * src/files.c (open_files): Actually the `.output' file is based
22163 on the short_base_name, not base_name.
22164 * tests/suite.at (Checking output file names): Adjust.
22165
22166 2000-12-20 Akim Demaille <akim@epita.fr>
22167
22168 * src/bison.s1: Remove, we now use directly...
22169 * src/bison.simple: this.
22170 * src/Makefile.am: Use pkgdata instead of data.
22171
22172 2000-12-20 Akim Demaille <akim@epita.fr>
22173
22174 * src/files.c (guard_obstack): New.
22175 (open_files): Initialize it.
22176 (output_files): Dump it...
22177 * src/files.h: Export it.
22178 * src/reader.c (copy_guard): Use it.
22179
22180 2000-12-19 Akim Demaille <akim@epita.fr>
22181
22182 * src/files.c (outfile, defsfile, actfile): Removed as global
22183 vars.
22184 (open_files): Don't compute them.
22185 (output_files): Adjust.
22186 (base_name, short_base_name): Be global.
22187 Adjust dependencies.
22188
22189 2000-12-19 Akim Demaille <akim@epita.fr>
22190
22191 * src/files.c (strsuffix): New.
22192 (stringappend): Be just like strcat but allocate.
22193 (base_names): Eve out from open_files.
22194 Try to simplify the rather hairy computation of base_name and
22195 short_base_name.
22196 (open_files): Use it.
22197 * tests/suite.at (Checking output file names): New test.
22198
22199 2000-12-19 Akim Demaille <akim@epita.fr>
22200
22201 * src/system.h (obstack_grow_literal_string): Rename as...
22202 (obstack_grow_string): this.
22203 * src/output.c (output_parser): Recognize `%% actions' instead of
22204 `$'.
22205 * src/bison.s1: s/$/%% actions/.
22206 * src/bison.hairy: Likewise.
22207
22208 2000-12-19 Akim Demaille <akim@epita.fr>
22209
22210 * src/output.c (output_parser): Compute the `#line' lines when
22211 there are.
22212 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
22213 Suggested by Hans Aberg.
22214
22215 2000-12-19 Akim Demaille <akim@epita.fr>
22216
22217 Let the handling of the skeleton files be local to the procedures
22218 that use it.
22219
22220 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
22221 longer static.
22222 (fparser, open_extra_files): Remove.
22223 (open_files, output_files): Don't take care of fparser.
22224 * src/files.h: Adjust.
22225 * src/output.c (output_parser): Open and close the file to the
22226 skeleton.
22227 * src/reader.c (read_declarations): When %semantic_parser, open
22228 fguard.
22229
22230 2000-12-19 Akim Demaille <akim@epita.fr>
22231
22232 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
22233 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
22234
22235 2000-12-19 Akim Demaille <akim@epita.fr>
22236
22237 * src/files.c (open_files): Yipee! We no longer need all the code
22238 looking for `/tmp' since we have no tmp file.
22239
22240 2000-12-19 Akim Demaille <akim@epita.fr>
22241
22242 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
22243 New macros.
22244 * src/files.c (open_files): Less dependency on MSDOS etc.
22245
22246 2000-12-14 Akim Demaille <akim@epita.fr>
22247
22248 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
22249 Provide a default definition.
22250 Use it when executing the default @ action.
22251 * src/reader.c (reader_output_yylsp): No longer include
22252 `timestamp' and `text' in the default YYLTYPE.
22253
22254 2000-12-12 Akim Demaille <akim@epita.fr>
22255
22256 * src/reader.c (copy_definition, parse_union_decl, copy_action)
22257 (copy_guard): Quote the file names.
22258 Reported by Laurent Mascherpa.
22259
22260 2000-12-12 Akim Demaille <akim@epita.fr>
22261
22262 * src/output.c (output_headers, output_program, output): Be sure
22263 to escape special characters when outputting filenames.
22264 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22265 (output_headers): Don't depend on them, Use ACTSTR.
22266
22267 2000-11-17 Akim Demaille <akim@epita.fr>
22268
22269 * lib/obstack.h: Formatting changes.
22270 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22271 prevents type checking.
22272 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22273 cast the value to (void *): assigning a `foo *' to a `void *'
22274 variable is valid.
22275 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22276 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22277 append characters.
22278
22279 2000-11-17 Akim Demaille <akim@epita.fr>
22280
22281 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22282 as...
22283 (suite.m4, regression.m4, calc.m4): these.
22284 * tests/atgeneral.m4: Update from CVS Autoconf.
22285
22286 2000-11-17 Akim Demaille <akim@epita.fr>
22287
22288 * tests/regression.m4 (%union and --defines): New test,
22289 demonstrating a current bug in the obstack implementation.
22290
22291 2000-11-17 Akim Demaille <akim@epita.fr>
22292
22293 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22294 macros.
22295 Use them to declare the variables which are global or local to
22296 `yyparse'.
22297
22298 2000-11-17 Akim Demaille <akim@epita.fr>
22299
22300 * acconfig.h: Remove, no longer used.
22301
22302 2000-11-07 Akim Demaille <akim@epita.fr>
22303
22304 * src: s/Copyright (C)/Copyright/g.
22305
22306 2000-11-07 Akim Demaille <akim@epita.fr>
22307
22308 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22309 defining.
22310 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22311
22312 2000-11-07 Akim Demaille <akim@epita.fr>
22313
22314 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22315 Merge in a single CPP if/else.
22316
22317 2000-11-07 Akim Demaille <akim@epita.fr>
22318
22319 * src/output.c (output): Remove useless variables.
22320 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22321 argument `data' for consistency with the prototypes.
22322 Qualify it `const'.
22323 (obstack_copy, obstack_copy0): Rename the second argument as
22324 `address' for consistency. Qualify it `const'.
22325 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22326 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22327 `const' their input argument (`data' or `address').
22328 Adjust the corresponding macros to include `const' in casts.
22329
22330 2000-11-03 Akim Demaille <akim@epita.fr>
22331
22332 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22333 s/PFILE1/BISON_HAIRY/.
22334 Adjust dependencies.
22335
22336 2000-11-03 Akim Demaille <akim@epita.fr>
22337
22338 For some reason, this was not applied.
22339
22340 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22341 `unlink': it's no longer used.
22342
22343 2000-11-03 Akim Demaille <akim@epita.fr>
22344
22345 * src/files.c (skeleton_find): New function, eved out of...
22346 (open_files, open_extra_files): here.
22347
22348 2000-11-03 Akim Demaille <akim@epita.fr>
22349
22350 Don't use `atexit'.
22351
22352 * src/files.c (obstack_save): New function.
22353 (done): Rename as...
22354 (output_files): this.
22355 Use `obstack_save'.
22356 * src/main.c (main): Don't use `atexit' to register `done', since
22357 it no longer has to remove tmp files, just call `output_files'
22358 when there are no errors.
22359
22360 2000-11-02 Akim Demaille <akim@epita.fr>
22361
22362 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22363 `unlink': it's no longer used.
22364 * src/files.h: Formatting changes.
22365
22366 2000-11-02 Akim Demaille <akim@epita.fr>
22367
22368 Remove the last uses of mktemp and unlink/delete.
22369
22370 * src/files.c (fdefines, ftable): Removed.
22371 (defines_ostack, table_obstack): New.
22372 Adjust dependencies of the former into uses of the latter.
22373 * src/output.c (output_short_or_char_table, output_short_table):
22374 Convert to using obstacks.
22375 * src/reader.c (copy_comment2): Accept one FILE * and two
22376 obstacks.
22377 (output_token_defines, reader_output_yylsp): Use obstacks.
22378 * src/system.h (obstack_fgrow3): New.
22379 * po/POTFILES.in: Adjust.
22380
22381 2000-11-01 Akim Demaille <akim@epita.fr>
22382
22383 Change each use of `fattrs' into a use of `attrs_obstack'.
22384
22385 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22386 * src/files.c (fattrs): Remove.
22387 (attrs_obstack): New.
22388 Adjust all dependencies.
22389 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22390
22391 2000-11-01 Akim Demaille <akim@epita.fr>
22392
22393 Introduce obstacks.
22394 Change each use of `faction' into a use of `action_obstack'.
22395
22396 * lib/obstack.h, lib/obstack.c: New files.
22397 * src/files.c (faction): Remove.
22398 (action_obstack): New.
22399 Adjust all dependencies.
22400
22401 2000-10-20 Akim Demaille <akim@epita.fr>
22402
22403 * lib/quote.h (PARAMS): New macro. Use it.
22404
22405 2000-10-16 Akim Demaille <akim@epita.fr>
22406
22407 * src/output.c (output_short_or_char_table): New function.
22408 (output_short_table, output_token_translations): Use it.
22409 (goto_actions): Use output_short_table.
22410
22411 2000-10-16 Akim Demaille <akim@epita.fr>
22412
22413 * src/symtab.c (bucket_new): New function.
22414 (getsym): Use it.
22415
22416 * src/output.c (output_short_table): New argument to display the
22417 comment associated with the table.
22418 Adjust dependencies.
22419 (output_gram): Use it.
22420 (output_rule_data): Nicer output layout for YYTNAME.
22421
22422 2000-10-16 Akim Demaille <akim@epita.fr>
22423
22424 * src/lex.c (read_typename): New function.
22425 (lex): Use it.
22426 * src/reader.c (copy_dollar): Likewise.
22427
22428 2000-10-16 Akim Demaille <akim@epita.fr>
22429
22430 * src/reader.c (copy_comment2): Expect the input stream to be on
22431 the `/' which is suspected to open a comment, instead of being
22432 called after `//' or `/*' was read.
22433 (copy_comment, copy_definition, parse_union_decl, copy_action)
22434 (copy_guard): Adjust.
22435
22436 2000-10-16 Akim Demaille <akim@epita.fr>
22437
22438 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22439 `read_signed_integer'.
22440
22441 2000-10-16 Akim Demaille <akim@epita.fr>
22442
22443 * src/reader.c (copy_dollar): New function.
22444 (copy_guard, copy_action): Use it.
22445
22446 2000-10-16 Akim Demaille <akim@epita.fr>
22447
22448 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22449 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22450 New files, from Fileutils 4.0.27.
22451 * src/main.c (printable_version): Remove.
22452 * src/lex.c, src/reader.c: Use `quote'.
22453
22454 2000-10-04 Akim Demaille <akim@epita.fr>
22455
22456 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22457
22458 2000-10-04 Akim Demaille <akim@epita.fr>
22459
22460 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22461
22462 2000-10-04 Akim Demaille <akim@epita.fr>
22463
22464 When a literal string is used to define two different tokens,
22465 `bison -v' segfaults.
22466 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22467
22468 * tests/regression.m4: New file.
22469 Include the core of the sample provided by Piotr Gackiewicz.
22470 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22471 properly.
22472
22473 2000-10-04 Akim Demaille <akim@epita.fr>
22474
22475 * src/reader.c (parse_expect_decl): Keep `count' within the size
22476 of `buffer'.
22477 From Neil Booth.
22478
22479 2000-10-02 Paul Eggert <eggert@twinsun.com>
22480
22481 * bison.s1 (yyparse): Assign the default value
22482 unconditionally, to avoid a GCC warning and make the parser a
22483 tad smaller.
22484
22485 2000-10-02 Akim Demaille <akim@epita.fr>
22486
22487 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22488 options.
22489
22490 2000-10-02 Akim Demaille <akim@epita.fr>
22491
22492 * src/derives.c, src/print.c, src/reduce.c: To ease the
22493 translation, move some `\n' out of the translated strings.
22494
22495 2000-10-02 Akim Demaille <akim@epita.fr>
22496
22497 The location tracking mechanism is precious for parse error
22498 messages. Nevertheless, it is enabled only when `@n' is used in
22499 the grammar, which is a different issue (you can use it in error
22500 message, but not in the grammar per se). Therefore, there should
22501 be another means to enable it.
22502
22503 * src/getargs.c (getargs): Support `--locations'.
22504 (usage): Report it.
22505 * src/getargs.h (locationsflag): Export it.
22506 * src/lex.c (percent_table): Support `%locations'.
22507 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22508 with `locationsflag'.
22509 * doc/bison.texinfo: Document `--locations' and `%locations'.
22510 Sort the options.
22511 * tests/calc.m4: Test it.
22512
22513 For regularity of the names, replace each
22514 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22515 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22516 In addition replace each `flag' with `_flag'.
22517
22518 2000-10-02 Akim Demaille <akim@epita.fr>
22519
22520 Also test parse error messages, including with YYERROR_VERBOSE.
22521
22522 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22523 associative).
22524 Use it to check the computations.
22525 Use it to check `nonassoc' is honored.
22526 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22527 `--yyerror-verbose'.
22528 (_AT_CHECK_CALC): Adjust to this option.
22529 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22530
22531 2000-10-02 Akim Demaille <akim@epita.fr>
22532
22533 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22534 the latter demonstrates a flaw in the handling of non debugging
22535 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22536 was used in order to simplify:
22537
22538 #if YYDEBUG
22539 if (yydebug)
22540 {
22541 ...
22542 }
22543 #endif
22544
22545 into
22546
22547 if (yydebug)
22548 {
22549 ...
22550 }
22551
22552 unfortunately this leads to a CPP conflict when
22553 `--name-prefix=foo' is used since it produces `#define yydebug
22554 foodebug'.
22555
22556 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22557 (YYDPRINTF): New macro.
22558 Spread its use.
22559 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22560 the bison options.
22561 Also test `--verbose', `--defines' and `--name-prefix'.
22562
22563 2000-10-02 Akim Demaille <akim@epita.fr>
22564
22565 Improve the readability of the produced parsers.
22566
22567 * src/bison.s1: Formatting changes.
22568 Improve the comment related to the `$' mark.
22569 (yydefault): Don't fall through to `yyresume': `goto' there.
22570 * src/output.c (output_parser): When the `$' is met, skip the end
22571 of its line.
22572 New variable, `number_of_dollar_signs', to check there's exactly
22573 one `$' in the parser skeleton.
22574
22575 2000-10-02 Akim Demaille <akim@epita.fr>
22576
22577 * lib/xstrdup.c: New file, from the fileutils.
22578 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22579 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22580 instead of strlen + xmalloc + strcpy.
22581 * src/symtab.c (copys): Remove, use xstrdup instead.
22582
22583 2000-10-02 Akim Demaille <akim@epita.fr>
22584
22585 * src/gram.h (associativity): New enum type which replaces the
22586 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22587 `right_assoc', `left_assoc' and `non_assoc'.
22588 Adjust all dependencies.
22589 * src/reader.c: Formatting changes.
22590 (LTYPESTR): Don't define it, use it as a literal in
22591 `reader_output_yylsp'.
22592 * src/symtab.h (symbol_class): New enum type which replaces the
22593 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22594 `sunknown', `stoken and `snterm'.
22595
22596 2000-10-02 Akim Demaille <akim@epita.fr>
22597
22598 * src/getargs.c (fixed_outfiles): Rename as...
22599 (yaccflag): for consistency and accuracy.
22600 Adjust dependencies.
22601
22602 2000-10-02 Akim Demaille <akim@epita.fr>
22603
22604 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22605 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22606 difficult and introduced a lot of core dump. It turns out that
22607 Bison used an implementation of `xmalloc' based on `calloc', and
22608 at various places it does depend upon the initialization to 0. I
22609 have not tried to isolate the pertinent places, and all the former
22610 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22611 someone should address this issue.
22612
22613 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22614 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22615 files.
22616 Adjust dependencies.
22617 * src/warshall.h: New file.
22618 Propagate.
22619
22620 2000-10-02 Akim Demaille <akim@epita.fr>
22621
22622 Various anti-`extern in *.c' changes.
22623
22624 * src/system.h: Include `assert.h'.
22625
22626 2000-10-02 Akim Demaille <akim@epita.fr>
22627
22628 * src/state.h (nstates, final_state, first_state, first_shift)
22629 (first_reduction): Move their exportation from here...
22630 * src/LR0.h: to here.
22631 Adjust dependencies.
22632 * src/getargs.c (statisticsflag): New variable.
22633 Add support for `--statistics'.
22634 Adjust dependencies.
22635
22636 Remove a lot of now useless `extern' statements in most files.
22637
22638 2000-10-02 Akim Demaille <akim@epita.fr>
22639
22640 * src/LR0.h: New file.
22641 Propagate its use.
22642
22643 2000-10-02 Akim Demaille <akim@epita.fr>
22644
22645 * src/print.h: New file.
22646 Propagate its use.
22647 * src/print.c: Formatting and ordering changes.
22648 (verbose, terse): Replace with...
22649 (print_results): this new function.
22650 Adjust dependencies.
22651
22652 2000-10-02 Akim Demaille <akim@epita.fr>
22653
22654 * src/conflicts.c (conflict_report): New function.
22655 (conflict_log, verbose_conflict_log): Replace with...
22656 (print_conflicts): this function.
22657 Adjust dependencies.
22658 * src/conflicts.h: New file.
22659 Propagate its inclusion.
22660
22661 2000-10-02 Akim Demaille <akim@epita.fr>
22662
22663 * src/nullable.h: New file.
22664 Propagate its inclusion.
22665 * src/nullable.c: Formatting changes.
22666
22667 2000-10-02 Akim Demaille <akim@epita.fr>
22668
22669 * src/reduce.h: New file.
22670 Propagate its inclusion.
22671 * src/reduce.c: Topological sort and other formatting changes.
22672 (bool, TRUE, FALSE): Move their definition to...
22673 * src/system.h: here.
22674
22675 2000-10-02 Akim Demaille <akim@epita.fr>
22676
22677 * src/files.c: Formatting changes.
22678 (tryopen, tryclose, openfiles): Rename as...
22679 (xfopen, xfclose, open_files): this.
22680 (stringappend): static.
22681 * src/files.h: Complete the list of exported symbols.
22682 Propagate its use.
22683
22684 2000-10-02 Akim Demaille <akim@epita.fr>
22685
22686 * src/reader.h: New file.
22687 Propagate its use instead of tedious list of `extern' and
22688 prototypes.
22689 * src/reader.c: Formatting changes, topological sort,
22690 s/register//.
22691
22692 2000-10-02 Akim Demaille <akim@epita.fr>
22693
22694 * src/lex.h: Prototype `lex.c' exported functions.
22695 * src/reader.c: Adjust.
22696 * src/lex.c: Formatting changes.
22697 (safegetc): Rename as...
22698 (xgetc): this.
22699
22700 2000-10-02 Akim Demaille <akim@epita.fr>
22701
22702 * src/lalr.h: New file.
22703 Propagate its inclusion instead of prototypes and `extern'.
22704 * src/lalr.c: Formatting changes, topological sorting etc.
22705
22706 2000-10-02 Akim Demaille <akim@epita.fr>
22707
22708 * src/output.c (token_actions): Introduce a temporary array,
22709 YYDEFACT, that makes it possible for this function to use
22710 output_short_table.
22711
22712 2000-10-02 Akim Demaille <akim@epita.fr>
22713
22714 `user_toknums' is output as a `short[]' in `output.c', while it is
22715 defined as a `int[]' in `reader.c'. For consistency with the
22716 other output tables, `user_toknums' is now defined as a table of
22717 shorts.
22718
22719 * src/reader.c (user_toknums): Be a short table instead of an int
22720 table.
22721 Adjust dependencies.
22722
22723 Factor the short table outputs.
22724
22725 * src/output.c (output_short_table): New function.
22726 * src/output.c (output_gram, output_stos, output_rule_data)
22727 (output_base, output_table, output_check): Use it.
22728
22729 2000-10-02 Akim Demaille <akim@epita.fr>
22730
22731 * src/output.c (output): Topological sort of the functions, in
22732 order to get rid of the `static' prototypes.
22733 No longer use `register'.
22734 * src/output.h: New file.
22735 Propagate its inclusion in files explicitly prototyping functions
22736 from output.c.
22737
22738 2000-09-21 Akim Demaille <akim@epita.fr>
22739
22740 * src/atgeneral.m4: Update from Autoconf.
22741
22742 2000-09-21 Akim Demaille <akim@epita.fr>
22743
22744 * src/closure.h: New file.
22745 * src/closure.c: Formatting changes, topological sort over the
22746 functions, use of closure.h.
22747 (initialize_closure, finalize_closure): Rename as...
22748 (new_closure, free_closure): these. Adjust dependencies.
22749 * src/LR0.c: Formatting changes, topological sort, use of
22750 cloture.h.
22751 (initialize_states): Rename as...
22752 (new_states): this.
22753 * src/Makefile.am (noinst_HEADERS): Adjust.
22754
22755 2000-09-20 Akim Demaille <akim@epita.fr>
22756
22757 * src/acconfig.h: Don't protect config.h against multiple
22758 inclusion.
22759 Don't define PARAMS.
22760 * src/system.h: Define PARAMS.
22761 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22762 purpose of config.h. system.h must not try to fix wrong
22763 definitions in config.h.
22764
22765 2000-09-20 Akim Demaille <akim@epita.fr>
22766
22767 * src/derives.h: New file.
22768 * src/main.c, src/derives.h: Use it.
22769 Formatting changes.
22770 * src/Makefile.am (noinst_HEADERS): Adjust.
22771
22772 2000-09-20 Akim Demaille <akim@epita.fr>
22773
22774 * tests/atgeneral.m4: Update from Autoconf.
22775 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22776 (AT_CHECK_CALC): New macros.
22777 Use these macros to test bison with options `', `--raw',
22778 `--debug', `--yacc', `--yacc --debug'.
22779
22780 2000-09-19 Akim Demaille <akim@epita.fr>
22781
22782 * src/output.c: Formatting changes.
22783 * src/machine.h: Remove, leaving its contents in...
22784 * src/system.h: here.
22785 Include stdio.h.
22786 Adjust all dependencies on stdio.h and machine.h.
22787 * src/getargs.h: New file.
22788 Let all `extern' declarations about getargs.c be replaced with
22789 inclusion of `getargs.h'.
22790 * src/Makefile.am (noinst_HEADERS): Adjust.
22791
22792 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22793 scope.
22794 (yyerror): Returns void, not int.
22795 * doc/bison.texinfo: Formatting changes.
22796
22797 2000-09-19 Akim Demaille <akim@epita.fr>
22798
22799 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
22800 portable.
22801
22802 2000-09-18 Akim Demaille <akim@epita.fr>
22803
22804 * configure.in: Append WARNING_CFLAGS to CFLAGS.
22805 * src/Makefile.am (INCLUDES): Don't.
22806 Be ready to fetch headers in lib/.
22807
22808 2000-09-18 Akim Demaille <akim@epita.fr>
22809
22810 * doc/bison.texinfo: Update the copyright.
22811 ANSIfy and GNUify the examples.
22812 Remove the old menu.
22813
22814 2000-09-18 Akim Demaille <akim@epita.fr>
22815
22816 First set of tests: use the `calc' example from the documentation.
22817
22818 * src/bison.s1 (yyparse): Condition the code using `yytname' which
22819 is defined only when YYDEBUG is.
22820 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
22821 * src/files.c (tryopen, tryclose): Formatting changes.
22822 Move to the top and be static.
22823 * src/reader.c (read_signed_integer): Likewise.
22824 * tests/calc.m4: New file.
22825 * Makefile.am, suite.m4: Adjust.
22826 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
22827
22828 2000-09-18 Akim Demaille <akim@epita.fr>
22829
22830 Add support for an Autotest test suite for Bison.
22831
22832 * m4/m4.m4, m4/atconfig.m4: New files.
22833 * m4/Makefile.am (EXTRA_DIST): Adjust.
22834 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
22835 files.
22836 * src/getargs.c: Display a more standard --version message.
22837 * src/reader.c (reader): Formatting changes.
22838 No longer depend upon VERSION_STRING.
22839 * configure.in: No longer use `dnl'.
22840 Set up the test suite and the new directory `tests/.
22841 (VERSION_STRING): Remove.
22842
22843 2000-04-14 Akim Demaille <akim@epita.fr>
22844
22845 * src/reader.c (copy_comment2): New function, same as former
22846 `copy_comment', but outputs into two FILE *.
22847 (copy_comment): Use it.
22848 (parse_union_decl): Use it.
22849 (get_type, parse_start_decl): Use the same `invalid' message.
22850 (parse_start_decl, parse_union_decl): Use the same `multiple'
22851 message.
22852 (parse_union_decl, copy_guard, copy_action): Use the same
22853 `unmatched' message.
22854 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
22855
22856 2000-03-31 Akim Demaille <akim@epita.fr>
22857
22858 * src/files.c (tryopen, tryclose): Move to the top.
22859 Be static.
22860
22861 2000-03-31 Akim Demaille <akim@epita.fr>
22862
22863 * src/main.c (main): Don't call `done', exit does it.
22864
22865 2000-03-31 Akim Demaille <akim@epita.fr>
22866
22867 * allocate.c: s/return (foo)/return foo/.
22868 * lalr.c: Likewise.
22869 * LR0.c: Likewise.
22870 * output.c: Likewise.
22871 * reader.c: Likewise.
22872 * symtab.c: Likewise.
22873 * vmsgetargs.c: Likewise.
22874
22875 2000-03-31 Akim Demaille <akim@epita.fr>
22876
22877 Clean up the error reporting functions.
22878
22879 * src/report.c: New file.
22880 * src/report.h: Likewise.
22881 * src/Makefile.am: Adjust.
22882 * m4/error.m4: New file.
22883 * m4/Makefile.am: Adjust.
22884 * configure.in (jm_PREREQ_ERROR): Call it.
22885 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
22886 Remove.
22887 (fatal, fatals): Remove. All callers use complain.c::fatal.
22888 (warn, warni, warns, warnss, warnss): Remove. All callers use
22889 complain.c::complain.
22890 (toomany): Remove, use fatal instead.
22891 * src/files.c (done): No argument, use complain_message_count.
22892 * src/main.c (main): Register `done' to `atexit'.
22893
22894 * src/getargs.c (usage): More `fputs', less `fprintf'.
22895
22896 2000-03-28 Akim Demaille <akim@epita.fr>
22897
22898 * lib/: New directory.
22899 * Makefile.am (SUBDIRS): Adjust.
22900 * configure.in: Adjust.
22901 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
22902 useless.
22903 * src/alloca.c: Moved to lib/.
22904 * src/getopt.c: Likewise.
22905 * src/getopt1.c: Likewise.
22906 * src/getopt.h: Likewise.
22907 * src/ansi2knr.c: Likewise.
22908 * src/ansi2knr.1: Likewise.
22909 * src/Makefile.am: Adjust.
22910 * lib/Makefile.am: New file.
22911
22912 2000-03-28 Akim Demaille <akim@epita.fr>
22913
22914 * src/getargs.c (usage): Refresh the help message.
22915
22916 2000-03-17 Akim Demaille <akim@epita.fr>
22917
22918 * src/getopt1.c: Updated from textutils 2.0e
22919 * src/getopt.c: Likewise.
22920 * src/getopt.h: Likewise.
22921
22922 2000-03-17 Akim Demaille <akim@epita.fr>
22923
22924 * src/Makefile.am (bison.simple): Fix the awk program: quote only
22925 the file name, not the whole `#line LINE FILE'.
22926
22927 2000-03-17 Akim Demaille <akim@epita.fr>
22928
22929 On syntax errors, report the token on which we choked.
22930
22931 * src/bison.s1 (yyparse): In the label yyerrlab, when
22932 YYERROR_VERBOSE, add yychar in msg.
22933
22934 2000-03-17 Akim Demaille <akim@epita.fr>
22935
22936 * src/reader.c (copy_at): New function.
22937 (copy_guard): Use it.
22938 (copy_action): Use it.
22939
22940 2000-03-17 Akim Demaille <akim@epita.fr>
22941
22942 Be kind to translators, save some useless translations.
22943
22944 * src/main.c (banner): New function.
22945 (fatal_banner): Use it.
22946 (warn_banner): Use it.
22947
22948 2000-03-17 Akim Demaille <akim@epita.fr>
22949
22950 * src/reader.c (copy_definition): Use copy_string and
22951 copy_comment. Removed now unused `match', `ended',
22952 `cplus_comment'.
22953 (copy_comment, copy_string): Moved, to be visible from
22954 copy_definition.
22955
22956 2000-03-17 Akim Demaille <akim@epita.fr>
22957
22958 * src/reader.c (copy_string): Declare `static inline'. No
22959 problems with inline, since it is checked by configure.
22960 (copy_comment): Likewise.
22961
22962 2000-03-17 Akim Demaille <akim@epita.fr>
22963
22964 * src/reader.c (packsymbols): Formatting changes.
22965
22966 2000-03-17 Akim Demaille <akim@epita.fr>
22967
22968 * src/reader.c (copy_comment): New function, factored out from:
22969 (copy_action): Use it. Removed now unused `match', `ended',
22970 `cplus_comment'.
22971 (copy_guard): Likewise.
22972
22973 2000-03-17 Akim Demaille <akim@epita.fr>
22974
22975 * src/reader.c (copy_string): New function, factored out from:
22976 (copy_action): Use it.
22977 (copy_guard): Likewise.
22978
22979 2000-03-17 Akim Demaille <akim@epita.fr>
22980
22981 Change the handling of @s so that they behave exactly like $s.
22982 There is now a pseudo variable @$ (readble and writable), location
22983 of the lhs of the rule (by default ranging from the location of
22984 the first symbol of the rhs, to the location of the last symbol,
22985 or, if the rhs is empty, YYLLOC).
22986
22987 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
22988 yyval.
22989 (yyparse): When providing a default semantic action, provide a
22990 default location action.
22991 (after the $): No longer change `*YYLSP', just stack YYLOC the
22992 same way you stack YYVAL.
22993 * src/reader.c (read_declarations): Use warns.
22994 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
22995 (copy_action, case '@'): Likewise.
22996 Use a standard error message, to save useless work from
22997 translators.
22998
22999 2000-03-17 Akim Demaille <akim@epita.fr>
23000
23001 * src/bison.s1: Formatting and cosmetics changes.
23002 * src/reader.c: Likewise.
23003 Update the Copyright notice.
23004
23005 2000-03-17 Akim Demaille <akim@epita.fr>
23006
23007 * src/bison.s1 (#line): All set to `#line' only, since the
23008 Makefile now handles them.
23009
23010 2000-03-16 Akim Demaille <akim@epita.fr>
23011
23012 * src/output.c (output_rule_data): Output the documentation of
23013 some of the tables.
23014 (Copyright notice): Update.
23015 Formatting changes.
23016
23017 2000-03-16 Akim Demaille <akim@epita.fr>
23018
23019 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
23020 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
23021 One `#if YYDEBUG' remains, since it uses variables which are
23022 defined only if `YYDEBUG != 0'.
23023
23024 2000-03-16 Akim Demaille <akim@epita.fr>
23025
23026 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
23027 and related variables so that the similarities are highlighted.
23028
23029 2000-03-16 Akim Demaille <akim@epita.fr>
23030
23031 * src/bison.s1: Properly indent CPP directives.
23032
23033 2000-03-16 Akim Demaille <akim@epita.fr>
23034
23035 * src/bison.s1: Properly indent the `alloca' CPP section.
23036
23037 2000-03-16 Akim Demaille <akim@epita.fr>
23038
23039 Do not hard code values of directories in `configure.in'.
23040 Update the `configure' tool chain.
23041
23042 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23043 src/makefile.am.
23044 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23045 (AC_OUTPUT): Add m4/Makefile.
23046 Bump to bison 1.28a, 1.29 has never been released.
23047 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23048 handled via src/Makefile.am.
23049 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23050 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23051 autoheader.
23052 * Makefile.am (SUBDIRS): Add m4.
23053 (ACLOCAL_AM_FLAGS): New variable.
23054 (AUTOMAKE_OPTIONS): Add check-news.
23055 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23056 the proper line number and file name.
23057 (DEFS): Propagate the location of bison library files and of the
23058 locale files.
23059 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23060 builddir.
23061 * acinclude.m4: Remove, replaced by the directory m4.
23062 * m4/Makefile.am (EXTRA_DIST): New variable.
23063 * m4/gettext.m4: New file, from the fileutils.
23064 * m4/lcmessage.m4: Likewise
23065 * m4/progtest.m4: Likewise.
23066 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23067
23068 2000-03-10 Akim Demaille <akim@epita.fr>
23069
23070 * src/closure.c:
23071 Formatting changes of various comments.
23072 Respect the GNU coding standards at various places.
23073 Don't use `_()' when no translation is needed.
23074
23075 1999-12-13 Jesse Thilo <jthilo@gnu.org>
23076
23077 * src/files.c:
23078 OS/2 honors TMPDIR environment variable.
23079
23080 1999-12-13 Jesse Thilo <jthilo@gnu.org>
23081
23082 * doc/bison.texinfo: Tweaked spelling and grammar.
23083 Updated ISBN.
23084 Removed reference to price of printed copy.
23085 Mention BISON_SIMPLE and BISON_HAIRY.
23086
23087 1999-12-13 Jesse Thilo <jthilo@gnu.org>
23088
23089 * configure.in, NEWS:
23090 Bison 1.29 released.
23091
23092 1999-10-27 Jesse Thilo <jthilo@gnu.org>
23093
23094 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23095 Added reference card.
23096
23097 1999-07-26 Jesse Thilo <jthilo@gnu.org>
23098
23099 * po/ru.po: Added Russian translation.
23100
23101 1999-07-26 Jesse Thilo <jthilo@gnu.org>
23102
23103 * configure.in: Added Russian translation.
23104
23105 1999-07-06 Jesse Thilo <jthilo@gnu.org>
23106
23107 * configure.in, NEWS, README:
23108 Released version 1.28.
23109
23110 1999-06-14 Jesse Thilo <jthilo@gnu.org>
23111
23112 * src/system.h:
23113 Squashed redefinition warning on some systems.
23114
23115 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
23116 Have configure build version string instead of relying on ANSI string
23117 concatentation.
23118
23119 1999-06-14 Jesse Thilo <jthilo@gnu.org>
23120
23121 * po/POTFILES.in: Got rid of version.c.
23122
23123 1999-06-14 Jesse Thilo <jthilo@gnu.org>
23124
23125 * acconfig.h, configure.in:
23126 Have configure build version string instead of relying on ANSI string
23127 concatentation.
23128
23129 1999-06-08 Jesse Thilo <jthilo@gnu.org>
23130
23131 * doc/bison.1:
23132 Dropped mention of `+' for long-named options.
23133
23134 1999-05-30 Jesse Thilo <jthilo@gnu.org>
23135
23136 * src/files.c: Added <unistd.h> for unlink().
23137
23138 * src/Makefile.am, src/system.h:
23139 I18n fixes.
23140
23141 1999-05-30 Jesse Thilo <jthilo@gnu.org>
23142
23143 * README: Added a FAQ list.
23144
23145 * configure.in, acconfig.h:
23146 I18n fixes.
23147
23148 1999-05-30 Jesse Thilo <jthilo@gnu.org>
23149
23150 * doc/FAQ, doc/Makefile.am:
23151 Added a FAQ list.
23152
23153 1999-05-19 Jesse Thilo <jthilo@gnu.org>
23154
23155 * src/alloc.h, src/symtab.h, src/version.c:
23156 Protected inclusion of "config.h" with HAVE_CONFIG_H.
23157
23158 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23159
23160 * src/.cvsignore, src/Makefile.am:
23161 Reorganized: sources in `src', documentation in `doc'.
23162
23163 * src/lex.c (literalchar):
23164 fixed the code for escaping double quotes (thanks
23165 Jonathan Czisny.)
23166
23167 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23168
23169 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
23170 Adjusted paths to reflect directory reorganization.
23171
23172 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23173
23174 * doc/.cvsignore, doc/Makefile.am:
23175 Reorganized: sources in `src', documentation in `doc'.
23176
23177 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23178
23179 * configure.in:
23180 Updated AC_INIT file to reflect directory reorganization.
23181
23182 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
23183 Reorganized: sources in `src', documentation in `doc'.
23184
23185 1999-04-13 Jesse Thilo <jthilo@gnu.org>
23186
23187 * src/allocate.c:
23188 Don't declare calloc() and realloc() if not necessary.
23189
23190 1999-04-13 Jesse Thilo <jthilo@gnu.org>
23191
23192 * configure.in, acconfig.h, acinclude.m4:
23193 Don't declare calloc() and realloc() if not necessary.
23194
23195 1999-03-23 Jesse Thilo <jthilo@gnu.org>
23196
23197 * po/.cvsignore: Added i18n support.
23198
23199 1999-03-23 Jesse Thilo <jthilo@gnu.org>
23200
23201 * acconfig.h, configure.in, Makefile.am:
23202 Added i18n support.
23203
23204 1999-03-22 Jesse Thilo <jthilo@gnu.org>
23205
23206 * src/bison.s1: Fixed #line numbers.
23207
23208 1999-03-15 Jesse Thilo <jthilo@gnu.org>
23209
23210 * po/es.po, po/fr.po, po/nl.po, po/de.po:
23211 Added PO files from Translation Project.
23212
23213 1999-03-03 Jesse Thilo <jthilo@gnu.org>
23214
23215 * Makefile.am:
23216 Added support for non-ANSI compilers (ansi2knr).
23217
23218 1999-02-16 Jesse Thilo <jthilo@gnu.org>
23219
23220 * configure.in: Bumped version number to 1.27.
23221
23222 * Makefile.am:
23223 Added `bison.simple' to list of files removed by `make distclean'.
23224
23225 1999-02-12 Jesse Thilo <jthilo@gnu.org>
23226
23227 * src/files.c, src/files.h:
23228 Defined locations of parser files in config.h instead of Makefile.
23229
23230 1999-02-12 Jesse Thilo <jthilo@gnu.org>
23231
23232 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
23233 Defined locations of parser files in config.h instead of Makefile.
23234
23235 1999-02-09 Jesse Thilo <jthilo@gnu.org>
23236
23237 * Makefile.am:
23238 Removed inappropriate use of $< macro.
23239
23240 1999-02-05 Jesse Thilo <jthilo@gnu.org>
23241
23242 * po/Makefile.in.in, po/POTFILES.in:
23243 Add `po' directory skeleton.
23244
23245 1999-01-27 Jesse Thilo <jthilo@gnu.org>
23246
23247 * README: Document help-bison list.
23248
23249 * configure.in: Add check for mkstemp().
23250
23251 1999-01-20 Jesse Thilo <jthilo@gnu.org>
23252
23253 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
23254 Hush a few compiler warnings.
23255
23256 * src/files.c:
23257 Add tryclose(), which verifies that fclose was successful.
23258 Hush a couple of compiler warnings.
23259
23260 1999-01-20 Jesse Thilo <jthilo@gnu.org>
23261
23262 * Makefile.am, OChangeLog:
23263 ChangeLog is now automatically generated. Include the old version as
23264 OChangeLog.
23265
23266 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23267
23268 * 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:
23269 Update FSF address.
23270
23271 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23272
23273 * doc/bison.texinfo: Fix formatting glitch.
23274
23275 * doc/bison.texinfo: Update FSF address.
23276
23277 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23278
23279 * acconfig.h: Update FSF address.
23280
23281 1999-01-08 Jesse Thilo <jthilo@gnu.org>
23282
23283 * src/system.h:
23284 Don't define PACKAGE here, since config.h defines it.
23285
23286 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23287
23288 * src/reader.c: Update copyright date.
23289
23290 * src/main.c:
23291 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23292 favor of output directly to stderr (avoids buffer overruns).
23293
23294 * src/reader.c: Some checks for premature EOF.
23295
23296 * 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:
23297 Use prototypes if the compiler understands them.
23298
23299 * src/files.c: Honor TMPDIR on Unix hosts.
23300 Use prototypes if the compiler understands them.
23301
23302 * src/reader.c:
23303 Fix a couple of buffer overrun bugs.
23304 Use prototypes if the compiler understands them.
23305
23306 * src/system.h: Include unistd.h and ctype.h.
23307 Use #ifdef instead of #if for NLS symbols.
23308
23309 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23310
23311 * doc/bison.texinfo:
23312 Delete comment "consider using @set for edition number, etc..." since
23313 we now are doing so.
23314
23315 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23316
23317 * configure.in:
23318 Use prototypes if the compiler understands them.
23319
23320 * NEWS: Document 1.26 highlights.
23321
23322 * Makefile.am: Require Automake 1.3 or later.
23323
23324 * acconfig.h:
23325 Use prototypes if the compiler understands them.
23326
23327 1998-12-29 Jesse Thilo <jthilo@gnu.org>
23328
23329 * src/version.c:
23330 Use VERSION symbol from automake for version number.
23331
23332 1998-12-29 Jesse Thilo <jthilo@gnu.org>
23333
23334 * acconfig.h, configure.in, version.cin:
23335 Use VERSION symbol from automake for version number.
23336
23337 1998-11-28 Jesse Thilo <jthilo@gnu.org>
23338
23339 * Makefile.am:
23340 Distribute original version of simple parser (bison.s1), not built
23341 version (bison.simple).
23342
23343 1998-11-28 Jesse Thilo <jthilo@gnu.org>
23344
23345 * doc/bison.texinfo: Add info dir entry.
23346
23347 * doc/bison.texinfo:
23348 Let automake put version number into documentation.
23349
23350 1998-11-26 Jesse Thilo <jthilo@gnu.org>
23351
23352 * src/bison.cld, src/build.com, src/vmshlp.mar:
23353 Add non-RCS files from /gd/gnu/bison.
23354
23355 1998-11-26 Jesse Thilo <jthilo@gnu.org>
23356
23357 * doc/bison.1:
23358 Document the BISON_HAIRY and BISON_SIMPLE variables.
23359
23360 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23361
23362 * src/version.c: Build version.c automatically.
23363
23364 * src/reader.c:
23365 Fix token numbering (used to start at 258, not 257).
23366
23367 * src/system.h: Include config.h.
23368
23369 * src/getargs.c: Update bug report address.
23370
23371 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23372 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23373
23374 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23375
23376 * Makefile.am:
23377 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23378
23379 * configure.in, version.cin:
23380 Build version.c automatically.
23381
23382 * AUTHORS: Add AUTHORS file.
23383
23384 * README: Update bug report address.
23385
23386 * bison.simple:
23387 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23388
23389 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23390 Add automake stuff.
23391
23392 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23393
23394 * doc/bison.texinfo: Clean up some formatting.
23395
23396 1998-05-05 Richard Stallman <rms@gnu.org>
23397
23398 * doc/bison.texinfo:
23399 Explain better why to make a pure parser.
23400
23401 1998-01-05 Richard Stallman <rms@gnu.org>
23402
23403 * src/files.c (openfiles):
23404 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23405 find a temporary directory, if possible. Do not unlink files while
23406 they are open.
23407
23408 1997-08-25 Richard Stallman <rms@gnu.org>
23409
23410 * src/reader.c (stack_offset;):
23411 Change some warni to warns.
23412
23413 * src/lex.c (literalchar): Use warns, not warni.
23414
23415 1997-06-28 Richard Stallman <rms@gnu.org>
23416
23417 * src/bison.s1: Add a Bison version comment.
23418
23419 * src/main.c (fatal, warn, berror):
23420 Use program_name.
23421
23422 1997-06-28 Richard Stallman <rms@gnu.org>
23423
23424 * Makefile.in (bison_version): New variable.
23425 (dist): Use that variable.
23426 (bison.s1): Substitute the Bison version into bison.simple.
23427
23428 * bison.simple: Add a Bison version comment.
23429
23430 1997-06-18 Richard Stallman <rms@gnu.org>
23431
23432 * src/main.c (fatal, warn, berror):
23433 Make error messages standard.
23434 (toomany): Improve error message text.
23435
23436 * 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:
23437 new.h renamed to alloc.h.
23438
23439 1997-06-18 Richard Stallman <rms@gnu.org>
23440
23441 * Makefile.in: new.h renamed to alloc.h.
23442
23443 1997-05-24 Richard Stallman <rms@gnu.org>
23444
23445 * src/lex.c (literalchar):
23446 Fix the code for escaping \, " and '.
23447
23448 (lex): Avoid trouble when there are many chars
23449 to discard in a char literal with just several chars in it.
23450
23451 1997-05-17 Richard Stallman <rms@gnu.org>
23452
23453 * src/bison.s1:
23454 Use malloc, if using alloca is troublesome.
23455 (YYSTACK_USE_ALLOCA): New flag macro.
23456 Define it for some systems and compilers.
23457 (YYSTACK_ALLOC): New macro.
23458 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23459 If it was malloc'd, free it.
23460
23461 1997-05-17 Richard Stallman <rms@gnu.org>
23462
23463 * bison.simple:
23464 Use malloc, if using alloca is troublesome.
23465 (YYSTACK_USE_ALLOCA): New flag macro.
23466 Define it for some systems and compilers.
23467 (YYSTACK_ALLOC): New macro.
23468 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23469 If it was malloc'd, free it.
23470
23471 1997-04-23 Richard Stallman <rms@gnu.org>
23472
23473 * src/bison.s1:
23474 (alloca) [__hpux]: Always define as __builtin_alloca.
23475
23476 1997-04-23 Richard Stallman <rms@gnu.org>
23477
23478 * bison.simple:
23479 (alloca) [__hpux]: Always define as __builtin_alloca.
23480
23481 1997-04-22 Richard Stallman <rms@gnu.org>
23482
23483 * src/bison.s1:
23484 [__hpux]: Include alloca.h (right for HPUX 10)
23485 instead of declaring alloca (right for HPUX 9).
23486
23487 * src/bison.s1 (__yy_memcpy):
23488 Declare arg `count' as unsigned int.
23489 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23490
23491 1997-04-22 Richard Stallman <rms@gnu.org>
23492
23493 * bison.simple:
23494 [__hpux]: Include alloca.h (right for HPUX 10)
23495 instead of declaring alloca (right for HPUX 9).
23496
23497 * bison.simple (__yy_memcpy):
23498 Declare arg `count' as unsigned int.
23499 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23500
23501 1997-01-03 Richard Stallman <rms@gnu.org>
23502
23503 * src/allocate.c: [__STDC__ or _MSC_VER]:
23504 Declare calloc and realloc to return void *.
23505
23506 1997-01-02 Richard Stallman <rms@gnu.org>
23507
23508 * src/system.h:
23509 [_MSC_VER]: Include stdlib.h and process.h.
23510 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23511
23512 * src/main.c (main): Return FAILURE as a value.
23513 (printable_version): Declare arg as int, not char.
23514
23515 1997-01-02 Richard Stallman <rms@gnu.org>
23516
23517 * Makefile.in (dist):
23518 Explicitly check for symlinks, and copy them.
23519
23520 1996-12-19 Richard Stallman <rms@gnu.org>
23521
23522 * src/files.c:
23523 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23524
23525 1996-12-18 Paul Eggert <eggert@gnu.org>
23526
23527 * src/bison.s1 (yyparse):
23528 If __GNUC__ and YYPARSE_PARAM are both defined,
23529 declare yyparse to have a void * argument.
23530
23531 1996-12-18 Paul Eggert <eggert@gnu.org>
23532
23533 * bison.simple (yyparse):
23534 If __GNUC__ and YYPARSE_PARAM are both defined,
23535 declare yyparse to have a void * argument.
23536
23537 1996-12-17 Richard Stallman <rms@gnu.org>
23538
23539 * src/reduce.c (nbits): Add some casts.
23540
23541 1996-08-12 Richard Stallman <rms@gnu.org>
23542
23543 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23544
23545 1996-08-12 Richard Stallman <rms@gnu.org>
23546
23547 * bison.simple: Test _MSDOS as well as _MSDOS_.
23548
23549 1996-07-31 Richard Stallman <rms@gnu.org>
23550
23551 * src/bison.s1:
23552 [__sun && __i386]: Include alloca.h.
23553
23554 1996-07-31 Richard Stallman <rms@gnu.org>
23555
23556 * bison.simple:
23557 [__sun && __i386]: Include alloca.h.
23558
23559 1996-07-30 Richard Stallman <rms@gnu.org>
23560
23561 * src/bison.s1: Comment change.
23562
23563 * src/bison.s1: Test _MSDOS_, not MSDOS.
23564
23565 1996-07-30 Richard Stallman <rms@gnu.org>
23566
23567 * bison.simple: Comment change.
23568
23569 * bison.simple: Test _MSDOS_, not MSDOS.
23570
23571 1996-06-01 Richard Stallman <rms@gnu.org>
23572
23573 * 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:
23574 Insert `_' macro around many string constants.
23575
23576 * src/main.c:
23577 Insert `_' macro around many string constants.
23578
23579 (main): Call setlocale, bindtextdomain and textdomain.
23580
23581 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23582 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23583 [ENABLE_NLS]: Include libintl.h.
23584 [ENABLE_NLS] (gettext): Define.
23585 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23586 (N_, PACKAGE, LOCALEDIR): New macros.
23587
23588 1996-06-01 Richard Stallman <rms@gnu.org>
23589
23590 * POTFILES.in: New file.
23591
23592 * Makefile.in (allocate.o):
23593 Define target explicitly.
23594
23595 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23596 (LDFLAGS): Set to @LDFLAGS@.
23597 (configure): Run autoconf only if preceding `cd' succeeds.
23598 (bison.s1): Redirect output to temporary file then move the
23599 temporary to the target, rather than redirecting directly to bison.s1.
23600 (clean): Remove config.status and config.log.
23601 (distclean): Don't remove config.status here.
23602
23603 1996-05-12 Richard Stallman <rms@gnu.org>
23604
23605 * src/bison.s1:
23606 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23607
23608 1996-05-12 Richard Stallman <rms@gnu.org>
23609
23610 * bison.simple:
23611 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23612
23613 1996-05-11 Richard Stallman <rms@gnu.org>
23614
23615 * src/bison.s1 (__yy_memcpy):
23616 Really reorder the args, as was supposedly done on Feb 14 1995.
23617 (yyparse): Calls changed accordingly.
23618
23619 1996-05-11 Richard Stallman <rms@gnu.org>
23620
23621 * Makefile.in (dist): Don't use $(srcdir).
23622
23623 * bison.simple (__yy_memcpy):
23624 Really reorder the args, as was supposedly done on Feb 14 1995.
23625 (yyparse): Calls changed accordingly.
23626
23627 1996-01-27 Richard Stallman <rms@gnu.org>
23628
23629 * src/output.c (output_rule_data):
23630 Test YYERROR_VERBOSE in the conditional
23631 around the definition of ttyname.
23632
23633 1995-12-29 Richard Stallman <rms@gnu.org>
23634
23635 * src/bison.s1:
23636 Fix line numbers in #line commands.
23637
23638 1995-12-29 Richard Stallman <rms@gnu.org>
23639
23640 * bison.simple:
23641 Fix line numbers in #line commands.
23642
23643 1995-12-27 Richard Stallman <rms@gnu.org>
23644
23645 * src/bison.s1 (YYPARSE_PARAM_DECL):
23646 In C++, make it always null.
23647 (YYPARSE_PARAM_ARG): New macro.
23648 (yyparse): Use YYPARSE_PARAM_ARG.
23649
23650 1995-12-27 Richard Stallman <rms@gnu.org>
23651
23652 * bison.simple (YYPARSE_PARAM_DECL):
23653 In C++, make it always null.
23654 (YYPARSE_PARAM_ARG): New macro.
23655 (yyparse): Use YYPARSE_PARAM_ARG.
23656
23657 1995-11-29 Richard Stallman <rms@gnu.org>
23658
23659 * doc/bison.texinfo:
23660 Describe literal string tokens, %raw, %no_lines, %token_table.
23661
23662 1995-11-29 Daniel Hagerty <hag@gnu.org>
23663
23664 * doc/bison.texinfo: Fixed update date
23665
23666 1995-10-16 Richard Stallman <rms@gnu.org>
23667
23668 * src/version.c: Version 1.25.
23669
23670 1995-10-16 Richard Stallman <rms@gnu.org>
23671
23672 * NEWS: *** empty log message ***
23673
23674 1995-10-16 Richard Stallman <rms@gnu.org>
23675
23676 * doc/bison.1, doc/bison.rnh:
23677 Add new options.
23678
23679 1995-10-15 Richard Stallman <rms@gnu.org>
23680
23681 * src/vmsgetargs.c, src/getargs.c:
23682 Added -n, -k, and -raw switches.
23683 (noparserflag, toknumflag, rawtoknumflag): New variables.
23684
23685 * src/symtab.h (SALIAS):
23686 New #define for adding aliases to %token.
23687 (struct bucket): Added `alias' field.
23688
23689 * src/reduce.c (reduce_grammar):
23690 Revise error message.
23691 (print_notices): Remove final `.' from error message.
23692
23693 * src/reader.c (reader_output_yylsp):
23694 New function.
23695 (readgram): Use `#if 0' around code that accepted %command
23696 inside grammar rules: The documentation doesn't allow it,
23697 and it will fail since the %command processors scan for the next %.
23698 (parse_token_decl): Extended the %token
23699 declaration to allow a multi-character symbol as an alias.
23700 (parse_thong_decl): New function.
23701 (read_declarations): Added %thong declarations.
23702 (read_declarations): Handle NOOP to deal with allowing
23703 % declarations as another means to specify the flags.
23704 (readgram): Allow %prec prior to semantics embedded in a rule.
23705 (skip_to_char, read_declarations, copy_definition)
23706 (parse_token_decl, parse_start_decl, parse_type_decl)
23707 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23708 (get_type_name, copy_guard, copy_action, readgram)
23709 (get_type, packsymbols): Revised most error messages.
23710 Changed `fatal' to `warnxxx' to avoid aborting for error.
23711 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23712 (read_declarations): Improve the error message for
23713 an invalid character. Do not abort.
23714 (read_declarations, copy_guard, copy_action): Use
23715 printable_version to avoid unprintable characters in printed output.
23716 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23717 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23718 Allow the type of a non-terminal can be given
23719 more than once, as long as all specifications give the same type.
23720
23721 * src/output.c:
23722 (output_headers, output_trailers, output, output_gram)
23723 (output_rule_data): Implement noparserflag variable.
23724 Implement toknumflag variable.
23725 (output): Call reader_output_yylsp to output LTYPESTR.
23726
23727 * src/main.c (main):
23728 If reader sees an error, don't process the grammar.
23729 (fatals): Updated to not use VARARGS1.
23730 (printable_version, int_to_string, warn, warni, warns, warnss)
23731 (warnsss): New error reporting functions. Avoid abort for error.
23732
23733 * src/lex.h:
23734 Added THONG and NOOP for alias processing.
23735 Added SETOPT for the new code that allows setting options with %flags.
23736
23737 * src/lex.c:
23738 Include getopt.h. Add some extern decls.
23739 (safegetc): New function to deal with EOF gracefully.
23740 (literalchar); new function to deal with reading \ escapes.
23741 (lex): Use literalchar.
23742 (lex): Implemented "..." tokens.
23743 (literalchar, lex, parse_percent_token): Made tokenbuffer
23744 always contain the token. This includes growing the token
23745 buffer while reading an integer.
23746 (parse_percent_token): Replaced if-else statement with percent_table.
23747 (parse_percent_token): Added % declarations as another
23748 way to specify the flags -n, -l, and -r. Also added hooks for
23749 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23750 major changes to files.c.
23751 (lex) Retain in the incoming stream a character following
23752 an incorrect '/'.
23753 (skip_white_space, lex): Revised most error messages
23754 and changed fatal to warn to avoid aborting.
23755 (percent_table): Added %thong declarations.
23756
23757 * src/gram.h: Comment changes.
23758
23759 * src/files.c (openfiles, open_extra_files, done):
23760 Add faction flag
23761 and actfile file. Handle noparserflag. Both for -n switch.
23762
23763 * src/conflicts.c (resolve_sr_conflict):
23764 Remove use of alloca.
23765
23766 1995-06-01 Jim Meyering <meyering@gnu.org>
23767
23768 * doc/bison.texinfo: *** empty log message ***
23769
23770 1995-05-06 Richard Stallman <rms@gnu.org>
23771
23772 * src/bison.s1: Comment change.
23773
23774 1995-05-06 Richard Stallman <rms@gnu.org>
23775
23776 * bison.simple: Comment change.
23777
23778 1995-05-03 Richard Stallman <rms@gnu.org>
23779
23780 * src/version.c: Version now 1.24.
23781
23782 * src/bison.s1: Change distribution terms.
23783
23784 * src/version.c: Version now 1.23.
23785
23786 1995-05-03 Richard Stallman <rms@gnu.org>
23787
23788 * doc/bison.texinfo:
23789 Rewrite "Conditions for Using Bison".
23790 Update version to 1.24.
23791
23792 1995-05-03 Richard Stallman <rms@gnu.org>
23793
23794 * bison.simple: Change distribution terms.
23795
23796 1995-02-23 Richard Stallman <rms@gnu.org>
23797
23798 * src/files.c: Test __VMS_POSIX as well as VMS.
23799
23800 1995-02-14 Jim Meyering <meyering@gnu.org>
23801
23802 * src/bison.s1 (__yy_memcpy):
23803 Renamed from __yy_bcopy to avoid
23804 confusion. Reverse FROM and TO arguments to be consistent with
23805 those of memcpy.
23806
23807 1995-02-14 Jim Meyering <meyering@gnu.org>
23808
23809 * bison.simple (__yy_memcpy):
23810 Renamed from __yy_bcopy to avoid
23811 confusion. Reverse FROM and TO arguments to be consistent with
23812 those of memcpy.
23813
23814 1994-11-10 David J. MacKenzie <djm@gnu.org>
23815
23816 * NEWS: reformat
23817
23818 * NEWS: New file.
23819
23820 * Makefile.in (DISTFILES): Include NEWS.
23821
23822 * Makefile.in (DISTFILES):
23823 Include install-sh, not install.sh.
23824
23825 * configure.in: Update to Autoconf v2 macro names.
23826
23827 1994-10-05 David J. MacKenzie <djm@gnu.org>
23828
23829 * Makefile.in: fix typo
23830
23831 * Makefile.in (prefix, exec_prefix):
23832 Let configure set them.
23833
23834 1994-09-28 David J. MacKenzie <djm@gnu.org>
23835
23836 * Makefile.in: Set datadir to $(prefix)/share.
23837
23838 1994-09-15 Richard Stallman <rms@gnu.org>
23839
23840 * src/bison.s1:
23841 Update copyright notice and GPL version.
23842
23843 1994-09-15 Richard Stallman <rms@gnu.org>
23844
23845 * bison.simple:
23846 Update copyright notice and GPL version.
23847
23848 1994-07-12 Richard Stallman <rms@gnu.org>
23849
23850 * src/reduce.c, src/reader.c:
23851 entered into RCS
23852
23853 1994-05-05 David J. MacKenzie <djm@gnu.org>
23854
23855 * Makefile.in: entered into RCS
23856
23857 1994-03-26 Richard Stallman <rms@gnu.org>
23858
23859 * src/bison.s1: entered into RCS
23860
23861 1994-03-26 Richard Stallman <rms@gnu.org>
23862
23863 * bison.simple: entered into RCS
23864
23865 1994-03-25 Richard Stallman <rms@gnu.org>
23866
23867 * src/main.c: entered into RCS
23868
23869 1994-03-24 Richard Stallman <rms@gnu.org>
23870
23871 * src/conflicts.c: entered into RCS
23872
23873 1994-01-02 Richard Stallman <rms@gnu.org>
23874
23875 * Makefile.in: *** empty log message ***
23876
23877 1993-11-21 Richard Stallman <rms@gnu.org>
23878
23879 * src/bison.s1: *** empty log message ***
23880
23881 1993-11-21 Richard Stallman <rms@gnu.org>
23882
23883 * doc/bison.texinfo: entered into RCS
23884
23885 * doc/bison.texinfo: *** empty log message ***
23886
23887 1993-11-21 Richard Stallman <rms@gnu.org>
23888
23889 * bison.simple: *** empty log message ***
23890
23891 1993-10-25 David J. MacKenzie <djm@gnu.org>
23892
23893 * doc/bison.texinfo: *** empty log message ***
23894
23895 1993-10-19 Richard Stallman <rms@gnu.org>
23896
23897 * src/bison.s1: *** empty log message ***
23898
23899 1993-10-19 Richard Stallman <rms@gnu.org>
23900
23901 * bison.simple: *** empty log message ***
23902
23903 1993-10-14 Richard Stallman <rms@gnu.org>
23904
23905 * src/bison.s1: *** empty log message ***
23906
23907 1993-10-14 Richard Stallman <rms@gnu.org>
23908
23909 * bison.simple: *** empty log message ***
23910
23911 1993-09-14 David J. MacKenzie <djm@gnu.org>
23912
23913 * doc/bison.texinfo: *** empty log message ***
23914
23915 1993-09-13 Noah Friedman <friedman@gnu.org>
23916
23917 * Makefile.in: *** empty log message ***
23918
23919 1993-09-10 Richard Stallman <rms@gnu.org>
23920
23921 * src/conflicts.c: *** empty log message ***
23922
23923 * src/system.h: entered into RCS
23924
23925 1993-09-10 Richard Stallman <rms@gnu.org>
23926
23927 * doc/bison.1: entered into RCS
23928
23929 1993-09-06 Noah Friedman <friedman@gnu.org>
23930
23931 * src/version.c: entered into RCS
23932
23933 1993-09-06 Noah Friedman <friedman@gnu.org>
23934
23935 * Makefile.in: *** empty log message ***
23936
23937 1993-07-30 David J. MacKenzie <djm@gnu.org>
23938
23939 * Makefile.in: *** empty log message ***
23940
23941 1993-07-24 Richard Stallman <rms@gnu.org>
23942
23943 * src/bison.s1: *** empty log message ***
23944
23945 1993-07-24 Richard Stallman <rms@gnu.org>
23946
23947 * bison.simple: *** empty log message ***
23948
23949 1993-07-08 David J. MacKenzie <djm@gnu.org>
23950
23951 * Makefile.in: *** empty log message ***
23952
23953 1993-07-04 Richard Stallman <rms@gnu.org>
23954
23955 * src/bison.s1: *** empty log message ***
23956
23957 1993-07-04 Richard Stallman <rms@gnu.org>
23958
23959 * bison.simple: *** empty log message ***
23960
23961 1993-06-26 David J. MacKenzie <djm@gnu.org>
23962
23963 * src/getargs.c: entered into RCS
23964
23965 1993-06-26 David J. MacKenzie <djm@gnu.org>
23966
23967 * doc/bison.texinfo: *** empty log message ***
23968
23969 * doc/bison.1: New file.
23970
23971 1993-06-25 Richard Stallman <rms@gnu.org>
23972
23973 * src/getargs.c: New file.
23974
23975 1993-06-16 Richard Stallman <rms@gnu.org>
23976
23977 * src/bison.s1: *** empty log message ***
23978
23979 1993-06-16 Richard Stallman <rms@gnu.org>
23980
23981 * bison.simple: *** empty log message ***
23982
23983 1993-06-03 Richard Stallman <rms@gnu.org>
23984
23985 * src/bison.s1: New file.
23986
23987 1993-06-03 Richard Stallman <rms@gnu.org>
23988
23989 * doc/bison.texinfo: *** empty log message ***
23990
23991 1993-06-03 Richard Stallman <rms@gnu.org>
23992
23993 * bison.simple: New file.
23994
23995 1993-05-19 Richard Stallman <rms@gnu.org>
23996
23997 * doc/bison.texinfo: New file.
23998
23999 1993-05-07 Noah Friedman <friedman@gnu.org>
24000
24001 * Makefile.in: *** empty log message ***
24002
24003 1993-04-28 Noah Friedman <friedman@gnu.org>
24004
24005 * src/reader.c: *** empty log message ***
24006
24007 1993-04-23 Noah Friedman <friedman@gnu.org>
24008
24009 * src/alloc.h: entered into RCS
24010
24011 1993-04-20 David J. MacKenzie <djm@gnu.org>
24012
24013 * src/version.c: *** empty log message ***
24014
24015 * src/files.c, src/allocate.c:
24016 entered into RCS
24017
24018 * src/reader.c: *** empty log message ***
24019
24020 * src/lex.c: entered into RCS
24021
24022 * src/conflicts.c: New file.
24023
24024 * src/symtab.c: entered into RCS
24025
24026 * src/alloc.h: New file.
24027
24028 * src/LR0.c: entered into RCS
24029
24030 1993-04-18 Noah Friedman <friedman@gnu.org>
24031
24032 * src/reader.c: New file.
24033
24034 * src/version.c: *** empty log message ***
24035
24036 1993-04-18 Noah Friedman <friedman@gnu.org>
24037
24038 * Makefile.in: *** empty log message ***
24039
24040 1993-04-17 Noah Friedman <friedman@gnu.org>
24041
24042 * Makefile.in: *** empty log message ***
24043
24044 1993-04-15 Richard Stallman <rms@gnu.org>
24045
24046 * src/main.c, src/files.c:
24047 New file.
24048
24049 1993-04-15 Noah Friedman <friedman@gnu.org>
24050
24051 * configure.in: entered into RCS
24052
24053 * configure.in: *** empty log message ***
24054
24055 * configure.in: New file.
24056
24057 1993-04-14 Richard Stallman <rms@gnu.org>
24058
24059 * Makefile.in: New file.
24060
24061 1993-04-13 Richard Stallman <rms@gnu.org>
24062
24063 * src/version.c: New file.
24064
24065 1993-03-25 Richard Stallman <rms@gnu.org>
24066
24067 * src/output.c: entered into RCS
24068
24069 1992-09-25 Richard Stallman <rms@gnu.org>
24070
24071 * configure.bat: entered into RCS
24072
24073 1992-06-22 Richard Stallman <rms@gnu.org>
24074
24075 * src/vmsgetargs.c: entered into RCS
24076
24077 1992-06-22 Richard Stallman <rms@gnu.org>
24078
24079 * doc/bison.rnh: entered into RCS
24080
24081 1992-04-20 David J. MacKenzie <djm@gnu.org>
24082
24083 * README: entered into RCS
24084
24085 1992-01-22 Richard Stallman <rms@gnu.org>
24086
24087 * src/machine.h: entered into RCS
24088
24089 1991-12-21 Richard Stallman <rms@gnu.org>
24090
24091 * src/lalr.c, src/closure.c:
24092 entered into RCS
24093
24094 1991-12-20 Richard Stallman <rms@gnu.org>
24095
24096 * src/state.h: entered into RCS
24097
24098 1991-12-18 Richard Stallman <rms@gnu.org>
24099
24100 * src/print.c, src/nullable.c, src/derives.c:
24101 entered into RCS
24102
24103 1991-11-03 David J. MacKenzie <djm@gnu.org>
24104
24105 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24106 entered into RCS
24107
24108 1988-09-09 Richard Stallman <rms@gnu.org>
24109
24110 * src/bison.hairy: entered into RCS
24111
24112 1987-12-16 Richard Stallman <rms@gnu.org>
24113
24114 * REFERENCES: entered into RCS
24115
24116
24117 -----
24118
24119 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
24120 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
24121 2008, 2009 Free Software Foundation, Inc.
24122
24123 Copying and distribution of this file, with or without
24124 modification, are permitted provided the copyright notice and this
24125 notice are preserved.