]> git.saurik.com Git - bison.git/blame - ChangeLog
lalr1.cc: destroy $$ when YYERROR is called.
[bison.git] / ChangeLog
CommitLineData
c4dc4c46
AD
12009-08-19 Akim Demaille <demaille@gostai.com>
2
3 lalr1.cc: destroy $$ when YYERROR is called.
4 * data/lalr1.cc (yyreduce): Compute the resulting state before
5 running the user action so that yylhs is a valid symbol.
6 (yyerrorlab): Since yylhs is complete (it knows its type), we can
7 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
8 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
9
c67e466f
JD
102009-08-18 Joel E. Denny <jdenny@clemson.edu>
11
12 maint: update for gnulib's recent update-copyright changes
13 * gnulib: Update.
14 * .x-update-copyright (COPYING): Add as it's no longer implied
15 when .x-update-copyright is present.
16 * cfg.mk (update-copyright-local): Remove, now ignored.
17 (update-copyright): Declare update-b4-copyright as a dependency.
18
af6d2358
AD
192009-08-17 Akim Demaille <demaille@gostai.com>
20
21 build: require gettext 0.17.
22
23 Suggested by Bruno Haible.
24 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
25 * configure.ac: require gettext 0.17 to ensure compatibility with
26 gnulib.
27
91a2b9b1
AD
282009-08-17 Akim Demaille <demaille@gostai.com>
29
30 build: lower gettext requirements.
31
32 Bison was uselessly requiring the formatstring macros from
33 gettext, which resulted in mo files not being installed on systems
34 that perfectly supported Bison mo files. Lower the requirement.
35 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
36
37 * configure.ac: Require need-ngettext instead of
38 need-formatstring-macros.
39 Reported by Martin Jabocs.
40 Suggested by Bruno Haible.
41 * INSTALL: Restructure.
42 (Internationalization): New.
43
585935e8
JD
442009-08-14 Joel E. Denny <jdenny@clemson.edu>
45
46 maint: fix use of copyright year intervals.
47 * gnulib: Update.
48 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
49 as now recommended in gnulib/NEWS.
50 * build-aux/update-b4-copyright: Fix.
51 * cfg.mk (update-copyright-env): Configure update-copyright.
52
83b60c97
JD
532009-08-13 Joel E. Denny <jdenny@clemson.edu>
54
55 Make it easier to write deterministic tests.
56 Continues Akim's work from his 2009-06-10 commits.
57 * src/reader.c (check_and_convert_grammar): Don't add any
58 symbols after the first symbols_do invocation.
59 * src/symtab.c (symbols_sorted): New static global.
60 (user_token_number_redeclaration): Update comments.
61 (symbol_from_uniqstr): If a new symbol is being created, assert
62 that symbols_sorted hasn't been allocated yet.
63 (symbols_free): Free symbols_sorted.
64 (symbols_cmp, symbols_cmp_qsort): New functions.
65 (symbols_do): Sort symbol_table into symbols_sorted on first
66 invocation.
67 * tests/input.at (Numbered tokens): Recombine tests now that the
68 output should be deterministic across multiple numbers.
69
28169bab
AD
702009-08-12 Akim Demaille <demaille@gostai.com>
71
72 tests: GCC 4.5 compliance.
73 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
74 messages about #error.
75
9f14e187
AD
762009-08-12 Akim Demaille <demaille@gostai.com>
77
78 build: fix the generation of the documentation.
79 Some of our targets use "bison --help", but they can't depend on
80 "bison" itself (to avoid additional requirements on the user), so
81 they used to call "make src/bison" in the commands. Then
82 concurrent builds may fail: one make might be aiming one of its
83 jobs at compiling src/bison, and another job at generating the man
84 page. If the latter is faster than the former, then we have two
85 makes that concurrently try to compile src/bison.
86
87 This might also be a more convincing explanation for the failure
88 described in the patch "build: fix paths".
89
90 * Makefile.am (SUFFIXES): Initialize.
91 * build-aux/move-if-change: New, symlink to gnulib's.
92 * build-aux/local.mk: Ship it.
93 * doc/common.x: Remove, merged into...
94 * doc/bison.x: here.
95 * doc/local.mk (doc/bison.help): New.
96 ($(CROSS_OPTIONS_TEXI)): Depend on it.
97 Use src/bison.
98 (.x.1): Replace with...
99 (doc/bison.1): this explicit, simpler, target.
100 (common_dep): Remove, inlined where appropriate.
101 (SUFFIXES, PREPATH): Remove, unused.
102
d1b55e81
AD
1032009-08-12 Akim Demaille <demaille@gostai.com>
104
105 gnulib: improve prefixing.
106 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
107 change the value of...
108 (gl_LIBOBJS): this.
109 Adjust more variables.
110 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
111 gl_LIBOBJS.
112 (prefix): Also transform rules whose targets have slashes.
113 Use $prefix liberally.
114 Map @MKDIR_P@ to $(MKDIR_P).
115 Prefix directories that are mkdir'd.
116
838205d5
AD
1172009-08-12 Akim Demaille <demaille@gostai.com>
118
119 build: fix paths.
120 When using $(top_builddir) inconsistently, Make (including GNU
121 Make) is sometimes confused. As a result it may want to build
122 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
123 file, different names) concurrently, which, amusingly enough,
124 might end with:
125
126 ranlib lib/libbison.a
127 ranlib lib/libbison.a
128 make[2]: *** [lib/libbison.a] Segmentation fault
129
130 on OS X.
131
132 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
133 needed.
134
67af7198
AD
1352009-08-12 Akim Demaille <demaille@gostai.com>
136
137 distcheck: fix.
138
139 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
140
c467dc42
JD
1412009-08-10 Joel E. Denny <jdenny@clemson.edu>
142
143 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
144
dfaa4860
JD
1452009-08-10 Joel E. Denny <jdenny@clemson.edu>
146
147 Miscellaneous code readability improvements.
148
149 * src/reader.c (reader): Move %define front-end variable
150 defaults and checking into...
151 (prepare_percent_define_front_end_variables): ... this new
152 function.
153
154 * src/scan-gram.l (INITIAL): For consistency with string
155 literals, don't store open quote on character literal. It's
156 discarded before returning anyway.
157 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
158 Make length test more readable, and make the character stored
159 for an empty literal more obvious while consistent with the
160 previous behavior.
161
162 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
163 USER_NUMBER_HAS_STRING_ALIAS throughout.
164 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
165 that is repeated in symtab.h. Improve argument names to make it
166 clear which side of the symbol-string alias pair is which.
167 (symbol_check_alias_consistency): Improve local variable names
168 for the same purpose.
169 * src/symtab.h (struct symbol): Make comments about aliases
170 clearer.
171 (symbol_make_alias): Improve comments and argument name.
172 * src/output.c (token_definitions_output): Update for rename to
173 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
174
ce268795
AR
1752009-08-08 Alex Rozenman <rozenman@gmail.com>
176
177 Convert "misleading reference" messages to warnings.
178 * src/scan-code.l: New function 'show_sub_messages', more
179 factoring.
180 * tests/named-ref.at: Adjust tests.
181
401b73af
JD
1822009-08-06 Joel E. Denny <jdenny@clemson.edu>
183
184 maint: run "make update-copyright"
185
a1a9422d
JD
1862009-08-06 Joel E. Denny <jdenny@clemson.edu>
187
188 maint: make update-b4-copyright easier to use
189 * build-aux/update-b4-copyright: In warnings, report line
190 numbers rather than character positions.
191 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
192 that update-copyright runs it.
193 * gnulib: Update.
194
0b61a8ec
JD
1952009-08-05 Joel E. Denny <jdenny@clemson.edu>
196
197 maint: clean up update-b4-copyright code
198 * build-aux/update-b4-copyright: Do not accept 2-digit
199 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
200 Don't accept a `[' in a b4_copyright argument.
201 Format code more consistently.
202 Don't assume b4*copyright never occurs.
203
269e222e
JD
2042009-08-04 Joel E. Denny <jdenny@clemson.edu>
205
206 maint: automate b4_copyright updates.
207 * Makefile.am (update-b4-copyright): New target rule.
208 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
209 * build-aux/update-b4-copyright: New.
210 * data/yacc.c: Remove stray characters around b4_copyright
211 invocations.
212
35905f2b
JD
2132009-08-04 Joel E. Denny <jdenny@clemson.edu>
214
215 maint: automate annual package-wide copyright-year update.
216 * .x-update-copyright: New.
217 * Makefile.am (EXTRA_DIST): Remove maint.mk.
218 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
219 update-copyright. Remove gnumakefile, which is implied by
220 maintainer-makefile.
221 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
222 * gnulib: Update.
223 * maint.mk: Remove, now copied from gnulib.
224 * examples/extexi: Add missing "(C)" in copyright statement so
225 update-copyright can recognize it.
226 * src/LR0.h: Likewise.
227 * src/print.h: Likewise.
228 * src/print_graph.h: Likewise.
229 * src/gram.c: Add missing comma in copyright statement.
230 * src/gram.h: Likewise.
231
b30e18dc
JD
2322009-08-04 Joel E. Denny <jdenny@clemson.edu>
233
234 Fix "make distcheck".
235 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
236 of just calc.stamp.
237
8d90395d
JD
2382009-08-01 Joel E. Denny <jdenny@clemson.edu>
239
240 Pacify "gcc -Wunused" for the input function from Flex.
241 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
242 and later.
243 * src/scan-code.l: Add "%option noinput", which I cannot find in
244 the Flex manual, but which Flex has supported since at least as
245 far back as 2.5.4. However, if any of our developers still use
246 Flex 2.5.4, they'll need to stop configuring with
247 --enable-gcc-warnings because "%option noinput" didn't work
248 correctly until Flex 2.5.6.
249 * src/scan-gram.l: Likewise.
250 * src/scan-skel.l: Likewise.
251
ba4184ec
AR
2522009-07-31 Alex Rozenman <rozenman@gmail.com>
253
254 Fix --enable-gcc-warnings problems.
255 * src/reader.c: Adjust variable names.
256 * src/scan-code.l: Fix prototypes and adjust names.
257 * src/named-ref.c: Remove redundant "if".
258
91a2af97
JD
2592009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
260
261 Fix a --enable-gcc-warnings problem.
262 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
263 variable.
264
3208e3f4
JD
2652009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
266
267 Warn about character literals not of length one.
268 * NEWS (2.5): Document.
269 * src/scan-gram.l (INITIAL): Remove comment that we don't check
270 the length.
271 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
272 * tests/input.at (Bad character literals): New test group.
273
5add20ab 2742009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
275
276 Fix some memory leaks.
277 * src/named-ref.c: Add a pointer check (named_ref_free).
278 * src/scan-code.l: New function (variant_table_free). Called in
279 code_scanner_free.
280 * src/symlist.c: Call to named_ref_free (symbol_list_free).
281
e459fb0e
JD
2822009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
283
284 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
285
c4be5517
JD
2862009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
287
288 Some M4 cleanup in the testsuite.
289 Suggested by Eric Blake at
290 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
291 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
292 complicate the code by distinguishing between a missing value
293 and an empty string value for an optional argument. This fix is
294 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
295 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
296 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
297 arguments are not needed because of the following changes.
298 Fix stale comments.
299 Bison developers should use GNU M4 and should not use
300 POSIXLY_CORRECT when building the test suite, so do not
301 complicate the code by avoiding $10 and above.
302 Do not quote an empty string value for an optional argument, and
303 do not distinguish between a missing value and an empty string
304 value.
305
feeb56cd
JD
3062009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
307
308 Revert unnecessary column realignment in --help output.
309 Reported by Akim Demaille at
310 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
311 * src/getargs.c (usage): Here.
312
5add20ab 3132009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
314
315 Alphabetical order in src/local.mk.
316 * src/local.mk: Adjust.
317
5add20ab 3182009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
319
320 Style changes and factoring.
321 * src/named-ref.h: Add comments.
322 * src/parse-gram.y: Readability and style changes.
323 * src/reader.c: Factoring: assign_named_ref function.
324 * src/scan-code.l: Factoring and style changes. Rename
325 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
326 Use "unsigned" type for variant index. Improve readablity.
327 * src/scan-gram.l: Change error messages and add comments.
328 * src/symlist.h: symbol_list_null: New function decl.
329 * src/symlist.c: symbol_list_null: Implement here.
330 * tests/named-refs.at: Adjust for new error messages.
331
83ea2423
EB
3322009-06-29 Eric Blake <ebb9@byu.net>
333
334 scan-code: avoid compiler warnings
335 * src/scan-code.l (parse_named_ref): Use correct specifiers.
336
5ece73ea
AD
3372009-06-29 Akim Demaille <demaille@gostai.com>
338
339 build: avoid concurrent extraction of calc++.
340 * examples/calc++/Makefile.am (calc.stamp): New.
341 Depend on it to create the sources of calc++ so that concurrent
342 builds don't launch several "extexi" in parallel.
343 Not only this is inefficient, this also builds incorrect sources
344 with several extractions mixed together.
345
ad597a78
AD
3462009-06-29 Akim Demaille <demaille@gostai.com>
347
348 parse.error: fix.
349 * data/bison.m4: Move code related to specific variables after the
350 definition of the variable-maintaining macros so that we don't
351 "invoke" b4_percent_define_check_values before it is defined.
352
31b850d2
AD
3532009-06-29 Akim Demaille <demaille@gostai.com>
354
355 variables: parse.error
356
357 Implement, document, and test the replacement of %error-verbose
358 by %define parse.error "verbose".
359 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
360 values of the parse.error variable.
361 Make "simple" its default value.
362 Check the valid values.
363 * src/parse-gram.y: Use %define parse.error.
364 (PERCENT_ERROR_VERBOSE): New token.
365 Support it.
366 * src/scan-gram.l: Support %error-verbose.
367
368 * doc/bison.texinfo (Decl Summary): Replace the documentation of
369 %define error-verbose by that of %define parse.error.
370 * NEWS: Document it.
371
372 * tests/actions.at, tests/calc.at: Use parse.error instead of
373 %error-verbose.
374
b9f1d9a4
AR
3752009-06-27 Alex Rozenman <rozenman@gmail.com>
376
377 Implement support for named symbol references.
378 * src/parse-gram.y: Add new syntax (named_ref.opt).
379 * src/reader.c: Store named refs in symbol lists.
380 * src/reader.h: New argument for symbol_append and
381 action_append functions.
382 * src/scan-code.h: Add new field (named_ref) into
383 code_props data structure. Keeps named ref of midrule
384 actions.
385 * src/scan-code.l: Support for named refs in semantic
386 action code. New function 'parse_named_ref'.
387 * src/scan-gram.l: Support bracketed id.
388 * src/symlist.c: Store named refs in symbol lists.
389 * src/symlist.h: New field in symbol list: named_ref.
390 * src/named-ref.h: New file, a struct for named_ref.
391 * src/named-ref.cp: New file, named_ref_new function.
392 * src/local.mk: Add two new files.
393 * tests/testsuite.at: Include new test group:
394 * tests/named-refs.at: this new file.
395
b5c212b6
AD
3962009-06-25 Akim Demaille <demaille@gostai.com>
397
398 hash: check insertion for memory exhaustion.
399 * src/uniqstr.c (uniqstr_new): New.
400
67501061
AD
4012009-06-24 Akim Demaille <demaille@gostai.com>
402
403 variables: rename namespace as api.namespace.
404 Discussed in
405 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
406
407 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
408 New.
409 (b4_percent_define_use): New.
410 Use it where applicable.
411 * data/c++.m4: Replace uses of the variable "namespace" by
412 "api.namespace".
413 Default the latter to the former.
414 * doc/bison.texinfo (Decl Summary): Document "namespace" as
415 obsolete.
416 Document api.namespace.
417 Use @samp to document %define uses, keep @code for identifiers.
418 * NEWS: Likewise.
419 * tests/c++.at, tests/input.at: Test api.namespace instead of
420 namespace. (The tests passed with namespace.)
421
41976786
AD
4222009-06-11 Akim Demaille <demaille@gostai.com>
423
424 style changes.
425 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
426 * src/print-xml.c: Style changes.
427 * tests/conflicts.at: Comment changes.
428
44bb9084
AD
4292009-06-11 Akim Demaille <demaille@gostai.com>
430
431 xml: beware of user strings used to give a %prec to rules.
432 * tests/conflicts.at (%prec with user strings): New.
433 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
434 XML output.
435
04d1e39d
AD
4362009-06-11 Akim Demaille <demaille@gostai.com>
437
438 hash: check insertion for memory exhaustion.
439 * src/muscle-tab.c (muscle_insert, muscle_grow)
440 * src/state.c (state_hash_insert): Check the return value of
441 hash_insert.
442
a8873669
AD
4432009-06-11 Akim Demaille <demaille@gostai.com>
444
445 tests: honor TESTSUITEFLAGS in every check target.
446 * tests/local.mk (RUN_TESTSUITE): New.
447 (check-local, installcheck-local, maintainer-check-g++)
448 (maintainer-check-posix, maintainer-check-valgrind): Use it.
449
8893145a
AD
4502009-06-10 Akim Demaille <demaille@gostai.com>
451
452 deterministic test suite.
453 Some consistency checks on symbols are performed after all the
454 symbols were read, by an iteration over the symbol table. This
455 traversal is nondeterministic, which can be a problem for test
456 cases.
457 Avoid this.
458 Addresses another form of nondeterminism reported by Joel E. Denny.
459 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
460
461 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
462 test in two.
463 Use different file names for the three tests to make the
464 maintenance easier.
465
92d7a23a
AD
4662009-06-10 Akim Demaille <demaille@gostai.com>
467
468 gnulib: update.
469 * gnulib: Update to latest.
470 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
471 * m4/.gitignore: Regen.
472 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
473 Call xalloc_die on hash_insert failures.
474 Requested by the new __warn_unused_result__ attribute of
475 hash_insert.
476
12cf133f
AD
4772009-06-10 Akim Demaille <demaille@gostai.com>
478
479 deterministic user-token-number redeclaration errors.
480 Address nondeterminism reported by Joel E. Denny.
481 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
482
483 * src/uniqstr.h: Comment changes.
484 * src/location.h (boundary_cmp, location_cmp): New.
485 * src/symtab.c (user_token_number_redeclaration): New.
486 (symbol_translation): Use it.
487 * tests/input.at (Numbered tokens): Adjust the expected output.
488
796a2b0a
AD
4892009-05-25 Akim Demaille <demaille@gostai.com>
490
491 build: avoid ignored errors.
492 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
493 errors, they pollute the output.
494
0b6d43c5
JD
4952009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
496
497 Convert multiple variable definition warnings to complaints.
498 * NEWS (2.5): Add a new entry for that change.
499 * doc/bison.texinfo (Decl Summary): Update %define entry.
500 (Bison Options): Update -D/--define/-F/--force-define entry.
501 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
502 * src/muscle-tab.h (muscle_percent_define_insert): Update
503 comments.
504 * tests/input.at (`%define errors'): Update.
505 (`%define, --define, --force-define'): Update.
506
de5ab940
JD
5072009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
508
509 -F/--force-define and relative %define/-D/--define priorities.
510 * NEWS (2.5): Add documentation to -D/--define entry.
511 * build-aux/cross-options.pl: Hard-code association of
512 --force-define with %define.
513 * doc/bison.texinfo (Decl Summary): In %define entry,
514 cross-reference command-line options.
515 (Bison Options): Add documentation to -D/--define entry.
516 (Option Cross Key): Widen column for --force-define row.
517 * src/getargs.c (usage): Document -F/--force-define. Realign
518 options in output.
519 (short_options, long_options, getargs): Parse -F/--force-define,
520 and update muscle_percent_define_insert invocations.
521 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
522 (muscle_percent_define_insert): Add argument with that type.
523 * src/muscle-tab.c (muscle_percent_define_insert): Implement
524 -F/--force-define behavior and priorities.
525 (muscle_percent_define_ensure): Update
526 muscle_percent_define_insert invocation.
527 * src/parse-gram.y (prologue_declaration): Update
528 muscle_percent_define_insert invocations.
529 * tests/input.at (`%define, --define'): Rename to...
530 (`%define, --define, --force-define'): ... this and extend.
531
f8e7258f
JD
5322009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
533
534 Update some comments to make sense for -D.
535 * data/bison.m4 (b4_check_user_names): In header comments, say
536 "user occurrence" instead of "grammar occurrence".
537 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
538 (muscle_percent_code_grow): Likewise just for consistency.
539
b987342b
JD
5402009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
541
542 * data/c++.m4 (b4_namespace_close): Simplify slightly.
543
4977e0a7
JD
5442009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
545
546 Handle a trailing `:' in a user-supplied C++ namespace better.
547 * data/c++.m4 (b4_namespace_close): Don't let it be printed
548 among the closing braces here. This fix might make the
549 generated code easier to debug, but otherwise it should be
550 insignificant because a trailing `:' is a C++ error already.
551
9b04dad7
AD
5522009-05-19 Akim Demaille <demaille@gostai.com>
553
554 remove useless variable.
555 * src/getargs.c (skeleton_arg): Remove now useless variable.
556 Should help the compiler see that this printf-like call is sane.
557
4c6622c2
AD
5582009-05-15 Akim Demaille <demaille@gostai.com>
559
560 Rename token.prefix as api.tokens.prefix.
561 Discussed here.
562 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
563
564 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
565 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
566 (token.prefix): Rename as...
567 (api.tokens.prefix): this.
568
3c248d70
AD
5692009-05-11 Akim Demaille <demaille@gostai.com>
570
571 doc: use C++ headers.
572 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
573 headers.
574
99c08fb6
AD
5752009-05-11 Akim Demaille <demaille@gostai.com>
576
577 doc: token.prefix
578 * doc/bison.simple (Decl Summary): Document token.prefix.
579 (Calc++ Parser): Various fixes.
580 Formatting changes.
581 Use token.prefix.
582 Introduce a macro TOKEN to shorten the code and make it more
583 readable.
584 (Calc++ Scanner): Adjust.
585 * NEWS (Variable token.prefix): New.
586
84a1cb5a
AD
5872009-05-04 Akim Demaille <demaille@gostai.com>
588
589 bison: catch bad symbol names.
590 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
591 * tests/input.at: Adjust.
592
cdf3f113
AD
5932009-05-04 Akim Demaille <demaille@gostai.com>
594
595 identifiers: dashes are letters.
596 Dashes can now start identifiers (symbols and directives).
84a1cb5a 597
cdf3f113
AD
598 * src/scan-gram.l ({letter}): Add dash.
599 ({id}): Remove it.
600 * tests/input.at (Symbols): Adjust.
601 Remove stray comment.
602 * tests/regression.at (Invalid inputs): Adjust error message.
603 * doc/bison.texinfo (Symbols): Update.
604
98a345a2
JD
6052009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
606
607 Declare %code to be a permanent feature.
608 * NEWS (2.4.2): Here.
609 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
610 experimental.
611 (Decl Summary): Likewise.
612
67212941
JD
6132009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
614
615 Convert underscores to dashes in some %define variable names.
616 For now, just api.push-pull and lr.keep-unreachable-states.
617 Maintain old names for backward compatibility.
618 * NEWS (2.5): Document.
619 * data/c.m4 (b4_identification): Update comment.
620 * data/yacc.c: Update access.
621 * doc/bison.texinfo: Update.
622 * etc/bench.pl.in (bench_push_parser): Update use.
623 * src/files.c (tr): Move to...
624 * src/getargs.c, src/getargs.h (tr): ... here because I can't
625 think of a better place to expose it. My logic is that, for all
626 uses of tr so far, command-line arguments can be involved, and
627 getargs.h is already included.
628 * src/main.c (main): Update access.
629 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
630 variable names to new variable names before assigning value.
631 * src/reader.c (reader): Update setting default.
632 * tests/calc.at: Update uses.
633 * tests/conflicts.at (Unreachable States After Conflict
634 Resolution): Update use.
635 * tests/input.at (%define enum variables): Update use.
636 (%define backward compatibility): New test group.
637 * tests/push.at: Update uses.
638 * tests/reduce.at: Update uses.
639 * tests/torture.at: Update uses.
640
ba5c6d94
JD
6412009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
642
643 Set all front-end %define defaults in one place.
644 * src/main.c (main): Move lr.keep_unreachable_states default...
645 * src/reader.c (reader): ... to here.
646
5bab9d08
JD
6472009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
648
649 Rename lr.default_reductions to lr.default-reductions.
650 * NEWS (2.5): Here.
651 * doc/bison.texinfo: Here.
652 * src/lalr.c (initialize_LA): Here.
653 * src/print.c (print_reductions): Here.
654 * src/reader.c (reader): Here.
655 * src/tables.c (action_row): Here.
656 * tests/input.at (%define enum variables): Here.
657 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
658
d521ee19
JD
6592009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
660
661 Pacify ./configure --enable-gcc-warnings.
662 * tests/input.at (Symbols): Prototype yyerror and yylex.
663
6642009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
665
666 Document how `%define "var" "value"' is not M4-friendly.
667 * src/parse-gram.y (variable): In comments here.
668
8f0d265e
JD
6692009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
670
671 Clean up recent patches a little.
672 Reported by Akim Demaille.
673 * doc/bison.texinfo (Understanding): Fix typos.
674 * src/print.c (print_reductions): Don't use negated variable.
675
f4909773
JD
6762009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
677
678 List accepted values for a %define enum variable with an invalid value.
679 Suggested by Akim Demaille at
680 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
681 * data/bison.m4 (_b4_percent_define_check_values): Implement.
682 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
683 * tests/input.at (%define lr.default_reductions invalid values): Merge
684 into...
685 (%define enum variables): ... here, and update output.
686
110ef36a
JD
6872009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
688
689 Rename "default rule" to "default reduction".
690 This includes changing variable names in code, changing
691 comments, and renaming %define lr.default_rules to %define
692 lr.default_reductions.
693 * NEWS (2.5): Update IELR documentation.
694 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
695 documentation.
696 * data/glr.c, data/lalr1.java: Sync copyright dates.
697 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
698 and lr.type documentation. Make some other wording
699 improvements.
700 (Glossary): Adjust cross-references and Default Reduction
701 definition.
702 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
703 Remove a confusing comment pointed out by Akim Demaille.
704 (initialize_LA): Adjust code.
705 * src/print-xml.c (print_reductions): Adjust code.
706 * src/print.c (print_reductions): Adjust code.
707 * src/reader.c (reader): Adjust code.
708 * src/tables.c (action_row): Adjust code.
709 (token_actions): Adjust code.
710 * src/tables.h: Adjust YYDEFACT documentation.
711 * tests/input.at (%define lr.default_rules invalid values):
712 Rename test group to...
713 (%define lr.default_reductions invalid values): ... this, and
714 update grammar file and expected output.
715 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
716 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
717
746ee38c
AD
7182009-04-21 Akim Demaille <demaille@gostai.com>
719
720 tests: check the use of dashes and periods in symbols.
721 * tests/input.at (Symbol): New test group.
722
eb45ef3b
JD
7232009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
724
725 Document %define lr.type and lr.default_rules.
726 * NEWS (2.5): Add an entry.
727 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
728 besides just LALR(1) and GLR(1).
729 * doc/bison.texinfo (Introduction): Likewise.
730 (Language and Grammar): Bison is no longer limited to LALR(1)
731 restrictions.
732 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
733 when trying to distinguish from GLR. Talk about LR(1) grammars
734 rather than LALR(1) grammars.
735 (Decl Summary): In %define api.push_pull entry, say it applies
736 to deterministic parsers in C rather than LALR(1) parsers in C.
737 Add lr.default_rules entry.
738 Add lr.type entry.
739 (Mystery Conflicts): Bison is no longer limited to LALR(1)
740 restrictions.
741 (Generalized LR Parsing): Same changes as for the previous GLR
742 section.
743 (Memory Management): Say deterministic rather than LALR(1).
744 (Understanding): Correct some bison output.
745 Index discussion of "accepting state".
746 Say deterministic rather than LALR(1).
747 (Bison Options): In --yacc entry, say deterministic rather than
748 LALR(1).
749 In --report, --graph, and --xml entries, just don't mention
750 LALR(1).
751 (C++ Parsers): Say deterministic rather than LALR(1).
752 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
753 (Glossary): Add Accepting State, Consistent State, Default Rule,
754 and IELR(1) definitions.
755 In Generalized LR (GLR) definition, make same changes as in
756 previous GLR sections.
757 In LALR(1) definition, say Bison uses LALR(1) by default rather
758 than implying Bison is limited to LALR(1).
759 (LocalWords): Add IELR.
760
db34f798
JD
7612009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
762
763 Finish implementing %define lr.type.
764 Its value can be "LALR", "IELR", or "canonical LR".
765 * lib/timevar.def (TV_IELR_PHASE1): New var.
766 (TV_IELR_PHASE2): New var.
767 (TV_IELR_PHASE3): New var.
768 (TV_IELR_PHASE4): New var.
769 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
770 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
771 Sbitset.h, ielr.h, and ielr.c.
772 * src/getargs.h, src/getargs.c (enum trace, trace_args,
773 trace_types): Add trace_ielr.
774 * src/lalr.h, src/lalr.c (ngotos): Export it.
775 (F): Rename to...
776 (goto_follows): ... this, update all uses, and export it.
777 (set_goto_map): Export it.
778 (map_goto): Export it.
779 (compute_lookahead_tokens): Don't free goto_follows yet. Now
780 handled in ielr.
781 (initialize_LA): Export it. Move lookback allocation to...
782 (lalr): ... here because, for canonical LR, initialize_LA must
783 be invoked but lookback and much of the rest of LALR isn't
784 needed.
785 * main.c (main): Instead of lalr, invoke ielr, which invokes
786 lalr.
787 * src/reader.c (reader): Default lr.type to "LALR".
788 Default lr.default_rules to "accepting" if lr.type is "canonical
789 LR". Leave the default as "all" otherwise.
790 Check for a valid lr.type value.
791 * src/state.h, src/state.c (struct state_list): Add state_list
792 member.
793 (state_new): Initialize state_list member to NULL.
794 (state_new_isocore): New function, exported.
795 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
796 exercises all values of lr.type.
797 (GNU AWK Grammar): Rename test group to...
798 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
799 AT_TEST_EXISTING_GRAMMAR.
800 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
801 (GNU pic Grammar): Rename test group to...
802 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
803 AT_TEST_EXISTING_GRAMMAR.
804 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
805 all values of lr.type.
806 (Single State Split): New test groups using AT_TEST_LR_TYPE.
807 (Lane Split): Likewise.
808 (Complex Lane Split): Likewise.
809 (Split During Added Lookahead Propagation): Likewise.
810
7fe11bb5
JD
8112009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
812
813 Add new files for IELR and canonical LR implementation.
814 * src/AnnotationList.c: New.
815 * src/AnnotationList.h: New.
816 * src/InadequacyList.c: New.
817 * src/InadequacyList.h: New.
818 * src/Sbitset.c: New.
819 * src/Sbitset.h: New.
820 * src/ielr.c: New.
821 * src/ielr.h: New.
822
7254f6a8
JD
8232009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
824
825 Implement %define lr.default_rules.
826 Its value describes the states that are permitted to contain
827 default rules: "all", "consistent", or "accepting".
828 * src/reader.c (reader): Default lr.default_rules to "all".
829 Check for a valid lr.default_rules value.
830 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
831 is "accepting", then only mark the accepting state as
832 consistent.
833 (initialize_LA): Tell state_lookahead_tokens_count whether
834 lr.default_rules is "accepting".
835 * src/tables.c (action_row): If lr.default_rules is not "all",
836 then disable default rules in inconsistent states.
837 * src/print.c (print_reductions): Use this opportunity to
838 perform some assertions about whether lr.default_rules was
839 obeyed correctly.
840 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
841 helps with checking the parser tables for a grammar.
842 * tests/input.at (%define lr.default_rules invalid values): New
843 test group.
844 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
845 AT_TEST_TABLES_AND_PARSE.
846 (`no %define lr.default_rules'): New test group generated by
847 AT_TEST_LR_DEFAULT_RULES.
848 (`%define lr.default_rules "all"'): Likewise.
849 (`%define lr.default_rules "consistent"'): Likewise.
850 (`%define lr.default_rules "accepting"'): Likewise.
851
72e727f2
AD
8522009-04-20 Akim Demaille <demaille@gostai.com>
853
854 Formatting change.
855
90462b8d
AD
8562009-04-20 Akim Demaille <demaille@gostai.com>
857
858 bison: factoring.
859 * src/output.c (token_definitions_output): Use symbol_id_get
860 instead of duplicating its logic.
861 * TODO (YYERRCODE): Extend.
862
4f646c37
AD
8632009-04-20 Akim Demaille <demaille@gostai.com>
864
71b00ed8
AD
865 variables: prefer error-verbose to error_verbose.
866 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
867 instead of error_verbose.
868 * src/scan-gram.l (%error-verbose): Map to the error-verbose
869 variable.
870 * doc/bison.texinfo: Promote %define error-verbose instead of
871 %error-verbose.
872 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
873
8742009-04-15 Akim Demaille <demaille@gostai.com>
875
4f646c37
AD
876 variables: accept dashes.
877 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
878 underscores.
879 * src/scan-gram.l ({id}): Also accept dashes after the initial
880 letter.
881 ({directive}): Use {id}.
882 * src/parse-gram.y: Comment and formatting changes.
883 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
884 symbols.
885 * src/complain.h, src/complain.c (yacc_at): New.
886 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
887 symbol names.
888 * src/output.c (token_definitions_output): Do not #define token
889 names with dashes.
890
184e3179
AD
8912009-04-20 Akim Demaille <demaille@gostai.com>
892
893 Consistently refer to Yacc, not YACC.
894 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
895
41253c3a
JD
8962009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
897
898 Pacify make maintainer-check-posix.
899 * tests/input.at (%define, --define): Move bison command-line
900 options before grammar file name.
901
197b82ba
JD
9022009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
903
904 Document semicolon warnings.
905 * NEWS (2.5): Here.
906
0c90a1f5
AD
9072009-04-14 Akim Demaille <demaille@gostai.com>
908
909 variables: use `parse.assert' instead of `assert'.
910 * TODO (assert): Remove.
911 * data/bison.m4 (b4_assert_if): Replace with...
912 (b4_parse_assert_if): this.
913 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
914 * doc/bison.texinfo (Decl Summary): Document parse.assert.
915
fa819509
AD
9162009-04-14 Akim Demaille <demaille@gostai.com>
917
16dc0d90 918 variables: use `parse.trace' instead of `debug'.
fa819509
AD
919 * src/getargs.c (getargs): Map -t to %define trace.parse.
920 * src/scan-gram.l (%debug): Map to %define trace.parse.
921 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
922 names to `_' in macro names.
923 (b4_debug_if): Replace with...
924 (b4_parse_trace_if): this.
925 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
926 * data/yacc.c: Adjust.
927 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
928 Use @code to label the variable list.
929 Document the variable parse.trace.
930 (Tracing): Promote the parse.trace variable.
931 * TODO: %printer is not documented.
932
f7dae1ea
AD
9332009-04-14 Akim Demaille <demaille@gostai.com>
934
935 doc: minor fixes.
936 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
937 (Table of Symbols): Remove duplicate entry for %debug.
938
3535c071
EB
9392009-04-10 Eric Blake <ebb9@byu.net>
940
941 submodules: update to latest
942 * submodules/autoconf: Use latest upstream Autoconf.
943
cf48f675
EB
9442009-04-06 Eric Blake <ebb9@byu.net>
945
946 Work around autoconf 2.63b bug in testsuite.
947 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
948 autoconf bug related to # in test.
949
50cca368
JD
9502009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
951
952 * NEWS (2.5): New section. Describe new -D/--define feature.
953
3583d96b
AD
9542009-04-06 Akim Demaille <demaille@gostai.com>
955
956 Regen.
957 * src/parse-gram.h, src/parse-gram.c: Regen.
958
00f5d575
AD
9592009-04-06 Akim Demaille <demaille@gostai.com>
960
961 rename muscle_tab.* as muscle-tab.* for consistency.
962 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
963 * src/muscle-tab.h, src/muscle-tab.c: these.
964 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
965 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
966
76bf5102
AD
9672009-04-06 Akim Demaille <demaille@gostai.com>
968
969 Makefile: introduce $(BISON).
970 * src/local.mk (BISON): New.
971 (YACC): Use it.
972
bc0f5737
AD
9732009-04-06 Akim Demaille <demaille@gostai.com>
974
975 parser: handle %locations as %define locations.
976 * src/getargs.h, src/getargs.c (locations_flag): Remove.
977 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
978 to set "locations" to true.
979 * src/output.c (prepare): Don't output "locations".
980 * src/scan-gram.l (%locations): Handle it as a %<flag>.
981 * src/parse-gram.y: It's no longer a token.
982 Don't handle it.
983 * data/bison.m4 (b4_locations_if): Define it with
984 b4_percent_define_if_define.
985 * data/c.m4, data/glr.cc: Adjust.
986
697c912f
AD
9872009-04-06 Akim Demaille <demaille@gostai.com>
988
989 Regen.
990 * src/parse-gram.c: Regen.
991
4920ae8b
AD
9922009-04-06 Akim Demaille <demaille@gostai.com>
993
994 muscle: factor the handling of obsolete of obsolete directives.
995 Suggested by Joel E. Denny.
50cca368 996
4920ae8b
AD
997 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
998 New, extracted from...
999 * src/parse-gram.y (prologue_declaration: pure-parser): here.
1000 Remove it.
1001 (prologue_declaration: "%<flag>"): Use
1002 muscle_percent_define_ensure.
1003 (%error-verbose, %pure-parser): No longer tokens.
1004 * src/scan-gram.l (pure-parser): Return as a %<flag>.
1005
1d5b3c08
JD
10062009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1007
1008 Fix options documentation.
1009 * build-aux/cross-options.pl: As in --help output, write optional
1010 arguments as [=ARG] not =[ARG].
1011 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1012
62c99cf4
JD
10132009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1014
1015 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1016 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1017 requirements for a correct m4 are stricter.
1018 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
1019 * configure.ac: Update to use AC_PROG_GNU_M4.
1020 Reported by Eric Blake.
1021
1c93f35b
JD
10222009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1023
1024 Help with updating web manual.
1025 * HACKING: Incorporate instructions from gnulib/doc/README.
1026 * bootstrap.conf (gnulib_modules): Add gendocs.
1027
86cfae0a
AD
10282009-04-03 Akim Demaille <demaille@gostai.com>
1029
1030 Regen.
1031 * src/parse-gram.h, src/parse-gram.c: Regen.
1032
ba061fa6
AD
10332009-04-03 Akim Demaille <demaille@gostai.com>
1034
1035 Factor %FLAG at scan level.
1036 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
1037 definitions and associated rules, replaced by....
1038 (PERCENT_FLAG): this new token type, and rule.
1039 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
1040 Use it for %debug and %error-verbose.
1041
b19ebeb3
AD
10422009-04-03 Akim Demaille <demaille@gostai.com>
1043
1044 Regen.
1045 * src/parse-gram.h, src/parse-gram.c: Regen.
1046
001a16a9
AD
10472009-04-03 Akim Demaille <demaille@gostai.com>
1048
1049 Treat %debug as %define debug.
1050 * data/bison.m4 (b4_debug_if): New.
1051 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
1052 * data/lalr1.java: Use it instead of b4_debug_flag.
1053 * src/getargs.h, src/getargs.c (debug_flag): Remove.
1054 * src/output.c (prepare): Don't output it.
1055 * src/parse-gram.y: Treat %debug as %define debug.
1056
10572009-04-03 Akim Demaille <demaille@gostai.com>
1058
1059 Treat %error-verbose as %define error_verbose.
1060 This allows to pass -Derror_verbose on the command line. Better
1061 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
1062 ERROR_VERBOSE being defined as false or true.
1063 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
1064 on b4_percent_define_ifdef, for does not check the defined value,
1065 but only whether the symbol is defined, rely on
1066 b4_percent_define_flag_if, so that a value of "false" is processed
1067 as a false.
1068 If not defined, define the flag to "false".
1069 (b4_error_verbose_if): New.
1070 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
1071 b4_error_verbose_flag.
1072 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
1073 * src/output.c (prepare): Don't output it.
1074 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
1075
92822aff
JD
10762009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1077
1078 Fix strange %define locations for default values.
1079 Reported by Akim Demaille at
1080 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1081 and discussed again starting at
1082 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1083 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1084 because location information is bogus.
1085 Use angle brackets to delimit fake file name because square brackets
1086 look like underexpanded m4. Choose a better fake file name.
1087 Use negative line numbers.
1088 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1089 * src/location.c (location_print): If line for a boundary is negative,
1090 only print that boundary's file name.
1091 * src/location.h: Document that.
1092 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1093 defaults): Update output.
1094
e021191b
JD
10952009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1096
1097 Pacify ./configure --enable-gcc-warnings.
1098 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
1099 in lib won't compile with it.
1100 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
1101
78f65418
AD
11022009-03-31 Akim Demaille <demaille@gostai.com>
1103
1104 bootstrap: --help to stdout.
1105 * bootstrap (usage): Don't send --help to stderr.
1106 Use a here doc instead of a long string.
1107
f7e241f4
AD
11082009-03-31 Akim Demaille <demaille@gostai.com>
1109
1110 bootstrap: README-hacking no longer exists
1111 * bootstrap (checkout_only_file): Set to HACKING.
1112
31d3e510
AD
11132009-03-26 Akim Demaille <demaille@gostai.com>
1114
1115 doc: merge HACKING and README-hacking.
1116 Two files is confusing.
1117 Reported by Alexandre Duret-Lutz.
1f9d8248 1118
31d3e510
AD
1119 * README-hacking: Merge into...
1120 * HACKING (Working from the repository): here.
1121
81535bfa
AD
11222009-03-26 Akim Demaille <demaille@gostai.com>
1123
1124 doc: update README-hacking.
1125 * README-hacking: We now use git and git submodules.
1126 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1127
56f772e9
AD
11282009-03-26 Akim Demaille <demaille@gostai.com>
1129
1130 lalr1.cc: avoid GCC 4.3 warnings.
1131 GCC 4.3 now warns about "a || b && c" and asks for explicit
1132 parentheses.
1133 Reported by Alexandre Duret-Lutz.
1134 * data/location.cc: Update copyright years.
1135 (Position::operator==): Use parens to make precedence explicit.
1136 Compare lines and columns first, as they are more likely to be
1137 different, and they are faster to compare.
1138
11c073b7
AD
11392009-03-26 Akim Demaille <demaille@gostai.com>
1140
1141 gnulib: update.
1142 * gnulib: Update to latest.
1143 * src/local.mk (AM_CFLAGS): Move to...
1144 * Makefile.am: here.
1145 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
1146 AM_CFLAGS.
1147
91be6b28
AD
11482009-03-02 Akim Demaille <demaille@gostai.com>
1149
1150 Comment changes.
1151
cbf25ce7
AD
11522009-03-02 Akim Demaille <demaille@gostai.com>
1153
1154 Share b4_yytranslate_define.
1155 * data/lalr1.cc (b4_yytranslate_define): Move to...
1156 * data/c++.m4: here.
1157
882f02ed
AD
11582009-03-02 Akim Demaille <demaille@gostai.com>
1159
1160 Use locations in the variant example.
1f9d8248
AD
1161 Yes, this obfuscates the point of this example, variants only.
1162 But glr.cc cannot work (yet?) without locations. This change
1163 makes it easier to use this example with glr.cc.
11c073b7 1164
882f02ed
AD
1165 * examples/variant.yy (assert): %define it.
1166 (locations): Request them.
1167 (yylex): Bind the location to the stage.
1168
0623bacc
AD
11692009-03-02 Akim Demaille <demaille@gostai.com>
1170
1171 Dub make_TOKEN as a public type interface.
1172 * data/c++.m4 (b4_symbol_constructor_declare)
1173 (b4_symbol_constructor_define): New empty stubs.
1174 (b4_public_types_declare, b4_public_types_define): Use them.
1175 * data/lalr1.cc (b4_symbol_constructor_declare)
1176 (b4_symbol_constructor_declare_)
1177 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
1178 Move to...
1179 * data/variant.hh: here.
1180 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
1181 needed.
1182 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
1183 b4_symbol_constructor_declare, as it is now done by
1184 b4_public_types_define and b4_public_types_declare.
1185
5f5a90df
AD
11862009-03-02 Akim Demaille <demaille@gostai.com>
1187
1188 Coding style changes.
1189 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1190 (b4_symbol_constructor_declarations)
1191 (b4_symbol_constructor_definition_)
1192 (b4_symbol_constructor_definitions)
1193 (b4_yytranslate_definition): Rename as...
1194 (b4_symbol_constructor_declare_)
1195 (b4_symbol_constructor_declare)
1196 (b4_symbol_constructor_define_)
1197 (b4_symbol_constructor_define)
1198 (b4_yytranslate_define): these.
1199 * data/variant.hh (b4_variant_definition): Rename as...
1200 (b4_variant_define): this.
1201
b47b6ff7
AD
12022009-03-02 Akim Demaille <demaille@gostai.com>
1203
1204 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
1205 * data/bison.m4 (b4_percent_define_if_define): New.
1206 * data/c++.m4 (b4_variant_if): Move to...
1207 * data/bison.m4: Here, using b4_percent_define_if_define.
1208 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
1209 * data/bison.m4: Here, using b4_percent_define_if_define.
1210
1d6b689b
AD
12112009-03-02 Akim Demaille <demaille@gostai.com>
1212
1213 Dub symbol_type_base as a public type.
1214 * data/c++.m4 (b4_public_types_declare): Now define
1215 symbol_type_base and symbol_type.
1216 (b4_public_types_define): New.
1217 In both cases, the definitions are taken verbatim from lalr1.cc.
1218 * data/lalr1.cc: Adjust.
1219
4f84717d
AD
12202009-03-02 Akim Demaille <demaille@gostai.com>
1221
1222 b4_public_types_declare.
1223 * data/c++.m4 (b4_public_types_declare): New.
1224 * data/glr.cc, data/lalr1.cc: Use it.
1225
b9e4eb5b
AD
12262009-03-02 Akim Demaille <demaille@gostai.com>
1227
1228 b4_semantic_type_declare.
1229 * data/c++.m4 (b4_semantic_type_declare): New.
1230 Factors and generalizes what was in glr.cc and lalr1.cc.
1231 * data/variant.hh (b4_semantic_type_declare): Redefine it for
1232 variants.
1233 * data/lalr1.cc, data/glr.cc: Use it.
1234
6a6e7f0c
AD
12352009-02-26 Akim Demaille <demaille@gostai.com>
1236
1237 Upgrade gnulib.
1238 * gnulib: Upgrade from master.
1239 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
1240 Regen.
1241
e9e61b00
AD
12422009-02-25 Akim Demaille <demaille@gostai.com>
1243
1244 Remove useless arguments.
1245 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
1246 relevant.
1247
3eead995
AD
12482009-02-25 Akim Demaille <demaille@gostai.com>
1249
1250 Comment changes.
1251 * data/lalr1.cc: here.
1252
87f28efe
AD
12532009-02-25 Akim Demaille <demaille@gostai.com>
1254
1255 Fix glr.cc's debug level handling.
1256 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
1257 glr.c which is used.
1258 (debug_level, set_debug_level): Adjust.
1259
9be2a009
AD
12602009-02-25 Akim Demaille <demaille@gostai.com>
1261
1262 Copyright years.
1263 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1264
07a6e87d
AD
12652009-02-25 Akim Demaille <demaille@gostai.com>
1266
1267 Style changes.
1268 * etc/bench.pl.in (generate_grammar_list): Consitently use
1269 location_type, not yy::location.
1270
33c78bd2
AD
12712009-02-25 Akim Demaille <demaille@gostai.com>
1272
1273 Comment change.
1274 * data/lalr1.cc: here.
1275
49572920
AD
12762009-02-19 Akim Demaille <demaille@gostai.com>
1277
1278 Make yyparser::error public.
1279 * data/lalr1.cc: here.
1280 There is no good reason to keep it private (and it is convenient
1281 to use it from the scanner for instance). It is already public in
1282 glr.cc.
1283
88654b47
AD
12842009-02-19 Akim Demaille <demaille@gostai.com>
1285
1286 Comment changes.
1287 * data/glr.cc: here.
1288
4524c55b
AD
12892009-02-19 Akim Demaille <demaille@gostai.com>
1290
1291 Remove trailing blanks.
6a6e7f0c
AD
1292 The epilogue has its own ending \n, no need to add another.
1293
4524c55b
AD
1294 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
1295 epilogue.
1296 * data/glr.cc: dnl when extending the epilogue.
1297 Remove stray "private:".
1298
6ceccee8
AD
12992009-02-19 Akim Demaille <demaille@gostai.com>
1300
1301 Use b4_c_modern.
1302 * data/c.m4 (b4_c_function_decl): Here.
1303
9c6a8966
AD
13042009-02-19 Akim Demaille <demaille@gostai.com>
1305
1306 Comment changes.
1307 * data/lalr1.cc: here.
1308
507aa0e2
AD
13092009-02-19 Akim Demaille <demaille@gostai.com>
1310
1311 Extract variant.hh
1312 * data/variant.hh: New, extracted from...
1313 * data/lalr1.cc: here.
1314 Adjust.
1315 * data/local.mk: Adjust.
1316
51bacae6
AD
13172009-02-19 Akim Demaille <demaille@gostai.com>
1318
1319 Extract stack.hh from lalr1.cc.
1320 * data/stack.hh: New.
1321 * data/lalr1.cc: Extract from here.
1322 * data/local.mk: Adjust.
1323
06c3084f
JD
13242009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1325
1326 Add reminder about uploading public key to keys.gnupg.net.
1327 * HACKING (Release Procedure): Here.
1328
0ea583d2
AD
13292009-01-28 Akim Demaille <demaille@gostai.com>
1330
1331 * NEWS: Update information about 2.4.1 and 2.4.2.
1332
402b123d
AD
13332008-11-04 Akim Demaille <demaille@gostai.com>
1334
1335 Reformat NEWS.
1336 * NEWS: Use more outline-mode markup.
1337 Suggested by Jim Meyering.
1338
74553c98
AD
13392009-01-08 Akim Demaille <demaille@gostai.com>
1340
1341 Fix grep portability issues.
1342 Grep on Solaris does not support -q.
1343 Reported by Summum Bonum.
1344
1345 * NEWS: Add a stub for 2.4.2.
1346 * THANKS: Add Summum Bonum.
1347 * tests/atlocal.in (EGREP): New.
1348 (CC, CXX, XSLTPROC): Make it possible to override them via
1349 envvars.
1350 * tests/java.at: Use $EGREP instead of egrep.
1351 Use AT_CHECK's ignore instead of grep's -q.
1352
84eedf86
AD
13532008-12-11 Akim Demaille <demaille@gostai.com>
1354
1355 Pass the token type to yysyntax_error.
1356 * data/yacc.c (yysyntax_error): Take the transated token instead
1357 of the raw number.
1358 Adjust callers.
1359 * TODO: Update.
1360
5860cc8c
AD
13612008-12-11 Akim Demaille <demaille@gostai.com>
1362
1363 Formatting changes.
1364 * data/glr.c: Formatting changes.
1365
2b008529
AD
13662008-12-11 Akim Demaille <demaille@gostai.com>
1367
1368 Propagate i18n changes into glr.c.
1369 * TODO: Update.
1370 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
1371 building the error message format dynamically.
1372 * data/lalr1.java: Formatting changes.
1373
2cd1af95
AD
13742008-12-11 Akim Demaille <demaille@gostai.com>
1375
1376 Use testsuite -C.
1377 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
1378 Solves problems when top_srcdir is an absolute path.
1379 Suggested by Eric Blake.
1380 * configure.ac: Require Autoconf 2.62.
1381
eeb29422
AD
13822008-12-11 Akim Demaille <demaille@gostai.com>
1383
1384 Simplify the i18n of the error messages.
1385 * data/lalr1.cc: Comment changes.
1386 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
1387 lalr1.cc instead of building dynamically the format string.
1388
6617622c
AD
13892008-12-08 Akim Demaille <demaille@gostai.com>
1390
1391 Fix portability issue in the test suite.
1392 * tests/local.at (AT_MATCHES_CHECK): New.
1393 Based on Perl instead of Sed. Sed has too many portability
1394 pitfalls, not ever Sed is GNU Sed.
1395 * tests/actions.at (Fix user actions without a trailing semicolon):
1396 Use it.
1397
2ca1136c
AD
13982008-12-08 Akim Demaille <demaille@gostai.com>
1399
1400 Update data/README.
1401 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1402
6c63b895
AD
14032008-12-08 Akim Demaille <demaille@gostai.com>
1404
1405 Install autoconf as a submodule to get m4sugar.
1406 * .gitmodules: Add submodules/autoconf.
1407 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1408 submodules/autoconf.
1409
417e31d2
AD
14102008-12-08 Akim Demaille <demaille@gostai.com>
1411
1412 Test token.prefix in all the skeletons.
1413 * data/java.m4 (b4_token_enum): Use the token.prefix.
1414 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
1415 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
1416 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
1417 * tests/java.at: Comment changes.
1418 (AT_CHECK_JAVA_MINIMAL): Define the END token.
1419 (Java parser class and package names): Add token.prefix check.
1420
97abf544
AD
14212008-12-08 Akim Demaille <demaille@gostai.com>
1422
1423 Fix regeneration of atconfig.
1424 * tests/local.mk (tests/atconfig): The rule was incorrect, but
1425 remove it: now that there is no tests/Makefile.am, the top-level
1426 Makefile properly updates atconfig when needed.
1427
e8cd1ad6
DJ
14282008-12-07 Di-an Jan <dianj@freeshell.org>
1429
1430 Implement the FIXME that ends an user action with a semicolon
1431 if it seems necessary.
1432 * src/scan-code.l (flex rules section): Flag cpp directive from
1433 any `#' to the first unescaped end-of-line. Semicolon is not
1434 needed after `;', `{', '}', or cpp directives and is needed after
1435 any other token (whitespaces and comments have no effect).
1436 * tests/actions.at (Fix user actions without a trailing semicolon):
1437 New test.
1438 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1439 to make user actions complete statements.
1440 Adjust column numbers in error messages.
1441 * tests/regression.at (Fix user actions without a trailing semicolon):
1442 Remove. Covered by new test.
1443
ce9447fc
AD
14442008-12-07 Akim Demaille <demaille@gostai.com>
1445
1446 Update gnulib.
1447 * gnulib: Update from master.
1448
d333175f
EB
14492008-12-05 Eric Blake <ebb9@byu.net>
1450
1451 Avoid compiler warning.
1452 * src/output.c (muscle_insert_item_number_table): Delete unused
1453 function.
1454
215b40ac
EB
14552008-12-02 Eric Blake <ebb9@byu.net>
1456
1457 Build testsuite with newer autoconf.
1458 * tests/output.at (m4_expand): Don't override in newer autoconf,
1459 where the underlying implementation changed.
1460 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1461 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1462 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1463 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1464 since some of them contain unbalanced ')'.
1465
3bb21113
AD
14662008-12-01 Akim Demaille <demaille@gostai.com>
1467
1468 Use b4_symbol for printers and destructors everywhere.
1469 * data/bison.m4 (b4_symbol_action_location): New.
1470 * data/c.m4 (b4_symbol_actions): Remove.
1471 Adjust all callers to use by b4_symbol_foreach and the corresponding
1472 b4_symbol_printer/destructor macro.
1473 * data/glr.cc: Adjust.
1474 * data/lalr1.java: Adjust the %destructor sanity check.
1475 * src/output.c (symbol_code_props_output): Remove, we no longer
1476 need the b4_symbol_printers/destructors tables.
1477
fb7c5b1f
AD
14782008-12-01 Akim Demaille <demaille@gostai.com>
1479
1480 Use b4_symbol_case_.
1481 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
1482 b4_symbol_case_.
1483
cf6fb222
AD
14842008-12-01 Akim Demaille <demaille@gostai.com>
1485
1486 Move b4_symbol based macro to bison.m4.
1487 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
1488 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
1489 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
1490 (b4_type_foreach): Move to...
1491 * data/bison.m4: Here.
1492 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
1493 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 1494
e3c52a63
AD
14952008-12-01 Akim Demaille <demaille@gostai.com>
1496
1497 b4_symbol/type_foreach.
1498 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
1499 Use them.
1500
2bde9113
AD
15012008-12-01 Akim Demaille <demaille@gostai.com>
1502
1503 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
1504 Instead of defining complex list of tuples to define various
1505 properties of the symbols, we now prefer to define symbols as
1506 "structs" in m4: using the symbol key (its number), and the
1507 property name, b4_symbol gives it value. Use this to handle
1508 destructors and printers.
1509
2bde9113
AD
1510 * src/output.c (CODE_PROP): New.
1511 (prepare_symbol_definitions): Use it to define the printer and
1512 destructor related attributes of the symbols.
1513 * data/lalr1.cc (b4_symbol_actions): Rename as...
1514 (b4_symbol_action): this.
1515 Use b4_symbol instead of 6 arguments.
1516 (b4_symbol_printer, b4_symbol_destructor): New.
1517 Use them instead of b4_symbol_actions.
1518
44494bf6
AD
15192008-12-01 Akim Demaille <demaille@gostai.com>
1520
1521 Avoid capturing variables too easily.
1522 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
1523 v__ and p__ instead of v and p.
1524
fad814bd
AD
15252008-12-01 Akim Demaille <demaille@gostai.com>
1526
1527 Remove spurious empty line before syncline.
1528 * data/bison.m4 (b4_syncline): Don't output an empty line before
1529 the output.
1530
feda5527
AD
15312008-11-26 Akim Demaille <demaille@gostai.com>
1532
1533 Convert lib/Makefile.am into lib/local.mk.
1534 The real problem is rather gnulib.mk, which itself is extracted
1535 from a Makefile.am that gnulib expects to the "recursive". The
1536 tool prefix-gnulib-mk converts such a gnulib.mk to be
1537 non-recursive. Also, some AC_SUBST variables need to be adjusted.
1538
1539 * etc/prefix-gnulib-mk: New.
1540 * bootstrap (slurp): Use it to convert further gnulib.mk.
1541 No longer try to avoid re-creation of lib/gnulib.mk as the changes
1542 are deeper.
1543 * lib/Makefile.am: Rename as...
1544 * lib/local.mk: this.
1545 Adjust to be prefixed.
1546 * Makefile.am, configure.ac: Adjust.
1547 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
1548
56ddee7f
AD
15492008-11-26 Akim Demaille <demaille@gostai.com>
1550
1551 s/_FLAGS/FLAGS/.
1552 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
1553 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
1554 Reported by Eric Blake.
1555
728e89a0
AD
15562008-11-26 Akim Demaille <demaille@gostai.com>
1557
1558 Use b4_parser_tables_define in glr.cc.
1559 * data/glr.c: Use b4_parser_tables_define instead of defining the
1560 (deterministic integral) tables by hand.
1561
2c1bf9bd
AD
15622008-11-26 Akim Demaille <demaille@gostai.com>
1563
1564 Use b4_parser_tables_define in Java.
1565 * data/java.m4 (b4_typed_parser_table): Rename as...
1566 (b4_typed_parser_table_define): this, for consistency.
1567 Accept a comment as $4.
1568 Move $2 into yy*_.
1569 (b4_integral_parser_table): Rename as...
1570 (b4_integral_parser_table_define): this.
1571 * data/lalr1.java: Adjust all uses.
1572 Use b4_parser_tables_define instead of generation by hand.
1573
ba206cf4
AD
15742008-11-26 Akim Demaille <demaille@gostai.com>
1575
1576 Prepare the convergence bw C style and Java table generation.
1577 * data/bison.m4 (b4_tables_map, b4_tables_declare)
1578 (b4_tables_define): Rename as...
1579 (b4_integral_parser_tables_map, b4_parser_tables_declare)
1580 (b4_parser_tables_define): these.
1581 * data/c.m4 (b4_table_define): Rename as...
1582 (b4_integral_parser_table_define): this.
1583 * data/lalr1.cc: Adjust.
1584 (b4_table_define, b4_table_declare): Rename as...
1585 (b4_integral_parser_table_define)
1586 (b4_integral_parser_table_declare): these.
1587 (yyrline_): Move the comment where it is actually used.
1588 * data/yacc.c: Adjust.
1589 (yyrline): Use b4_integral_parser_table_define.
1590
d12f8e49
AD
15912008-11-26 Akim Demaille <demaille@gostai.com>
1592
1593 Regen.
1594 * src/parse-gram.h, src/parse-gram.c: Regen.
1595
0991e29b
AD
15962008-11-26 Akim Demaille <demaille@gostai.com>
1597
1598 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
1599 * data/lalr1.cc (b4_tables_map): Move to...
1600 * data/bison.m4: here.
1601 Update the comment for yytable during the flight.
1602 (b4_tables_declare, b4_tables_define): New.
1603 * data/lalr1.cc: Use them.
1604 * data/c.m4 (b4_table_define): New.
1605 * data/yacc.c: Use b4_tables_define instead of output the tables
1606 by hand.
1607 * tests/regression.at (Web2c Actions): Adjust the expected output,
1608 the order of the tables changed.
1609
3d3bc1fe
AD
16102008-11-26 Akim Demaille <demaille@gostai.com>
1611
1612 Get rid of (yy)rhs and (yy)prhs.
1613 These tables are no longer needed in the parsers, and they don't seem to
1614 be useful. They are not documented either.
feda5527 1615
3d3bc1fe
AD
1616 * src/output.c (prepare_rules): Get rid of rhs and prhs.
1617 Adjust the computation of (yy)r2.
1618
08c81469
AD
16192008-11-26 Akim Demaille <demaille@gostai.com>
1620
1621 Rule length is unsigned.
1622 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
1623
932b0c96
AD
16242008-11-26 Akim Demaille <demaille@gostai.com>
1625
1626 Get rid of lalr1-split.cc.
1627 It was no longer maintainer.
feda5527 1628
932b0c96
AD
1629 * data/lalr1-split.cc: Remove.
1630 * etc/bench.pl.in (bench_fusion_parser): Remove.
1631 Adjust.
1632
8452c667
AD
16332008-11-26 Akim Demaille <demaille@gostai.com>
1634
1635 Use yy* consistently.
1636 * data/glr.c: Now that yyrhs no longer exists as a global
1637 variable, rename local "rhs" variables into "yyrhs" for
1638 consistency.
1639
783aa653
AD
16402008-11-25 Akim Demaille <demaille@gostai.com>
1641
1642 Get rid of yyrhs and yyprhs in glr.c.
1643 * data/glr.c (yyrhs, yyprhs): Remove.
1644 Instead, use the state stack and yystos.
1645
6130b755
AD
16462008-11-25 Akim Demaille <demaille@gostai.com>
1647
1648 Flag glr tests.
1649 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
1650 as an Autotest keyword.
1651
95a7b1c9
AD
16522008-11-25 Akim Demaille <demaille@gostai.com>
1653
1654 Prefer TESTSUITE_FLAGS.
1655 TESTSUITEFLAGS is barely readable.
feda5527 1656
95a7b1c9
AD
1657 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
1658 for backward compatibility.
1659 Use the former instead of the latter.
1660
b4f18401
AD
16612008-11-25 Akim Demaille <demaille@gostai.com>
1662
1663 Get rid of yyrhs and yyprhs in larl1.java.
1664 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
1665 (yy_reduce_print): Rather, use yystos_ and the state stack.
1666
c265fd6b
AD
16672008-11-25 Akim Demaille <demaille@gostai.com>
1668
1669 Formatting changes.
1670
68dbdee8
AD
16712008-11-25 Akim Demaille <demaille@gostai.com>
1672
1673 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
1674 They were used to get the symbol types, given a rule number, when
1675 displaying the top of the stack before a reduction. But the
1676 symbol type is available from the state stack. This has two be
1677 benefits: two tables less in the parser (making it smaller), and a
1678 more consistent use of the three stacks which will help to fuse
1679 them.
feda5527 1680
68dbdee8
AD
1681 * data/yacc.c (yyprhs, yyrhs): Remove.
1682 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
1683 (yy_reduce_print): Take yyssp as argument.
1684 Use it, together with yystos, to get the symbol type.
1685 * tests/regression.at (Web2c Report): Remove these tables from the
1686 expected output.
1687
6ab1adbe
AD
16882008-11-25 Akim Demaille <demaille@gostai.com>
1689
1690 b4_tables_map.
1691 The point is to factor the generation of the tables across skeletons.
1692 This is language dependant.
feda5527 1693
6ab1adbe
AD
1694 * data/c.m4 (b4_comment_): New.
1695 Should be usable to define how to generate tables independently of
1696 the language.
1697 (b4_c_comment): New.
1698 (b4_comment): Bounce to b4_c_comment.
1699 Now support $2 = [PREFIX] for indentation.
1700 * data/lalr1.cc (b4_table_declare): Don't output a comment if
1701 there is no comment.
1702 Indent it properly when there is one.
1703 Output the ending semicolon.
1704 (b4_table_define): Space changes.
1705 Output the ending semicolon.
1706 (b4_tables_map): New.
1707 Use it twice instead of declaring and defining the (integral)
1708 tables by hand.
1709
0fddb3d5
AD
17102008-11-25 Akim Demaille <demaille@gostai.com>
1711
1712 b4_table_declare.
1713 * data/lalr1.cc (b4_table_declare): New.
1714 Use it to declare the tables defined with b4_table_define.
1715 (b4_table_define): Declare a third arg to match b4_table_declare
1716 signature.
1717 Move all the comments around invocations of b4_table_define into
1718 the invocations itselves.
1719 Move things around to have the order for declarations and
1720 definitions.
1721
c4ddc0fb
AD
17222008-11-25 Akim Demaille <demaille@gostai.com>
1723
1724 Formatting changes.
1725 * data/lalr1.java: here.
1726
e0c653e7
AD
17272008-11-25 Akim Demaille <demaille@gostai.com>
1728
1729 b4_args is more general than only C++.
1730 * data/lalr1.cc (b4_args, _b4_args): Move to...
1731 * data/bison.m4: here.
1732
4182a0a1
DJ
17332008-11-21 Di-an Jan <dianj@freeshell.org>
1734
1735 Implement no-XXX arguments for --warnings, --report, --trace.
1736 * src/getargs.c (flags_argmatch): Handles no-XXX.
1737 Fix typo in doxygen comment.
1738
01466c3e
AD
17392008-11-21 Akim Demaille <demaille@gostai.com>
1740
1741 Display the changes in cross-options.texi.
1742 * build-aux/cross-options.pl ($sep): New, to separate items.
1743 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
1744 changes.
1745
a7c09cba
DJ
17462008-11-20 Di-an Jan <dianj@freeshell.org>
1747
1748 Improves options in the manual.
1749 * doc/bison.texinfo (-g, -x): Add space before argument.
1750 (Option Cross Key): Implement FIXME: listing directives also.
1751 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1752 (Short Option): Special case -d. Put arguments inside @option.
feda5527 1753 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
1754 src/scan-gram.l (actual name passed as the first argument)
1755 with special case for %define.
1756 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
1757 to build-aux/cross-options.pl.
1758 * src/getargs.c (usage): Document limitations of cross-options.pl.
1759 * src/scan-gram.l: Likewise.
1760
6c88b51e
JD
17612008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1762
1763 Fix unexpanded macros in GLR defines file.
1764 Reported by Csaba Raduly at
1765 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1766 * THANKS (Csaba Raduly): Add.
1767 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1768 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1769 lexer in a separate module that includes the defines file.
1770 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
1771 source.
1772 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1773 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1774 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1775 (AT_DATA_SOURCE_PROLOGUE): New.
1776 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1777 (AT_DATA_SOURCE): New.
1778 (AT_FULL_COMPILE): Extend to support an additional source file.
1779
1e034807
AD
17802008-11-18 Akim Demaille <demaille@gostai.com>
1781
1782 More TODO.
1783 * TODO: More short term issues.
1784
e3dda35c
AD
17852008-11-18 Akim Demaille <demaille@gostai.com>
1786
1787 Regen.
1788 * src/parse-gram.h, src/parse-gram.c: Regen.
1789
bd187d7b
AD
17902008-11-18 Akim Demaille <demaille@gostai.com>
1791
1792 Use b4_subtract where possible.
1793 * data/lalr1.cc (b4_subtract): Move to...
1794 * data/bison.m4: here.
1795 * data/glr.c (b4_rhs_data): Use it.
1796 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
1797
6085ab0d
AD
17982008-11-18 Akim Demaille <demaille@gostai.com>
1799
1800 Remove incorrect mode specification.
1801 * data/glr.cc: Don't pretend it's C code.
1802
9ce405ce
JD
18032008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1804
1805 Simplify last patch slightly.
1806 * src/getargs.c (getargs): Here.
1807
a8beef7e
JD
18082008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1809
1810 Fix last warning from --enable-gcc-warnings.
1811 * src/getargs.c (getargs): Don't assign const address to non-const
1812 pointer.
1813
d50eea6d
JD
18142008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1815
1816 Don't let maintainer-*-check targets force a version update.
1817 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1818 handled.
1819
f5f419de
DJ
18202008-11-17 Di-an Jan <dianj@freeshell.org>
1821
1822 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1823 Align menus. Adjust word wrapping. Use node names for menu names.
1824 (Examples): Don't abbreviate node names.
1825 (LocalWords): Remove abbreviations.
1826 (Copying): Make description a sentence.
d50eea6d 1827 (Java Action Features): Remove period to match the rest of menu.
f5f419de 1828
d73e55e0
DJ
18292008-11-17 Di-an Jan <dianj@freeshell.org>
1830
1831 Handles several --enable-gcc-warnings.
1832 * src/getargs.c (command_line_location): Set parameters to void.
1833 * src/output.c (symbol_type_name_cmp): Make static.
1834 (symbols_by_type_name): Set parameters to void.
1835 (symbol_definitions_output): Remove unused parameter. Rename as...
1836 (prepare_symbol_definitions): this.
1837 (muscles_output): Move symbol_definitions_output to...
1838 (output): here as prepare_symbol_definitions.
1839 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 1840 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 1841
68c989de
DJ
18422008-11-17 Di-an Jan <dianj@freeshell.org>
1843
1844 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
1845 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
1846
23ce6f4c
AD
18472008-11-16 Akim Demaille <demaille@gostai.com>
1848
1849 Add missing $(EXEEXT).
1850 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
1851 "src/bison$(EXEEXT)".
1852 Reported by Di-an Jan.
1853
dd704c35
AD
18542008-11-15 Akim Demaille <demaille@gostai.com>
1855
1856 * TODO: Update.
1857
dab244d5
AD
18582008-11-15 Akim Demaille <demaille@gostai.com>
1859
1860 Formatting changes.
1861 * tests/input.at: here.
1862
4b4da9fb
AD
18632008-11-15 Akim Demaille <demaille@gostai.com>
1864
1865 Remove duplicate header inclusion.
1866 * src/LR0.c: here.
1867
4ea3f53d
AD
18682008-11-15 Akim Demaille <demaille@gostai.com>
1869
1870 * src/parse-gram.h, src/parse-gram.c: Regen.
1871
cb823b6f
AD
18722008-11-15 Akim Demaille <demaille@gostai.com>
1873
1874 Support parametric types.
b06df3c2
AD
1875
1876 There are two issues to handle: first scanning nested angle
1877 bracket pairs to support types such as std::pair< std::string,
1878 std::list<std::string> > >.
1879
1880 Another issue is to address idiosyncracies of C++: do not glue two
1881 closing angle brackets together (otherwise it's operator>>), and
1882 avoid sticking blindly a TYPE to the opening <, as it can result
1883 in '<:' which is a digraph for '['.
1884
cb823b6f
AD
1885 * src/scan-gram.l (brace_level): Rename as...
1886 (nesting): this.
1887 (SC_TAG): New.
1888 Implement support for complex tags.
b06df3c2 1889 (tag): Accept
cb823b6f
AD
1890 , but not <.
1891 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
1892 (b4_symbol_variant): Leave space around types as parameters.
1893 * examples/variant.yy: Use nested template types and leading ::.
1894 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
1895 Rename as...
1896 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
1897 * tests/c++.at: Test parametric types.
1898
7b6e6753
AD
18992008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1900
1901 Test token.prefix.
1902 This is not sufficient, but we test at least that the make_SYMBOL
1903 interface is not affected by token.prefix. A more general test
1904 will be implemented when the support of token.prefix is generalized
1905 to more skeletons.
b06df3c2 1906
7b6e6753
AD
1907 * tests/c++.at: One more variant test, using token.prefix.
1908
dddec537
AD
19092008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1910
1911 Test the make_TOKEN interface.
1912 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
1913 Factor the common code in yylex.
1914 Use it to test "%define lex_symbol".
1915
7d3e21ba
AD
19162008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1917
1918 Formatting change.
1919
4fc55348
AD
19202008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1921
1922 Simplify code for variants bench marks.
1923 * etc/bench.pl.in (&generate_grammar_list): Define and use
1924 location_type.
1925 Factor the common code in yylex.
1926
070e6509
AD
19272008-11-15 Akim Demaille <demaille@gostai.com>
1928
1929 Better error message.
1930 * bootstrap (find_tool): Fix the error message.
1931
0078681b
AD
19322008-11-15 Akim Demaille <demaille@gostai.com>
1933
1934 Update variant.yy to newest interface.
1935 * examples/variant.yy: Define lex_symbol.
1936 Adjust.
1937
ff084799
AD
19382008-11-15 Akim Demaille <demaille@gostai.com>
1939
1940 Don't use locations in variant.yy.
1941 * examples/variant.yy: Adjust to not using locations.
1942
b0d79ec6
AD
19432008-11-15 Akim Demaille <demaille@gostai.com>
1944
1945 Comment changes.
1946 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
1947 comments for the license.
1948
d4977ce3
AD
19492008-11-15 Akim Demaille <demaille@gostai.com>
1950
1951 Remove tests/Makefile.am.
1952 * tests/Makefile.am: Rename as...
1953 * tests/local.mk: this.
1954 * Makefile.am, configure.ac: Adjust.
1955 * Makefile.am (DISTCLEANFILES): Define.
1956 (maintainer-check, maintainer-xml-check, maintainer-push-check):
1957 Remove, we no longer need to bounce to the real targets.
1958
87f1149a
AD
19592008-11-15 Akim Demaille <demaille@gostai.com>
1960
1961 Comment changes.
1962
36415906
AD
19632008-11-15 Akim Demaille <demaille@gostai.com>
1964
1965 djgpp/local.mk.
1966 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
1967 * djgpp/local.mk: this new file.
1968
e2c2f696
AD
19692008-11-15 Akim Demaille <demaille@gostai.com>
1970
1971 Remove doc/Makefile.am.
1972 * doc/Makefile.am: Rename as...
1973 * doc/local.mk: this.
1974 Adjust paths
1975 * Makefile.am, configure.ac: Adjust.
1976 * Makefile.am (MOSTLYCLEANFILES): New.
1977 * src/local.mk: Adjust.
1978
2ead32e6
AD
19792008-11-15 Akim Demaille <demaille@gostai.com>
1980
1981 Move sc_tight_scope into maint.mk.
b06df3c2
AD
1982 It does not work, and I don't know how it was supposed to work: it
1983 seems to be looking for sources in the build tree. I just moved
1984 it at a better place, fixing it is still required.
1985
2ead32e6
AD
1986 * src/local.mk (echo): Remove.
1987 (sc_tight_scope): Move to...
1988 * maint.mk: here.
1989
2df9ec37
AD
19902008-11-15 Akim Demaille <demaille@gostai.com>
1991
1992 Regen.
1993 * src/parse-gram.h, src/parse-gram.h: Regen.
1994
0305d25e
AD
19952008-11-15 Akim Demaille <demaille@gostai.com>
1996
1997 Remove src/Makefile.am.
1998 * src/Makefile.am: Rename as...
1999 * src/local.mk: this.
2000 Prefix all the paths with src/.
2001 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
2002 (AM_CPPFLAGS): Find find in builddir/src.
2003 (YACC): Move the flags into...
2004 (AM_YFLAGS): here.
2005 * maint.mk (sc_tight_scope): Disable.
2006 It used to bounce to the version in src/Makefile.am which is now
2007 part of this very Makefile.
2008 * Makefile.am, configure.ac: Adjust.
2009 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
2010 include "..." to find files "here": we are no longer in src/, so
2011 qualify the includes with src/.
2012 * doc/Makefile.am (PREPATH): No longer include the top_builddir
2013 prefix.
2014 (.x.1): Adjust to be able to create src/foo from the top level
2015 Makefile, instead of going bounce to src/Makefile the creation of
2016 foo.
2017
5277c0a3
AD
20182008-11-15 Akim Demaille <demaille@gostai.com>
2019
2020 Remove useless variable.
2021 * doc/Makefile.am (srcsrcdir): Remove.
2022
6a5aa0cd
AD
20232008-11-15 Akim Demaille <demaille@gostai.com>
2024
2025 Remove data/Makefile.am.
2026 * data/Makefile.am: Rename as...
2027 * data/local.mk: this.
2028 Adjust paths.
2029 * Makefile.am, configure.ac: Adjust.
2030
7cb794dc
AD
20312008-11-15 Akim Demaille <demaille@gostai.com>
2032
2033 Remove etc/Makefile.am.
2034 * etc/Makefile.am: Rename as...
2035 * etc/local.mk: this.
2036 Adjust.
2037 * Makefile.am, configure.ac: Adjust.
2038
cd409e3b
AD
20392008-11-15 Akim Demaille <demaille@gostai.com>
2040
2041 Remove examples/local.mk.
2042 examples/calc++/Makefile.am might be interesting to keep as is, since
2043 it is an example in itself.
2df9ec37 2044
cd409e3b
AD
2045 * examples/Makefile.am: Rename as...
2046 * examples/local.mk: this.
2047 Adjust.
2048 * Makefile.am, configure.ac: Adjust.
2049
9a1e4214
AD
20502008-11-15 Akim Demaille <demaille@gostai.com>
2051
2052 Remove build-aux/Makefile.am.
2053 Recursive Makefiles are really way too slow, let's get rid of some of
2054 them.
2df9ec37 2055
9a1e4214
AD
2056 * build-aux/Makefile.am: Rename as...
2057 * build-aux/local.mk: this.
2058 Adjust paths.
2059 * Makefile.am, configure.ac: Adjust.
2060
0634493c
AD
20612008-11-15 Akim Demaille <demaille@gostai.com>
2062
2063 Provide convenience constructors for locations and positions.
2064 * data/location.cc (position::position): Accept file, line and
2065 column as arguments with default values.
2066 Always qualify initial line and column literals as unsigned.
2067 (location::location): Provide convenience constructors.
2068
fe1b448a
AD
20692008-11-15 Akim Demaille <demaille@gostai.com>
2070
b06df3c2
AD
2071 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
2072 token type.
fe1b448a
AD
2073 Using template buys us nothing, and makes it uselessly complex to
2074 construct a symbol. Besides, it could not be generalized to other
2075 languages, while make_FOO would work in C/Java etc.
2df9ec37 2076
fe1b448a
AD
2077 * data/lalr1.cc (b4_symbol_): New.
2078 (b4_symbol): Use it.
2079 (b4_symbol_constructor_declaration_)
2080 (b4_symbol_constructor_definition_): Instead of generating
2081 specializations of an overloaded template function, just generate
2082 several functions whose names are forged from the token names
2083 without the token.prefix.
2084 (b4_symbol_constructor_declarations): Generate them for all the
2085 symbols, not just by class of symbol type, now that instead of
2086 specializing a function template by the token, we generate a
2087 function named after the token.
2088 (b4_symbol_constructor_specialization_)
2089 (b4_symbol_constructor_specializations): Remove.
2090 * etc/bench.pl.in: Adjust to this new API.
2091
5679f311
AD
20922008-11-13 Akim Demaille <demaille@gostai.com>
2093
2094 %define token.prefix.
b06df3c2
AD
2095 Provide a means to add a prefix to the name of the tokens as
2096 output in the generated files. Because of name clashes, it is
2097 good to have such a prefix such as TOK_ that protects from names
2098 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 2099
5679f311
AD
2100 * data/bison.m4 (token.prefix): Empty by default.
2101 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
2102 * data/lalr1.cc (b4_symbol): Ditto.
2103
3204049e
AD
21042008-11-13 Akim Demaille <demaille@gostai.com>
2105
2106 Compute at M4 time some of the subtractions.
90290ce5 2107 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
2108 (b4_rhs_data): Use it.
2109
202598d3
AD
21102008-11-13 Akim Demaille <demaille@gostai.com>
2111
2112 symbol::token.
b06df3c2 2113 This allows the user to get the type of a token returned by yylex.
2df9ec37 2114
202598d3
AD
2115 * data/lalr1.cc (symbol::token): New.
2116 (yytoknum_): Define when %define lex_symbol, independently of
2117 %debug.
2118 (yytoken_number_): Move into...
2119 (symbol::token): here, since that's the only use.
2120 The other one is YYPRINT which was not officially supported
2121 by lalr1.cc, and anyway it did not work since YYPRINT uses this
2122 array under a different name (yytoknum).
2123
fc2476c7
AD
21242008-11-13 Akim Demaille <demaille@gostai.com>
2125
2126 YYERRCODE.
2127 * TODO (YYERRCODE): Mention the case of $undef.
2128
865f1e9f
AD
21292008-11-13 Akim Demaille <demaille@gostai.com>
2130
2131 TODO: YYPRINT.
2132 * TODO (YYPRINT): New.
2133
cb0b136a
AD
21342008-11-13 Akim Demaille <demaille@gostai.com>
2135
2136 Comment changes.
2137 * data/lalr1.cc, data/yacc.c: Fix the description of the
2138 yytranslate and yytoknum tables.
2139
2c086d29
AD
21402008-11-13 Akim Demaille <demaille@gostai.com>
2141
2142 Define make_symbol in the header.
b06df3c2
AD
2143 To reach good performances these functions should be inlined (yet
2144 this is to measure precisely). To this end they must be available
2145 to the caller.
2df9ec37 2146
2c086d29
AD
2147 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
2148 location_type with the class name.
2149 Since will now be output in the header, declare "inline".
2150 No longer use b4_symbol_constructor_specializations, but
2151 b4_symbol_constructor_definitions in the header.
2152 Don't call it in the *.cc file.
2153
1c4af381
AD
21542008-11-13 Akim Demaille <demaille@gostai.com>
2155
2156 Define yytranslate in the header for lex_symbol.
2157 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
2158 into the header file when using %define lex_symbol.
2159 (yytranslate_): Declare inline.
2160
e51b0a82
AD
21612008-11-13 Akim Demaille <demaille@gostai.com>
2162
b06df3c2
AD
2163 Define the constructors of symbol_type in
2164 b4_symbol_constructor_definitions.
e51b0a82 2165 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
2166 forthcoming patch will move elsewhere. Hence the interest of
2167 putting them together.
2df9ec37 2168
b06df3c2
AD
2169 The stack_symbol_type does not need to be moved, it is used only
2170 by the parser.
2df9ec37 2171
e51b0a82
AD
2172 * data/lalr1.cc: Move symbol_type and symbol_base_type
2173 constructors into...
2174 (b4_symbol_constructor_definitions): here.
2175 Adjust.
2176
78835571
AD
21772008-11-13 Akim Demaille <demaille@gostai.com>
2178
2179 Make it easier to move the definition of yytranslate_.
2180 Forthcoming changes will make it possible to use yytranslate_
2181 from outside the parser implementation file.
2df9ec37 2182
78835571
AD
2183 * data/lalr1.cc (b4_yytranslate_definition): New.
2184 Use it.
2185
c1e6c88c
AD
21862008-11-13 Akim Demaille <demaille@gostai.com>
2187
2188 Remove useless class specification.
2189 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
2190 to refer to the class name to use a type defined by the class for
2191 arguments of member functions.
2192
4654b0c0
AD
21932008-11-13 Akim Demaille <demaille@gostai.com>
2194
2195 Finer input type for yytranslate.
2196 This patch is debatable: the tradition expects yylex to return an int
2197 which happens to correspond to token_number (which is an enum). This
2198 allows for instance to return characters (such as '*' etc.). But this
2199 goes against the stronger typing I am trying to have with the new
2200 lex interface which return a symbol_type. So in this case, feed
2201 yytranslate_ with a token_type.
2df9ec37 2202
4654b0c0
AD
2203 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
2204 expect a token_type.
2205
dd735e4e
AD
22062008-11-13 Akim Demaille <demaille@gostai.com>
2207
2208 Honor lex-params in %define lex_symbol mode.
2209 * data/lalr1.cc: Use b4_lex_param.
2210
6659366c
AD
22112008-11-13 Akim Demaille <demaille@gostai.com>
2212
2213 Simplify names.
2214 * src/output.c (symbol_definitions_output): Rename symbol
2215 attributes type_name and has_type_name as type and has_type.
2216 * data/lalr1.cc: Adjust uses.
2217
e9805e57
AD
22182008-11-13 Akim Demaille <demaille@gostai.com>
2219
2220 Use b4_type_names for the union type.
b06df3c2
AD
2221 The union used to compute the size of the variant used to iterate
2222 over the type of all the symbols, with a lot of redundancy. Now
2223 iterate over the lists of symbols having the same type-name.
2df9ec37 2224
e9805e57
AD
2225 * data/lalr1.cc (b4_char_sizeof_): New.
2226 (b4_char_sizeof): Use it.
2227 Adjust to be called with a list of numbers instead of a single
2228 number.
2229 Adjust its caller for new-line issues.
2230
aea10ef4
AD
22312008-11-13 Akim Demaille <demaille@gostai.com>
2232
2233 Define the "identifier" of a symbol.
b06df3c2
AD
2234 Symbols may have several string representations, for instance if
2235 they have an alias. What I call its "id" is a string that can be
2236 used as an identifier. May not exist.
2df9ec37 2237
b06df3c2
AD
2238 Currently the symbols which have the "tag_is_id" flag set are
2239 those that don't have an alias. Look harder for the id.
2df9ec37 2240
aea10ef4
AD
2241 * src/output.c (is_identifier): Move to...
2242 * src/symtab.c (is_identifier): here.
2243 * src/symtab.h, src/symtab.c (symbol_id_get): New.
2244 * src/output.c (symbol_definitions_output): Use it to define "id"
2245 and "has_id".
2246 Remove the definition of "tag_is_id".
2247 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
2248 "tag_is_id" were used to produce code.
2249 We still use "tag" for documentation.
2250
2ea7730c
AD
22512008-11-11 Akim Demaille <demaille@gostai.com>
2252
2253 Locations are no longer required by lalr1.cc.
2254 * data/lalr1.cc (_b4_args, b4_args): New.
2255 Adjust all uses of locations to make them optional.
2256 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
2257 (AT_CHECK_NAMESPACE): Check the use of locations.
2258 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
2259 without locations with lalr1.cc.
2260 Test these cases.
2261 * tests/output.at: Check lalr1.cc with and without location
2262 support.
2263 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
2264 Don't use locations.
2265
7ca2266a
AD
22662008-11-11 Akim Demaille <demaille@gostai.com>
2267
2268 AT_FULL_COMPILE.
2269 * tests/local.at (AT_FULL_COMPILE): New.
2270 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
2271
1a7a65f9
AD
22722008-11-11 Akim Demaille <demaille@gostai.com>
2273
2274 Support parens in calc++.
2275 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
2276 * examples/calc++/test (run): Check the expected output.
2277 Adjust callers.
2278 Check parens too.
2279
c944f7f2
AD
22802008-11-11 Akim Demaille <demaille@gostai.com>
2281
2282 Simplify lalr1.cc since %defines is mandatory.
2283 * data/lalr1.cc: Remove useless calls to b4_defines_if.
2284
dada3cd1
AD
22852008-11-11 Akim Demaille <demaille@gostai.com>
2286
2287 TODO: yyfmt.
2288 * TODO (yysyntax_error): New item.
2289
422c18f4
AD
22902008-11-11 Akim Demaille <demaille@gostai.com>
2291
2292 Prefer M4 to CPP.
2293 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
2294 YYERROR_VERBOSE.
2295
a0ffc175
AD
22962008-11-11 Akim Demaille <demaille@gostai.com>
2297
2298 Support i18n of the parse error messages.
2299 * TODO (lalr1.cc/I18n): Remove.
2300 * data/lalr1.cc (yysyntax_error_): Support the translation of the
2301 error messages, as done in yacc.c.
2302 Stay within the yy* pseudo namespace.
2303
00a8a083
AD
23042008-11-11 Akim Demaille <demaille@gostai.com>
2305
2306 More TODO.
2307 * TODO (single stack, yysyntax_error): New.
2308
09277875
AD
23092008-11-11 Akim Demaille <demaille@gostai.com>
2310
2311 Make it possible to return a symbol_type from yylex.
2312 * data/lalr1.cc (b4_lex_symbol_if): New.
2313 (parse): When lex_symbol is defined, expected yylex to return the
2314 complete lookahead.
2315 * etc/bench.pl.in (generate_grammar_list): Extend to support this
2316 yylex interface.
2317 (bench_variant_parser): Exercise it.
2318
64c1b92a
AD
23192008-11-11 Akim Demaille <demaille@gostai.com>
2320
2321 Remove useless bench case.
2322 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
2323 no longer used.
2324
2722aa42
AD
23252008-11-11 Akim Demaille <demaille@gostai.com>
2326
2327 Improve display of directives.
2328 * etc/bench.pl.in (parse_term): Don't add useless eol.
2329
918eb7c5
AD
23302008-11-11 Akim Demaille <demaille@gostai.com>
2331
2332 Use string_cast in the bench.
2333 * etc/bench.pl.in (generate_grammar_list): Define and use
2334 string_cast.
2335
39be9022
AD
23362008-11-11 Akim Demaille <demaille@gostai.com>
2337
2338 Replace yychar with a Boolean.
2339 * data/lalr1.cc (parse::yychar): Replace by...
2340 (parse::yyempty): this.
2341
a2e3fa77
AD
23422008-11-11 Akim Demaille <demaille@gostai.com>
2343
2344 Factor the tables.
2345 * TODO: New item.
2346
aba12ad1
AD
23472008-11-11 Akim Demaille <demaille@gostai.com>
2348
2349 Let yytranslate handle the eof case.
2350 * data/lalr1.cc (yytranslate_): Handle the EOF case.
2351 Adjust callers.
2352 No longer expect yychar to be equal to yyeof_, rather, test the
2353 lookahead's (translated) kind.
2354
27cb5b59
AD
23552008-11-11 Akim Demaille <demaille@gostai.com>
2356
2357 yychar cannot be empty in yyerrlab.
2358 * TODO (yychar == yyempty_): New.
2359 * data/lalr1.cc: Remove the handling of this case.
2360 This eases forthcoming changes related to yychar and yytranslate.
2361
fce629c0
AD
23622008-11-11 Akim Demaille <demaille@gostai.com>
2363
2364 Bench: syntactic sugar for %define/#define.
2365 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
2366 (&bench_push_parser, bench_variant_parser): Use this feature.
2367 (&eat): New.
2368 Use it.
2369
ce671960
AD
23702008-11-11 Akim Demaille <demaille@gostai.com>
2371
2372 Less memory pressure on the "list" bench.
2373 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
2374 the values, to limit memory pressure.
2375
2873fdf8
AD
23762008-11-11 Akim Demaille <demaille@gostai.com>
2377
2378 Introduce make_symbol.
b06df3c2
AD
2379 make_symbol provides a means to construct a full symbol (kind,
2380 value, location) in a single shot. It is meant to be a Symbol
2381 constructor, parameterized by the symbol kind so that overloading
2382 would prevent incorrect kind/value pairs. Unfortunately
2383 parameterized constructors do not work well in C++ (unless the
2384 parameter also appears as an argument, which is not acceptable),
2385 hence the use of a function instead of a constructor.
2df9ec37 2386
2873fdf8
AD
2387 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2388 (b4_symbol_constructor_declarations)
2389 (b4_symbol_constructor_specialization_)
2390 (b4_symbol_constructor_specializations)
2391 (b4_symbol_constructor_definition_)
2392 (b4_symbol_constructor_definitions): New.
2393 Use them where appropriate to generate declaration, declaration of
2394 the specializations, and implementations of the templated
2395 overloaded function "make_symbol".
2396 (variant::variant): Always define a default ctor.
2397 Also provide a copy ctor.
2398 (symbol_base_type, symbol_type): New ctor overloads for value-less
2399 symbols.
2400 (symbol_type): Now public, so that functions such as yylex can use
2401 it.
2402
8be046d7
AD
24032008-11-11 Akim Demaille <demaille@gostai.com>
2404
2405 Inform m4 whether a tag is a valid id.
2406 * src/output.c (is_identifier): New.
2407 (symbol_definitions_output): Use it to define tag_is_id.
2408 But maybe this should be done at m4 level?
2409
de62edee
AD
24102008-11-11 Akim Demaille <demaille@gostai.com>
2411
2412 Test 214 was failing: it greps with a pattern containing [ ]*
2413 which obviously meant to catch spaces and tabs, but contained only
2414 spaces. Tabulations in sources are a nuisance, so to simplify the
2415 matter, get rid of all the tabulations in the Java sources. The
2416 other skeletons will be treated equally later.
2417
2418 * data/java.m4, data/lalr1.java: Untabify.
2419 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
2420 tabulations are no longer generated.
2421
905f0697
PB
24222008-11-11 Paolo Bonzini <bonzini@gnu.org>
2423
2424 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2425 * configure.ac: Adjust usage.
2426 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2427 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2428 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2429
09ccae9b
DJ
24302008-11-10 Di-an Jan <dianj@freeshell.org>
2431
2432 Workaround Java's ``code too large'' problem for parser tables
2433 in most cases, by using one function per initialization.
2434 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
2435 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
2436 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
2437 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
2438 (yytname_): Use b4_typed_parser_table.
2439 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
2440 ``code too large'' error.
2441
1979121c
DJ
24422008-11-10 Di-an Jan <dianj@freeshell.org>
2443
2444 * NEWS: Document them.
de62edee 2445
1979121c
DJ
2446 General Java skeleton improvements.
2447 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
2448 using gcj < 4.3 in the testsuite, according to comments in
2449 gnulib/m4/javacomp.m4.
2450 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
2451 location_type, position_type): Remove extraneous brackets from
2452 b4_percent_define_default.
2453 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
2454 m4_define and m4_define_default.
2455 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
2456 which marks the end of user code with appropriate syncline, like all
2457 the other skeletons.
2458 (b4_user_post_prologue): Add. Don't silently drop.
2459 (yylex): Remove.
2460 (parse): Inline yylex.
2461 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
2462 (%{...%}): Fix typo of %code imports.
2463 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
2464
2465 Support annotations on parser class with %define annotations.
2466 * data/lalr1.java (annotations): Add to parser class modifier.
2467 * doc/bison.texinfo (Java Parser Interface): Document
2468 %define annotations.
2469 (Java Declarations Summary): Document %define annotations.
2470 * tests/java.at (Java parser class modifiers): Test annotations.
2471
2472 Do not generate code for %error-verbose unless requested.
2473 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
2474 Make private. Make conditional on %error-verbose.
2475 (getErrorVerbose, setErrorVerbose): New.
2476 (yytnamerr_): Make conditional on %error-verbose.
2477 (yysyntax_error): Make some code conditional on %error-verbose.
2478 * doc/bison.texinfo (Java Bison Interface): Remove the parts
2479 about %error-verbose having no effect.
2480 (getErrorVerbose, setErrorVerbose): Document.
2481
2482 Move constants for token names to Lexer interface.
2483 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
2484 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
2485 (parse): Qualify EOF to Lexer.EOF.
2486 * doc/bison.texinfo (Java Parser Interface): Move documentation of
2487 EOF and token names to Java Lexer Interface.
2488 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
2489
2490 Make yyerror public.
2491 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
2492 (yyerror): Change to public. Add Javadoc comments. Use longer
2493 parameter names. Make the body rather than the declarator
2494 conditional on %locations.
2495 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
2496
2497 Allow user to add code to the constructor with %code init.
2498 * data/java.m4 (b4_init_throws): New, for %define init_throws.
2499 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
2500 Add %code init to the front of the constructor body.
2501 * doc/bison.texinfo (YYParser.YYParser): Document %code init
2502 and %define init_throws.
2503 (Java Declarations Summary): Document %code init and
2504 %define init_throws.
2505 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
2506 (Java constructor init and init_throws): Add tests.
de62edee 2507
42f832d6
AD
25082008-11-10 Akim Demaille <demaille@gostai.com>
2509
2510 Update TODO.
2511 * TODO (-D): is implemented.
2512 (associativity): Same precedence must have the same associativity.
2513 For instance, how can a * b / c be parsed if * is %left and / is
2514 %right?
2515 (YYERRORCODE, YYFAIL, YYBACKUP): New.
2516
247efe34
AD
25172008-11-10 Akim Demaille <demaille@gostai.com>
2518
2519 Formatting changes.
2520
5d731440
AD
25212008-11-10 Akim Demaille <demaille@gostai.com>
2522
2523 More information about the symbols.
2524 * src/output.c (type_names_output): Document all the symbols,
2525 including those that don't have a type-name.
2526 (symbol_definitions_output): Define "is_token" and
2527 "has_type_name".
2528 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
2529 type-name, now that they are defined too in b4_type_names.
2530
21db118b
AD
25312008-11-10 Akim Demaille <demaille@gostai.com>
2532
2533 Regen.
2534
6ed15cde
AD
25352008-11-10 Akim Demaille <demaille@gostai.com>
2536
2537 Make parser::yytranslate static.
b06df3c2
AD
2538 Small speedup (1%) on the list grammar. And makes yytranslate_
2539 available in non member functions.
de62edee 2540
6ed15cde
AD
2541 * data/lalr1.cc (yytranslate_): Does not need to be a instance
2542 function.
2543
30bb2edc
AD
25442008-11-10 Akim Demaille <demaille@gostai.com>
2545
2546 Avoid trailing spaces.
2547 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
2548 * data/lalr1.cc: Don't indent before rule and symbol actions, as
2549 they can be empty, and anyway this incorrectly indents the first
2550 action.
2551
b3a28fd4
AD
25522008-11-10 Akim Demaille <demaille@gostai.com>
2553
2554 Comment changes.
2555
914202bd
AD
25562008-11-10 Akim Demaille <demaille@gostai.com>
2557
2558 Use "enum" for integral constants.
2559 This is just nicer to read, I observed no speedup.
de62edee 2560
914202bd
AD
2561 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
2562 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
2563 (yyuser_token_number_max_, yyundef_token_): Move into...
2564 (yytranslate_): here.
2565
c17f9a4a
AD
25662008-11-10 Akim Demaille <demaille@gostai.com>
2567
2568 Shortcuts in bench directives.
2569 * etc/bench.pl.in (parse_dirs): New.
2570 Use it.
2571 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
2572 Create the benches in "benches/".
2573
b9855ea5
AD
25742008-11-10 Akim Demaille <demaille@gostai.com>
2575
2576 Formatting changes.
2577 * data/lalr1.cc: here.
2578
6e097787
AD
25792008-11-10 Akim Demaille <demaille@gostai.com>
2580
2581 Adjust verbose message to using emacs.
2582 * etc/bench.pl.in: Inform compilation-mode when we change the
2583 directory.
2584 (generate_grammar_list): Recognize %define "variant" in addition
2585 to %define variant.
2586
4c3cc7da
AD
25872008-11-10 Akim Demaille <demaille@gostai.com>
2588
2589 Classify symbols by type-name.
2590 * src/uniqstr.h (UNIQSTR_CMP): New.
2591 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
2592 (type_names_output): New.
2593 (muscles_output): Use it.
2594 * data/lalr1.cc (b4_symbol_action_): Remove.
2595 (b4_symbol_case_, b4_type_action_): New.
2596 Adjust uses of b4_symbol_action_ to use b4_type_action_.
2597
d69c9694
AD
25982008-11-10 Akim Demaille <demaille@gostai.com>
2599
2600 Change the handling of the symbols in the skeletons.
2601 Before we were using tables which lines were the symbols and which
2602 columns were things like number, tag, type-name etc. It is was
2603 difficult to extend: each time a column was added, all the numbers had
2604 to be updated (you asked for colon $2, not for "tag"). Also, it was
2605 hard to filter these tables when only a subset of the symbols (say the
2606 tokens, or the nterms, or the tokens that have and external number
2607 *and* a type-name) was of interest.
de62edee 2608
d69c9694
AD
2609 Now instead of monolithic tables, we define one macro per cell. For
2610 instance "b4_symbol(0, tag)" is a macro name which contents is
2611 self-decriptive. The macro "b4_symbol" provides easier access to
2612 these cells.
de62edee 2613
d69c9694
AD
2614 * src/output.c (type_names_output): Remove.
2615 (symbol_numbers_output, symbol_definitions_output): New.
2616 (muscles_output): Call them.
2617 (prepare_symbols): Define b4_symbols_number.
2618
5263bea9
AD
26192008-11-10 Akim Demaille <demaille@gostai.com>
2620
2621 --trace=muscles
2622 * src/getargs.h, src/getargs.c (trace_muscle): New.
2623 (trace_types, trace_args): Support it.
2624 * src/output.c (output_skeleton): Use it.
2625
4175f6bb
AD
26262008-11-10 Akim Demaille <demaille@gostai.com>
2627
2628 muscles_output.
2629 * src/output.c (muscles_output): New, extracted from...
2630 (output_skeleton): here.
2631 Adjust.
2632
1de69d6a
AD
26332008-11-10 Akim Demaille <demaille@gostai.com>
2634
2635 Formatting changes.
2636
36db78a7
AD
26372008-11-10 Akim Demaille <demaille@gostai.com>
2638
2639 Update the variant example.
2640 * examples/variant.yy: Formatting changes.
2641 One stage build.
2642
e5eb92e7
AD
26432008-11-10 Akim Demaille <demaille@gostai.com>
2644
2645 Support constructor with an argument.
2646 This improves the "list" bench by 2%.
de62edee 2647
e5eb92e7
AD
2648 * data/lalr1.cc (variant::build): Add an overloaded version with
2649 an argument.
2650 * tests/c++.at (AT_CHECK_VARIANT): Check it.
2651
76307410
AD
26522008-11-10 Akim Demaille <demaille@gostai.com>
2653
2654 Test variants.
2655 * tests/c++.at (AT_CHECK_VARIANTS): New.
2656 Use it with and without %define assert.
2657
d78f0ac9
AD
26582008-11-10 Akim Demaille <demaille@gostai.com>
2659
2660 Add %precedence support.
2661 Unfortunately it is not possible to reuse the %prec directive. This
2662 is because to please POSIX, we do not require to end the rules with a
2663 semicolon. As a result,
de62edee 2664
d78f0ac9 2665 foo: bar %prec baz
de62edee 2666
d78f0ac9
AD
2667 is ambiguous: either a rule which precedence is that of baz, or a rule,
2668 and then a declaration of the precedence of the token baz.
de62edee 2669
d78f0ac9
AD
2670 * doc/bison.texinfo: Document %precedence.
2671 (Precedence Only): New.
2672 * src/assoc.h, src/assoc.c (precedence_assoc): New.
2673 * src/conflicts.c (resolve_sr_conflict): Support it.
2674 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
2675 Parse it.
2676 * tests/calc.at: Use %precedence for NEG.
2677 * tests/conflicts.at (%precedence does not suffice)
2678 (%precedence suffices): New tests.
2679
c85be41a
AD
26802008-11-09 Akim Demaille <demaille@gostai.com>
2681
2682 Make benches in a sub dirs.
2683 * etc/bench.pl.in ($dir): New.
2684 Use it.
2685 Check the use of constructors with an argument.
2686 (bench_variant_parser): Fix.
2687
db65ca1f
AD
26882008-11-09 Akim Demaille <demaille@gostai.com>
2689
2690 fix eof condition
2691
9b0efa5b
AD
26922008-11-09 Akim Demaille <demaille@gostai.com>
2693
2694 Fix --help.
2695
432ac57a
AD
26962008-11-09 Akim Demaille <demaille@gostai.com>
2697
2698 Require the generation of parse-gram.output.
2699 * src/Makefile.am (YACC): Pass --report=all.
2700
deef2a0a
AD
27012008-11-09 Akim Demaille <demaille@gostai.com>
2702
2703 Formatting changes.
2704
df72984a
AD
27052008-11-09 Akim Demaille <demaille@gostai.com>
2706
2707 Update TODO.
2708 * TODO: Remove obsolete items.
2709 Update others.
2710
f10e19fd
AD
27112008-11-09 Akim Demaille <demaille@gostai.com>
2712
2713 Enhance bench.pl.
2714 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
2715 (@token, $grammar, $bench): New.
2716 (generate_grammar_variant): Rename as...
2717 (generate_grammar_list): this.
2718 (generate_grammar): Adjust.
2719 (bench_grammar): Rename as...
2720 (bench): this.
2721 Use it in the various bench-marking routines.
2722 (-b, -g): New options.
2723
5de9c593
AD
27242008-11-09 Akim Demaille <demaille@gostai.com>
2725
2726 Use a static hierarchy for symbols in the C++ parser.
2727 * data/lalr1.cc (symbol_base_type, symbol_type)
2728 (stack_symbol_type): Make it a static hierarchy.
2729 Adjust dependencies.
2730
757f8f98
AD
27312008-11-09 Akim Demaille <demaille@gostai.com>
2732
2733 bench.pl -d, --directive.
2734 * etc/bench.pl.in (@directive): New.
2735 (&bench_grammar): Use it.
2736 (&bench_list_grammar): New, to provide access to the "variant"
2737 grammar.
2738 Use it.
2739 (getopts): Support -d, --directive.
2740
d3be4f6d
AD
27412008-11-09 Akim Demaille <demaille@gostai.com>
2742
2743 Use inline for small operations.
2744 * data/lalr1.cc (symbol_base_type, symbol_type)
2745 (stack_symbol_type): Declare constructor and other operations as
2746 inline.
2747 (yy_destroy_): Inline.
2748
1f7d007b
AD
27492008-11-09 Akim Demaille <demaille@gostai.com>
2750
2751 Introduce a hierarchy for symbols.
2752 * data/lalr1.cc (symbol_base_type, symbol_type): New.
2753 (data_type): Rename as...
2754 (stack_symbol_type): this.
2755 Derive from symbol_base_type.
2756 (yy_symbol_value_print_): Merge into...
2757 (yy_symbol_print_): this.
2758 Rename as...
2759 (yy_print_): this.
2760 (yydestruct_): Rename as...
2761 (yy_destroy_): this.
2762 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
2763 (parser::parse): yyla is now of symbol_type.
2764 Use its type member instead of yytoken.
2765
bc0b0477
AD
27662008-11-09 Akim Demaille <demaille@gostai.com>
2767
2768 Rename data_type and stack_symbol_type.
2769 * data/lalr1.cc (data_type): Rename as...
2770 (stack_symbol_type): this.
2771
57295d14
AD
27722008-11-09 Akim Demaille <demaille@gostai.com>
2773
2774 Handle semantic value and location together.
2775 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
2776 yydata.value and yydata.location.
2777 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
2778 (YY_SYMBOL_PRINT): Now take semantic value and location as a
2779 single arg.
2780 Adjust all callers.
2781 (yydestruct_): New overload for a stack symbol.
2782
e9b0834e
AD
27832008-11-09 Akim Demaille <demaille@gostai.com>
2784
2785 Push a complete symbol, not connected parts.
2786 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
2787 state, value and location.
2788 Adjust callers.
2789
6082531a
AD
27902008-11-09 Akim Demaille <demaille@gostai.com>
2791
2792 Agregate yylval and yylloc.
2793 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
2794 (parser::yyla): this.
2795
33c195cc
AD
27962008-11-09 Akim Demaille <demaille@gostai.com>
2797
2798 Rely on the state stack to display reduction traces.
b06df3c2
AD
2799 To display rhs symbols before a reduction, we used information
2800 about the rule reduced, which required the tables yyrhs and
2801 yyprhs. Now use rely only on the state stack to get the same
2802 information.
de62edee 2803
33c195cc
AD
2804 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
2805 Use them.
2806 (parser::yyrhs_, parser::yyprhs_): Remove.
2807 (parser::yy_reduce_print_): Use the state stack.
2808
e1f93869
AD
28092008-11-09 Akim Demaille <demaille@gostai.com>
2810
2811 Fuse yyval and yyloc into yylhs.
2812 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
2813 yylhs.
2814 (parse): Replace yyval and yyloc with yylhs.value and
2815 yylhs.location.
2816 After a user action, compute yylhs.state earlier.
2817 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
2818 fresh error_token.
2819
2935744b
DJ
28202008-11-09 Di-an Jan <dianj@freeshell.org>
2821
2822 Remove unused variable.
2823 * src/output.c (type_names_output): Remove unused variable sep.
2824
bbf9ca37
PB
28252008-11-09 Paolo Bonzini <bonzini@gnu.org>
2826
2827 Change tests/output.at quoting.
2828 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
2829 expanding arguments.
2830
d9a9b96b
JD
28312008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2832
2833 Don't add a semicolon to actions for %skeleton or %language.
2834 It breaks Java test cases as reported by Akim Demaille.
2835 * src/scan-code.l: Implement.
2836
51365192
JD
28372008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2838
2839 Clean up %skeleton and %language priority implementation.
2840 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
2841 remove static qualifier because others will soon need to see it.
2842 (language_prio): Likewise.
2843 (getargs): Use command_line_prio rather than 0.
2844 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
2845 enum fields.
2846 (skeleton_prio): Extern it.
2847 (language_prio): Extern it.
2848 * src/parse-gram.y: Use grammar_prio rather than 1.
2849
9380cfd0
AD
28502008-11-07 Akim Demaille <demaille@gostai.com>
2851
2852 Moving push traces into yypush_.
2853 * data/lalr1.cc (yypush_): Now takes a optional trace message.
2854 Adjust all uses.
2855
8901f32e
AD
28562008-11-07 Akim Demaille <demaille@gostai.com>
2857
2858 The single-stack C++ parser is now the standard one.
2859 * data/lalr1.cc: Rename as...
2860 * data/lalr1-split.cc: this.
2861 * data/lalr1-fusion.cc: Rename as...
2862 * data/lalr1.cc: this.
2863 * etc/bench.pl.in: Adjust.
2864
8cdabf02
AD
28652008-11-07 Akim Demaille <demaille@gostai.com>
2866
2867 Avoid empty-if warnings.
2868 Reported by Quentin Hocquet.
de62edee 2869
8cdabf02
AD
2870 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
2871 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
2872
5a893c2b
AD
28732008-11-07 Akim Demaille <demaille@gostai.com>
2874
2875 Pass command line location to skeleton_arg and language_argmatch.
2876 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2877 The location argument is now mandatory.
2878 Adjust all dependencies.
2879 (getargs): Use command_line_location.
2880
58697c6d
AD
28812008-11-07 Akim Demaille <demaille@gostai.com>
2882
2883 -D, --define.
2884 * src/getargs.c (usage): Document -D.
2885 Fix help string for --locations.
2886 (command_line_location): New.
2887 (short_options, long_options, getargs): Support -D, --define.
2888 (getargs): Move -d support at the right place.
2889 * doc/bison.texinfo (Bison Options): Update.
2890 * tests/input.at (%define, --define): New.
2891
9fe5a457
AD
28922008-11-07 Akim Demaille <demaille@gostai.com>
2893
2894 Initialize the muscle table before parsing the command line.
2895 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2896 (getargs): Define file_name.
2897 * src/main.c (main): Initialize muscle_tab before calling
2898 getargs.
2899 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2900 its value is not available yet.
2901
56c5eca9
AD
29022008-11-07 Akim Demaille <demaille@gostai.com>
2903
2904 Locations without columns for command line arguments.
2905 * src/location.c (location_print): Don't display negative columns.
2906 * src/location.h: Document this.
2907
9b9e0a7d
AD
29082008-11-07 Akim Demaille <demaille@gostai.com>
2909
2910 Fix --help.
2911 * src/getargs.c (usage): Fix help string for -W.
2912
74eae918
AD
29132008-11-07 Akim Demaille <demaille@gostai.com>
2914
2915 Handle more general types of option arguments.
2916 * build-aux/cross-options.pl: The argument ends at the first
2917 space, not the first non-symbol character.
2918 Use @var for each word appearing the argument description.
2919
a3d4c6fb
AD
29202008-11-07 Akim Demaille <demaille@gostai.com>
2921
2922 Destroy the variants that remain on the stack in case of error.
2923 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
2924 destructor.
2925 Display the value only if yymsg is nonnull.
2926 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
2927
2d32fc9f
AD
29282008-11-07 Akim Demaille <demaille@gostai.com>
2929
2930 Add "%define assert" to variants.
2931 This is used to help the user catch cases where some value gets
2932 ovewritten by a new one. This should not happen, as this will
2933 probably leak.
de62edee 2934
2d32fc9f
AD
2935 Unfortunately this uncovered a bug in the C++ parser itself: the
2936 lookahead value was not destroyed between two calls to yylex. For
2937 instance if the previous lookahead was a std::string, and then an int,
2938 then the value of the std::string was correctly taken (i.e., the
2939 lookahead was now an empty string), but std::string structure itself
2940 was not reclaimed.
de62edee 2941
2d32fc9f
AD
2942 This is now done in variant::build(other&) (which is used to take the
2943 value of the lookahead): other is not only stolen from its value, it
2944 is also destroyed. This incurs a new performance penalty of a few
2945 percent, and union becomes faster again.
de62edee 2946
2d32fc9f
AD
2947 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
2948 (b4_variant_if): New.
2949 (variant::built): New.
2950 Use it whereever the status of the variant changes.
2951 * etc/bench.pl.in: Check the penalty of %define assert.
2952
f6038cb8
AD
29532008-11-07 Akim Demaille <demaille@gostai.com>
2954
2955 Use "%define variant" in bench.pl.
2956 * etc/bench.pl.in: No longer use the pseudo directive %variants,
2957 just use %define variants.
2958
ccde1f98
AD
29592008-11-07 Akim Demaille <demaille@gostai.com>
2960
2961 Regen.
2962 * src/parse-gram.h, src/parse-gram.c: Regen.
2963
58bd33b7
JD
29642008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
2965
2966 Fix user actions without a trailing semicolon.
2967 Reported by Sergei Steshenko at
2968 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
2969 * THANKS (Sergei Steshenko): Add.
2970 * src/scan-code.l (SC_RULE_ACTION): Fix it.
2971 * tests/regression.at (Fix user actions without a trailing semicolon):
2972 New test case.
2973
639867b5
AD
29742008-11-04 Akim Demaille <demaille@gostai.com>
2975
2976 Use b4_copyright_years.
2977 * data/yacc.c (b4_copyright_years): New.
2978 Fix its value according to the comments in the file.
2979 Use it and undefine it.
2980
3c262606
AD
29812008-11-04 Akim Demaille <demaille@gostai.com>
2982
2983 Formatting changes.
2984 * data/lalr1-fusion.cc, src/parse-gram.y: here.
2985
a2b93d52
AD
29862008-11-04 Akim Demaille <demaille@gostai.com>
2987
2988 Formatting changes.
2989 * data/lalr1-fusion.cc: here.
2990
3a2803df
AD
29912008-11-04 Akim Demaille <demaille@gostai.com>
2992
2993 Use strict on bench.pl.
2994 * etc/bench.pl.in (&run, &generate_grammar): New.
2995 Rename the grammar generating functions for consistency.
2996 Change the interface so that the list of benches to run is passed
2997 as (optionless) arguments.
2998 (&compile): Use &run.
2999
a0d4650a
AD
30002008-11-04 Akim Demaille <demaille@gostai.com>
3001
3002 Remove spurious initial empty lines.
3003 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
3004 * data/yacc.c: End the @output lines with an @.
3005
cac9e09b
AD
30062008-11-04 Akim Demaille <demaille@gostai.com>
3007
3008 Improve the display of sizes.
3009 * etc/bench.p.in: Higher precision.
3010 Sort by decreasing size.
3011
4af4348a
AD
30122008-11-04 Akim Demaille <demaille@gostai.com>
3013
3014 Don't memcpy C++ structures.
3015 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
3016 arguments.
3017 (variant::build): New overload for
3018 copy-construction-that-destroys.
3019 (variant::swap): New.
3020 (parser::yypush_): Use it in variant mode.
3021
ef05c4d6
AD
30222008-11-04 Akim Demaille <demaille@gostai.com>
3023
3024 Better defaults for bench.pl.
3025 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
3026 default values.
3027 Adjust &verbose uses.
3028 (-q, --quiet): New.
3029
9718cfa9
AD
30302008-11-04 Akim Demaille <demaille@gostai.com>
3031
3032 Make variant.yy more complex.
3033 std::list cannot be copied via memcpy, they are more demanding than
3034 std::string. Use one std::list to strengthen the test.
de62edee 3035
9718cfa9
AD
3036 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
3037 Adjust.
3038 Create a list of strings, instead of a single large string.
3039
a6df593d
AD
30402008-11-04 Akim Demaille <demaille@gostai.com>
3041
3042 bench.pl --bench.
3043 * etc/bench.pl.in (--bench, $bench): New.
3044
006a0303
AD
30452008-11-04 Akim Demaille <demaille@gostai.com>
3046
3047 Sort methods.
3048 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
3049 Define it after as().
3050
faef3466
AD
30512008-11-04 Akim Demaille <demaille@gostai.com>
3052
3053 Useless parens.
3054 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
3055
2141aded
AD
30562008-11-04 Akim Demaille <demaille@gostai.com>
3057
3058 Issue missing synclines after user actions.
3059 * data/c.m4 (b4_case): Issue synclines on the output file.
3060
e426d17b
AD
30612008-11-04 Akim Demaille <demaille@gostai.com>
3062
3063 Remove trailing empty line.
3064 * data/lalr1-fusion.cc: Don't add an empty line after the user's
3065 epilogue.
3066
a9ce3f54
AD
30672008-11-04 Akim Demaille <demaille@gostai.com>
3068
3069 Fix output of copyright years.
3070 * data/bison.m4 (b4_copyright): Fix the indentation of the
3071 copyright year paragraph.
3072 Use b4_copyright_years when no years are given.
3073 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
3074 (b4_copyright_years): New.
3075 Use it.
3076
59c544c2
AD
30772008-11-04 Akim Demaille <demaille@gostai.com>
3078
3079 Avoid the spurious initial empty line.
3080 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
3081 the end of @output request to suppress the empty line that
3082 results.
3083
96b15448
AD
30842008-11-04 Akim Demaille <demaille@gostai.com>
3085
3086 Remove parser::rhs_number_type.
3087 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
3088 (yyrhs_): Use b4_table_define.
3089
f0633174
AD
30902008-11-04 Akim Demaille <demaille@gostai.com>
3091
3092 Fix iteration type.
3093 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
3094
417b8004
AD
30952008-11-04 Akim Demaille <demaille@gostai.com>
3096
3097 Factor the declaration of the integer tables.
3098 * data/lalr1-fusion.cc (b4_table_define): New.
3099 Use it.
3100
1a5246c6
AD
31012008-11-03 Akim Demaille <demaille@gostai.com>
3102
3103 Fix indentation of tables in lalr1.cc
3104 * data/lalr1-fusion.cc: Fix the indentation.
3105
f8a95c9c
AD
31062008-11-03 Akim Demaille <demaille@gostai.com>
3107
3108 Destroy the lhs symbols after reduction.
3109 * data/lalr1-fusion.cc (parse): After the user action, when in
3110 variant mode, destroy the lhs symbols.
3111
d7f4d823
AD
31122008-11-03 Akim Demaille <demaille@gostai.com>
3113
3114 Simplify yysyntax_error_ use.
3115 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
3116 type, but make it unnamed in the declaration when it is not used.
3117
8b9c89fb
AD
31182008-11-03 Akim Demaille <demaille@gostai.com>
3119
3120 Let yy::variant::build return an lvalue.
3121 * data/lalr1-fusion.cc (variant::build): Return a reference to the
3122 object.
3123
83243c24
AD
31242008-11-03 Akim Demaille <demaille@gostai.com>
3125
3126 Define yy::variant only when needed.
3127 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
3128 used.
3129
429b4848
AD
31302008-11-03 Akim Demaille <demaille@gostai.com>
3131
3132 Bench the three-stack lalr1.cc.
3133 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
3134 one-stack one.
3135
414c76a4
AD
31362008-11-03 Akim Demaille <demaille@gostai.com>
3137
3138 Fail on parse error in calc++.
3139 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
3140 status.
3141 * examples/calc++/test ($me, $number, $exit, run): New.
3142 Use them to propagate errors to the exit status.
3143
8a5783fd
AD
31442008-11-03 Akim Demaille <demaille@gostai.com>
3145
3146 Don't specify the skeleton twice in the example.
3147 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
3148 file does what is needed.
3149
0cc5bead
AD
31502008-11-03 Akim Demaille <demaille@gostai.com>
3151
3152 bench: Improve output.
3153 * etc/bench.pl.in (bench_grammar): Tune the printf format.
3154
5b421a4e
AD
31552008-11-03 Akim Demaille <demaille@gostai.com>
3156
3157 bench: check impact of %debug on variants.
3158 * etc/bench.pl.in (variant_grammar): Fix the computation of
3159 $variant.
3160 Generate a grammar file that can work with or without %debug.
3161 Do use the @directive.
3162 (bench_variant_parser): Check impact of %debug.
3163 (@directives): Rename all the occurrences to...
3164 (@directive): this, for consistency.
3165
d11ee647
AD
31662008-11-03 Akim Demaille <demaille@gostai.com>
3167
3168 bench: report the size too.
3169 * etc/bench.pl.in ($iterations): Defaults to -3.
3170 (&bench_grammar): Require hireswallclock.
3171 Compute and display the size of the result.
3172 More comments.
3173
e1b74b92
AD
31742008-11-03 Akim Demaille <demaille@gostai.com>
3175
3176 bench: More use of the verbosity level.
3177 * etc/bench.pl.in ($verbose, &verbose): New.
3178 Use them.
3179 More POD documentation.
3180
7e5f9c54
AD
31812008-11-03 Akim Demaille <demaille@gostai.com>
3182
3183 bench.pl: a command line interface
3184 * etc/bench.pl.in: More doc.
3185 Some fixes in the documentation.
3186 ($cflags, $iterations, &help, &getopt): New.
3187 Use them.
3188 (&variant_grammar): Let the number of stages be 10 times what is
3189 specified.
3190
7109a18d
AD
31912008-11-03 Akim Demaille <demaille@gostai.com>
3192
3193 Bench the use of Boost.Variants.
3194 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
3195 New.
3196 (&compile): Be ready to compile C++ parsers.
3197 (&bench_push_parser): Move debug information to the outermost
3198 level.
3199 * THANKS: Add Michiel De Wilde.
3200
922730fe
AD
32012008-11-03 Akim Demaille <demaille@gostai.com>
3202
3203 bench.pl: Pass directives as a list instead of as a string.
3204 * etc/bench.pl.in (&directives): New.
3205 (&triangular_grammar, &calc_grammar): Use it to format the Bison
3206 directives.
3207 (&triangular_grammar): Do use the directives (were ignored).
3208 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
3209 directives.
3210
7484f1d4
AD
32112008-11-03 Akim Demaille <demaille@gostai.com>
3212
3213 Improve genericity of bench.pl.
3214 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
3215 argument.
3216 (&bench_push_parser): New.
3217 Call it.
3218
15129f25
AD
32192008-11-03 Akim Demaille <demaille@gostai.com>
3220
3221 Add documentation to bench.pl.
3222 * etc/bench.pl.in: Comment changes.
3223
0e0ed236
AD
32242008-11-03 Akim Demaille <demaille@gostai.com>
3225
3226 Fuse the three stacks into a single one.
de62edee 3227
b06df3c2
AD
3228 In order to make it easy to perform benchmarks to ensure that
3229 there are no performance loss, lalr1.cc is forked into
3230 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
3231 lalr1.cc.
3232
3233 Meanwhile, to make sure that lalr1-fusion.cc is correctly
3234 exercized by the test suite, the user must install a symbolic link
3235 from lalr1.cc to it.
de62edee 3236
b06df3c2
AD
3237 Instead of having three stacks (state, value, location), use a
3238 stack of triples. This considerably simplifies the code (and it
3239 will be easier not to require locations as currently does the C++
3240 parser), and also gives a 10% speedup according to
3241 etc/bench (probably mainly since memory allocation is done once
3242 instead of three times).
de62edee 3243
0e0ed236
AD
3244 Another motivation is to make it easier to destruct properly
3245 semantic values: now that they are bound to their state (hence
3246 symbol type) it will be easier to call the appropriate destructor.
de62edee 3247
0e0ed236 3248 These changes should probably benefit the C parser too.
de62edee 3249
b06df3c2
AD
3250 * data/lalr1.cc: Copy as...
3251 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
3252 (b4_rhs_value, b4_rhs_location): New definitions overriding those
3253 from c++.m4.
3254 (state_stack_type, semantic_stack_type, location_stack_type)
3255 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
3256 (data_type, stack_type, yystack_): New.
3257 (YYLLOC_DEFAULT, yypush_): Adjust.
3258 (yyerror_range): Now based on data_type, not location_type.
3259
7dedf26e
AD
32602008-11-03 Akim Demaille <demaille@gostai.com>
3261
3262 Push the state, value, and location at the same time.
3263 This is needed to prepare a forthcoming patch that fuses the three
3264 stacks into one.
de62edee 3265
7dedf26e
AD
3266 * data/lalr1.cc (parser::yypush_): New.
3267 (parser::yynewstate): Change the semantics: instead of arriving to
3268 this label when value and location have been pushed, but yystate
3269 is to be pushed on the state stack, now the three of them must
3270 have been pushed before. yystate still must be the new state.
3271 This allows to use yypush_ everywhere instead of individual
3272 handling of the stacks.
3273
c4585f1e
AD
32742008-11-03 Akim Demaille <demaille@gostai.com>
3275
3276 Prefer references to pointers.
3277 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
3278 definition to use references instead of pointers.
3279 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
3280 Take the value and location as references.
3281 Adjust callers.
3282
56017c17
AD
32832008-11-03 Akim Demaille <demaille@gostai.com>
3284
3285 stack::size instead of stack::height.
3286 * data/lalr1.cc (stack::height): Rename as...
3287 (stack::size): this.
3288 Fix the output type.
3289 Comment changes.
3290
5ab8c47b
AD
32912008-11-03 Akim Demaille <demaille@gostai.com>
3292
3293 Use variants to support objects as semantic values.
b06df3c2
AD
3294 This patch was inspired by work by Michiel De Wilde. But he used
3295 Boost variants which (i) requires Boost on the user side, (ii) is
3296 slow, and (iii) has useless overhead (the parser knows the type of
3297 the semantic value there is no reason to duplicate this
3298 information as Boost.Variants do).
3299
3300 This implementation reserves a buffer large enough to store the
3301 largest objects. yy::variant implements this buffer. It was
3302 implemented with Quentin Hocquet.
de62edee 3303
5ab8c47b
AD
3304 * src/output.c (type_names_output): New.
3305 (output_skeleton): Invoke it.
3306 * data/c++.m4 (b4_variant_if): New.
3307 (b4_symbol_value): If needed, provide a definition for variants.
3308 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
3309 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
3310 (b4_char_sizeof, yy::variant): New.
3311 (parser::parse): If variants are requested, define
3312 parser::union_type, parser::variant, change the definition of
3313 semantic_type, construct $$ before running the user action instead
3314 of performing a default $$ = $1.
3315 * examples/variant.yy: New.
3316 Based on an example by Michiel De Wilde.
3317
1fa5d8bb
AD
33182008-11-03 Akim Demaille <demaille@gostai.com>
3319
3320 Parameterize the extraction of semantic values.
3321 To make future changes easier, no longer rely on ".TYPE" being the
3322 way to get a semantic value.
de62edee 3323
1fa5d8bb
AD
3324 * data/c.m4 (b4_symbol_value): New.
3325 Use it.
3326 * data/c++.m4, data/yacc.c: Use it.
3327 * data/glr.c: Use b4_symbol_value.
3328 (b4_rhs_data): New.
3329 Use it.
3330
91ba8a55
AD
33312008-11-03 Akim Demaille <demaille@gostai.com>
3332
3333 Prepare easier M4 changes.
3334 * data/lalr1.cc: Use escaped [] instead of literals to prepare
3335 future changes.
3336
c9ba9e59
JD
33372008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3338
3339 Initiate further development.
3340 * NEWS: Create an empty section for new entries.
3341 * gnulib: Update submodule to HEAD.
3342
bfb40910
JD
33432008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3344
3345 * NEWS: Version 2.4.
3346
241fda7a
JD
33472008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3348
3349 Prepare for next release.
3350 * NEWS: Briefly mention changes since 2.3b.
3351 * README: Say GNU m4 1.4.6, which we've been requiring in release
3352 announcements already, not 1.4.3, which breaks the build.
3353
ed4d67dc
JD
33542008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3355
3356 Say %language is experimental.
3357 We're thinking of extending it's effect on output file naming. See the
3358 thread at
3359 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
3360 * NEWS: Say it's experimental.
3361 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
3362 recommend it over %skeleton for now.
3363 (Bison Options): Likewise.
3364 (C++ Bison Interface): Use %skeleton not %language.
3365 (Calc++ Parser): Use %skeleton not %language.
3366 * src/getargs.c (usage): Say it's experimental.
3367
e254a580
DJ
33682008-11-01 Di-an Jan <dianj@freeshell.org>
3369 Paolo Bonzini <bonzini@gnu.org>
3370
3371 Support all Java parser class modifiers.
3372 * data/java.m4 (b4_percent_define_get3): New.
3373 (b4_final_if, b4_strictfp_if): New.
3374 * data/lalr1.java (final, strictfp, extends, implements): Support.
3375 * doc/bison.texinfo (final, strictfp, extends, implements): Add
3376 documentation.
3377 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
3378 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
3379 (AT_CHECK_JAVA_GREP): New.
3380 (Java parser class modifiers): New test.
3381 (Java parser class extends and implements): New test.
3382
3383 Model exception propagation better with throws and lex_throws.
3384 * data/java.m4 (b4_list2): New.
3385 (throws): Change default.
3386 * data/lalr1.java (yyaction): Add throws.
3387 (parse): Add lex_throws in addition to throws.
3388 * doc/bison.texinfo (throws, lex_throws): Add documentation.
3389 * tests/java.at (Java throws specifications): New test.
3390
3391 Improve documentation for Java parsers.
3392 * doc/bison.texinfo (Java Parsers): Add subsections.
3393 Don't quote first argument of %define.
3394 (Java Bison Interface): Document output files. Move documentation
3395 of parser class and merge into Java Parser Interface. Document
3396 features that error out. Document directives with no effect.
3397 Move note about Javadoc higher.
3398 (Java Semantic Values): Explicitly mention stype.
3399 Document that generic types cannot be used.
3400 (Java Location Values): Use @deftypeivar. Document constructors.
3401 Correct return value for toString.
3402 (Java Parser Interface): List undocumented constants/fields.
3403 Move documentation of fields added by %parse-param closer to list
3404 of members. Document that token names are added as fields.
3405 Document constructors accurately. Remove error method.
3406 (Java Scanner Interface): Move note on %pure-parser to Java Bison
3407 Interface. Describe %code lexer and yylex accutately.
3408 Remove documentation that does not match the code.
3409 (Java Action Features): New.
3410 (Java Differences): Add reference. Add item on semantic values.
3411 Add note about @{ ... @}. Clarify %% epilogue placement.
3412 (Java Declarations Summary): New.
3413
3414 Fix Java skeleton.
3415 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
3416 (b4_remove_comma): Quote test argument.
3417 (b4_identification): Remove "bison" field.
3418 * tests/java.at (Java parser class and package names): New test.
3419 (Java %parse-param and %lex-param): New test.
3420 (Java stype, position_class and location_class): New test.
3421
f259e4e6
PB
34222008-10-31 Di-an Jan <dianj@freeshell.org>
3423
3424 * data/lalr1.jave: Update copyright years.
3425 (YYParser): Correct name of "generated from" file in Javadoc:
3426 use b4_file_name instead of @ofile@.
3427 (Location constructor): Correct Javadoc parameter name.
3428 (yylloc): Add missing opening m4 quote after b4_location_if.
3429 This removes a stray [ in the Javadoc of Lexer.getStartPos.
3430 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
3431 (YYParser constructor): Correct Javadoc parameter name.
3432
cae5057f
JD
34332008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
3434
3435 Always put auxiliary code files in the same dir as other output files.
3436 * src/files.c (compute_file_name_parts): When the user specifies
3437 --output but not --file-prefix, extract the directory prefix from the
3438 file prefix not from the grammar file name. This affects the location
3439 of files like location.hh generated by the C++ skeleton. The includes
3440 in the other output files require this fix.
3441 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
3442 for expected output files.
3443 (Output files): Add a test for the above.
3444
4af432ba
JD
34452008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
3446
3447 * gnulib: Update submodule to HEAD.
3448
e26d4e43
JD
34492008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3450
3451 Update copyright year.
3452 * src/files.c: Here.
3453
c0ee9e21
DJ
34542008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
3455
3456 Don't overwrite the input file.
3457 * src/files.c (output_file_name_check): Fatal error if using input file
3458 for output.
3459 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
3460 argument.
3461 (Conflicting output files): Add test.
3462
482dc52f
AD
34632008-10-28 Akim Demaille <demaille@gostai.com>
3464
3465 Space changes.
3466 * data/lalr1.cc: Formatting changes.
3467
52cbbe84
AD
34682008-10-28 Akim Demaille <demaille@gostai.com>
3469
3470 Don't define debugging functions when !YYDEBUG.
3471 * data/lalr1.cc (debug_stream, set_debug_stream)
3472 (debug_level_type, debug_level, set_debug_level): Don't
3473 declare them when YYDEBUG is not defined.
3474 The implementation are already YYDEBUG-aware.
3475
0925d5bf
AD
34762008-10-28 Akim Demaille <demaille@gostai.com>
3477
3478 Prefer "continue" for empty loop bodies.
3479 * etc/bench.pl.in: Use "continue" instead of {}.
3480
cf98343c
AD
34812008-10-28 Akim Demaille <demaille@gostai.com>
3482
3483 Space and comments changes.
3484 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3485 * data/c.m4, data/lalr1.cc: Space changes.
3486
9f467b7d
AD
34872008-10-28 Akim Demaille <demaille@gostai.com>
3488
3489 Make gnulib a submodule.
3490 * gnulib: New.
3491 * .gitmodules (gnulib): New.
3492
0f0e1ace
JD
34932008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3494
3495 Fix yyerror_range for user-defined location type in C++. Reported by
3496 Georg Sauthoff at
3497 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3498 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3499 * THANKS (Georg Sauthoff): Add.
3500
548e2104
JD
35012008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3502
3503 Update several administrative files mainly to facilitate releasing.
3504 * HACKING (Administrivia): Make the git-merge-changelog notes more
3505 helpful.
3506 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3507 (Release Procedure): Update for git and add numerous details that were
3508 previously missing.
3509 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3510 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3511 that announcements don't claim we bootstrapped with whatever bison
3512 happened to be in PATH. Add flex as a bootstrap tool.
3513 * Makefile.maint: Remove, previously replaced by maint.mk.
3514 * Makefile.cfg: Remove, and migrate settings to...
3515 * cfg.mk: ... here for the sake of `make announcement'.
3516 * bootstrap.conf (gnulib_modules): Add announce-gen.
3517 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3518 Berry.
3519
ddf17a6e
PB
35202008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3521
3522 Small but important bugfixes for the Java skeleton.
3523 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3524 (yy_symbol_print): Call toString on yyvaluep.
3525
e1145ad8
AD
35262008-08-29 Akim Demaille <demaille@gostai.com>
3527
3528 Clarify UPDATED use.
215b40ac 3529 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 3530 not to the release date of Bison.
215b40ac 3531 Reported by Joel E. Denny.
e1145ad8 3532
0df72d78
AD
35332008-08-29 Akim Demaille <demaille@gostai.com>
3534
3535 * README: Update FAQ pointer.
3536 Reported by Joel E. Denny.
3537
9a90b6bb
EB
35382008-08-27 Eric Blake <ebb9@byu.net>
3539
3540 Resync m4sugar from autoconf.
3541 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3542 (m4_init): Adjust to latest m4.git changes.
3543 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3544 effects.
3545 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3546 (_m4_list_cmp): Reduce side effects.
3547
65015668
AD
35482008-08-27 Akim Demaille <demaille@gostai.com>
3549
3550 Check yyerrok in calc.at.
215b40ac
EB
3551 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3552 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3553 expected.
65015668 3554
98e26a92
AD
35552008-08-27 Akim Demaille <demaille@gostai.com>
3556
3557 Support yyerrok in lalr1.cc.
3558 YYBACKUP is still to import back into lalr1.cc.
215b40ac 3559 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 3560
86c0e784
JD
35612008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3562
3563 For maintainer-check*, don't recompile for a $(VERSION) update.
3564 * cfg.mk: New file.
3565 (_is-dist-target): Override the one in GNUmakefile.
3566 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3567
88511166
JD
35682008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3569
3570 Update for recent change to gnulib.
3571 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3572 string.h now.
3573
6bbb2ed5
EB
35742008-08-15 Eric Blake <ebb9@byu.net>
3575
d67c52e8
EB
3576 Remaining m4sugar merge from autoconf.
3577 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3578 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3579 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3580 * src/output.c (output_skeleton): Tell m4 how to find it.
3581
6bbb2ed5
EB
3582 Partial m4sugar merge from autoconf: m4_map.
3583 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3584 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3585 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3586 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3587 for empty list.
3588 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3589 Likewise.
3590 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3591 declares it.
3592
8dce3875
JD
35932008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3594
3595 Keep .version and PACKAGE_VERSION in sync.
3596 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3597 dependency, and add comments justifying this in more detail. Discussed
3598 starting at
3599 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3600
882a1fbf
EB
36012008-08-06 Eric Blake <ebb9@byu.net>
3602
a3764451
EB
3603 Partial m4sugar merge from autoconf: m4_shiftn.
3604 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3605 (m4_shift2, m4_shift3): New macros.
3606 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3607 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3608 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3609 * data/java.m4 (b4_remove_comma): Likewise.
3610
882a1fbf
EB
3611 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3612 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3613 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3614 (m4_init): Consolidate wrapped text into single m4_wrap.
3615 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3616 in wrapped text.
3617
a30e920d
EB
36182008-08-05 Eric Blake <ebb9@byu.net>
3619
dfcc5959
EB
3620 Partial m4sugar merge from autoconf: builtins, version.m4.
3621 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3622 (m4_prepend): Remove, as it is unused and inherently quadratic,
3623 whereas m4_append is linear in newer m4.
3624 (m4_mkstemp): New builtin.
3625 (m4_symbols): Make rename conditional.
3626 (m4_version_prereq): Ensure fatal error if used in bison, which
3627 intentionally lacks version.m4.
3628
a30e920d
EB
3629 Fix comments in m4sugar.
3630 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3631
445b7470
JD
36322008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3633
3634 Update for recent .gitignore fix in Gnulib.
3635 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3636 anchored .gitignore entries.
3637
a1e50014
JD
36382008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3639
3640 Set gnu or gnits strictness.
3641 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3642 development and gnits strictness for releases. Based on Eric Blake's
3643 suggestion at
3644 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3645
d43f77e7
PB
36462008-07-31 Paolo Bonzini <bonzini@gnu.org>
3647
3648 * NEWS: Clarify documentation of %language.
3649
fee2ed87
PB
36502008-07-31 Paolo Bonzini <bonzini@gnu.org>
3651
3652 Support usage of git-merge-changelog.
3653 * .gitattributes: New.
3654 * HACKING: Document usage of git-merge-changelog.
3655 * bootstrap: Install git-merge-changelog entries in .git/config
3656 if appropriate.
3657
78029cd5
JD
36582008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3659
3660 Remove remaining dependence on CVS Id keyword.
3661 * ChangeLog: For the sake of people still using CVS, don't use dollars
3662 when mentioning Id.
3663 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3664 unusual anyway.
3665 * data/xslt/xml2dot.xsl: Likewise.
3666 * data/xslt/xml2text.xsl: Likewise.
3667 * data/xslt/xml2xhtml.xsl: Likewise.
3668 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3669 * doc/Makefile.am (neutralize): Remove, no longer needed.
3670 (.x.1): Don't use neutralize.
3671 (edit): Don't substitute for ID.
3672 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3673
c53d18b1
JD
36742008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3675
3676 Fix dependence on computed configure variables.
3677 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3678 $(top_srcdir)/configure.ac so that changes to computed variables, such
3679 as PACKAGE_VERSION, are seen.
3680 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3681
5523ac79
JD
36822008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3683
3684 Update copyright dates for recent changes.
3685 * Makefile.am: Here.
3686 * src/Makefile.am: Here.
3687 * src/reduce.c: Here.
3688 * tests/reduce.at: Here.
3689
8fa36911
JD
36902008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3691
3692 Use git-version-gen for version names between releases.
3693 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3694 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3695 * .prev-version: New.
3696 * .version.in: Remove.
78029cd5 3697 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
3698 revision.
3699 * GNUmakefile: Remove, now copied from Gnulib.
3700 * Makefile.am: Add code suggested by comments in
3701 build-aux/git-version-gen.
3702 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3703 .prev-version, and .version.
3704 * NEWS (2.3b+): Rename to...
3705 (?.?): ... this because we're dropping the "+" version naming scheme,
3706 but, in general, we still can't be sure of our next release name.
3707 * bootstrap: Add a quick hack to remove from .gitignore the
3708 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3709 entry. This should really be fixed in gnulib instead.
3710 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3711 * configure.ac (AC_INIT): Set version name by invoking
3712 build-aux/git-version-gen.
3713 (AC_CONFIG_FILES): Remove .version, now generated by
3714 build-aux/git-version-gen.
3715 * maint.mk: New, copied from coreutils.
3716 * doc/.cvsignore (bison.1): Add.
3717 * doc/.gitignore (/bison.1): Add.
3718 * doc/bison.1: Remove, generated.
3719 * src/.cvsignore (revision.c): Remove.
3720 * src/.gitignore (/revision.c): Remove.
3721 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3722 (BUILT_SOURCES): Remove revision.c.
3723 (revision.c): Remove.
3724 * src/getargs.c (version): Don't print revision after the VERSION.
3725 * src/revision.h: Remove.
3726
bcf07cb7
JD
37272008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3728
3729 Fix untranslatable composition of sentences. Reported by Goran
3730 Uddeborg at
3731 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3732 * THANKS (Goran Uddeborg): Add.
3733 * src/reduce.c (reduce_print): Report the number of nonterminals and
3734 rules useless in the grammar in separate sentences.
3735 * tests/reduce.at (Useless Rules): Update output.
3736 (Reduced Automaton): Likewise.
3737 (Underivable Rules): Likewise.
3738 (Empty Language): Likewise.
3739
9aacab9a
JD
37402008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3741
3742 Fix some .gitignore and .cvsignore problems.
3743 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3744 (insert_vc_ignore): ... this new function, which prepends `/' to all
3745 .gitignore entries before passing them to insert_sorted_if_absent.
3746 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3747 .cvsignore files are maintained even though Bison developers run
3748 bootstrap while using Git.
3749 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3750 unneeded by Bison.
3751 (gnulib): Add.
3752 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3753 unneeded. Reported by Eric Blake.
3754 * lib/.gitignore (/*~): Add.
3755 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3756 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3757 Blake.
3758 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3759
a9fc7990
JD
37602008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3761
3762 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3763 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3764 * bootstrap.conf (gnulib_modules): Add unsetenv.
3765 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3766 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3767 (/setenv.m4): Add.
3768 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3769 the first argument because it may become position-dependent, and unset
3770 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3771 Add comments explaining these issues in more detail.
3772
0f1d6f10
JD
37732008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3774
3775 Add .gitignore everywhere based on .cvsignore.
3776 * .gitignore: New.
3777 * build-aux/.gitignore: New.
3778 * data/.gitignore: New.
3779 * doc/.gitignore: New.
3780 * etc/.gitignore: New.
3781 * examples/.gitignore: New.
3782 * examples/calc++/.gitignore: New.
3783 * lib/.gitignore: New.
3784 * m4/.gitignore: New.
3785 * po/.gitignore: New.
3786 * runtime-po/.gitignore: New.
3787 * src/.gitignore: New.
3788 * tests/.gitignore: New.
3789
7bd1665a
JD
37902008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3791
3792 * NEWS (2.3b+): New section, empty for now.
3793 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3794
72c5b982
JD
37952008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3796
3797 * NEWS (2.3b): Update release date since there has been a delay in
3798 getting the announcements and tarballs out.
3799
bd02cd5d
JD
38002008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3801
3802 * NEWS: Version 2.3b.
3803 * configure.ac (AC_INIT): Likewise.
3804 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3805
9126263e
JD
38062008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3807
3808 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3809 been doing it for years.
3810 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3811 (Release Procedure): Add FIXME about make alpha being unmaintained.
3812
fa6aa7b3
JD
38132008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3814
3815 * data/yacc.c: Reformat m4 a little for readability.
3816 * src/lalr.c (build_relations): Correct comment.
3817
d30b312d
JMG
38182008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3819
3820 DJGPP specific issue.
3821 * djgpp/config.sed: Fixes required to run configure scripts generated
3822 by autoconf 2.62.
3823
138d4cd9
JD
38242008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3825
3826 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3827 coordinator@translationproject.org.
3828
8f7e2e1f
JD
38292008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3830
3831 * THANKS: Add Eric Blake.
3832
f55efa38
JD
38332008-04-23 Eric Blake <ebb9@byu.net>
3834
3835 Revert prior patch, by working around autoconf regression.
3836 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3837 ("Output file name: ("): Uncomment test.
3838 ("Output file name: )"): Likewise.
3839 Based on an idea from Noah Misch.
3840
096c9f9d
JD
38412008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3842
3843 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3844 2.61. Reported by Juan Manuel Guerrero at
3845 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3846 * tests/output.at ("Output file name: ("): Comment out test case for
3847 now.
3848 ("Output file name: )"): Likewise.
3849
0f664b89
JD
38502008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3851
3852 * GNUmakefile: Update git-version-gen invocation so make dist
3853 succeeds.
3854
1cfe6375
JD
38552008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3856
3857 Update to the current gnulib CVS repository, and fix trigraph handling
3858 in Bison.
3859 * bootstrap: Update gnulib CVS repository URL.
3860 (symlink_to_dir): Encapsulate the code that guarantees the destination
3861 directory exists into...
3862 (check_dst_dir): ... this new function, and...
3863 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3864 fail when copying files into lib/uniwidth/.
3865 * src/output.c (prepare_symbols): When writing yytname muscles, where
3866 symbol names will be encoded in C-string literals, tell quotearg to
3867 escape trigraphs. This used to be the default in gnulib.
3868 * tests/regression.at (Token definitions): Because of the change in
3869 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3870 escapes trigraphs in symbol names. Thus, yytname no longer has
3871 trigraphs unnecessarily doubly escaped. Update test case output.
3872 Extend test case to be sure Bison's own error messages will no longer
3873 have trigraphs in symbol names unnecessarily escaped once.
3874
74c52fc8
JD
38752008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3876
3877 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3878 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3879 * .cvsignore: Add .version.
3880 * .version.in: New.
3881 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3882 * configure.ac (AC_CONFIG_FILES): Add .version.
3883 * build-aux/.cvsignore: Add git-version-gen.
3884
8e55b3aa
JD
38852008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3886
3887 * NEWS (2.3a+): Mention that -g now takes an argument.
3888 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3889 consistency. Update the -g and -x entries now that they take
3890 arguments. Use brackets to indicate optional arguments.
3891 * src/getargs.c (usage): Explain the relationship between arguments of
3892 long and short options more completely. Document --defines and -d
3893 separately since the former takes an argument but, for POSIX Yacc, the
3894 latter does not.
3895 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 3896 (getargs): Sort cases.
8e55b3aa 3897
59c5ac72
AD
38982008-02-28 Akim Demaille <demaille@gostai.com>
3899
3900 * doc/bison.texinfo: Fix a few typos.
3901
118d4978
AD
39022008-02-28 Akim Demaille <akim@epita.fr>
3903
3904 * doc/bison.texinfo (Bison Options): Document -W.
3905 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3906
7020f1e9
AD
39072008-02-28 Akim Demaille <akim@epita.fr>
3908
3909 * src/getargs.c (short_options): Split and sort for readability.
3910 -g and -x take optional arguments, just like their long options.
3911 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3912 understand.
3913 Fix the handling of $opt which resulted in all the argument to be
3914 considered as optional.
3915
59da312b
JD
39162008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
3917
3918 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
3919 say its interface is experimental.
3920 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
3921 Java.
3922 (Bison Options): In the -L and --language entry, mention Java.
3923 (Java Bison Interface): Say the interface is experimental.
3924 * src/getargs.c (usage): Mention -L and --language.
3925
3926 * NEWS (2.3a+): Say the push parsing interface is experimental.
3927 * doc/bison.texinfo (Push Decl): Likewise.
3928 (Decl Summary): Likewise in the "%define api.push_pull" entry.
3929 (Push Parser Function): Likewise.
3930 (Pull Parser Function): Likewise.
3931 (Parser Create Function): Likewise.
3932 (Parser Delete Function): Likewise.
3933 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
3934 yypull_parse, and yypush_parse entries.
3935
3936 * NEWS (2.3a+): Mention XML support, and say the schema is
3937 experimental.
3938 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
3939 * src/getargs.c (usage): Say the XML schema is experimental.
3940
3941 * NEWS (2.3a+): Say option instead of flag.
3942
2bb3ebec
WP
39432008-02-21 Wojciech Polak <polak@gnu.org>
3944
3945 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
3946 text.
3947
333e670c
JD
39482008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
3949
3950 Fix impure push parser compile error reported by Bob Rossi at
3951 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
3952 * data/yacc.c: Clean up whitespace in the output a little.
3953 (yypstate_allocated): Define for impure push parsers regardless of
3954 whether the pull interface is also requested.
3955 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
3956 check impure push parsers without the pull interface.
3957
3958 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
3959 yyerror takes arguments specified by %parse-param while yypstate_new
3960 does not.
3961 * doc/bison.texinfo (Parser Create Function): Document that
3962 yypstate_new returns 0 for multiple impure parser instances.
3963 * tests/push.at (Push Parsing: Multiple impure instances): Update
3964 expected stderr output.
3965
798096e1
JD
39662008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
3967
3968 * runtime-po/POTFILES.in (push.c): Remove.
3969
9ca7f077
JD
39702008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3971
3972 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
3973 * data/push.c: Rename to...
3974 * data/yacc.c: ... this, overwriting it.
3975 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
3976 `%push-pull-parser' -> `%define api.push_pull "both"'.
3977 Remove old yacc.c tests, and update push.c tests to yacc.c.
3978
42ee26bb
JD
39792008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
3980
3981 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
3982 `"%code top" blocks' instead of `%code "top" blocks'.
3983 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
3984 Clean up whitespace in the output a little.
3985
b1cc23c4
JD
39862008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3987
3988 Fix documentation problems reported by Tim Josling at
3989 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
3990 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
3991 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
3992 integers. Explain the effect of literal string aliases on error
3993 messages. Copy token 0 documentation from the C++ skeleton
3994 documentation.
3995
ab7f29f8
JD
39962008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
3997
3998 Accept a token number in a %left, %right, or %nonassoc for POSIX
3999 conformance. Reported by Tim Josling at
4000 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
4001 * NEWS (2.3a+): Mention.
4002 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
4003 and code numbers are treated by precedence declarations.
4004 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
4005 of symbols.1.
4006 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
4007 of symbol.
4008 (symbol.prec): New, just like symbol but allows INT.
4009 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
4010 longer holds.
4011 * tests/regression.at (Token number in precedence declaration): New
4012 test case.
4013
a924ef36
JMG
40142008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4015
4016 DJGPP specific issues.
4017 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
4018 be changed. Copyright timestamp adjusted.
4019 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
4020 be changed. Copyright timestamp adjusted.
4021 * djgpp/config.site: Copyright timestamp adjusted.
4022 * djgpp/config_h.sed: Copyright timestamp adjusted.
4023 * djgpp/djunpack.bat: Copyright timestamp adjusted.
4024 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
4025 filename translation list.
4026 * djgpp/subpipe.c (init_subpipe): Check the environment variables
4027 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
4028 files shall be created. Before trying to use the temp dir where the
4029 environment variable points to check that the dir really exists. If
4030 not default to the cwd as temp dir. Copyright timestamp adjusted.
4031 * djgpp/subpipe.h: Copyright timestamp adjusted.
4032 * djgpp/testsuite.sed: Copyright timestamp adjusted.
4033
389c8cfd
PE
40342008-01-30 Paul Eggert <eggert@cs.ucla.edu>
4035
4036 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
4037
5d1cfef4
PE
40382008-01-09 Paul Eggert <eggert@cs.ucla.edu>
4039
4040 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
4041 Problem reported by Claudio Saavedra in
4042 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
4043
e2dcf996
WP
40442008-01-05 Wojciech Polak <polak@gnu.org>
4045
4046 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
4047 document's title with the input grammar file name.
4048
da730230
JD
40492007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
4050
4051 Automate regression testing of the XML/XSLT implementation. Discussed
4052 starting at
4053 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
4054 * configure.ac (XSLTPROC): New substitution.
4055 * Makefile.am (maintainer-xml-check): New phony target invoking...
4056 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
4057 invoking make maintainer-check with BISON_TEST_XML=1.
4058 * tests/atlocal.in (XSLTPROC): New.
4059 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
4060 not to report reachable memory when Bison is expected to have a
4061 non-zero exit status and (2) to compare XML/XSLT output with --graph
4062 and --report=all output for every working grammar when
4063 BISON_TEST_XML=1.
4064 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
4065 (AT_BISON_CHECK_XML): New.
4066 (AT_QUELL_VALGRIND): New.
4067 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
4068 (AT_CHECK): ... don't redefine this since this was the old way to
4069 quell Valgrind.
4070 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
4071 AT_BISON_CHECK invocations.
4072 * tests/c++.at: Likewise.
4073 * tests/calc.at: Likewise.
4074 * tests/conflicts.at: Likewise.
4075 * tests/cxx-type.at: Likewise.
4076 * tests/existing.at: Likewise.
4077 * tests/glr-regression.at: Likewise.
4078 * tests/headers.at: Likewise.
4079 * tests/input.at: Likewise.
4080 * tests/java.at: Likewise.
4081 * tests/output.at: Likewise.
4082 * tests/push.at: Likewise.
4083 * tests/reduce.at: Likewise.
4084 * tests/regression.at: Likewise.
4085 * tests/sets.at: Likewise.
4086 * tests/skeletons.at: Likewise.
4087 * tests/synclines.at: Likewise.
4088 * tests/torture.at: Likewise.
4089 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
4090 tends to hang xsltproc.
4091 (Big horizontal): Likewise.
4092
408476bc
JD
40932007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4094
4095 In XML output, remove redundant class attribute on symbol element.
4096 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
4097 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
4098 look up a symbol to determine whether it's a nonterminal or terminal.
4099 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
4100 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
4101
4102 Add prec/assoc information to XML output.
4103 * src/gram.c (grammar_rules_print_xml): For each rule that has a
4104 %prec, add a percent_prec attribute.
4105 * src/print-xml.c (print_grammar): For each terminal that has a
4106 precedence or associativity, add a prec or assoc attribute.
4107 (xml_indent): New.
4108 (xml_puts): Use xml_indent.
4109 (xml_printf): Use xml_indent.
4110 * src/print-xml.h (xml_indent): Prototype.
4111
4112 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
4113 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
4114
d4a26c48
JD
41152007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4116
4117 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
4118 (bison:ruleByNumber): ... this for clarity.
4119 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
4120 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
4121 (xsl:template match="reduction"): Update.
4122 (xsl:template match="item"): Update.
4123 (xsl:template match="reduction"): Update.
4124
4125 In the XML output, don't print the list of rules where symbols appear.
4126 Compute it in XSLT instead. Discussed at
4127 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
4128 * data/xslt/bison.xsl (bison:ruleByLhs): New.
4129 (bison:ruleByRhs): New.
4130 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
4131 bison:ruleByRhs.
4132 (xsl:template match="terminal/rule"): Remove.
4133 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4134 bison:ruleByRhs.
4135 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4136 Remove.
4137 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
4138 bison:ruleByRhs and mode="number-link" for rule template.
4139 (xsl:template match="terminal/rule"): Remove.
4140 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4141 bison:ruleByRhs and mode="number-link" for rule template.
4142 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4143 Rewrite as...
4144 (xsl:template match="rule" mode="number-link"): ... this.
4145 * src/print-xml.c (print_grammar): Don't print the list of rules.
4146
ef1b4273
JD
41472007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4148
4149 Don't let --report affect XML output; always print all information.
4150 Discussed at
4151 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
4152 * src/conflicts.c (log_resolution): Implement.
4153 * src/print-xml.c (print_core): Implement.
4154 (print_state): Implement.
4155 (print_xml): Implement.
4156
4157 * NEWS (2.3a+): Fix quotes.
4158 * src/parse-gram.y (prologue_declaration): For consistency with -v,
4159 don't let %verbose clear the list specified by --report.
4160
0f6cd9e3
AD
41612007-11-26 Akim Demaille <akim@epita.fr>
4162
4163 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
4164
d80fb37a
JD
41652007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
4166
4167 In the XML output, list useless and unused symbols and rules with the
4168 useful ones and add a "usefulness" attribute. Discussed starting at
4169 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
4170 * src/gram.c (grammar_rules_partial_print_xml): Remove.
4171 (grammar_rules_print_xml): Print all rules instead of just those
4172 useful in the grammar, and add a "usefulness" attribute.
4173 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
4174 * src/print-xml.c (print_rules_useless_in_parser): Remove.
4175 (print_grammar): Print all nonterminals instead of just useful ones,
4176 and add a "usefulness" attribute to nonterminals and terminals.
4177 (print_xml): Don't print a separate "reductions" or
4178 "rules-useless-in-parser" element.
4179 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
4180 (reduce_xml): Remove.
4181 (reduce_token_unused_in_grammar): New.
4182 (reduce_nonterminal_useless_in_grammar): New.
4183 * src/reduce.h (reduce_xml): Remove prototype.
4184 (reduce_token_unused_in_grammar): Add prototype.
4185 (reduce_nonterminal_useless_in_grammar): Add prototype.
4186 * data/xslt/xml2text.xsl: Update for XML changes.
4187 * data/xslt/xml2xhtml.xsl: Update for XML changes.
4188 * tests/reduce.at (Useless Terminals): Update output.
4189 (Useless Rules): Update output.
4190 (Reduced Automaton): Update output.
4191
4192 Say "Terminals unused in grammar" instead of "Unused terminals".
4193 * NEWS (2.3a+): Update.
4194 * doc/bison.texinfo (Understanding): Update example output.
4195 * src/reduce.c (reduce_output): Implement.
4196 * data/xslt/xml2text.xsl: Implement.
4197 * data/xslt/xml2xhtml.xsl: Implement.
4198
1bb2bd75
JD
41992007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
4200
4201 Accept --report-file=FILE to override the default `.output' filename.
4202 * NEWS (2.3a+): Mention.
4203 * doc/bison.texinfo (Bison Options): Add an entry.
4204 * src/files.c (compute_output_file_names): Don't override
4205 spec_verbose_file if already set.
4206 * src/getargs.c (usage): Document --report-file.
4207 (REPORT_FILE_OPTION): New anonymous enum member.
4208 (long_options): Add entry for it.
4209 (getargs): Add case for it setting spec_verbose_file.
4210
4211 * build-aux/cross-options.pl: Don't record a short option just because
4212 there's an arg.
4213 * doc/.cvsignore: Add yacc.1.
4214
a005a9c4
AD
42152007-11-14 Akim Demaille <akim@epita.fr>
4216
4217 * doc/yacc.1.in: New.
4218 * configure.ac, doc/Makefile.am: Adjust.
4219 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
4220 config.h symbol.
4221 Use AC_SUBST for assignments too.
4222 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
4223
cff03fb2
JD
42242007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4225
4226 * src/gram.c: Remove comments that duplicate comments in gram.h.
4227
4228 When reporting useless rules and nonterminals, say "useless in grammar"
4229 instead of "useless", and say "useless in parser" instead of "never
4230 reduced". Discussed starting at
4231 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
4232 * NEWS (2.3a+): Mention this change.
4233 * data/xslt/xml2text.xsl: Update output text and expected input XML
4234 element names to match changes below.
4235 * data/xslt/xml2xhtml.xsl: Likewise.
4236 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4237 Contents: "Rules useless in parser due to conflicts".
4238 * doc/bison.texinfo (Decl Summary): Reword a little.
4239 (Understanding): Update example output for changes below.
4240 * src/gram.c: (rule_useful_p): Rename to...
4241 (rule_useful_in_grammar_p): ... this.
4242 (rule_useless_p): Rename to...
4243 (rule_useless_in_grammar_p): ... this.
4244 (rule_never_reduced_p): Rename to...
4245 (rule_useless_in_parser_p): ... this.
4246 (grammar_rules_print): Update for renames.
4247 (grammar_rules_print_xml): Update for renames.
4248 (grammar_rules_never_reduced_report): Rename to...
4249 (grammar_rules_useless_report): ... this since it is used for either
4250 kind of useless rule.
4251 * src/gram.h: Reword comments and update function names in prototypes.
4252 * src/main.c (main): Say "rule useless in parser due to conflicts".
4253 * src/print-xml.c (print_rules_never_reduced): Rename to...
4254 (print_rules_useless_in_parser): ... this, and rename output XML
4255 element "rules-never-reduced" to "rules-useless-in-parser".
4256 (print_xml): Update for rename.
4257 * src/print.c (print_results): Say "Rules useless in parser due to
4258 conflicts".
4259 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4260 (nonterminals_reduce): Say "nonterminal useless in grammar".
4261 (reduce_output): Say "Nonterminals useless in grammar".
4262 Say "Rules useless in grammar".
4263 (reduce_xml): Rename output XML element "useless" to
4264 "useless-in-grammar".
4265 (reduce_print): Don't report the count of grammatically useless rules
4266 as "rules never reduced" just because %yacc is specified.
4267 In the correct report of this count, say nonterminal(s) and rule(s)
4268 "useless in grammar".
4269 * tests/conflicts.at (S/R in initial): Update expected output.
4270 (Defaulted Conflicted Reduction): Likewise.
4271 (Unreachable States After Conflict Resolution): Likewise.
4272 * tests/existing.at (GNU pic Grammar): Likewise.
4273 * tests/reduce.at (Useless Nonterminals): Likewise.
4274 (Useless Rules): Likewise.
4275 (Reduced Automaton): Likewise.
4276 (Underivable Rules): Likewise.
4277 (Empty Language): Likewise.
4278
66f0441d
JD
42792007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4280
4281 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4282 here document and before the EOF so that BSD's implementation of Bourne
4283 shell doesn't parse the delimiter as part of the here document.
4284 * doc/.cvsignore: Add cross-options.texi.
4285 * src/getargs.c (usage): Add a blank line after the warning categories.
4286
d0ee4105
PB
42872007-11-08 Paolo Bonzini <bonzini@gnu.org>
4288
4289 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4290
e8b1fb9b
AD
42912007-11-05 Akim Demaille <akim@epita.fr>
4292
4293 Remove Id: from bison.1.
4294 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4295 (perl -0777 -pi -e 's/\.PP\nId): New.
4296 (.x.1): Use it to ignore the version control revision.
4297
2f7a96b5
AD
42982007-11-05 Akim Demaille <demaille@gostai.com>
4299
4300 * build-aux/Makefile.am: Ship cross-options.pl.
4301 * doc/Makefile.am: Always refer to cross-options.texi with
4302 $(srcdir).
4303 (MAINTAINERCLEANFILES): Add it.
4304
f4101aa6
AD
43052007-11-04 Akim Demaille <demaille@gostai.com>
4306
4307 Generate the long/short option cross-table.
4308 * build-aux/cross-options.pl: New.
4309 * doc/Makefile.am (cross-options.texi): New.
4310 * doc/bison.texinfo: Use it.
4311
727a1401
AD
43122007-11-04 Akim Demaille <demaille@gostai.com>
4313
4314 Generate bison.1 using help2man.
4315 * doc/common.x, doc/bison.x: New.
4316 * doc/Makefile.am (bison.1, .x.1): New.
4317 The code is taken from autoconf-2.61/man/Makefile.am.
4318 * configure.ac: Look for help2man.
4319
6aeb9c57
AD
43202007-11-04 Akim Demaille <demaille@gostai.com>
4321
4322 Complete --help.
4323 * src/getargs.c (usage): Document -W, make it clear that -d,
4324 -g and -x have optional arguments.
4325
d7be4085
AD
43262007-11-04 Akim Demaille <demaille@gostai.com>
4327
4328 Find sha1sum when named gsha1sum.
4329 * bootstrap (find_tool): New.
4330 ($SHA1SUM): New.
4331
d9df47b6
JD
43322007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4333
4334 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
4335 at
4336 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
4337 * NEWS (2.3a+): Mention.
4338 * data/bison.m4 (b4_pure_if): Don't define it here.
4339 * data/c.m4 (b4_identification): Depend on individual skeletons to
4340 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
4341 values of the %define variables api.pure or api.push_pull. Define
4342 YYPURE, YYPUSH, and YYPULL accordingly.
4343 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
4344 glr.cc has already defined b4_pure_flag.
4345 * data/push.c: Define b4_pure_if based on `%define api.pure'.
4346 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 4347 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
4348 * doc/bison.texinfo (Pure Decl): Update.
4349 (Push Decl): Update.
4350 (Decl Summary): Add api.pure to %define entry.
4351 In %pure-parser entry, say it's deprecated and reference %define.
4352 (Pure Calling): Update.
4353 (Error Reporting): Update.
4354 (C++ Scanner Interface): Update.
4355 (How Can I Reset the Parser): Update.
4356 (Table of Symbols): In %pure-parser entry, say it's deprecated and
4357 reference %define.
4358 * src/getargs.c (pure_parser): Remove global variable.
4359 * src/getargs.h (pure_parser): Remove extern.
4360 * src/output.c (prepare): Don't define pure_flag muscle.
4361 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
4362 wrapper around `%define api.pure'.
4363 * tests/calc.at (Simple LALR Calculator): Update.
4364 (Simple GLR Calculator): Update.
4365 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
4366 Update.
4367 (GLR: Resolve ambiguity, pure, locations): Update.
4368 (GLR: Merge conflicting parses, pure, no locations): Update.
4369 (GLR: Merge conflicting parses, pure, locations): Update.
4370 * tests/glr-regression.at (Uninitialized location when reporting
4371 ambiguity): Update
4372 * tests/input.at (Unused %define api.pure): New test case.
4373 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
4374 AT_PURE_IF and AT_PURE_AND_LOC_IF.
4375 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4376
c373bf8b
JD
43772007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4378
4379 %define push_pull -> %define api.push_pull. Discussed starting at
4380 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
4381 * data/push.c: Expect the new name.
4382 * data/yacc.c: Likewise.
4383 * doc/bison.texinfo (Push Decl): Update.
4384 (Decl Summary): Update %define entry.
4385 (Push Parser Function): Update.
4386 (Pull Parser Function): Update.
4387 (Parser Create Function): Update.
4388 (Parser Delete Function): Update.
4389 * tests/calc.at (Simple LALR Calculator): Update.
4390 * tests/input.at (%define enum variables): Update.
4391 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4392 (Push Parsing: Multiple impure instances): Update.
4393 (Push Parsing: Unsupported Skeletons): Update.
4394 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
4395 (Exploding the Stack Size with Malloc): Update.
4396
4397 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
4398 other entries some.
4399
32f19b6b
JD
44002007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
4401
4402 For the XML output's terminal element, rename @number to @token-number,
4403 and add @symbol-number. In the nonterminal element, rename @number to
4404 @symbol-number. Discussed starting at
4405 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
4406 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
4407 renames.
4408 (xsl:template match="nonterminal"): Likewise.
4409 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
4410 (xsl:template match="nonterminal"): Likewise.
4411 * src/print-xml.c (print_grammar): Implement.
4412
255a6b90
JD
44132007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4414
4415 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4416 2007-10-11 change, the child elements here are items not rules.
408476bc 4417 (xsl:template match="item"): New.
255a6b90
JD
4418 (xsl:template match="rule"): Update for new reduced itemset.
4419 (xsl:template match="point"): Remove.
4420 (xsl:template match="empty"): For consistency with --graph, don't
4421 output "/* empty */".
4422 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
4423 line-wrap, don't pass a negative value as first-line-length since this
4424 won't work with the following changes.
4425 (xsl:template name="line-wrap"): Simplify slightly.
4426 (xsl:template name="ws-search"): Eliminate recursion.
4427 * src/print_graph.c (print_core): Don't print a reduction's lookahead
4428 set next to an item whose dot is not at the end of the RHS even if it
4429 happens to be associated with the same rule.
4430
88c78747
JD
44312007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4432
31984206
JD
4433 Add %define lr.keep_unreachable_states.
4434 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
4435 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
4436 * src/main.c (main): Implement it.
4437 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4438 Extend to test it, and fix a typo.
4439
44402007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4441
4442 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
4443 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
4444 the example .output text.
4445 * tests/regression.at (Extra lookahead sets in report): Improve wording
4446 of comments.
4447
b7a70162
WP
44482007-10-17 Wojciech Polak <polak@gnu.org>
4449
4450 * src/print-xml.c (print_grammar): Renamed
4451 <terminal> and <nonterminal> attributes:
4452 "type" to "number" and "symbol" to "name".
4453 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
4454 Use new attribute names.
4455 (xsl:template match="nonterminal"): Likewise.
4456 * data/xslt/xml2xhtml.xsl: Likewise.
4457
a0de5091
JD
44582007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
4459
4460 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
4461 (Option Cross Key): Likewise.
4462
4463 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
4464 next to an item whose dot is not at the end of the RHS even if it
4465 happens to be associated with the same rule.
4466 * src/print.c (print_core): Likewise.
4467 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4468 (Resolved SR Conflicts): Update output.
4469 * tests/regression.at (Extra lookahead sets in report): New test case.
4470
4c20d18d
WP
44712007-10-11 Wojciech Polak <polak@gnu.org>
4472
4473 * src/print-xml.c (print_core): Remove item set
4474 redundancy.
4475 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4476 Improve processing time. Suggested by Joel E. Denny.
4477 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4478 Write xsl:param "required" attribute as comment.
4479 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4480 (xsl:template match="rule"): Support new reduced itemset.
4481 (xsl:template match="point"): Remove.
4482 * data/xslt/xml2xhtml.xsl: Likewise.
4483
f506ad1c
JD
44842007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4485
4486 * src/getargs.c (version): Update copyright year.
4487
21f1b063
JD
44882007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4489
4490 Make xml2dot.xsl and --graph produce the same output.
4491 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
4492 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4493 escaped later.
4494 (xsl:template name="output-node"): Use the new escape template instead
4495 of the string-replace template directly.
4496 (xsl:template name="output-edge"): Likewise.
4497 (xsl:template name="escape"): New, escapes backslashes and newlines in
4498 addition to quotation marks.
4499 * src/graphviz.c (start_graph, output_node, output_edge): Add
4500 whitespace to output for legibility.
4501
4502 Make xml2text.xsl and --report produce the same output, and remove the
4503 XML "conflicts" element since a conflict summary is easily extracted
4504 from the automaton.
4505 * data/xslt/bison.xsl: New.
4506 (xsl:template match="state" mode="bison:count-conflicts): New.
4507 * data/xslt/xml2text.xsl: Import bison.xsl.
4508 (xsl:template match="bison-xml-report"): Instead of styling the
4509 "conflicts" element, style the "automaton" element with mode
4510 "conflicts". Unlike the former, the latter lists S/R and R/R
4511 conflicts for a state on the same line.
4512 (xsl:template match="conflicts"): Remove.
4513 (xsl:template match="conflict"): Remove.
4514 (xsl:template match="terminal"): Line-wrap the list of rules in which
4515 the terminal is used.
4516 (xsl:template match="nonterminal"): Likewise for nonterminals.
4517 (xsl:template match="automaton" mode="conflicts"): New.
4518 (xsl:template match="state" mode="conflicts"): New.
4519 (xsl:template name="line-wrap"): New.
4520 (xsl:template name="ws-search"): New.
4521 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4522 (xsl:template match="bison-xml-report"): Instead of styling the
4523 "conflicts" element, style the "automaton" element with mode
4524 "conflicts."
4525 (xsl:template match="conflicts"): Remove.
4526 (xsl:template match="conflict"): Remove.
4527 (xsl:template match="automaton" mode="conflicts"): New.
4528 (xsl:template match="state" mode="conflicts): New.
4529 * src/conflicts.c (conflicts_output_xml): Remove.
4530 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4531 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4532 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4533 the corresponding XSLT is easier. Also, never wrap between a word and
4534 the comma that follows it.
4535
793fbca5
JD
45362007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4537
4538 Improve C++ namespace support. Discussed starting at
4539 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4540 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4541 b4_namespace_close): New macros that interpret the %define variable
4542 "namespace" so its value can contain "::" to indicate nested
4543 namespaces.
4544 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4545 the above macros.
4546 * data/lalr1.cc (b4_namespace): Likewise.
4547 * data/location.cc (b4_namespace): Likewise.
4548 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4549 inside a new table in the general %define entry. Document `%define
4550 namespace' there as well. Point the %name-prefix entry to it since it
4551 explains it more completely in the case of C++.
4552 (C++ Bison Interface): Mention `%define namespace' instead of
4553 %name-prefix.
4554 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4555 entry suffices.
4556 * tests/c++.at (Relative namespace references): New test case.
4557 (Absolute namespace references): New test case.
4558 (Syntactically invalid namespace references): New test case.
4559 * tests/input.at (C++ namespace reference errors): New test case.
4560
35b8730d
JD
45612007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4562
4563 Add syncline support and location accessor to internal %define
4564 interfaces.
4565 * data/bison.m4 (b4_percent_define_get_loc): New.
4566 (b4_percent_define_get_syncline): New.
4567 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4568 (b4_percent_define_default): Record defining location as line 1 rather
4569 than 0 for the sake of synchronizing #line's, and define
4570 b4_percent_define_syncline(VARIABLE).
4571 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4572 * src/muscle_tab.c (muscle_syncline_grow): New.
4573 (muscle_code_grow): Use muscle_syncline_grow.
4574 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4575 define b4_percent_define_syncline(VARIABLE).
4576 (muscle_percent_define_get_loc): New.
4577 (muscle_percent_define_get_syncline): New.
4578 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4579 remove some unused variables.
4580 (muscle_percent_define_default): Record defining location as line 1
4581 rather than 0 for the sake of synchronizing #line's, and define
4582 b4_percent_define_syncline(VARIABLE).
4583 (muscle_percent_define_check_values): Use
4584 muscle_percent_define_get_loc.
4585 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4586 (muscle_percent_define_get_syncline): Prototype.
4587 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4588 defaults): Update output for location change.
4589 (Complaining during macro argument expansion): Extend to test
4590 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4591
7dc4a694
JD
45922007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4593
4594 Fix some error-reporting macro bugs.
4595 * data/bison.m4 (b4_cat): New.
4596 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4597 to stdout so they don't become arguments to other macros. Update
4598 comments and add examples.
4599 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4600 add examples.
4601 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4602 after printing the error directive so that M4 doesn't report subsequent
4603 problems that are induced by this problem.
4604 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4605 instead of just in them. Recognize @\n in both places. Both expand to
4606 the empty string. Needed by b4_cat.
4607 * tests/skeletons.at (Complaining during macro argument expansion):
4608 New test case.
4609 (Fatal errors make M4 exit immediately): New test case.
4610
d4bd2295
JD
46112007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4612
4613 Implement --print-datadir.
4614 * src/getargs.c (usage): Mention.
4615 (PRINT_DATADIR_OPTION): New anonymous enum member.
4616 (long_options): Add entry for it.
4617 (getargs): Add case for it calling compute_pkgdatadir.
4618 * src/output.c (output_skeleton): Encapsulate data directory
4619 computation from here...
4620 (prepare): ... and from here...
4621 (compute_pkgdatadir): ... into this new function.
4622 * src/output.h (compute_pkgdatadir): Prototype.
4623
34cdeddf
JD
46242007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4625
4626 * src/print-xml.c (escape_bufs): New static global variable
4627 replacing...
4628 (xml_escape_n): ... the static local variable buf here.
4629 (print_xml): Free memory for escape_bufs.
4630 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4631
d782395d
JD
46322007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4633
4634 Replace `%push-parser' and `%push-pull-parser' with
4635 `%define push_pull "push"' and `%define push_pull "both"'.
4636 `%define push_pull "pull"' is the default.
4637 * doc/bison.texinfo (Push Decl, Push Parser Function,
4638 Pull Parser Function, Parser Create Function, Parser Delete Function):
4639 Update declarations.
4640 (Decl Summary, Table of Symbols): Replace %push-parser and
4641 %push-pull-parser entries with a %define push_pull entry.
4642 * data/bison.m4 (b4_percent_define_check_values): New macro.
4643 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4644 definitions...
4645 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4646 definitions...
4647 * data/push.c: ... to here and compute them from the value of the
4648 %define variable push_pull.
4649 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4650 parsing requests here...
4651 * data/yacc.c: ... hack this to switch to push.c any time
4652 b4_use_push_pull_flag or the %define variable push_pull is set. This
4653 will go away when we mv push.c yacc.c.
4654 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4655 push parsing is not supported since unused %define variables are
4656 reported anyway.
4657 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4658 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4659 comments for consistency with b4_percent_define_check_values.
4660 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4661 muscles.
4662 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4663 Remove.
4664 (prologue_declaration): Remove %push-parser and %push-pull-parser
4665 rules.
4666 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4667 * tests/calc.at: Update declarations.
4668 * tests/input.at (%define enum variables): New test case.
4669 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4670 declaration.
4671 (Push Parsing: Multiple impure instances): Update declaration.
4672 (Push Parsing: Unsupported Skeletons): New test case.
4673 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4674 declaration.
4675 (Exploding the Stack Size with Malloc): Update declaration.
4676
3f999f78
WP
46772007-09-24 Wojciech Polak <polak@gnu.org>
4678
4679 Add XSLT transformations.
4680
4681 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4682 * data/xslt/xml2text.xsl: Transform XML into plain text.
4683 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4684 * data/Makefile.am (xsltdir): New variable.
4685 (dist_xslt_DATA): Add xslt/*.xsl files.
4686
a4f75309
PE
46872007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4688
4689 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4690 Problem reported by Wojciech Polak.
4691 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4692 (xml_printf): Undo change I made on 21 September; that is,
4693 indent 2 spaces, not 1.
4694
ad5feac4
JD
46952007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4696
4697 Pacify ./configure --enable-gcc-warnings.
4698 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4699 `char const *' instead of `char *'.
4700 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4701 local variable `sep'.
4702
41d7a5f2
PE
47032007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4704
4705 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4706 elsewhere.
4707 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4708 (xml_printf): Indent just 1 space for level.
4709 (e_char, xlate_char): Remove.
4710 (xml_escape_string): Rewrite to avoid undefined behavior (used
4711 storage that was freed from the stack).
4712 (xml_escape_n): Don't bother checking for subscript error.
4713
3f999f78
WP
47142007-09-21 Wojciech Polak <polak@gnu.org>
4715
4716 Add Bison XML Automaton Report.
41d7a5f2
PE
4717
4718 Add support for an -x option to generate an XML report.
4719 It is not documented yet.
4720 * src/print-xml.c: New file.
4721 * src/print-xml.h: Likewise.
4722 * lib/timevar.def (TV_XML): New var.
4723 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4724 * src/conflicts.c: Include print-xml.h.
4725 (solved_conflicts_xml_obstack): New var.
4726 (log_resolution, conflicts_solve, conflicts_free):
4727 Add support for XML report.
4728 (conflicts_output_val): New function.
4729 * src/conflicts.h (conflicts_output_val): New decl.
4730 * src/files.c (spec_xml_file): New var.
4731 (compute_output_file_names, output_file_names_free): Add XML support.
4732 * src/files.h (spec_xml_file): New decl.
4733 * src/getargs.c (xml_flag): New var.
4734 (usage, short_options, long_options, getargs): Add XML support.
4735 * src/getargs.h (xml_flag): New decl.
4736 * src/gram.c: Include print-xml.h.
4737 (rule_lhs_print_xml, rule_rhs_print_xml):
4738 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4739 New functions.
4740 * src/gram.h: Declare external ones.
4741 * src/main.c: Include print-xml.h.
4742 (main): Add XML support.
4743 * src/reduce.c: Include print-xml.h.
4744 (reduce_xml): New function.
4745 * src/reduce.h: Declare it.
4746 * src/state.c: Include print-xml.h.
4747 (state_new): Add XML support.
4748 (state_rule_lookahead_tokens_print_xml): New function.
4749 * src/state.h: Declare it.
4750 (struct state): New member solved_conflicts_xml.
4751 * src/symtab.c (symbol_class_get_string): New function.
4752 * src/symtab.h: Declare it.
4753
6d8e724d
PE
47542007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4755
4756 * GNUmakefile: Switch to coreutils's version.
4757 * bootstrap: Likewise.
4758 * Makefile.cfg: Adjust to new GNUmakefile.
4759 * README-hacking: Likewise.
4760
4761 Import from gnulib:
4762
4763 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4764 Bruno Haible <bruno@clisp.org>
4765
4766 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4767 and is a script that invokes bison. Tighten the code. Add comments.
4768
922bdd7f
JD
47692007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4770
4771 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4772 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4773 * doc/bison.texinfo (Decl Summary): Fix.
4774 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4775 * tests/input.at (Boolean %define variables): Update output.
4776 * tests/skeletons.at (%define boolean variables: invalid skeleton
4777 defaults): Rename to...
4778 (%define Boolean variables: invalid skeleton defaults): ... this and
4779 update output.
4780
1b17b01d
JD
47812007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4782
4783 In impure push mode, don't allow more than one yypstate to be allocated
4784 since multiple impure parsers would corrupt yynerrs.
4785 * data/push.c (yypstate_allocated): New static global variable
4786 initialized to 0.
4787 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4788 exhaustion if yypstate_allocated is 1, but still return 2.
4789 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4790 already 1. Otherwise, set it to 1.
4791 (yypstate_delete): Set it to 0.
4792 * tests/push.at (Push Parsing: Multiple impure instances): New test
4793 case.
4794
9987d1b3
JD
47952007-08-17 Bob Rossi <bob@brasko.net>
4796
4797 * doc/bison.texinfo (Push Decl): Document the push parser.
4798 (Table of Symbols): Ditto.
4799 (Pure Decl): Ditto.
4800 (Decl Summary): Ditto.
4801 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4802 Parser Create Function, Parser Delete Function):
4803 Add new push parser symbols.
4804 (Table of Symbols): Document push-parser, push-pull-parser,
4805 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4806
f16b0819
PE
48072007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4808
4809 Update to GPLv3.
4810 * doc/gpl-3.0.texi: New file.
4811 * doc/gpl.texi: Remove.
4812 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4813 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4814 * README-hacking, TODO, bootstrap, bootstrap.conf:
4815 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4816 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4817 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4818 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4819 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4820 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4821 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4822 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4823 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4824 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4825 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4826 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4827 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4828 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4829 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4830 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4831 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4832 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4833 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4834 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4835 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4836 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4837 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4838 * src/complain.c, src/complain.h, src/conflicts.c:
4839 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4840 * src/files.h, src/flex-scanner.h, src/getargs.c:
4841 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4842 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4843 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4844 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4845 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4846 * src/print.c, src/print.h, src/print_graph.c:
4847 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4848 * src/reduce.h, src/relation.c, src/relation.h:
4849 * src/revision.h, src/scan-code.h, src/scan-code.l:
4850 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4851 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4852 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4853 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4854 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4855 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4856 * tests/existing.at, tests/glr-regression.at:
4857 * tests/headers.at, tests/input.at, tests/java.at:
4858 * tests/local.at, tests/output.at, tests/push.at:
4859 * tests/reduce.at, tests/regression.at, tests/sets.at:
4860 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4861 * tests/torture.at:
4862 Update to GPLv3.
4863
728c4be2
JD
48642007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4865
4866 Get rid of broken %no-parser, -n, and --no-parser implementation and
4867 documentation.
4868 * TODO: Don't mention them.
4869 * doc/bison.1: Likewise.
4870 * doc/bison.texinfo (Decl Summary): Likewise.
4871 (Bison Options): Likewise.
4872 (Option Cross Key): Likewise.
4873 * src/getargs.c (no_parser_flag): Remove global variable.
4874 (usage): Don't print description of -n and --no-parser.
4875 (long_options): Remove --no-parser entry here.
4876 (getargs): Remove -n case in the switch here.
4877 * src/getargs.h (no_parser_flag): Remove extern.
4878 * tests/regression.at (Web2c Actions): Remove comment that mentions
4879 --no-parser.
4880
5d31a216
JD
48812007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4882
4883 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4884 name user variables starting with `yy'. Just pass NULL instead of a
4885 dummy local &yylval to yypush_parse.
4886 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4887 starting with `yy'.
4888
a2ea208d
JD
48892007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4890
4891 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4892 true since it's then always used regardless of whether yyoverflow is
4893 defined. Reported by Christian Burger at
4894 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4895 * THANKS: Add Christian Burger.
4896
91661ebb
JD
4897 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4898 node names: say "Decl Summary" not "Bison Declaration Summary".
4899
cbd50549
JD
49002007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4901
4902 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4903 determine whether this function has already complained about an invalid
4904 value for a %define boolean variable, don't check whether Bison has
4905 ever examined the value. As written, the check was a tautology.
4906 Instead, record and check for this complaint using a separate muscle.
4907
eb1b0740
JD
49082007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4909
4910 Fix push parsing memory leak reported by Brandon Lucia at
4911 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4912 * THANKS: Add Brandon Lucia.
4913 * data/push.c (yypstate_delete): Free the stack if it was reallocated
4914 but the parse never completed and thus freed it.
4915 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
4916 * tests/testsuite.at: Include push.at.
4917 * test/push.at: New.
4918 (Push Parsing: Memory Leak for Early Deletion): New test case.
4919
9d774aff
JD
49202007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
4921
4922 Improve handling of multiple S/R conflicts in the same state and of S/R
4923 conflicts involving multiple reductions.
4924 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
4925 set for a state here or Bison will abort if it is reassigned on a
4926 later conflicted reduction in the same state.
4927 Similarly, don't finalize and assign the solved conflicts report here
4928 or it will be lost if it is reassigned on a later conflicted reduction
4929 in the same state.
4930 (set_conflicts): Instead, assign them both here after all S/R conflicts
4931 in the state have been fully examined.
4932 * src/print.c (shift_set): Rename to...
4933 (no_reduce_set): ... this.
4934 (print_reductions): Update for rename, and add %nonassoc error action
4935 tokens to no_reduce_set so that, when printing the first remaining
4936 reduction on an error action token, the reduction is enclosed in
4937 brackets.
4938 (print_results): Update for rename.
4939 * tests/conflicts.at (Solved conflicts report for multiple reductions
4940 in a state): New test case.
4941 (%nonassoc error actions for multiple reductions in a state): New test
4942 case.
4943
4944 * src/main.c (main): Don't depend on C99 features.
4945
10159d2a
JD
49462007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4947
4948 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
4949 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
4950 uniwidth.
10159d2a 4951
953b3935
JD
49522007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
4953
4954 * bootstrap (slurp): Create target directories that don't exist.
4955 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
4956
6ce2d93a
JD
49572007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
4958
4959 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
4960 than item number.
4961 * closure.c (closure): Likewise.
4962 * state.h (reductions): Comment sorting of rules.
4963 (state): Comment sorting of items.
4964
ce3448d5
JD
49652007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
4966
4967 Fix C++ test cases after recent Gnulib changes. Discussed starting at
4968 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
4969 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
4970 definition in order to avoid Gnulib headers since we don't use config.h
4971 here.
4972 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
4973 rather than AT_DATA so that config.h is included.
4974
8a86eef0
JD
49752007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
4976
4977 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
4978 instead of fprintf. Guard these functions with #if YYDEBUG instead of
4979 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
4980 and so that YYFPRINTF is guaranteed to be defined here.
4981
b1a81613
JD
49822007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4983
4984 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
4985 with...
4986 (muscle_percent_define_check_values): ... this more helpful function.
4987 Again, it's not used yet, but it will be.
4988 * src/muscle_tab.h: Likewise.
4989
71b61d4d
JD
4990 Improve some comments in parser table construction.
4991 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
4992 (generate_states): Don't mention ruleset, which is internal to closure.
4993 * src/closure.c (closure): Explain sorting of core and itemset, which
4994 is required for this function to behave correctly.
4995 * src/closure.h (closure): Mention sorting.
4996
2a6b783d
JD
49972007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
4998
4999 * src/lalr.c (state_lookahead_tokens_count): For code readability,
5000 move the check for disabled transitions to an aver since conflict
5001 resolution hasn't happened yet.
5002
5003 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
5004 labels a state as inconsistent just because it has error transitions.
5005 The original form of this check appeared in revision 1.1 of lalr.c,
5006 which was committed on 1991-12-21. Now (at least), changing the
5007 consistency label on such a state appears to have no useful effect in
5008 any of the places it is examined, which I enumerate below. The key
5009 point to understanding each item in this enumeration is that a state
5010 with an error transition is labelled consistent in the first place only
5011 if it has no rules, so the check cannot matter for states that have
5012 rules. (1) Labelling a state as inconsistent will cause set_conflicts
5013 to try to identify its conflicts, and a state must have *rules* to have
5014 conflicts. (2) Labelling a state as inconsistent will affect how
5015 action_row sets the default *rule* for the state. (3) Labelling a
5016 state as inconsistent will cause build_relations to add lookback edges
5017 to *rules* in that state.
5018 * src/state.h (struct state): Word the comment for member consistent
5019 more carefully.
5020
14462c2b
JD
50212007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5022
5023 Don't depend on C99 features.
5024 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
5025 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
5026 * src/reader.c (check_and_convert_grammar): Fix for-loop.
5027 * src/state.c (state_mark_reachable_states): Fix for-loop.
5028 (state_remove_unreachable_states): Fix for-loop.
5029
5030 Don't widen struct state with member reachable just to temporarily
5031 record reachability. Instead, use a local bitset.
5032 * src/state.h (struct state): Remove member.
5033 * src/state.c (state_new): Don't initialize it.
5034 (state_mark_reachable_states): Rename to...
5035 (state_record_reachable_states): ... this, and use bitset.
5036 (state_remove_unreachable_states): Use bitset.
5037
5a43d418
JD
50382007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
5039
5040 * src/Makefile.am (yacc): Quote target action commands properly so
5041 that the yacc script isn't corrupt. Reported by Hans Aberg at
5042 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
5043
0c650a20
JD
5044 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
5045 the case of pure parsers. Reported by Frans Englich at
5046 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
5047 * THANKS: Add Frans Englich.
5048
61fee93e
JD
5049 * NEWS (2.3a+): In the %code entry, reference section `Bison
5050 Declaration Summary' from the manual now since the %code summary has
5051 moved there.
5052 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
5053 in the rules section must be terminated by semicolons.
5054
f124d423
JD
50552007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
5056
5057 Extend the front-end API for %define variables to more completely
5058 mirror the back-end. This will be useful in the future.
5059 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
5060 Update comments to mention the new front-end counterparts of these
5061 macros.
5062 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
5063 for muscle_string_decode and muscle_location_decode.
5064 (muscle_string_decode): New static function.
5065 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
5066 (muscle_percent_define_get, muscle_percent_define_ifdef): New
5067 functions.
5068 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
5069 muscle_percent_define_get to mimic the b4_percent_define_flag_if
5070 implementation more closely.
5071 (muscle_percent_define_invalid_value): New function.
5072 * src/muscle_tab.h (muscle_percent_define_get,
5073 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
5074 Prototype.
5075
75ad86ee
JD
50762007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5077
5078 * NEWS (2.3a+): Mention yesterday's state-removal change.
5079 (2.3a): Remove the %language entry, which was added after 2.3a.
5080 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
5081 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
5082 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
5083 tests/existing.at: Update copyright date.
5084
5967f0cf
JD
50852007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5086
5087 If conflict resolution makes states unreachable, remove those states,
5088 report rules that are then unused, and don't report conflicts in those
5089 states.
5090 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
5091 New global function.
5092 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
5093 function.
5094 * src/main.c (main): After conflict resolution, remove the unreachable
5095 states and update all data structures that reference states by number.
5096 * src/state.c (state_new): Initialize each state's reachable member to
5097 false.
5098 (state_mark_reachable_states): New static function.
5099 (state_remove_unreachable_states): New global function.
5100 * src/state.h (struct state): Add member bool reachable.
5101 (state_remove_unreachable_states): Prototype.
5102 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5103 New test case.
5104 * tests/existing.at (GNU pic Grammar): Update test case output now that
5105 an unused rule is discovered.
5106
b09f4f48
JD
51072007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5108
5109 Minor code cleanup in parser table construction.
5110 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
5111 (new_itemsets, save_reductions): Update for rename to nitemset.
5112 * src/closure.c (nritemset): Rename to...
5113 (nitemset): ... this since the "r" appears to meaningless and isn't
5114 used in the comments.
5115 (closure): Update for rename.
5116 * src/closure.h (nritemset): Update extern to...
5117 (nitemset): ... this.
5118 * src/lalr.c (LA): Fix a typo in comments.
5119 * src/print.c (print_core): Update for rename to nitemset.
5120 * src/print_graph.c (print_graph): Likewise.
5121 * src/state.h: Fix some typos in header comments.
5122
bbb44d83
PE
51232007-04-04 Paul Eggert <eggert@cs.ucla.edu>
5124
9b33de72
PE
5125 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
5126 still sticks to ASCII. Sorry!
5127
bbb44d83
PE
5128 * README-hacking: New file, taken mostly from coreutils, with changes
5129 for Bison. Contains much of the contents of:
5130 * README-cvs: Remove.
5131 * bootstrap: Sync from gnulib.
5132 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
5133 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
5134
29553547
JD
51352007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
5136
5137 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
5138 Setzer.
5139 (Java Differences): Fix some typos.
5140 * THANKS: Add Sebastian Setzer.
5141
01b477c6
PB
51422007-03-07 Paolo Bonzini <bonzini@gnu.org>
5143
730739e4
AD
5144 * data/java.m4 (b4_single_class_if): Remove.
5145 (b4_abstract_if): Look at "%define abstract".
5146 (b4_lexer_if): New.
5147 (b4_union_name): Rename...
5148 (b4_yystype): ... to this. Map to "%define stype".
5149 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
5150 b4_maybe_throws): Fix quoting.
5151 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
5152 * data/lalr1.java (Lexer interface): Always define.
5153 (Lexer interface within parser class): Remove.
5154 (YYLexer class): New, used when "%code lexer" is present.
5155 (constructor): When "%code lexer" is used, pass %lex-param
5156 to the lexer constructor.
5157 (yylex, yyparse): Remove %lex-param from method invocations
5158 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
5159
5160 * doc/bison.texinfo (Java Bison Interface): Mention "%define
5161 abstract". Rename "%define union_name" to "%define stype".
5162 Rename method names according to previous patch.
5163 (Java Scanner Interface): Describe "%code lexer" instead of
5164 "%pure-parser" and "%define single_class".
5165 (Java Differences): Mention "%code lexer".
5166
5167 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
5168 Include scanner here, using macros from tests/local.at.
5169 (AT_DATA_CALC_Y): Remove final argument.
5170 (_AT_CHECK_JAVA_CALC): Likewise.
5171 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
5172 of %locations and %error-verbose.
5173 (main): Test with and without %lex-param.
5174 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
5175 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 5176
122bea3a
JMG
51772007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5178
5179 DJGPP spefic issue. Inhibit the use of disallowed characters for
5180 file name genertion on Win98, WinXP, etc. These are |<>":?*\
5181 and concern testsuite case 46.
5182 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
5183 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
5184 * djgpp/config.bat: Inhibit the use of disallowed characters.
5185
9611cfa2
JD
51862007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5187
5188 Miscellaneous %define and %code cleanup.
5189 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
5190 values are interpreted.
5191 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
5192 documentation a little more.
5193 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
5194 muscle_percent_define_insert, muscle_percent_code_grow): New
5195 functions/macros.
5196 * src/muscle_tab.h (muscle_percent_define_insert,
5197 muscle_percent_code_grow): Prototype.
5198 * src/parse-gram.y (prologue_declaration): Use
5199 muscle_percent_define_insert and muscle_percent_code_grow when parsing
5200 %define and %code directives.
5201
5202 Make it easy to share %define boolean variables between the front-end
5203 and back-end. Though not used yet, this will be useful in the future.
5204 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
5205 Bison uses of names rather than just skeleton uses of names.
5206 (b4_percent_define_get, b4_percent_define_ifdef): Rename
5207 b4_percent_define_skeleton_variables(VARIABLE) to
5208 b4_percent_define_bison_variables(VARIABLE).
5209 (b4_percent_code_get, b4_percent_code_ifdef): Rename
5210 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
5211 b4_percent_code_bison_qualifiers(QUALIFIER).
5212 (b4_check_user_names_wrap): Update for renames.
5213 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
5214 muscle_percent_define_default): New functions mimicking
5215 b4_percent_define_flag_if and b4_percent_define_default.
5216
5217 For %define variables, report locations for invalid values and
bbb44d83 5218 redefinitions.
9611cfa2
JD
5219 * data/bison.m4 (b4_percent_define_flag_if): Read
5220 b4_percent_define_loc(VARIABLE) to report the location of an invalid
5221 value for VARIABLE.
5222 (b4_percent_define_default): Save a special location in
5223 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
5224 must later be reported as invalid.
5225 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
5226 functions.
5227 (muscle_percent_define_insert): Record the location of VARIABLE in
5228 muscle percent_define_loc(VARIABLE), and use it to report the previous
5229 location for a redefinition.
5230 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
5231 (muscle_percent_define_default): Update like b4_percent_define_default.
5232 (muscle_grow_user_name_list): Rename to...
5233 (muscle_user_name_list_grow): ... this for consistency and use
5234 muscle_location_grow.
5235 * src/muscle_tab.h (muscle_location_grow): Prototype.
5236 * tests/input.at (%define errors): Update expected output.
5237 * tests/skeletons.at (%define boolean variables: invalid skeleton
5238 defaults): New test case.
5239
0bf92491
JD
52402007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5241
5242 * src/print.c (lookahead_set, state_default_rule): Remove.
5243 (print_reductions): Replace state_default_rule invocation with
5244 equivalent use of yydefact, which was computed in token_actions in
5245 tables.c.
5246 (print_results): Don't allocate lookahead_set.
5247
d3b12988
PB
52482007-02-27 Paolo Bonzini <bonzini@gnu.org>
5249
5250 * data/lalr1.java: Prefix all private members with yy.
5251
f57a7536
JD
52522007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5253
5254 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 5255 Sebastien Fricker at
f57a7536 5256 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 5257 * THANKS: Add Sebastien Fricker.
f57a7536
JD
5258 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5259 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5260 accept a variable number of arguments.
5261
6404a5bf
JD
52622007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5263
5264 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5265
e4e09639
JMG
52662007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5267
5268 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5269 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5270 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5271
d7e0a1a7
PE
52722007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5273
5274 Undo my 2007-02-07 change, switching back to the c-strcase module
5275 introduced in the 2007-02-03 change. Bruno Haible reported that
5276 the 2007-02-07 change would be dangerous in Turkish if we add a
5277 language whose name contains "i", since "i" is not lowercase "I"
5278 in Turkish.
5279 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5280 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5281 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5282 * m4/.cvsignore: Remove strcase.m4.
5283 * src/getargs.c: Revert 2007-02-07 change, as follows.
5284 Include c-strcase.h.
5285 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5286
deee93a1
JD
52872007-02-11 Bruno Haible <bruno@clisp.org>
5288
5289 Enable the Java related testsuite tests when the only Java compiler
5290 found is a gcj < 4.3. Discussed at
5291 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5292 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5293
574add85
JD
52942007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5295
5296 * data/Makefile.am: Update copyright date.
5297 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5298 yypstate_new returns NULL.
5299 (yypstate_new): Return NULL if malloc does.
5300 * src/reader.c (packgram): Move translation of rule actions from the
5301 beginning of packgram to...
5302 (check_and_convert_grammar): ... here right before packgram is invoked
5303 so it's easier to write more complete comments, and remove redundant
5304 code.
5305
e785ccf7
JD
53062007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5307
5308 As in semantic actions, make @$ in %initial-action, %destructor, and
5309 %printer imply %locations.
5310 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5311 scanning @$.
5312 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5313 (@$ in %initial-action implies %locations,
5314 @$ in %destructor implies %locations,
5315 @$ in %printer implies %locations): ... these new test cases.
5316
1cfe1ed7
PE
53172007-02-07 Paul Eggert <eggert@cs.ucla.edu>
5318
5319 Undo most of the 2007-02-03 change, switching to the strcase module
5320 now that gnulib strcase has been fixed.
5321 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
5322 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
5323 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
5324 * m4/.cvsignore: Add strcase.m4.
5325 * src/getargs.c: Revert 2007-02-03 change, as follows.
5326 Don't include c-strcase.h.
5327 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
5328 strcasecmp has "unspecified behavior" outside the POSIX locale,
5329 but it works fine in practice if at least one argument is ASCII,
5330 as is the case in Bison.
5331
0049ec86
PB
53322007-02-07 Paolo Bonzini <bonzini@gnu.org>
5333
5334 * tests/java.at: Skip tests if only one of javac/java is present.
5335 Reported by Joel E. Denny.
5336 * tests/atlocal.in: Adjust copyright years.
5337
53382007-02-05 Paolo Bonzini <bonzini@gnu.org>
5339
5340 * data/lalr1.java (Stack): Work around old verifiers that disallow
5341 access to the private fields of an inner class, from the outer class.
5342 We can make Stack's fields public because user code doesn't have access
5343 to the instance of Stack used by parse(). Reported by Paul Eggert.
5344
2c2b7220
PE
53452007-02-03 Paul Eggert <eggert@cs.ucla.edu>
5346
5347 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
5348 the right spot for these files?
5349 * bootstrap.conf (gnulib_modules): Add c-strcase.
5350 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
5351 c-strncasecmp.c.
5352 * src/getargs.c: Include c-strcase.h.
5353 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
5354 to avoid unspecified behavior.
5355
b2b81dae
JD
53562007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
5357
5358 * doc/bison.texinfo (Decl Summary): Correct typo.
5359
c1d19e10
PB
53602007-01-30 Paolo Bonzini <bonzini@gnu.org>
5361
5362 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
5363 Complain if the value does not match empty, "true" or "false".
5364 * data/c++.m4: Adjust default definitions of %define variables.
5365 * data/java.m4: Adjust default definitions of %define variables.
5366 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
5367 to above behavior.
5368 * tests/input.at (Boolean %define variables): Test new behavior.
5369
8405b70c
PB
53702007-01-29 Paolo Bonzini <bonzini@gnu.org>
5371
5372 * NEWS: Mention java.
5373 * TODO: Remove things that are done.
5374 * bootstrap.conf: Add javacomp-script and javaexec-script.
5375 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
5376
5377 * data/Makefile.am: Add new files.
5378 * data/java-skel.m4: New.
5379 * data/java.m4: New.
5380 * data/lalr1.java: New.
5381
5382 * doc/bison.texinfo: Put "A Complete C++ Example" under
5383 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
5384 under Other Languages.
5385
5386 * src/getargs.c (valid_languages): Add Java.
5387 * src/getargs.h (struct bison_language): Update size of string fields.
5388
5389 * tests/Makefile.am: Add java.at.
5390 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
5391 * tests/java.at: New.
5392 * tests/testsuite.at: Include it.
5393
3eb82471
JD
53942007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
5395
5396 Clean up.
5397 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
5398 at_directive_argv arguments so these no longer have to be global
5399 variables. Also, update the implementation for the following changes.
5400 (fail_for_at_directive_too_many_args,
5401 fail_for_at_directive_too_few_args): Add at_directive_name argument.
5402 (at_directive_name): Remove as at_directive_argv[0] will be used for
5403 this now.
5404 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
5405 for the directive name.
5406 (at_directive_argc, at_directive_argv): Make these local within
5407 skel_lex instead of global.
5408 (INITIAL): Update directive start action for above changes.
5409 (SC_AT_DIRECTIVE_ARG): Rename to...
5410 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
5411 (SC_AT_DIRECTIVE_SKIP_WS): Update.
5412 (scan_skel): Move yylex_destroy to...
5413 (skel_scanner_free): ... here.
5414 * tests/skeletons.at (installed skeleton file name): Rename to...
5415 (installed skeleton file names): ... this.
5416
148d66d8
JD
54172007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
5418
5419 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5420 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
5421 Summary" not "Directives".
5422 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
5423 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
5424 since the former is now the more complete one.
5425 (Prologue Alternatives): Likewise and do the same for %defines.
5426 (Table of Symbols): Add summary of %code, add summary of %define, and
5427 move full %code documentation to...
5428 (Decl Summary): ... here for consistency with other entries in these
5429 sections.
5430 Move %define entry in order to keep this list alphabetized.
5431 Reword %define entry a little to put less emphasis on the skeleton
5432 concept, which most users shouldn't have to think about.
5433
665f0c24
PE
54342007-01-26 Paul Eggert <eggert@cs.ucla.edu>
5435
5436 Adjust to recent gnulib changes.
5437 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
5438 Add string.h, string_.h, unistd_.h, wchar_.h.
5439 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
5440 * src/system.h: Don't include <stpcpy.h>; this is now done by
5441 <string.h>.
5442
592d0b1e
PB
54432007-01-23 Paolo Bonzini <bonzini@gnu.org>
5444
5445 Simplify implementation of unqualified %code, implement macros for
5446 uniform treatment of boolean %define flags. Document %define.
5447 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
5448 b4_percent_code_ifdef): New.
5449 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
5450 * data/c++.m4: Define default value for global_tokens_and_yystype.
5451 * data/glr.cc: Likewise.
5452 * data/location.cc: Use b4_percent_define_flag_if.
5453
148d66d8 5454 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
5455
5456 * src/parse-gram.y (Unqualified %code): Change muscle name to
5457 b4_percent_code().
5458 (content.opt): Default to empty.
5459
a7867f53
JD
54602007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5461
5462 Implement support for relative and absolute skeleton file names.
5463 Discussed starting at
5464 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5465 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5466 (Bison Options): Document in --skeleton entry.
5467 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5468 full_skeleton can't necessarily hold all of pkgdatadir.
5469 If the specified skeleton file name contains a `/', don't prepend
5470 pkgdatadir.
5471 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5472 file name contains a `/', prepend the grammar file directory.
5473 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5474 * skeletons.at: New file.
5475 (relative skeleton file names): New test case.
5476 (installed skeleton file names): New test case.
5477 * tests/testsuite.at: Include skeletons.at.
5478
5479 * bootstrap: Update copyright to 2007.
5480
830c9b18
PB
54812007-01-17 Paolo Bonzini <bonzini@gnu.org>
5482
5483 * bootstrap: Remove occurrences of .#bootmp from the files.
5484
a8c2e813
AD
54852007-01-17 Akim Demaille <akim@epita.fr>
5486
5487 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5488 nonterminals.
5489 Use per-type %printer.
5490
279cabb6
JD
54912007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5492
5493 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5494 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5495 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5496 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5497 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5498 tests/glr-regression.at, tests/input.at, tests/local.at,
5499 tests/output.at, tests/torture.at: Update copyright to 2007.
5500
bb32f4f2
AD
55012007-01-16 Akim Demaille <akim@epita.fr>
5502
5503 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5504 error code.
5505 (Calc++ Scanner): Exit with failure if we can't open the input
5506 file.
5507 Accept "-" standing for stdin.
5508 (Calc++ Top Level): Print the result only if the parsing was
5509 successful.
5510
7cff04b5
AD
55112007-01-16 Akim Demaille <akim@epita.fr>
5512
5513 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5514
a4e25e1d
JD
55152007-01-15 Paolo Bonzini <bonzini@gnu.org>
5516 and Joel E. Denny <jdenny@ces.clemson.edu>
5517
5518 Clean up %define and %code implementation in M4 some. Most
5519 importantly, rename all related macros to be in the b4_percent_define
5520 and b4_percent_code namespaces. Also, complete support for `.' in
5521 %define variable names and %code qualifiers.
5522 * data/bison.m4 (b4_check_user_names): Check for special
5523 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5524 m4_foreach loops.
5525 (b4_get_percent_define, b4_get_percent_code): Rename to...
5526 (b4_percent_define_get, b4_percent_code_get): ... these.
5527 Extend documentation with examples.
5528 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5529 b4_percent_define_skeleton_variables and
5530 b4_percent_code_skeleton_qualifiers.
5531 Expect any value for the %define variable `foo' to be stored in the
5532 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5533 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5534 expect any unqualified %code blocks to be stored in a macro named
5535 `b4_percent_code_unqualified'.
5536 Use m4_indir so that %define variable names and %code qualifiers can
5537 contain `.', which is allowed by the grammar parser.
5538 (b4_percent_define_default): New macro to set a default value for a
5539 %define variable.
5540 (m4_wrap): Update wrapped code, and fix some underquoting.
5541 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5542 Expect grammar uses of %define variables and %code qualifiers to be
5543 defined in b4_percent_define_user_variables and
5544 b4_percent_code_user_qualifiers.
5545 * data/c++.m4: Use b4_percent_define_default rather than
5546 m4_define_default. Fix some underquoting. Skeleton usage of %define
5547 variable define_location_comparison now implies skeleton usage of
5548 %define variable filename_type.
5549 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5550 data/push.c, data/yacc.c: Update macro names.
5551 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5552 muscle names.
5553
e37c665c
JMG
55542007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5555
5556 DJGPP specific issues.
5557
5558 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5559 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5560
7d2d521f
JD
55612007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5562
5563 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5564 run parsers in all tests so that Valgrind is invoked during
5565 maintainer-check-valgrind.
5566 (Duplicate representation of merged trees): Free all semantic values.
5567 (Duplicated user destructor for lookahead): Likewise.
5568
e0ac9b4b
JD
55692007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5570
5571 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5572 command-line prefix.
5573 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5574 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5575 miss Valgrind messages.
5576 (Exploding the Stack Size with Malloc): Likewise.
5577
78143faa
JD
55782007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5579
5580 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5581 locals. Reported by Juan Manuel Guerrero at
5582 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5583 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5584 Fix some indentation also.
5585 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5586 explaining this issue.
5587
7ecec4dd
JD
55882007-01-09 Paolo Bonzini <bonzini@gnu.org>
5589 and Joel E. Denny <jdenny@ces.clemson.edu>
5590
5591 Simplify union and prologue handling, and escape union and lex/parse
5592 params with digraphs.
5593 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5594 values to the empty string since these are no longer guaranteed
5595 initialized by the front-end.
5596 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5597 braces around b4_user_stype since this is no longer done by the
5598 front-end.
5599 * src/files.c, src/files.h (pre_prologue_obstack,
5600 post_prologue_obstack): Remove.
5601 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5602 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5603 with digraphs. This fixes lex params and parse params.
5604 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5605 * src/output.c (prepare): Remove muscle insertion of the prologues.
5606 (output): Remove freeing of pre_prologue_obstack and
5607 post_prologue_obstack.
5608 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5609 than prologue_augment for prologue parsing so you don't need prologue
5610 obstacks.
5c80250c
JD
5611 (grammar_declaration): For %union RHS, use `braceless' instead of
5612 "{...}" so that braces are already stripped and code is escaped with
5613 digraphs.
7ecec4dd
JD
5614 * src/reader.c (prologue_augment): Remove.
5615 (reader): Remove initialization of pre_prologue_obstack and
5616 post_prologue_obstack.
5617 * src/reader.h (prologue_augment): Remove.
5618
5619 * data/c.m4: Remove stray parenthesis.
5620
16dc6a9e
JD
56212007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5622
5623 Remove quotes from variables names in %define directives and from
5624 qualifiers in %code directives, and restrict the characters that are
5625 allowed in them to M4-friendly ones. For %define, continue to support
5626 the quoted form as a deprecated feature. Discussed starting at
5627 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5628 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5629 %code.
5630 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
5631 (Decl Summary): In %defines entry, update mention of `%code requires'
5632 and `%code provides'.
16dc6a9e
JD
5633 (C++ Location Values): Update %define uses.
5634 (Calc++ Parser Interface): Likewise.
5635 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 5636 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
5637 * src/parse-gram.y (prologue_declaration): For %define variables, use
5638 `variable' instead of `STRING'.
5639 (grammar_declaration): For %code qualifiers, use `ID' instead of
5640 `STRING'.
5641 (variable): New nonterminal that takes an `ID' or a `STRING'.
5642 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5643 and %define uses.
5644 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5645 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5646 (%define errors): Update %define uses.
5647
e9813cd4
JD
56482007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5649
5650 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5651 instead of muscle_insert for %define values so that M4-special
5652 characters are replaced with digraphs.
5653 * tests/input.at (%define errors): Extend to check weird values.
5654
6afc30cc
JD
56552007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5656
5657 Instead of having skeletons declare all valid %define variables and
5658 %code qualifiers, provide macros that retrieve the associated values
5659 and build these lists automatically. Thus Bison will now warn when a
5660 variable or qualifier is not used by the skeleton in the current
5661 invocation regardless of whether it might sometimes be used by that
5662 skeleton in other invocations. Also, move all %define value macros to
5663 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5664 form, which is replaced by %code.
5665 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5666 (b4_check_user_names): ... this, and change the series of valid name
5667 arguments to a single list argument for names used in the skeleton
5668 similar to the existing list argument for names used in the grammar.
5669 Warn instead of complaining.
5670 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5671 values and %code code, to format %code code properly, and to build
5672 lists of all %define variables and %code qualifiers used in the
5673 skeleton: b4_skeleton_percent_define_variables and
5674 b4_skeleton_percent_code_qualifiers.
5675 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5676 Remove, and...
5677 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5678 the skeleton names lists can finish building first. In place of
5679 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5680 expect the lists b4_user_percent_define_variables and
5681 b4_user_percent_code_qualifiers.
5682 * data/c++.m4: Where setting default values for b4_parser_class_name,
5683 b4_location_type, b4_filename_type, b4_namespace, and
5684 b4_define_location_comparison, update their names to the
5685 b4_percent_define_ namespace.
5686 * data/glr.c: Don't use b4_check_percent_define_variables and
5687 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5688 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5689 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 5690 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
5691 * data/location.cc: Use b4_get_percent_define.
5692 * data/push.c: Don't use b4_check_percent_define_variables and
5693 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5694 * data/yacc.c: Likewise, and don't call m4_exit in
5695 b4_use_push_for_pull_if or m4_wrap code will never execute.
5696 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5697 Rename to...
5698 (muscle_grow_user_name_list): ... this for consistency with the
5699 terminology used in bison.m4.
5700 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5701 %define variable names, and rename muscle used_percent_define_variables
5702 to user_percent_define_variables.
5703 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5704 user_percent_code_qualifiers.
5705 (content): Remove.
5706 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5707 {CODE} form is no longer accepted.
5708 * tests/input.at (Reject bad %code qualifiers): Rename to...
5709 (Reject unused %code qualifiers): ... this, and update test output.
5710 (%define error): Update test output.
5711
7eb8a0bc
JD
57122007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5713
5714 Check for unrecognized %define variables similar to checking for
5715 unrecognized %code qualifiers. Check for redefined %define variables.
5716 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5717 generalizes...
5718 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5719 (b4_check_percent_define_variables): New, also wraps it.
5720 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5721 variables using b4_check_percent_define_variables.
5722 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5723 all those exercised in the test suite and all those listed in the
5724 `Default values' section of c++.m4. Are there others?
5725 * data/push.c, data/yacc.c: Declare no valid %define variables.
5726 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5727 similar to muscle_find, but it works even when the muscle stores a
5728 const value.
5729 (muscle_grow_used_name_list): New function for constructing the used
5730 name list muscles that b4_check_for_unrecognized_names requires.
5731 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5732 %define'd more than once. Define the b4_used_percent_define_variables
5733 muscle with muscle_grow_used_name_list.
5734 (grammar_declaration): Abbreviate %code code with
5735 muscle_grow_used_name_list.
5736 * tests/input.at (%define errors): New.
5737
3fc65ead
JD
57382007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5739
5740 Provide warn_at, complain_at, and fatal_at function callbacks to the
5741 skeletons, and use this for %code qualifier complaints.
5742 * data/bison.m4 (b4_error_at): New, invoked by...
5743 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5744 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5745 @fatal_at(...@) directives.
5746 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5747 qualifiers in b4_used_percent_code_qualifiers and to use
5748 b4_complain_at.
5749 * src/location.c, src/location.h (boundary_set_from_string): New global
5750 function.
5751 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5752 function.
5753 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5754 to b4_used_percent_code_qualifiers.
5755 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5756 function.
5757 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5758 (lineno): Rename to...
5759 (out_lineno): ... this so I don't misunderstand it again.
5760 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5761 here; these newlines are in the input but not the output file.
5762 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5763 (at_directive_perform): ... this new static function, and add handling
5764 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5765 directives.
5766 * tests/input.at (Reject bad %code qualifiers): Update test output with
5767 locations and extend.
5768
5769 * tests/output.at (Output file name: [, Output file name: ]): Remove
5770 bogus comment about these tests failing.
5771
1c7b7e1d
JD
57722007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5773
5774 Clean up b4_check_percent_code_qualifiers a little.
5775 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5776 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5777 documentation and add examples.
5778 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5779 qualifiers here.
5780
08af01c2
JD
57812007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5782
5783 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5784 unreliable -- especially when they're hidden inside another macro.
5785 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5786 data/c.m4: Remove m4_divert(-1).
5787 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5788 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5789 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 5790 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
5791 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5792 pushed and popped by m4sugar, should be first on the stack.
5793
5794 Provide warn, complain, and fatal function callbacks to the skeletons.
5795 This provides more flexibility than m4_fatal, improves the error
5796 message format, and captures messages for translation. Discussed
5797 starting at
5798 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5799 * data/bison.m4 (b4_error): New, invoked by...
5800 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5801 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5802 directives. Because these M4 macros might be called when the current
5803 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5804 the previous removal of uses of m4_divert, which caused trouble.
5805 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5806 m4_fatal to report unrecognized %code qualifiers.
5807 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5808 push parser requests.
5809 * data/glr.c: Use b4_complain instead of m4_fatal to report
5810 non-deterministic push parser requests.
5811 Update @output usage to @output(...@) form.
5812 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5813 report missing %defines. Update @output usage to @output(...@) form.
5814 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5815 @output(...@) form.
5816 * src/main.c (main): Invoke skel_scanner_free.
5817 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5818 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5819 obstack_for_string from flex-scanner.h.
5820 (YY_DECL): Use to declare skel_lex static.
5821 (decode_at_digraphs): Remove; now handled in the new
5822 SC_AT_DIRECTIVE_ARG start condition.
5823 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5824 functions.
5825 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5826 at_directive_argv): New static globals.
5827 (INITIAL): Use fail_for_invalid_at.
5828 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5829 recognize the start of a generalized `@directive(...@)' form and
5830 start...
5831 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5832 directive args (using the new obstack_for_string), to decode the
5833 contained @ diagraphs, and to perform the directive. It recognizes
5834 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5835 @output(...@).
5836 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5837 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5838 `@,'.
5839 (scan_skel): Initialize obstack_for_string on the first call.
5840 (skel_scanner_free): New function to free obstack_for_string.
5841 * tests/input.at (Reject bad %code qualifiers): Update test output.
5842
8e0a5e9e
JD
58432007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5844
5845 Consolidate the 4 prologue alternative directives (%code, %requires,
5846 %provides, and %code-top) into a single %code directive with an
5847 optional qualifier field. Discussed at
5848 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5849 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5850 alternatives.
5851 * doc/bison.texinfo (Prologue Alternatives): Update.
5852 (Decl Summary): Update to %code "requires" and %code "provides".
5853 (Calc++ Parser): Update to %code "requires".
148d66d8 5854 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
5855 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5856 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5857 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5858 which are skeleton-specific.
5859 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5860 declare what %code qualifiers it supports and to complain if any other
5861 qualifiers were used in the grammar.
5862 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5863 and b4_user_code([b4_percent_code_provides]) in place of
5864 b4_user_requires and b4_user_provides.
5865 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5866 Add b4_user_code([b4_percent_code_top]) and
5867 b4_user_code([b4_percent_code]).
5868 Invoke b4_check_percent_code_qualifiers.
5869 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5870 PERCENT_REQUIRES): Remove.
5871 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5872 %requires. Rewrite the %code RHS as the unqualified form defining the
5873 muscle b4_percent_code. Add another RHS for the qualified %code form,
5874 which defines muscles of the form b4_percent_code_QUALIFIER and the
5875 b4_used_percent_code_qualifiers muscle.
5876 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5877 PERCENT_REQUIRES): Remove.
5878 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5879 %code "requires" and %code "provides".
5880 * tests/input.at (Reject bad %code qualifiers): New.
5881
95021767
JD
58822007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5883
5884 Use the new code_props interface for destructors and printers.
5885 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5886 printer_location members, and change the type of the destructor and
5887 printer members to code_props.
5888 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5889 symbol_printer_get, semantic_type_destructor_set,
5890 semantic_type_printer_set, default_tagged_destructor_set,
5891 default_tagless_destructor_set, default_tagged_printer_set,
5892 default_tagless_printer_set): Use code_props in arguments and return
5893 types in place of char const * and location.
5894 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5895 since the locations are now contained in the return of
5896 symbol_destructor_get and symbol_printer_get.
5897 * src/output.c (symbol_destructors_output, symbol_printers_output):
5898 Replace with...
5899 (symbol_code_props_output): ... this to eliminate duplicate code.
5900 (output_skeleton): Update to use symbol_code_props_output.
5901 * src/reader.c (symbol_should_be_used): Update use of
5902 symbol_destructor_get.
5903 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5904 Update uses of the various _destructor_set and _printer_set functions.
5905 * src/symtab.c: (default_tagged_destructor_location,
5906 default_tagless_destructor_location, default_tagged_printer_location,
5907 default_tagless_printer_location): Remove since we...
5908 (default_tagged_destructor, default_tagless_destructor,
5909 default_tagged_printer, default_tagless_printer): ... change the type
5910 of these to code_props.
5911 (symbol_new, semantic_type_new, symbol_destructor_set,
5912 semantic_type_destructor_set, symbol_destructor_get,
5913 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
5914 symbol_check_alias_consistency, default_tagged_destructor_set,
5915 default_tagless_destructor_set, default_tagged_printer_set,
5916 default_tagless_printer_set): Update.
5917 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
5918 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
5919 code_props members.
5920 (symbol_print): Use SYMBOL_CODE_PRINT.
5921
f6857bbf
JD
59222007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5923
5924 Use the new code_props interface for rule actions.
5925 * src/symlist.h (symbol_list): Replace action, action_location, and
5926 used members with a code_props action_props member.
5927 * src/reader.c (symbol_should_be_used, grammar_rule_check,
5928 grammar_midrule_action, grammar_current_rule_merge_set,
5929 grammar_current_rule_symbol_append, packgram): Update.
5930 * src/scan-code.h (translate_rule_action): Remove, no longer used.
5931 * src/scan-code.l (handle_action_dollar): Update.
5932 (translate_rule_action): Remove, no longer used.
5933 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
5934
7c0c6181
JD
59352007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5936
5937 Use the new code_props interface in parse-gram.y.
5938 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
5939 Update all uses of translate_* functions to use the new code_props
5940 interface and to use gram_scanner_last_string_free and
5941 code_scanner_last_string_free where possible.
5942 (grammar_declaration): symbol_list_destructor_set and
5943 symbol_list_printer_set now perform the translation, so don't do it
5944 here. Use gram_scanner_last_string_free where possible.
5945 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
5946 translate_code): Remove, no longer used.
5947 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
5948 symbol_list_printer_set): Perform code translation here rather than
5949 depending on the caller to do so.
5950
5951 * src/symlist.h (struct symbol_list): Correct some documentation typos.
5952 * src/scan-gram.h (gram_last_string): Remove declaration.
5953 * src/scan-gram.l (last_string): Declare it static.
5954
28e52c0d
JD
59552007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5956
5957 Encapsulate code properties and related functionality for the various
5958 destructors, printers, and actions into a code_props structure and
5959 interface. This patch merely implements code_props in scan-code.h and
5960 scan-code.l. Future patches will rewrite other modules to use it.
5961 Discussed starting at
5962 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
5963 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
5964 consistently initialize const structs that have an empty location
5965 field.
5966 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
5967 to ensure consistency.
5968 * src/scan-code.h (code_props): New structure.
5969 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
5970 function, macro, and const global variable for initializing a
5971 code_props with no code.
5972 (code_props_plain_init, code_props_symbol_action_init,
5973 code_props_rule_action_init, code_props_translate_code): The rest of
5974 the new code_props functional interface. Among other things, the init
5975 functions set the code_props kind field so that
5976 code_props_translate_code will know whether to behave like
5977 translate_symbol_action, translate_rule_action, or translate_code.
5978 These old translate functions must remain until all other modules are
5979 updated to use the new code_props interface.
5980 (code_scanner_last_string_free): New function similar to
5981 gram_scanner_last_string_free.
5982 (code_scanner_free): Add documentation.
5983 * src/scan-code.l: Implement the new interface.
5984 (code_lex): Make it static, add a code_props* argument, and remove the
5985 rule argument.
5986 (last_string): New static global similar to the one in scan-gram.l.
5987 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
5988 instead of rule.
5989 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
5990 code_props since Bison may one day use this information for destructors
5991 and printers.
5992 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
5993 (handle_action_dollar): Use symbol_list_n_get and set used flag
5994 directly since symbol_list_n_used_set is removed.
5995 (translate_action): Add a code_props* argument and remove the rule,
5996 action, and location arguments. Pass the code_props* on to code_lex.
5997 (translate_rule_action, translate_symbol_action, translate_code):
5998 Rewrite as wrappers around the new code_props interface.
5999 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
6000 it would eventually need to break the encapsulation of code_props.
6001
96034983
JD
60022007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6003
6004 * etc/.cvsignore: New.
6005
945e396c
JD
60062007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6007
6008 Add maintainer-push-check to run maintainer-check using push parsing in
6009 place of pull parsing where available.
6010 * Makefile.am (maintainer-push-check): New.
6011 * data/bison.m4 (b4_use_push_for_pull_if): New.
6012 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
6013 appropriately based on their existing values.
6014 (yypush_parse): Don't print push-parser-specific diagnostics if push
6015 parsing is being used in place of pull parsing.
6016 * data/yacc.c: If push parsing should replace pull parsing, redirect to
6017 push.c.
6018 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
6019 variable, and insert b4_use_push_for_pull_flag into muscles.
6020 * tests/Makefile.am (maintainer-push-check): New.
6021
7d596384
JD
60222006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6023
6024 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
6025 (whether successful or failed) so that yypush_parse can be invoked
6026 again to start a new parse using the same yypstate.
6027 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
6028 check multiple yypull_parse invocations on the same yypstate. For pull
6029 mode, extend to check multiple yyparse invocations.
6030 (Exploding the Stack Size with Alloca): Extend to try with
6031 %push-pull-parser.
6032 (Exploding the Stack Size with Malloc): Likewise.
6033
6034 * tests/calc.at (Simple LALR Calculator): Don't specify
6035 %skeleton "push.c" since %push-pull-parser implies that now.
6036 * tests/headers.at (export YYLTYPE): Don't check for the push
6037 declarations. Otherwise, this test case can't be used to see if push
6038 mode can truly emulate pull mode.
6039 * tests/input.at (Torturing the Scanner): Likewise.
6040 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
6041 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
6042 AT_YACC_IF, which now includes the case of push mode since %skeleton
6043 need not be used for push mode. This will be more intuitive once
6044 push.c is renamed to yacc.c.
6045
7172e23e
JD
60462006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6047
6048 For push mode, convert yyparse from a macro to a function, invoke yylex
6049 instead of passing a yylexp argument to yypull_parse, and don't
6050 generate yypull_parse or yyparse unless %push-pull-parser is declared.
6051 Discussed starting at
6052 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
6053 * data/bison.m4 (b4_pull_if): New.
6054 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
6055 * data/push.c: Improve M4 quoting a little.
6056 (b4_generate_macro_args, b4_parenthesize): Remove.
6057 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
6058 any time a pull parser is requested.
6059 Don't #define this as a wrapper around yypull_parse. Instead, when
6060 both push and pull are requested, make it a function that does that
6061 same thing.
6062 (yypull_parse): If there's a b4_prefix, #define this to
6063 b4_prefix[pull_parse] when both push and pull are requested.
6064 Don't define this as a function unless both push and pull are
6065 requested.
6066 Remove the yylexp argument and hard-code yylex invocation instead.
6067 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
6068 %push-parser.
6069 * src/getargs.c (pull_parser): New global initialized to true.
6070 * getargs.h (pull_parser): extern it.
6071 * src/output.c (prepare): Insert pull_flag muscle.
6072 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
6073 (prologue_declaration): Set both push_parser and pull_parser = true for
6074 %push-pull-parser. Set push_parser = true and pull_parser = false for
6075 %push-parser.
6076 * src/scan-gram.l: Don't accept %push_parser as an alternative to
6077 %push-parser since there's no backward-compatibility concern here.
6078 Scan %push-pull-parser.
6079 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
6080 instead of %push-parser.
6081 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
6082 prototype it in the module that calls yyparse.
6083 * tests/input.at (Torturing the Scanner): Likewise.
6084 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
6085
2e7944cb
JD
60862006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
6087
6088 Update etc/bench.pl. Optimize push mode a little (the yyn change
6089 deserves most of the credit).
6090 * Makefile.am (SUBDIRS): Add etc subdirectory.
6091 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
6092 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
6093 yytoken, yyval, and yyloc declarations to...
6094 (yyparse or yypush_parse): ... here to improve performance. For
6095 yypush_parse invocations after the first, be sure to assign yyn its old
6096 value again.
6097 (yypstate_new): Don't bother initializing the yyresult field since the
6098 initial value isn't used.
6099 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
6100 remove the #define that, in push mode, set it to yyps->NAME.
6101 * etc/Makefile.am: New.
6102 * etc/bench.pl: Remove and build it instead from...
6103 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
6104 "tests/bison" from the build directory by default rather than just
6105 invoking "bison" from $PATH.
6106 (calc_grammar): Update push parser code: don't declare yylval globally,
6107 don't define yyparse_wrapper, and don't #define yyparse.
6108 (bench_grammar): Update to check all working combinations of yacc.c,
6109 push.c, impure, pure, pull, and push.
6110
c3d50342
JD
61112006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6112
6113 For push mode, add pull wrappers around yypush_parse.
6114 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
6115 (yypull_parse): New function wrapping yypush_parse.
6116 (yyparse): New #define wrapping yypull_parse.
6117 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
6118 is declared.
6119 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
6120 prototype yylex in the module that calls yyparse, and don't prototype
6121 yyparse there. Otherwise, the yyparse expansion won't compile.
6122 * tests/input.at (Torturing the Scanner): Likewise.
6123
94ebeba5
JD
61242006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6125
6126 Enable push parsers to operate in impure mode. Thus, %push-parser no
6127 longer implies %pure-parser. The point of this change is to move
6128 towards being able to test the push parser code by running the entire
6129 test suite as if %push-parser had been declared.
6130 * data/push.c (yypush_parse): For impure mode, remove the
6131 yypushed_char, yypushed_val, and yypushed_loc arguments.
6132 Instead, declare these as local variables initialized to the global
6133 yychar, yylval, and yylloc.
6134 For the first yypush_parse invocation only, restore the initial values
6135 of these global variables when it's time to read a token since they
6136 have been overwritten.
6137 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
6138 %push-parser.
6139 * tests/calc.at (Simple LALR(1) Calculator): Always declare
6140 %pure-parser along with %push-parser since this test case was designed
6141 for pure push parsers.
6142 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
6143 (AT_YACC_OR_PUSH_IF): New.
6144 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
6145 add a note that it's still wrong for some cases (as it has been for a
6146 while).
6147 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
6148 %push-parser no longer implies %pure-parser.
6149
a0633178
JD
61502006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6151
6152 Remove some unnecessary differences between the pull parser code and
6153 the push parser code. This patch enables yynerrs in push mode.
6154 * data/push.c: Reformat M4 a little.
6155 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
6156 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
6157 because push mode is on. Instead, if pure mode is on, move yynerrs
6158 to...
6159 (b4_declare_parser_state_variables): ... here.
6160 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
6161 to yyps->NAME so it can be used in yypush_parse.
6162 (yypush_parse): Don't omit uses of yynerrs in push mode.
6163
8646b6a3
JD
61642006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6165
6166 Fix bug such that the first pushed token's value and location are
6167 sometimes overwritten (sometimes by %initial-action) before being used.
6168 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
6169 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
6170 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
6171 more closely mimic the pull parser logic.
6172 Don't copy the pushed token to yychar, yylval, and yylloc until it's
6173 time to read a token, which is after any initialization of yylval and
6174 yylloc.
6175 (gottoken): Rename label to...
6176 (yyread_pushed_token): ... for clarity and to avoid infringing on the
6177 user namespace.
6178
9baf4d74
JD
61792006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6180
6181 Rearrange initialization of the parser state variables so that the
6182 skeleton doesn't have to have a copy for pull mode and another for push
6183 mode. This patch also fixes at least a bug such that yylloc was not
6184 initialized (with b4_location_initial_line and
6185 b4_location_initial_column) upon calling yypush_parse. However, that
6186 initialization now overwrites the first token's location;
6187 %initial-action assigning @$ already did the same thing, and both bugs
6188 will be fixed in a later patch.
6189 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
6190 (b4_declare_parser_state_variables): Remove initialization of yytoken,
6191 yyss, yyvs, yyls, and yystacksize.
6192 (yypstate_new): Remove initialization of some yypstate fields: yystate,
6193 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
6194 yylsp.
6195 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
6196 yyps->NAME so it can be used in yypush_parse.
6197 (yyparse or yypush_parse): For yypush_parse, don't print the
6198 "Starting parse" diagnostic for invocations after the first.
6199 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
6200 yypush_parse, only do it for the first invocation.
6201 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
6202 initialization to occur in yypush_parse but only on the first
6203 invocation.
6204
23522164
JD
62052006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6206
6207 * data/push.c: Add CPP guards around push parser declarations in both
6208 the header and the code file.
6209 In the code file, move the push parser declarations to the same place
6210 they appear in the header file.
6211 Clean up the M4 some, especially the inconsistent underquoting in
6212 some b4_c_function_def and b4_c_function_decl uses.
6213
bb010fe5
JD
62142006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6215
6216 Encapsulate the push parser state variables into an M4 macro so the
6217 push skeleton doesn't have to list them again for pull mode's yyparse.
6218 For push mode, remove yypush_parse's local equivalents of these
6219 variables to eliminate unnecessary copying between the two sets at
6220 run-time. This patch also fixes at least a bug related to multiple
6221 %initial-action invocations in push mode.
6222 * data/push.c (b4_declare_parser_variables): Rename to...
6223 (b4_declare_scanner_communication_variables): ... this for clarity and
6224 update both uses.
6225 (b4_declare_yyparse_variables): Remove and move its contents to the one
6226 spot where it was invoked.
6227 (b4_declare_parser_state_variables): New macro containing the parser
6228 state variables required by push mode.
6229 (struct yypstate): Replace all fields but yynew with
6230 b4_declare_parser_state_variables.
6231 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
6232 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
6233 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6234 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6235 parser state variable declarations with
6236 b4_declare_parser_state_variables.
6237 Don't initialize parser state variables when calling yypush_parse since
6238 yypstate_new already does that.
6239 Invoke the user's initial action only upon the first yypush_parse
6240 invocation.
6241 Remove all code that copies between the local parser state variables
6242 and the yypstate.
6243
2d212f8c
JD
62442006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6245
6246 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6247 prevent a name collision in a future patch where these names will
6248 sometimes be #define'd.
6249 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6250 since it no longer has the same name as the existing argument.
6251 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6252
e6e704dc
JD
62532006-12-19 Paolo Bonzini <bonzini@gnu.org>
6254 and Joel E. Denny <jdenny@ces.clemson.edu>
6255
6256 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6257 that the argument is case-insensitive, and there's no `=' here.
6258 For the %skeleton entry, mention that %language is better.
6259 (Bison Options): Likewise for --language and --skeleton. Move the
6260 --skeleton entry so that the `Tuning the parser' section is sorted
6261 alphabetically on long options.
6262 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6263 %language directive in detail here; cross-reference the %language
6264 documentation instead.
6265 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6266 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 6267 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
6268 * examples/extexi (normalize): Instead of replacing every %require
6269 argument with the current Bison version, just substitute for
6270 `@value{VERSION}'. This guarantees that we're testing what actually
6271 appears in the documentation.
6272 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6273 rather than `@VERSION@'.
6274
0e021770
PE
62752006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6276
fd575f05
PE
6277 * NEWS: Reword the %language news a bit, and put it earlier.
6278
0e021770
PE
6279 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6280 Rewrite to simplify the logic.
6281 (language_argmatch): Likewise.
fd575f05
PE
6282 (program_name): We now own this var.
6283 * src/getargs.h (struct bison_language): Use char[] rather than
6284 const char *.
0e021770
PE
6285
6286 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6287 Java is supported.
6288 * src/complain.c (program_name): Remove decl; no longer needed.
6289 * src/main.c (program_name): Remove; now belongs to getargs.
6290
62912006-12-18 Paolo Bonzini <bonzini@gnu.org>
6292
6293 * NEWS: Document %language.
6294
6295 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6296
6297 * data/c-skel.m4, data/c++-skel.m4: New files.
6298 * data/glr.c: Complain on push parsers.
6299
6300 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6301 over %skeleton.
148d66d8 6302 (Decl Summary): Document %language and %skeleton.
0e021770
PE
6303 (Command line): Document -L.
6304
6305 * examples/extexi: Rewrite %require directive.
6306 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6307
6308 * src/files.c (compute_exts_from_gc): Look in language structure
6309 for .y extension.
6310 (compute_file_name_parts): Check whether .tab should be added.
6311 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6312 (language, skeleton_arg, language_argmatch): New.
6313 (long_options): Add --language.
6314 (getargs): Use skeleton_arg, add -L/--language.
6315 * src/getargs.h: Include location.h.
6316 (struct bison_language, language, skeleton_arg, language_argmatch): New.
6317 * src/output.c (prepare): Pick default skeleton from struct language.
6318 Don't dispatch C skeletons here.
6319 * src/parse-gram.y (PERCENT_LANGUAGE): New.
6320 (prologue_declaration): Add "%language" rule, use skeleton_arg.
6321 * src/scan-gram.l ("%language"): New rule.
6322
6323 * tests/calc.at: Test %skeleton and %language.
6324 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
6325 (AT_GLR_IF): Look for %skeleton "glr.cc".
6326 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
6327 (AT_YACC_IF): Reject %language.
6328
5691bf57
PE
63292006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6330
db06f0ce
PE
6331 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
6332 since it wasn't used; only the typedef name 'semantic_type' is needed.
6333 Also, omit trailing white space.
6334
5691bf57
PE
6335 * bootstrap: Sync from coreutils.
6336 (gnulib_extra_files): Add build-aux/announce.gen.
6337 (slurp): Adjust .gitignore files like .cvsignore files.
6338 * build-aux/announce-gen: Remove from CVS, since bootstrap
6339 now creates this.
6340
791934e4
JD
63412006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
6342
6343 Make %push-parser imply %pure-parser. This fixes several bugs; see
6344 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
6345 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6346 pure_parser = true.
6347 * data/push.c: Don't bother testing b4_push_if when deciding whether
6348 to expand b4_declare_parser_variables globally.
6349 (yypush_parse): Likewise in here.
6350
6351 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
6352 (yy_reduce_print): Reformat M4 for readability.
6353
ee5abb37
JD
63542006-12-15 Bob Rossi <bob@brasko.net>
6355 and Joel Denny <jdenny@ces.clemson.edu>
6356
6357 * data/push.c (yypstate): Add typedef, and update all uses of
6358 struct yypstate to just yypstate.
6359 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
6360
16ca01f9
JD
63612006-12-14 Bob Rossi <bob@brasko.net>
6362
6363 * data/push.c (yypush_parse): Declare prototype regardless of
6364 %locations option.
6365
ab8e7e1a
JD
63662006-12-14 Bob Rossi <bob@brasko.net>
6367
6368 * data/push.c (yyparse): Remove the prototype and the #define when in
6369 push-parser mode.
6370
9bf32be3
JD
63712006-12-13 Bob Rossi <bob@brasko.net>
6372
6373 * data/push.c (yypstate_init): Rename to...
6374 (yypstate_new): ... this and use b4_c_function_def.
6375 (yypstate_delete): New.
6376 (yypush_parse): Change parameters yynval and yynlloc to be const.
6377 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
6378 yypstate_delete functions.
6379
f02e2948
JD
63802006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
6381
6382 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
6383 strange test case titles. Reported by Bob Rossi.
6384
38eb7751
PE
63852006-12-13 Paul Eggert <eggert@cs.ucla.edu>
6386
6387 * TODO: Add pointer to Sylvain Schmitz's work on static detection
6388 of potential ambiguities in GLR grammers.
6389
bd9d212b
JD
63902006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
6391
6392 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
6393 `bison ', use m4_index instead of m4_substr since chopping up a string
6394 containing M4-special characters causes problems here.
6395
6396 Fix a couple of bugs related to special characters in user-specified
6397 file names, and make it easier for skeletons to compute output file
6398 names with the same file name prefix as Bison-computed output file
6399 names.
6400 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
6401 b4_parser_file_name and b4_spec_defines_file instead of
6402 @output_parser_name@ and @output_header_name@, which are now redundant.
6403 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
6404 b4_parser_file_name, b4_spec_defines_file, and the new
6405 @basename(FILENAME@) instead of @output_parser_name@ and
6406 @output_header_name@, which inappropriately escaped the file names as
6407 C string literals.
6408 * src/files.c (all_but_ext): Remove static qualifier.
6409 (compute_output_file_names): Move `free (all_but_ext)' to...
6410 (output_file_names_free): ... here since all_but_ext is needed later.
6411 * src/files.h (all_but_ext): Extern.
6412 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
6413 exactly what MUSCLE_INSERT_STRING used to do.
6414 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
6415 characters are escaped properly.
6416 * src/output.c (prepare): Define muscle file_name_all_but_ext as
6417 all_but_ext.
6418 For pkgdatadir muscle, maintain previous functionality by using
6419 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
6420 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
6421 digraphs would never be expanded. Hopefully no one has M4-special
6422 characters in his Bison installation path.
6423 * src/scan-skel.l: Don't parse @output_header_name@ and
6424 @output_parser_name@ anymore since they're now redundant.
6425 In @output, use decode_at_digraphs.
6426 Parse a new @basename command that invokes last_component.
6427 (decode_at_digraphs): New.
6428 (BASE_QPUTS): Remove unused.
6429 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
6430 (Output file name): New tests.
6431
3f7ca628
JD
64322006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
6433
6434 Warn about output files that are generated by the skeletons and that
6435 conflict with other output files.
6436 * data/glr.c: Don't generate the header file here when glr.cc does.
6437 * src/files.c (file_names, file_names_count): New static globals.
6438 (compute_output_file_names): Invoke output_file_name_check for files
6439 not generated by the skeletons and remove existing checks.
6440 (output_file_name_check): New function that warns about conflicting
6441 output file names.
6442 (output_file_names_free): Free file_names.
6443 * src/files.h (output_file_name_check): Declare.
6444 * src/scan-skel.l: Invoke output_file_name_check for files generated by
6445 the skeletons.
6446 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
6447 (Conflicting output files): New tests.
6448
178e123e
PE
64492006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6450
6451 * doc/bison.texinfo: Fix a couple of typos.
6452
64532006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
6454
6455 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
6456 Rename to...
6457 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
6458 update all uses.
6459 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
6460 (yypush_parse): Rename yypvars argument to yyps and remove redundant
6461 local pv.
6462 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
6463 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
6464
ea17f233
JD
64652006-12-07 Bob Rossi <bob@brasko.net>
6466 and Joel Denny <jdenny@ces.clemson.edu>
6467
6468 * data/push.c (yypvarsinit): Change return type from void* to struct
6469 yypvars*. No longer cast to void* on return.
6470 (struct yypvars): Remove yylen since it need not be remembered between
6471 yypushparse invocations.
6472 (yypushparse): Don't copy between yylen and pv->yylen.
6473
55a30bda
JD
64742006-12-05 Bob Rossi <bob@brasko.net>
6475
6476 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6477 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6478 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6479 (struct yypvars): Remove b4_declare_parser_variables.
6480 (yypvarsinit): Remove init code for removed variables.
6481 (global scope): Do not declare b4_declare_parser_variables if
6482 push or pure mode.
6483 (yypushparse): Add b4_declare_parser_variables.
6484 Init new local variables, and remove init code for removed
6485 yypvars variables.
6486 (yyparse): Delete.
6487 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6488 and yyparse for other modes.
6489 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6490 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6491 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6492 (AT_PURE_LEX_IF): True if pure or push parser.
6493
85894313
JD
64942006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6495
6496 Document Yacc prologue alternatives and default %destructor's and
6497 %printer's as experimental. Don't mention Java yet. Discussed at
6498 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6499 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6500 (2.3a): Annotate this entry to say the old forms of these features were
6501 also experimental.
6502 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 6503 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
6504 of Java (we'll want this back eventually).
6505
02975b9a
JD
65062006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6507
6508 Support a file name argument to %defines. Deprecate `=' in
6509 %file-prefix, %name-prefix, and %output. Discussed at
6510 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6511 * NEWS (2.3a+): Mention.
148d66d8 6512 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
6513 form of %defines, and remove `=' from entries for %file-prefix,
6514 %name-prefix, and %output.
6515 * src/parse-gram.y (prologue_declaration): Implement.
6516 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6517 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6518 all but one occurrence of %name-prefix.
6519 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6520 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6521 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6522 occurrence of each of %file-prefix and %output. Add check for %defines
6523 with argument.
6524 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6525 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6526 Remove the `=' from %output.
6527
287b314e
JD
65282006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6529
6530 Don't escape $ in test case titles since Autoconf 2.61 now does that
6531 correctly.
6532 * tests/actions.at (Default %printer and %destructor are not for error
6533 or $undefined): Here.
6534 (Default %printer and %destructor are not for $accept): Here.
6535 * tests/input.at (Invalid $n and @n): Here.
6536
3ebecc24
JD
65372006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6538
6539 Rename <!> to <>. Discussed starting at
6540 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6541 * NEWS (2.3a+): Update.
148d66d8 6542 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
6543 Update.
6544 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6545 * src/scan-gram.l (INITIAL): Implement.
6546 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6547 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6548 comment.
6549 * tests/actions.at (Default tagless %printer and %destructor,
6550 Default tagged and per-type %printer and %destructor,
6551 Default %printer and %destructor are not for error or $undefined,
6552 Default %printer and %destructor are not for $accept,
6553 Default %printer and %destructor for mid-rule values): Update.
6554 * tests/input.at (Default %printer and %destructor redeclared,
6555 Unused values with default %destructor): Update.
6556
26b8a438
JD
65572006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6558
6559 Don't let %prec take a nonterminal.
6560 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6561 token.
6562 * tests/input.at (%prec takes a token): New test checking that %prec
6563 won't take a nonterminal.
6564
07c39ae9
JD
65652006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6566
405d53b7
JD
6567 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6568 it was double-quoted.
07c39ae9
JD
6569 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6570 grammar is maintained with Bison's highest standards.
6571 * src/getargs.c: Fix some typos in Doxygen comments.
6572
580b8926
JD
65732006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6574
6575 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6576 later. Reported by Paul Eggert in
6577 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6578 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6579 * src/scan-code.l (translate_action): Don't bother invoking
6580 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6581 (code_scanner_free): Instead of invoking
6582 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6583 which frees more.
6584 * src/scan-gram.l (gram_scanner_free): Likewise.
6585 * src/scan-skel.l (scan_skel): Likewise.
6586
4502eadc
JD
65872006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6588
6589 * src/files.c (tr): Change return type to void.
6590 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6591 has been called previously for the same key.
6592 (muscle_find): Return storage instead of value so that
6593 --enable-gcc-warnings doesn't produce warnings that the return discards
6594 const. aver that the value and storage are the same since storage
6595 could potentially be NULL when value is not.
6596 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6597 same as 0.
6598
7746c8f6
PE
65992006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6600
6601 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6602 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6603 us a slightly cleaner distribution, and also works.
6604 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6605 gnulib changes.
6606
eb095650
PE
66072006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6608 and Paul Eggert <eggert@cs.ucla.edu>
6609
6610 Don't let Bison leak memory except when it complains.
6611 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6612 (spec_defines_file, dir_prefix): Now char *, not const char *,
6613 since they are freed.
6614 * src/files.c: Likewise.
6615 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6616 Likewise.
6617 (tr): Now operates in-place. All uses changed.
6618 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6619 values.
6620 (compute_file_name_parts, compute_output_file_names): Don't store
6621 read-only data in variables that will be freed.
6622 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6623 src_extension, and header_extension.
6624 (output_file_names_free): New public function to free
6625 spec_verbose_file, spec_graph_file, spec_defines_file,
6626 parser_file_name, and dir_prefix.
6627 * src/getargs.c (getargs): Don't store read-only data in variables that
6628 will be freed.
6629 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6630 (which previously existed but was unused), and quotearg_free.
6631 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6632 * src/muscle_tab.c: Likewise.
6633 (muscle_entry): Make the value char const *,
6634 and add a new storage member that is char * and can be freed.
6635 (muscle_entry_free): New private function.
6636 (muscle_init): Use it instead of free.
6637 (muscle_insert, muscle_grow): Update and use new storage member.
6638 (muscle_code_grow): Free the string passed to muscle_grow
6639 since it's not needed anymore.
6640 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6641 add a new `char *code' member.
6642 ("{...}"): Declare semantic type as code.
6643 * src/scan-code.h (translate_rule_action):
6644 (translate_symbol_action, translate_code, translate_action): Return
6645 `char const *' rather than `char *' since external code should not free
6646 these strings.
6647 * src/scan-code.l: Likewise.
6648 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6649 which is "{...}" in the parser.
6650 * tests/Makefile.am (maintainer-check-valgrind): Set
6651 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6652 Valgrind.
6653 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6654 complain.
6655 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6656 expecting a non-zero exit status sets --leak-check=summary and
6657 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6658 this case, and we don't want to hear about it.
6659
ac564be4
PE
66602006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6661
6662 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6663 instead of from the template, to simplify configuration a bit.
6664 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6665 and m4/wint_t.m4, as they are needed with the latest gnulib.
6666
17bd8a73
JD
66672006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6668
6669 Disable unset/unused mid-rule value warnings by default, and recognize
6670 --warnings=midrule-values to enable them. Discussed starting at
6671 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6672 * NEWS (2.3a+): Mention.
6673 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6674 warnings): Add entry for midrule-values subargument.
6675 * src/reader.c (symbol_should_be_used): Don't return true just because
6676 the value is a set/used mid-rule value unless
6677 --warnings=midrule-values was specified.
6678 * tests/input.at (Unused values, Unused values before symbol
6679 declarations): Run tests with and without --warnings=midrule-values.
6680
6681 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6682 than LIST_FREE directly.
6683
89eb3c76
JD
66842006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6685
6686 Finish implementing --warnings=error, which should not be implied by
6687 --warnings=all (or by its synonyms -W and --warnings without
6688 subarguments).
6689 * src/complain.c (set_warning_issued): New function to report that
6690 warnings are being treated as errors and to record an error if so.
6691 Invoke...
6692 (warn_at, warn): ... here.
6693 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6694 "error - warnings are errors" does not appear above "all - all of the
6695 above".
6696 (getargs): For -W and --warnings without subarguments, don't let
6697 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6698 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6699
ba7560e2
JD
67002006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6701
6702 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6703 empty subargument list. For example: `bison --warnings= parser.y'.
6704
31283fc3
JD
67052006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6706
6707 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6708 the parser header file so that gcc doesn't warn.
6709
12e35840
JD
67102006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6711
6712 Split the default %destructor/%printer into two kinds: <*> and <!>.
6713 Discussed starting at
6714 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6715 * NEWS (2.3a+): Mention.
6716 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6717 previous change today related to mid-rules.
148d66d8 6718 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 6719 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
6720 (TYPE_TAG_ANY): Add as <*>.
6721 (TYPE_TAG_NONE): Add as <!>.
6722 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6723 for <*> and <!>.
6724 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6725 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6726 * src/symlist.c (symbol_list_default_new): Split into tagged and
6727 tagless versions.
6728 (symbol_list_destructor_set, symbol_list_printer_set): Split
6729 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6730 SYMLIST_DEFAULT_TAGLESS.
6731 * src/symlist.h: Update symbol_list_default*_new prototypes.
6732 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6733 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6734 * src/symtab.c (default_destructor, default_destructor_location,
6735 default_printer, default_printer_location): Split each into tagged and
6736 tagless versions.
6737 (symbol_destructor_get, symbol_destructor_location_get,
6738 symbol_printer_get, symbol_printer_location_get): Implement tagged
6739 default and tagless default cases.
6740 (default_destructor_set, default_printer_set): Split each into tagged
6741 and tagless versions.
6742 * src/symtab.h: Update prototypes.
6743 * tests/actions.at (Default %printer and %destructor): Rename to...
6744 (Default tagless %printer and %destructor): ... this, and extend.
6745 (Per-type %printer and %destructor): Rename to...
6746 (Default tagged and per-type %printer and %destructor): ... this, and
6747 extend.
6748 (Default %printer and %destructor for user-defined end token): Extend.
6749 (Default %printer and %destructor are not for error or $undefined):
6750 Update.
6751 (Default %printer and %destructor are not for $accept): Update.
6752 (Default %printer and %destructor for mid-rule values): Extend.
6753 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6754 (Unused values with default %destructor): Extend.
6755
f91b1629
JD
67562006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6757
6758 Don't apply the default %destructor/%printer to an unreferenced midrule
6759 value. Mentioned at
6760 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6761 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6762 like $@n instead of just @n so that the default %destructor/%printer
6763 logic doesn't see them as user-defined symbols.
6764 (symbol_is_dummy): Check for both forms of the name.
6765 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6766 name for which the midrule value is referenced in any action.
6767 * tests/actions.at (Default %printer and %destructor for mid-rule
6768 values): New test.
6769 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6770 for change to dummy symbol names.
6771
519d0004
JD
67722006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6773
6774 Warn about unset midrule $$ if the corresponding $n is used.
6775 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6776 $n usage.
6777 (packgram): Before invoking grammar_rule_check on any rule, make sure
6778 all actions have already been scanned in order to set `used' flags.
6779 Otherwise, checking that a midrule's $$ is set will not always work
6780 properly because the midrule check must forward-reference the midrule's
6781 parent rule.
6782 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6783 warning.
6784
a501eca9
JD
67852006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6786
6787 More improvements to the documentation of the prologue alternatives:
6788 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6789 Bison manual.
6790 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6791 some text to clarify the relative importance of the new directives and
6792 to show how these directives may be viewed as code labels.
6793
2cbe6b7f
JD
67942006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6795
6796 Similar to the recently removed %before-header, add %code-top as the
6797 alternative to the pre-prologue. Mentioned at
6798 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6799 Also, let the prologue alternatives appear in the grammar section.
6800 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6801 (prologue_declaration): Move the existing prologue alternatives to...
6802 (grammar_declaration): ... here and add %code-top.
6803 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6804
6805 Clean up and extend documentation for the prologue alternatives.
6806 * NEWS (2.3a+): Describe prologue alternatives.
6807 * doc/bison.texinfo (Prologue): Move discussion of prologue
6808 alternatives to...
6809 (Prologue Alternatives): ... this new section, and extend it to discuss
6810 all 4 directives in detail.
148d66d8
JD
6811 (Table of Symbols): Clean up discussion of prologue alternatives and
6812 add %code-top.
2cbe6b7f 6813
e557d3ea
JMG
68142006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6815
6816 DJGPP specific issues.
6817
6818 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6819 config.bat accordingly.
6820 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6821 * djgpp/config.site: Likewise.
6822
136a0f76
PB
68232006-10-16 Paolo Bonzini <bonzini@gnu.org>
6824
27bd5d67
PB
6825 Replace %*-header with %provides, %requires, %code. See discussion at
6826 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6827
136a0f76
PB
6828 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6829 (b4_user_start_header): Remove.
6830 * data/glr.c: Use new macros instead of b4_*start_header
6831 and b4_*end_header.
6832 * data/glr.cc: Likewise.
6833 * data/lalr1.cc: Likewise.
6834 * data/push.c: Likewise.
6835 * data/yacc.c: Likewise.
6836
6837 * doc/bison.texinfo: Remove %before-header, rename
6838 %{start,end,after}-header to %requires, %provides, %code.
6839
6840 * src/parse-gram.y: Likewise (also rename token names accordingly).
6841 * src/scan-gram.l: Likewise.
6842 * tests/actions.at: Likewise.
6843
10f429ef
PE
68442006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6845
6846 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6847 Problem reported by Joel E. Denny.
6848
68492006-10-14 Jim Meyering <jim@meyering.net>
6850
6851 (Sync from coreutils.)
6852 Work also when the working directory (with e.g. coreutils sources)
6853 is version controlled with git, rather than CVS.
6854 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6855 rather than CVS.
6856 In messages and comments, say e.g., "checked-out sources",
6857 rather than "CVS sources".
6858 (version_controlled_file): New function. Work for git as well as
6859 for CVS. Don't use grep's -q option.
6860 (slurp): Call it here, in place of CVS-specific code.
6861
c4bd5bf7
JD
68622006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6863
6864 Fix testsuite for ./configure --enable-gcc-warnings:
6865 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6866 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6867 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6868 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6869 * test/regression.at (Diagnostic that expects two alternatives):
6870 Likewise.
6871
46356ea4
PE
68722006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6873
231ed89a
PE
6874 * bootstrap.conf (gnulib_modules): Add config-h.
6875 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6876 worry about HAVE_CONFIG_H.
6877 * lib/abitset.c: Likewise.
6878 * lib/bitset.c: Likewise.
6879 * lib/bitset_stats.c: Likewise.
6880 * lib/bitsetv-print.c: Likewise.
6881 * lib/bitsetv.c: Likewise.
6882 * lib/ebitset.c: Likewise.
6883 * lib/get-errno.c: Likewise.
6884 * lib/lbitset.c: Likewise.
6885 * lib/subpipe.c: Likewise.
6886 * lib/timevar.c: Likewise.
6887 * lib/vbitset.c: Likewise.
6888 * lib/bitset.c: Include "bitset.h" first, to test interface.
6889 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6890 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6891 * lib/bitsetv.c: Include "bitsetv.h" first.
6892 * lib/get-errno.c: Include "get-errno.h" first.
6893 * m4/.cvsignore: Add config-h.m4.
6894 * tests/actions.at (Default %printer and %destructor for ...):
6895 Adjust expected line numbers in output to reflect removal of #if
6896 HAVE_CONFIG_H lines.
6897 * tests/glr-regression.at (Missed %merge type warnings when ...):
6898 Likewise.
6899 * tests/regression.at (Braced code in declaration in rules section):
6900 Likewise.
6901 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6902 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6903 Include <config.h> unconditionally.
6904
46356ea4
PE
6905 * bootstrap: Sync from coreutils, as follows:
6906
6907 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6908
6909 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6910 variable was sometimes used without being initialized. This
6911 messed up the installation of the INSTALL file in some cases.
6912
6913 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6914
6915 * bootstrap (usage, main program, symlink_to_gnulib): Add option
6916 --copy. Inspired by a suggestion from Bruno Haible.
6917
6918 2006-10-03 Jim Meyering <jim@meyering.net>
6919
6920 * bootstrap: Undo last change to this file, since now gnulib-tool
6921 sticks with the automake default in generating dependencies.
6922
dd4bf078
PE
69232006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6924
cf2a5f7c
PE
6925 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
6926 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
6927
6928 * doc/bison.1: Add copyright notice.
6929
6930 * data/glr.c: Don't include <stdarg.h>; not used.
6931
35fe0834
PE
6932 * NEWS: The -g and --graph options now output graphs in Graphviz
6933 DOT format, not VCG format.
6934 * doc/bison.1: Likewise.
6935 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
6936 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
6937 of this change in
6938 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
6939 * TODO: Remove Graphviz entry.
6940 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
6941 remove vcg.c, vcg.h, vcg_defaults.h.
6942 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
6943 * src/graphviz.c, src/graphviz.h: New files.
6944 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
6945 * src/files.h: Make comment more generic.
6946 * src/main.c (main): Likewise.
6947 * src/print_graph.h: Likewise.
6948 * src/getargs.c (usage): Make usage description more generic.
6949 * src/print_graph.c: Include graphviz.h rather than vcg.h.
6950 (static_graph, fgraph): Remove. All uses changed to pass
6951 arguments instead of sharing a static var.
6952 (print_core, print_actions, print_state, print_graph):
6953 Output graphviz format rather than VCG format.
6954 * tests/.cvsignore: Remove *.vcg; add *.dot.
6955 * tests/output.at: Expect *.dot files, not *.vcg files.
6956
dd4bf078
PE
6957 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
6958 accommodates the 2006-10-08 change.
6959
efdd7421
PE
69602006-10-11 Bob Rossi <bob@brasko.net>
6961
6962 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
6963 (b4_yyssa, b4_yyerror_range): New macros.
6964 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
6965 (yypvarsinit): Remove init of removed fields.
6966 (yypushparse): Remove use of removed fields; use new macros instead.
6967
96a1981a
PE
69682006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6969
6970 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
6971 in a push parser. Reindent slightly to match yacc.c better.
6972
69732006-10-11 Bob Rossi <bob@brasko.net>
6974
46356ea4
PE
6975 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
6976 yymsg_alloc fields.
6977 (yypvarsinit, yypushparse): Remove init of removed fields.
6978 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 6979
c1630a8b
PE
69802006-10-09 Paul Eggert <eggert@cs.ucla.edu>
6981
6982 * THANKS: Add Paolo Bonzini and Bob Rossi.
6983
90b9908d
PB
69842006-10-08 Paolo Bonzini <bonzini@gnu.org>
6985
6986 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
6987 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
6988 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
6989 b4_define_user_cde and uses): Remove.
6990 (b4_comment, b4_prefix, b4_sync_start): New.
6991 * data/bison.m4: New file, with most of the content removed from c.m4.
6992 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
6993 * src/output.c (output_skeleton): Pass bison.m4.
6994 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
6995 only if specified.
6996
cf806753
PE
69972006-10-05 Paul Eggert <eggert@cs.ucla.edu>
6998
6999 Fix test failure reported by Tom Lane in
7000 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
7001 and try to make such failures easier to catch in the future.
7002 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
7003 that's now the caller's responsibility.
7004 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
7005 Set yychar = YYEOF if it's negative.
7006 * tests/actions.at (yylex): Abort if asked to read past EOF.
7007 * tests/conflicts.at (yylex): Likewise.
7008 * tests/cxx-type.at (yylex): Likewise.
7009 * tests/glr-regression.at (yylex): Likewise.
7010 * tests/input.at (yylex): Likewise.
7011 * tests/regression.at (yylex): Likewise.
7012 * tests/torture.at (yylex): Likewise.
7013
0e2f006a
PE
70142006-10-01 Paul Eggert <eggert@cs.ucla.edu>
7015
7016 Fix problems with translating English-language diagnostics.
7017 * bootstrap: Fix bug introduced in recent bootstrap changes, with
7018 respect to bison-runtime pot generation. The YY_ stuff
7019 wasn't being captured.
7020 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
7021 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
7022 * runtime-po/POTFILES.in: Add data/push.c.
7023
e3ddc1e3
PE
70242006-09-29 Paul Eggert <eggert@cs.ucla.edu>
7025
7026 Merge bootstrap changes from coreutils.
7027
7028 2006-09-28 Jim Meyering <jim@meyering.net>
7029
7030 Automatically generated dependencies are important even
7031 when all of the sources in a directory come from gnulib.
7032 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
7033 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
7034
7035 2006-09-23 Jim Meyering <jim@meyering.net>
7036
7037 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
7038
7039 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7040
7041 * bootstrap: Add support for --force.
7042 (usage): New function. Describe usage less tersely.
7043 (CVS_only_file): New var.
7044
01e972b3
PE
70452006-09-21 Paul Eggert <eggert@cs.ucla.edu>
7046
7047 * data/push.c (YYPUSH_MORE): Make it an enum instead.
7048 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
7049 Adjust white space and comments to match GNU style better.
7050
c63d3e90
PE
70512006-09-20 Bob Rossi <bob@brasko.net>
7052
7053 * data/push.c (yyresult_get): Remove function.
7054 (YYPUSH_MORE): Add #define.
7055 (yypushparse): Modify return value.
7056
e70f46d1
PE
70572006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7058
7059 * stamp-h.in: Remove; no longer needed.
7060 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
7061 Remove config.h, config.hin, intl (no longer created).
7062 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
7063 stamp-h1.
7064
7065 Sync bootstrap from coreutils, as follows:
7066
7067 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
7068
7069 * bootstrap (symlink_to_gnulib): New function.
7070 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
7071 to copies-of-gnulib.
7072 (cp_mark_as_generated, slurp, gnulib_files):
7073 Avoid making a copy if it's the same as the old version.
7074 (gnulib_files): Add support for this variable (used by Bison).
7075
a92be413
PE
70762006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7077
7078 * src/getargs.c (usage): Rework to use conventions similar to
7079 coreutils, to make translation a bit easier and the code a bit
7080 smaller. Problem reported by Tim Van Holder.
7081
4f82b42a
PE
70822006-09-15 Paul Eggert <eggert@cs.ucla.edu>
7083
3b2942e6
PE
7084 Use some of gnulib's new modules, taken from coreutils.
7085
7086 * bootstrap: Sync from coreutils, except add support for gnulib_files.
7087 * bootstrap.conf: New file.
7088 (gnulib_modules): Add configmake, inttypes, unistd.
7089 (XGETTEXT_OPTIONS): Add complain, complain_at,
7090 fatal, fatal_at, warn, warn_at, unexpected_end.
7091 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
7092 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
7093 (gl_EARLY): Add.
7094 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
7095 (gl_INIT): Add
7096 (GNULIB_AUTOCONF_SNIPPET): Remove.
7097 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
7098 the pickiest.
7099 * lib/.cvsignore: Add inttypes_.h.
7100 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
7101 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
7102 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
7103 no-longer-necessary initializations.
7104 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
7105 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
7106 use the unistd module.
7107 * src/system.h: Likewise.
7108 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
7109 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
7110 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
7111 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
7112 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
7113 * src/system.h: Include inttypes.h unconditionally, now that we
7114 use the inttypes module. Don't bother to include stdint.h, since
7115 inttypes.h now does that for us.
7116 (LOCALEDIR): Remove, now that we use the configmake module.
7117 * src/getargs.c: Include configmake.h.
7118 * src/main.c: Likewise.
7119 * src/output.c: Likewise.
7120 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
7121 not from $abs_top_builddir, since config.h moved.
7122
7123
4f82b42a
PE
7124 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
7125 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
7126
7127 * src/parse-gram.y (symbol_declaration): Don't put statements
7128 before declarations; it's not portable to C89.
7129 * src/scan-code.l (handle_action_at): Likewise.
7130
7131 * src/scan-code.l: Always initialize braces_level; the old code
7132 left it uninitialized and therefore had undefined behavior.
7133
7134 Don't attempt to redefine 'assert', since it runs afoul of
7135 systems where standard headers (mistakenly) include <assert.h>.
7136 Instead, define and use our own alternative, called 'aver'.
7137 * src/reader.c: Don't include assert.h, since we no longer
7138 use assert.
7139 * src/scan-code.l: Likewise.
7140 * src/system.h (assert): Remove, replacing with....
7141 (aver): New function, taking a bool arg. All uses changed.
7142 * src/tables.c (pack_vector): Ensure that aver arg is bool,
7143 not merely an integer.
7144
31c10e38
PE
71452006-09-15 Bob Rossi <bob@brasko.net>
7146
7147 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
7148 * data/c.m4 (YYPUSH): New.
7149 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
7150 * src/getargs.c (push_parser): New var.
7151 * src/getargs.h (push_parser): New declaration.
7152 * src/output.c (prepare): Add macro insertion of `push_flag'.
7153 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
7154 (prologue_declaration): Parse %push-parser.
7155 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
7156 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
7157 list of removed lines from the traces observed.
7158 (AT_CHECK_CALC_LALR): Added push parser tests.
7159
fa7b79c0
PE
71602006-09-13 Paul Eggert <eggert@cs.ucla.edu>
7161
21fe08ca
PE
7162 * NEWS: Version 2.3a.
7163 * configure.ac (AC_INIT): Likewise.
7164
e8ec4d9b
PE
7165 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
7166 "#define YYSTYPE int" that caused "make maintainer-check" to fail
7167 due to header ordering dependencies. I don't know why the #define
7168 was there.
7169
fa7b79c0
PE
7170 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
7171 runtime cost when YYDEBUG is not defined, and so that some tests
7172 that used to fail now work. Problem and initial suggestion by
7173 Paolo Bonzini.
7174 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
7175 * data/glr.cc (b4_parser_class_name):
7176 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
7177 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
7178 (yydebug_) [YYDEBUG]: New member.
7179 (yycdebug_): Now defined only if YYDEBUG.
7180 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
7181 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
7182 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
7183 if YYYDEBUG.
7184 (debug_stream, set_debug_stream, debug_level, set_debug_level):
7185 Define only if YYDEBUG.
7186 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
7187 set_debug_level.
7188 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
7189 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
7190 AT_CHECK_CALC_GLR_CC that are working now.
7191
4ec13d60
PE
71922006-09-12 Paul Eggert <eggert@cs.ucla.edu>
7193
7194 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
7195 We don't need them in glr.cc, and glr.c defines them.
7196 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
7197 assumes that defining it to anything is the same as defining
7198 it to 1. Problem reported by Paolo Bonzini.
7199
8e1687ae
PE
72002006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
7201
7202 * data/c.m4 (b4_null, b4_case): Define.
7203 * src/output.c (prepare_symbols): Use b4_null.
7204 (user_actions_output): Use b4_case.
7205
3dc5e96b
PE
72062006-09-11 Paul Eggert <eggert@cs.ucla.edu>
7207
aef3da86
PE
7208 * data/glr.c (b4_shared_declarations): Put start-header first,
7209 before any #includes that we generate, so that feature-test
7210 macros work. Problem reported by Michael Deutschmann in
7211 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7212 * data/lalr1.cc: Likewise.
7213 * doc/bison.texinfo (Prologue): Document that feature-test macros
7214 should be defined before any Bison declarations.
7215 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
7216 that depend on location.hh after, not before, Bison decls, since
7217 we now include location.hh after the first user prologue.
7218
3dc5e96b
PE
7219 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
7220 Sander Brandenburg in
7221 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
7222 Also, fix minor white space and comment issues.
aef3da86
PE
7223 (Prologue): Mention that it's better to define feature-test macros
7224 before Bison declarations. Problem reported by Michael Deutschmann.
7225
7226 * README-cvs: Fix typo: "&" should be "&&". Problem reported
7227 by Jim Meyering.
7228 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
7229 This adjusts to recent gnulib changes.
3dc5e96b 7230
b2a0b7ca
JD
72312006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7232
7233 Finish implementation of per-type %destructor/%printer. Discussed
7234 starting at
7235 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7236 and
7237 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7238 * NEWS (2.3+): Add a description of this feature to the default
7239 %destructor/%printer description.
7240 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7241 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7242 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7243 list node contains a semantic type.
7244 * src/symtab.c, src/symtab.h: Extend with a table that associates
7245 semantic types with their %destructor's and %printer's.
7246 (semantic_type_from_uniqstr, semantic_type_get,
7247 semantic_type_destructor_set, semantic_type_printer_set): New functions
7248 composing the public interface of that table.
7249 (symbol_destructor_get, symbol_destructor_location_get,
7250 symbol_printer_get, symbol_printer_location_get): If there's no
7251 per-symbol %destructor/%printer, look up the per-type before trying
7252 the default.
7253 * tests/actions.at (Per-type %printer and %destructor): New test case.
7254 * tests/input.at (Default %printer and %destructor redeclared):
7255 Extend to check that multiple occurrences of %symbol-default in a
7256 single %destructor/%printer declaration is an error.
7257 (Per-type %printer and %destructor redeclared, Unused values with
7258 per-type %destructor): New test cases.
7259
3be03b13
JD
72602006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7261
7262 Require default %destructor/%printer to be declared using
7263 %symbol-default instead of an empty symbol list, and start working on
7264 new per-type %destructor/%printer. Discussed at
7265 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7266 * NEWS (2.3+): Add %symbol-default to example.
7267 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 7268 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
7269 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7270 (generic_symlist, generic_symlist_item): New nonterminals for creating
7271 a list in which each item is a symbol, semantic type, or
7272 %symbol-default.
7273 (grammar_declaration): Use generic_symlist in %destructor and %printer
7274 declarations instead of symbols.1 or an empty list.
7275 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7276 for changes to symbol_list.
7277 * src/reader.c: Update for changes to symbol_list.
7278 * src/scan-code.l: Likewise.
7279 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7280 * src/symlist.c, src/symlist.h: Extend such that a list node may
7281 represent a semantic type or a %symbol-default in addition to just an
7282 ordinary symbol. Add switched functions for setting %destructor's and
7283 %printer's.
7284 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7285 %destructor/%printer declarations.
7286
3508ce36
JD
72872006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7288
7289 Whether the default %destructor/%printer applies to a particular symbol
7290 isn't a question of whether the user *declares* that symbol (in %token,
7291 for example). It's a question of whether the user by any means
7292 *defines* the symbol at all (by simply using a char token, for
7293 example). $end is defined by Bison whereas any other token with token
7294 number 0 is defined by the user. The error token is always defined by
7295 Bison regardless of whether the user declares it with %token, but we
7296 may one day let the user define error as a nonterminal instead.
7297 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7298 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7299 the meaning of "user-defined".
7300 * tests/actions.at (Default %printer and %destructor for user-declared
7301 end token): Rename to...
7302 (Default %printer and %destructor for user-defined end token): ...
7303 this.
7304
7305 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7306 computation of whether to apply the default, don't maintain a list of
7307 every Bison-defined symbol. Instead, just check for a first character
7308 of '$', which a user symbol cannot have, and check for the error token.
7309
9350499c
JD
73102006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7311
7312 Don't apply the default %destructor or %printer to the error token,
7313 $undefined, or $accept. This change fits the general rule that the
7314 default %destructor and %printer are only for user-declared symbols,
7315 and it solves several difficulties that are described in the new test
7316 cases listed below.
7317 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
7318 * tests/actions.at (Default %printer and %destructor are not for error
7319 or $undefined, Default %printer and %destructor are not for $accept):
7320 New test cases.
7321
4d7370cb
JD
73222006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
7323
7324 Allow %start after the first rule.
7325 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
7326 when parsing the first rule.
7327 (check_and_convert_grammar): Search for it here after all grammar
7328 declarations have been parsed. Skip midrules, which have dummy LHS
7329 nonterminals.
7330 * src/symtab.c (symbol_is_dummy): New function.
7331 * src/symtab.h (symbol_is_dummy): Declare it.
7332 * tests/input.at (%start after first rule): New test.
7333
6d0ef4ec
JD
73342006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7335
7336 Redo some of the previous commit: add back the ability to use
7337 non-aliased/undeclared string literals since it might be useful to
7338 those declaring %token-table.
7339 * src/reader.c (check_and_convert_grammar): Undo changes in previous
7340 commit: don't worry about complaints from symbols_pack.
7341 * src/symtab.c (symbol_new, symbol_class_set,
7342 symbol_check_alias_consistency): Undo changes in previous commit: count
7343 each string literal as a new symbol and token, assign it a symbol
7344 number, and don't complain about non-aliased string literals.
7345 (symbols_pack): Since symbol_make_alias still does not decrement symbol
7346 and token counts but does still set aliased tokens to the same number,
7347 symbol_pack_processor now leaves empty slots in the symbols array.
7348 Remove those slots.
7349 * tests/regression.at (Undeclared string literal): Remove test case
7350 added in previous commit since non-aliased string literals are allowed
7351 again.
7352 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
7353 remove unnecessary string literal declarations.
7354 * tests/sets.at (Firsts): Likewise.
7355
965537bc
JD
73562006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7357
7358 Don't allow an undeclared string literal, but allow a string literal to
7359 be used before its declaration.
7360 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
7361 symbols_pack complained.
7362 * src/symtab.c (symbol_new): Don't count a string literal as a new
7363 symbol.
7364 (symbol_class_set): Don't count a string literal as a new token, and
7365 don't assign it a symbol number since symbol_make_alias does that.
7366 (symbol_make_alias): It's not necessary to decrement the symbol and
7367 token counts anymore. Don't assume that an alias declaration occurs
7368 before any uses of the identifier or string, and thus don't assert that
7369 one of them has the highest symbol number so far.
7370 (symbol_check_alias_consistency): Complain if there's a string literal
7371 that wasn't declared as an alias.
7372 (symbols_pack): Bail if symbol_check_alias_consistency failed since
7373 symbol_pack asserts that every token has been assigned a symbol number
7374 although undeclared string literals have not.
7375 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 7376 string literal): New test cases.
965537bc
JD
7377 (Characters Escapes, Web2c Actions): Declare string literals as
7378 aliases.
7379 * tests/sets.at (Firsts): Likewise.
7380
47aee066
JD
73812006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
7382
7383 In the grammar scanner, STRING_FINISH unclosed constructs and return
7384 them to the parser in order to improve error messages.
7385 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
7386 SC_BRACED_CODE, SC_PROLOGUE): Implement.
7387 * tests/input.at (Unclosed constructs): New test case.
7388 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
7389 seen.
7390
7391 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
7392 unused global.
7393
1f6b3679
JD
73942006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
7395
7396 Handle string aliases for character tokens correctly.
7397 * src/symtab.c (symbol_user_token_number_set): If the token has an
7398 alias, check and set its alias's user token number instead of its own,
7399 which is set to indicate the alias. Previously, every occurrence of
7400 the character token in the grammar overwrote that alias indicator with
7401 the character code.
7402 * tests/input.at (String aliases for character tokens): New test.
7403
219741d8
JD
74042006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
7405
7406 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
7407
11daa4e7
PE
74082006-08-11 Paul Eggert <eggert@cs.ucla.edu>
7409
7410 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
7411 to prevent failures when building on older platforms.
7412 Check for autopoint failure.
7413 Set XGETTEXT_OPTIONS to values that check for C format strings,
7414 so that translators are warned about them (this also helps
7415 prevent core dumps).
7416
7417 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
7418 function, since it simplifies our code a bit.
7419
7420 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
7421 rather than -W, so we don't get bogus warnings about sign comparisons.
7422 Add -Wpointer-arith, since that warning is useful (it reports code
7423 that does not conform to C89 and that some compilers reject).
7424 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
7425 since it's no longer needed.
7426
f9bfc42a
JD
74272006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
7428
7429 Clean up scanners a bit.
7430 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
7431 definitions so gcc won't warn when obstack_for_string is unused.
7432 * src/scan-code.l: config.h and system.h are already #include'd by
7433 scan-code-c.c, so get rid of them here.
7434 * src/scan-gram.l: Likewise.
7435 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
7436 definitions rather than duplicating the rest of it.
7437 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
7438
06e8700a
JD
74392006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
7440
7441 Suppress signed/unsigned comparison warnings for yycheck.
7442 * data/c.m4 (b4_safest_int_type): New macro.
7443 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
7444 a signed int type, cast it to b4_safest_int_type first.
7445 * data/yacc.c: Likewise.
7446 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
7447 also overwritten.
7448
9c437126
PE
74492006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
7450
7451 * doc/bison.texinfo: Fix some typos.
7452
284d8a13
PE
74532006-08-02 Paul Eggert <eggert@cs.ucla.edu>
7454
7455 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
7456 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
7457
7458 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
7459 the latest gnulib does this a different way.
7460 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
7461 translation was patched, so stop omitting it.
7462
ec5479ce
JD
74632006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7464
7465 Enable declaration of default %printer/%destructor. Make the parser
7466 use these for all user-declared grammar symbols for which the user does
7467 not declare a specific %printer/%destructor. Thus, the parser uses it
7468 for token 0 if the user declares it but not if Bison generates it as
7469 $end. Discussed starting at
7470 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7471 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7472 and
7473 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7474 * NEWS (2.3+): Mention.
7475 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7476 declare a %destructor for a mid-rule's semantic value. It's just
7477 impossible to declare one specific to it.
7478 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7479 code. Describe default %destructor form.
7480 * src/parse-gram.y (grammar_declaration): Parse default
7481 %printer/%destructor declarations.
7482 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7483 and symbol_destructor_location_get rather than accessing the destructor
7484 and destructor_location members of struct symbol.
7485 (symbol_printers_output): Likewise but for %printer's.
7486 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7487 again.
7488 * src/symtab.c (default_destructor, default_destructor_location,
7489 default_printer, default_printer_location): New static global
7490 variables to record the default %destructor and %printer.
7491 (symbol_destructor_get, symbol_destructor_location_get,
7492 symbol_printer_get, symbol_printer_location_get): New functions to
7493 compute the appropriate %destructor and %printer for a symbol.
7494 (default_destructor_set, default_printer_set): New functions to set the
7495 default %destructor and %printer.
7496 * src/symtab.h: Prototype all those new functions.
7497 * tests/actions.at (Default %printer and %destructor): New test to
7498 check that the right %printer and %destructor are called, that they're
7499 not called for $end, and that $$ and @$ work correctly.
7500 (Default %printer and %destructor for user-declared end token): New
7501 test to check that the default %printer and %destructor are called for
7502 a user-declared end token.
7503 * tests/input.at (Default %printer and %destructor redeclared, Unused
7504 values with default %destructor): New tests to check related grammar
7505 warnings and errors.
7506
868d2d96
JD
75072006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7508
7509 Clean up handling of %destructor for the end token (token 0).
7510 Discussed starting at
7511 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7512 and
7513 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7514
7515 Make the skeletons consistent in how they pop the end token and invoke
7516 its %destructor.
7517 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7518 state, which has token number 0, since this would invoke the
7519 %destructor for the end token.
7520 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7521 until after shifting the end token, or else it won't be popped.
7522 * data/yacc.c (yyparse): Likewise.
7523
7524 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7525 it's the end token. Upon termination, destroy an unshifted lookahead
7526 even when it's the end token.
7527 * data/lalr1.cc (yy::parser::parse): Likewise.
7528 * data/yacc.c (yyparse): Likewise.
7529
7530 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7531 value warnings for the end token when the user gives the end token a
7532 %destructor.
7533
7534 * tests/actions.at (Printers and Destructors): Test all the above.
7535
62a9592d
PE
75362006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7537
7538 Update to latest gnulib and gettext versions.
7539 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7540 Add fopen-safer.
7541 (gnulib_files): Add m4/warning.m4. Don't worry about files
7542 overwritten by autopoint.
7543 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7544 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7545 rejects them.
7546 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7547 so that we can remove the intl files at a better time.
7548 (intl_files_to_remove): Remove aclocal.m4, since it gets
7549 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7550 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7551 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7552 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7553 Remove datarootdir hack; no longer needed.
7554 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7555 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7556 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7557 strdup.h.
7558 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7559 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7560
10d6970f
PE
75612006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7562
7563 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7564 it with --assume-autoconf='latest-stable'.
7565
50a33993
JD
75662006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7567
7568 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7569 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7570 YYSTYPE' and `{'.
7571 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7572 those from muscle_tab.c since the old ones are misleading.
7573
2ce4ed68
AD
75742006-07-13 Akim Demaille <akim@epita.fr>
7575
7576 Support %define "KEY" {VALUE}.
7577 * src/scan-code.h, src/scan-code.l (translate_action)
7578 (translate_rule_action, translate_symbol_action, translate_code):
7579 Return char *, not const char *.
7580 * src/parse-gram.y (declaration): Rename as...
7581 (prologue_declaration): this.
7582 (string_content): Remove this nonterminal, use STRING.
7583 (braceless, content, content.opt): New nonterminal.
7584 Use them.
7585 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7586 as value.
7587 * src/scan-gram.l (getargs.h): Don't include it.
7588
db7e5eb5
PE
75892006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7590
7591 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7592 rather than a for-loop that declares a local bool variable. This
7593 should work around a compatibility problem with a Cray x1e C++
7594 compiler reported by Hung Nguyen in
7595 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7596 The for-loop was introduced in the 2004-11-17 change but I don't
7597 know why it was needed.
7598
a5d80ba5
AD
75992006-07-12 Akim Demaille <akim@epita.fr>
7600
7601 * data/c.m4: Comment changes.
7602
23eb2a69
AD
76032006-07-10 Akim Demaille <akim@lrde.epita.fr>
7604
7605 * src/complain.c (error_message, ERROR_MESSAGE): New.
7606 To factor...
7607 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7608 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7609
ddc8ede1
PE
76102006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7611
7612 * NEWS: Instead of %union, you can define and use your own union type
7613 YYSTYPE if your grammar contains at least one <type> tag.
7614 Your YYSTYPE need not be a macro; it can be a typedef.
7615 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7616 (Union Decl, Decl Summary): Document this.
7617 * data/glr.c (YYSTYPE): Implement this.
7618 * data/glr.cc (YYSTYPE): Likewise.
7619 * data/lalr1.cc (YYSTYPE): Likewise.
7620 * data/yacc.c (YYSTYPE): Likewise.
7621 * src/output.c (prepare): Output tag_seen_flag.
7622 * src/parse-gram.y (declaration, grammar_declaration):
7623 Use 'union_seen' rather than 'typed' to determine whether
7624 %union has been seen, since grammars can now be typed without
7625 %union.
7626 (symbol_declaration, type.opt, symbol_def):
7627 Keep track of whether a tag has been seen.
7628 * src/reader.c (union_seen, tag_seen): New vars.
7629 (typed): remove.
7630 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7631 * src/scan-code.l (untyped_var_seen): New variable.
7632 (handle_action_dollar): Adjust to above changes.
7633 (handle_action_dollar, handle_action_at):
7634 Improve overflow checking for outlandish numbers.
7635 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7636 avoid new diagnostics generated by above changes.
7637 * tests/regression.at (YYSTYPE typedef): Add test to check
7638 for type tags without %union.
7639
7640 * src/symlist.c (symbol_list_length): Return int, not unsigned
7641 int, since callers expect int. This may need to get revisited
7642 once we have proper integer overflow checking.
7643
7644 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7645 object is now static.
7646
7647 * src/getargs.c (flags_argmatch): Return void, not int,
7648 to pacify ./configure --enable-gcc-warnings.
7649
7650 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7651 since last_string is already defined to FLEX_PREFIX (last_string).
7652
7b42569e
AD
76532006-07-09 Akim Demaille <akim@lrde.epita.fr>
7654
7655 Implement --warnings/-W.
7656 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7657 replaced by...
7658 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7659 Adjust callers.
7660 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7661 (warnings_args, warnings_types): New.
7662 (getargs, short_options, long_options): Accept -W/--warnings.
7663 Sort the options by alphabetical order, upper case letter right
7664 before its lower case.
7665
3b452f4e
JD
76662006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7667
7668 Change %merge result type clash warnings to errors. Discussed at
7669 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7670 * src/reader.c (record_merge_function_type): Use complain_at.
7671 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7672 declared later): Update test case results.
7673
b8a41559
AD
76742006-07-09 Akim Demaille <akim@lrde.epita.fr>
7675
7676 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7677 to be in alphabetical order.
7678 (trace_args): Spelling fixes.
7679
cd9e1ba2
PE
76802006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7681
7682 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7683 so they don't collide with user-defined macros.
7684 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7685 this was never guaranteed, and now that we're using gnulib stdint,
7686 which defines int_fast16_t to long int, the problem is exposed.
7687
cb48f191
PE
76882006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7689
b8445a15
PE
7690 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7691 need the full POSIX semantics (and weren't implementing them
7692 anyway).
7693
cb48f191
PE
7694 Adjust to Autoconf 2.60 and today's gnulib.
7695 * bootstrap (gnulib_modules): Add stdint.
7696 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7697 no longer copies it.
7698 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7699 since stdint needs the former and wcwidth (which is now required
7700 by mbswidth) needs the latter.
7701 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7702 work around a compatibility glitch between gettext 0.14.6 and
7703 Autoconf 2.60.
7704 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7705 Do not check for uintptr_t, since new stdint module does the right
7706 thing.
7707 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7708 Add stdint.h, stdint_.h, wcwidth.h.
7709 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7710 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7711 stdint.m4, wchar_t.m4, wcwidth.m4.
7712 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7713 usual order for ../lib/*.h files.
7714 (file_name_split): Use last_component, not base_name, to adjust
7715 to gnulib changes.
7716 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7717 for ../lib/*.h files.
7718 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7719 Define unconditionally, since we now assume the stdint module.
7720 * src/scan-skel.l: Include <dirname.h>.
7721 (BASE_QPUTS): Use last_component, not base_name.
7722 * src/system.h: Include <unlocked-io.h> in the usual order
7723 for ../lib/*.h files. Include <stdint.h> unconditionally,
7724 since we now use the stdint module.
7725 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7726 HAVE_UINTPTR_T, since we now use the stdint module.
7727 (base_name): Remove decl, since files now include <dirname.h>
7728 to get the decl.
7729
cd48d21d
AD
77302006-07-08 Akim Demaille <akim@lrde.epita.fr>
7731
7732 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7733 New, default to 1.
7734 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7735 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7736 default.
7737 * tests/calc.at: Adjust.
7738
8ec0a172
AD
77392006-07-08 Akim Demaille <akim@lrde.epita.fr>
7740
b8445a15 7741 * data/c.m4 (b4_basename): New.
8ec0a172
AD
7742 (b4_syncline): Also output the location of its invocation (from
7743 the skeleton).
7744 (b4_user_action, b4_define_user_action, b4_user_actions)
7745 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7746 (b4_user_stype): New.
7747 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7748
4a678af8
JD
77492006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7750
7751 In the grammar file, the first column is 1 not 0 on the first line as
7752 on every other line.
7753 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7754 * tests/input.at (Torturing the Scanner): Update output.
7755
7756 * src/scan-gram.l (scanner_cursor): Declare it static.
7757
dd60572a
JD
77582006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7759
7760 In warnings, say "previous declaration" rather than "first
7761 declaration".
7762 * src/symtab.c (redeclaration): Do that here.
7763 * src/reader.c (record_merge_function_type): In the case of a result
7764 type clash, report the previous declaration rather than the very first
7765 one in the grammar file.
7766 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7767 declared later): Add a third declaration to check this behavior.
7768 * tests/input.at (Incompatible Aliases): Update output.
7769
2073e1b6
AD
77702006-06-27 Akim Demaille <akim@epita.fr>
7771
7772 * doc/Doxyfile.in: New.
7773 * doc/Makefile.am: Use it.
7774 * src/lalr.h, src/symtab.h: Initial doxygenation.
7775
8ee5b538
JD
77762006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7777
7778 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
7779 declared after the %merge. This continues the effort of the previous
7780 patch.
8ee5b538
JD
7781 * src/reader.c (get_merge_function): Don't set the merger type yet.
7782 (record_merge_function_type): New function for setting the merger type
7783 and checking for clashes.
7784 (grammar_current_rule_merge_set): Set the location of the %merge for
7785 the current rule.
7786 (packgram): Invoke record_merge_function_type for each rule now that
7787 all symbol type declarations have been parsed.
7788 * src/reader.h (merger_list.type_declaration_location): New member
7789 storing the location of the first %merge from which the type for this
7790 merging function was derived.
7791 * src/symlist.h (symbol_list.merger_declaration_location): New member
7792 storing the location of a rule's %merge, if any.
7793 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7794 declared later): New test to catch the error fixed by the above patch.
7795
ffa4ba3a
JD
77962006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7797
7798 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
7799 declarations appear after the rules. Discussed at
7800 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7801 and
7802 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7803 Don't mistake the type of $$ in a midrule to be that of its parent
7804 rule's $$.
ffa4ba3a
JD
7805 * src/reader.c (grammar_current_rule_end): Don't invoke
7806 grammar_rule_check yet since not all symbol declarations may have been
7807 parsed yet.
7808 (grammar_midrule_action): Likewise.
7809 Don't record whether the midrule's $$ has been used yet since actions
7810 haven't been translated yet.
7811 Record the midrule's parent rule and its RHS index within the parent
7812 rule.
7813 (grammar_current_rule_action_append): Don't translate the action yet
7814 since not all symbol declarations may have been parsed yet and, thus,
7815 warnings about types for $$, $n, @$, and @n can't be reported yet.
7816 (packgram): Translate the action and invoke grammar_rule_check now that
7817 all symbol declarations have been parsed.
7818 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7819 after parsing the entire grammar file, the symbol list here in the case
7820 of a midrule is actually the midrule's empty RHS, so reference its
7821 parent rule's RHS where necessary.
7822 On the other hand, now that you can already know it's a midrule, you
7823 aren't forced to think $$ has the same type as its parent rule's $$.
7824 (handle_action_at): In the case of a midrule, reference the parent rule
7825 where necessary.
7826 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7827 members.
7828 (symbol_list_length): Now that this is invoked after all rules have
7829 been parsed, a NULL symbol (rather than a NULL symbol list node)
7830 terminates a rule. symbol_list_print already does this correctly.
7831 * src/symlist.h (symbol_list.midrule_parent_rule,
7832 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7833 remember their relationships with their parents.
7834 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7835 fixed by the above patch.
7836 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7837 implementing...
7838 (Unused values): ... this old test case and...
7839 (Unused values before symbol declarations): ... this new test case.
7840 This one is the same as `Unused values' except that all symbol
7841 declarations appear after the rules in order to catch the rest of the
7842 errors fixed by the above patch.
7843
e256e17f
JD
78442006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7845
300a1930
JD
7846 More cleanup.
7847 * src/reader.c (current_rule): Declare it static since it's no longer
7848 used outside this file.
7849 (grammar_current_rule_action_append): Remove redundant arguments from
7850 translate_rule_action invocation.
7851 * src/reader.h (current_rule): Remove this unused extern.
7852 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7853 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 7854
381ecb06
JD
78552006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7856
7857 Clean up yesterday's patch.
7858 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7859 to...
7860 * src/reader.c (grammar_current_rule_action_append): ... here for
7861 consistency with grammar_current_rule_symbol_append.
7862 * tests/regression.at (Braced code in declaration in rules section):
7863 Make yyerror and yylex static as usual.
7864
4210cd0b
JD
78652006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7866
7867 Fix bug that mistakes braced code in a declaration in the rules section
7868 to be a rule action. Mentioned at
7869 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7870 * src/scan-gram.l: Move midrule action detection from the start of the
7871 scanning of any braced code to...
7872 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7873 action. For readability, use $2 and @2 rather than the equivalent
7874 global variables.
7875 * tests/regression.at (Braced code in declaration in rules section):
7876 New test to catch the error fixed by the above patch.
7877
7878 Work on code readability some.
7879 * src/scan-code.l (current_rule): Get rid of this misleading and
7880 redundant declaration: it's actually extern'ed in reader.h.
7881 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7882 translate_action): Add a rule argument and use it instead of the global
7883 current_rule.
7884 (translate_rule_action): This already receives current_rule through an
7885 argument, so pass it on to translate_action instead of assigning
7886 current_rule to current_rule.
7887 (translate_symbol_action, translate_code): Pass rule = NULL to
7888 translate_action.
7889
34f98f46
JD
78902006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7891
7892 Rename %before-definitions to %start-header and %after-definitions to
7893 %end-header. Don't use these declarations to separate pre-prologue
7894 blocks from post-prologue blocks. Add new order-independent
7895 declarations %before-header and %after-header as alternatives to the
7896 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7897 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7898 * NEWS (2.3+): Update for these changes.
7899 * data/glr.c (b4_before_definitions): Update to...
7900 (b4_start_header): ... this.
7901 (b4_after_definitions): Update to...
7902 (b4_end_header): ... this.
7903 * data/glr.cc: Likewise.
7904 * data/lalr1.cc: Likewise.
7905 * data/yacc.c: Likewise.
7906 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7907 prologue blocks with %*-header declarations.
7908 (Calc++ Parser): Likewise.
91661ebb 7909 (Decl Summary): Update names.
148d66d8 7910 (Table of Symbols): Update description.
34f98f46
JD
7911 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7912 (PERCENT_END_HEADER): ... this.
7913 (PERCENT_BEFORE_DEFINITIONS): Update to...
7914 (PERCENT_START_HEADER): ... this.
7915 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7916 (declaration): Update token names and m4 macro names.
7917 When parsing %end-header and %start-header, invoke translate_code
7918 before muscle_code_grow, and no longer set global booleans to remember
7919 whether these declarations have been seen.
7920 Parse new %after-header and %before-header.
7921 * src/reader.c (before_definitions, after_definitions): Remove.
7922 (prologue_augment): Accept a new bool argument to specify whether to
7923 augment the pre-prologue or post-prologue.
7924 * src/reader.h (before_definitions, after_definitions): Remove these
7925 extern's.
7926 (prologue_augment): Add new bool argument.
7927 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
7928 (PERCENT_END_HEADER): ... this.
7929 (PERCENT_BEFORE_DEFINITIONS): Update to...
7930 (PERCENT_START_HEADER): ... this.
7931 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
7932 * tests/actions.at (Printers and Destructors): Update names.
7933
31b2b07e
JD
79342006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
7935
7936 Add comparison operators for C++ location classes. Discussed at
7937 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
7938 * data/c++.m4 (b4_define_location_comparison): New boolean %define
7939 declaration indicating whether filename_type has an operator==. If
7940 filename_type is `std::string', it defaults to `1', `0' otherwise.
7941 * data/location.cc: Iff b4_define_location_comparison is `1', add
7942 operator== and operator!= for class position and for class location.
7943
7944 Some minor fixes.
7945 * src/scan-action.l: Remove unused file.
7946 * src/symtab.c (symbol_printer_set): Use printer_location not
7947 destructor_location.
7948 * src/symtab.h (struct symbol): Replace incorrect source comment for
7949 printer members.
7950 * tests/input.at (Incompatible Aliases): Update output with correct
7951 printer location.
7952
9bc0dd67
JD
79532006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
7954
7955 Don't put the pre-prologue in the header file. For the yacc.c code
7956 file and the glr.c header and code files, move the pre-prologue before
7957 the token definitions. Add new %before-definitions and
7958 %after-definitions to declare code that will go in both the header file
7959 and code file. Discussed at
7960 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
7961 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
7962 and
7963 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
7964 * NEWS (2.3+): Describe these changes.
7965 * data/glr.c (b4_pre_prologue): Move from within to before...
7966 (b4_shared_declarations): ... this.
7967 Add new b4_before_definitions before b4_token_enums.
7968 Add new b4_after_definitions at the end.
7969 * data/glr.cc (b4_pre_prologue): Replace with...
7970 (b4_before_definitions): ... this in the header file.
7971 (b4_after_definitions): New near the end of the header file.
7972 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
7973 code file right before including the header file.
7974 (b4_before_definitions): New in the previous position of
7975 b4_pre_prologue in the header file.
7976 (b4_after_definitions): New near the end of the header file.
7977 * data/yacc.c: Clean up some m4 quoting especially in the header file.
7978 (b4_token_enums_defines): In the code file, move to right before
7979 YYSTYPE for consistency with the header file.
7980 (b4_before_definitions): New right before b4_token_enums_defines in
7981 both the header and code file.
7982 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
7983 header and code file.
7984 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
7985 of prologues for %union dependencies.
91661ebb
JD
7986 (Decl Summary): In %defines description, mention the effect of
7987 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
7988 (Calc++ Parser): Forward declare driver in a %before-definitions rather
7989 than in the pre-prologue so that make check succeeds.
148d66d8 7990 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
7991 %after-definitions.
7992 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
7993 %before-definitions.
7994 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
7995 (declaration): Parse those declarations and append to
7996 b4_before_definitions and b4_after_definitions, respectively.
7997 * src/reader.c (before_definitions, after_definitions): New bools to
7998 track whether those declarations have been seen.
7999 (prologue_augment): Add to the post-prologue if %union,
8000 %before-definitions, or %after-definitions has been seen.
8001 * src/reader.h (before_definitions, after_definitions): New extern's.
8002 * src/scan-gram.l: Scan the new declarations.
8003 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
8004 prologue block in a %before-definitions or a %after-definitions based
8005 on whether the %union is declared.
8006 * tests/regression.at (Early token definitions with --yacc, Early token
8007 definitions without --yacc): Move tests for token definitions into the
8008 post-prologue since token names are no longer defined in the
8009 pre-prologue.
8010
203b9274
AD
80112006-06-20 Akim Demaille <akim@epita.fr>
8012
8013 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
8014 (symbol_get): Use it.
8015 * src/parse-gram.y: Use it.
8016
a7ee59cf
JD
80172006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
8018
8019 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
8020 build succeeds when configured with --enable-gcc-warnings.
8021
5a2baae7
PE
80222006-06-19 Paul Eggert <eggert@cs.ucla.edu>
8023
33ad1a9c
PE
8024 * src/parse-gram.y (char_name): New function.
8025 (CHAR, STRING, string_content): For %printer, properly escape.
8026 (ID): Prefer fputs to fprintf.
8027 (id): Reindent to be consistent with other rules.
8028 Properly quote char.
8029
5a2baae7
PE
8030 The Translation Project changed its way of publishing translations
8031 to maintainers. I haven't received any responses to my request
8032 for supporting the old way, or for documenting the new way. I
8033 have modified 'bootstrap' to use screen scraping
8034 (in this case, HTML scraping). This is unreliable and inelegant,
8035 but I don't see any better way. Yuck.
8036 * bootstrap (TP_URL, WGET_COMMAND): New vars.
8037 (get_translations): New function, which uses HTML scraping to
8038 deduce locations of latest translations.
8039 Use this function to grab both bison and bison-runtime .po files.
8040 Don't bother priming the pump for the runtime-po domain any more,
8041 as it's now translated better than bison is.
8042
58d7a1a1
AD
80432006-06-19 Akim Demaille <akim@epita.fr>
8044
8045 * src/scan-gram.l: No longer "parse" things after `%union' until
8046 `{'. Rather, return a single "%union" token.
8047 No longer make symbols: return strings, and leave the conversion
8048 to symbols to the parser.
8049 (SC_PRE_CODE, token_type): Remove.
8050 * src/parse-gram.y (%union): New field `character'.
8051 Sort tokens.
8052 (CHAR): New token.
8053 (ID, ID_COLON): Now that the scanner no longer makes them
8054 identifiers, adjust all uses to invoke symbol_get.
8055 (id_colon): New, wraps the conversion from string to symbol.
8056 (%union): Accept a possible union_name.
8057 (symbol): Now can be a char.
8058 * data/c.m4 (b4_union_name): Leave a default value.
8059 * data/glr.c, data/yacc.c: Use it.
8060
b931235e
JD
80612006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
8062
8063 For associating token numbers with token names for "yacc.c", don't use
8064 #define statements unless `--yacc' is specified; always use enum
8065 yytokentype. Most important discussions start at:
8066 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
8067 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
8068 and
8069 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
8070 * NEWS (2.3+): Mention.
8071 * data/c.m4 (b4_yacc_if): New.
8072 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
8073 token #define's.
8074 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
8075 on token name definitions.
8076 * src/getargs.c (usage): Capitalize `Yacc' in English.
8077 * src/output.c (prepare): Define b4_yacc_flag.
8078 * tests/regression.at (Early token definitions): Test that tokens names
8079 are defined before the pre-prologue not just before the post-prologue.
8080 Remove this test case and copy to...
8081 (Early token definitions with --yacc): ... this to test #define's.
8082 (Early token definitions without --yacc): ... and this to test enums.
8083
9e6e7ed2
PE
80842006-06-11 Paul Eggert <eggert@cs.ucla.edu>
8085
8086 * NEWS: Reword the post-2.3 change to not be so optimistic about
8087 removing the old "look-ahead" spelling.
8088 Update previous look-ahead/lookahead change reports.
8089 * REFERENCES: look-ahead -> lookahead (since that's
8090 what he actually wrote).
8091 * doc/refcard.tex: look ahead -> lookahead,
8092 look-ahead -> lookahead
8093
742e4900
JD
80942006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
8095
8096 For consistency, use `lookahead' instead of `look-ahead' or
8097 `look_ahead'. Discussed starting at
8098 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
8099 and then at
8100 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
8101 * NEWS: For the next release, note the change to `--report'.
8102 * TODO, doc/bison.1: Update English.
8103 * doc/bison.texinfo: Update English.
8104 (Understanding Your Parser, Bison Options): Document as
8105 `--report=lookahead' rather than `--report=look-ahead'.
8106 * src/conflicts.c: Update English in comments.
8107 (lookahead_set): Rename from look_ahead_set.
8108 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
8109 (resolve_sr_conflict): Rename local look_ahead_tokens to
8110 lookahead_tokens, and update other uses.
8111 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
8112 count_rr_conflicts, conflicts_free): Update uses.
8113 * src/getargs.c (report_args): Move "lookahead" before alternate
8114 spellings.
8115 (report_types): Update uses.
8116 (usage): For `--report' usage description, state `lookahead' spelling
8117 rather than `look-ahead'.
8118 * src/getargs.h (report.report_lookahead_tokens): Rename from
8119 report_look_ahead_tokens.
8120 * src/lalr.c: Update English in comments.
8121 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
8122 (state_lookahead_tokens_count): Rename from
8123 state_look_ahead_tokens_count.
8124 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8125 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
8126 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8127 Update other uses.
8128 Update English in output.
8129 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
8130 * src/print.c: Update English in comments.
8131 (lookahead_set): Rename from look_ahead_set.
8132 (print_reduction): Rename argument lookahead_token from
8133 look_ahead_token.
8134 (print_core, state_default_rule, print_reductions, print_results):
8135 Update uses.
8136 * src/print_graph.c: Update English in comments.
8137 (print_core): Update uses.
8138 * src/state.c: Update English in comments.
8139 (reductions_new): Update uses.
8140 (state_rule_lookahead_tokens_print): Rename from
8141 state_rule_look_ahead_tokens_print, and update other uses.
8142 * src/state.h: Update English in comments.
8143 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
8144 (state_rule_lookahead_tokens_print): Rename from
8145 state_rule_look_ahead_tokens_print.
8146 * src/tables.c: Update English in comments.
8147 (conflict_row, action_row): Update uses.
8148 * tests/glr-regression.at
8149 (Incorrect lookahead during deterministic GLR,
8150 Incorrect lookahead during nondeterministic GLR): Rename
8151 print_look_ahead to print_lookahead.
8152 * tests/torture.at: Update English in comments.
8153 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
8154 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
8155 (Many lookahead tokens): Update uses.
8156 * data/glr.c: Update English in comments.
8157 * lalr1.cc: Likewise.
8158 * yacc.c: Likewise.
8159 * src/conflicts.h: Likewise.
8160 * src/lalr.h: Likewise.
8161 * src/main.c: Likewise.
8162 * src/output.c: Likewise.
8163 * src/parse-gram.c: Likewise.
8164 * src/tables.h: Likewise.
8165 * tests/calc.at: Likewise.
8166
3c40d0b5
JD
81672006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
8168
8169 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
8170
5d278082
PE
81712006-06-07 Paul Eggert <eggert@cs.ucla.edu>
8172
8173 * TODO: Add request from Nelson H. F. Beebe to be able to install
8174 Bison without installing the yacc script.
8175
9e668899
JD
81762006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8177
8178 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
8179 and yytext if they're already #define'd.
8180 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
8181 * src/scan-code-c.c: ... here.
8182 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
8183 <config.h>.
8184
0c8e079f
JD
81852006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8186
8187 Get Bison to build again when configured with --enable-gcc-warnings.
8188 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
8189 missing #include's.
8190 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
8191 loc argument as it shadows a global.
8192 * src/scan-gram.l: Remove stray comma that prevents boundary_set
8193 invocation.
8194
8195 * src/.cvsignore: Add scan-code.c.
8196
2346344a
AD
81972006-06-07 Akim Demaille <akim@epita.fr>
8198
8199 * src/scan-gram.l: Move the "add a trailing ; to actions" code
8200 to...
8201 * src/scan-code.l: here.
8202 * tests/input.at (Torturing the Scanner): Fix another location
8203 error.
8204
4862bdfd
AD
82052006-06-07 Akim Demaille <akim@epita.fr>
8206
8207 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
8208
e9071366
AD
82092006-06-06 Akim Demaille <akim@epita.fr>
8210
8211 Extract the parsing of user actions from the grammar scanner.
8212 As a consequence, the relation between the grammar scanner and
8213 parser is much simpler. We can also split "composite tokens" back
8214 into simple tokens.
8215 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
8216 * src/scan-gram.l (add_column_width, adjust_location): Move to and
8217 rename as...
8218 * src/location.h, src/location.c (add_column_width)
8219 (location_compute): these.
8220 Fix the column count: the initial column is 0.
8221 (location_print): Be robust to ending column being 0.
8222 * src/location.h (boundary_set): New.
8223 * src/main.c: Adjust to scanner_free being renamed as
8224 gram_scanner_free.
8225 * src/output.c: Include scan-code.h.
8226 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
8227 Use boundary_set.
8228 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
8229 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
8230 which is now, again, a separate token.
8231 Adjust all dependencies.
8232 Whereever actions with $ and @ are used, use translate_code.
8233 (action): Remove this nonterminal which is now useless.
8234 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8235 (grammar_current_rule_action_append): Use translate_code.
8236 (packgram): Bound check ruleno, itemno, and rule_length.
8237 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8238 (last_string, last_braced_code_loc, max_left_semantic_context)
8239 (scanner_initialize, scanner_free, scanner_last_string_free)
8240 (gram_out, gram_lineno, YY_DECL_): Move to...
8241 * src/scan-gram.h: this new file.
8242 (YY_DECL): Rename as...
8243 (GRAM_DECL): this.
8244 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8245 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8246 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8247 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8248 Move these declarations, and...
8249 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8250 these to...
8251 * src/flex-scanner.h: this new file.
8252 * src/scan-gram.l (rule_length, rule_length_overflow)
8253 (increment_rule_length): Remove.
8254 (last_braced_code_loc): Rename as...
8255 (gram_last_braced_code_loc): this.
8256 Adjust to the changes of the parser.
8257 Move all the handling of $ and @ into...
8258 * src/scan-code.l: here.
8259 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8260 (handle_action_dollar, handle_action_at): Move to...
8261 * src/scan-code.l: here.
8262 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8263 scan-code.h, scan-code-c.c, scan-gram.h.
8264 (EXTRA_bison_SOURCES): Add scan-code.l.
8265 (BUILT_SOURCES): Add scan-code.c.
8266 (yacc): Be robust to white spaces.
8267
8268 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8269 * tests/regression.at: Adjust the column numbers.
8270 * tests/regression.at: Adjust the error message.
7891a7c4 8271
184e42f0
JD
82722006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8273
8274 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8275 Use Akim's wording from
8276 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8277
7891a7c4
JD
82782006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8279
8280 Between Bison releases, manually append `+' to the previous Bison
8281 release number, and use that as a signal to automatically print the
8282 ChangeLog's CVS Id keyword from --version. Discussed starting at
8283 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8284 * ChangeLog: Add Id header.
8285 * configure.ac (AC_INIT): Append `+' to `2.3'.
8286 * src/.cvsignore: Add revision.c.
8287 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8288 (BUILT_SOURCES): Add revision.c.
8289 (revision.c): New target rule. This file defines a new global variable
8290 named revision. It initializes it with either the Id from ChangeLog
8291 or, if VERSION doesn't contain `+', with the empty string.
8292 * src/getargs.c (version): Print the value of revision.
8293 * src/revision.h: Extern revision.
8294
4ad3ed84
PE
82952006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8296
8297 * NEWS: Version 2.3.
8298 * configure.ac (AC_INIT): Likewise.
8299
02103984
PE
83002006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8301
8302 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8303 with no arguments, not as an object-like macro. This is for
8304 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8305 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8306 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8307 Document this.
8308
2c08afa5
JD
83092006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8310
8311 * src/getargs.c (usage): Back out yesterday's modification of the
8312 --help output so that we don't have to wait for translation before
8313 releasing 2.3.
8314
6077da58
PE
83152006-05-29 Paul Eggert <eggert@cs.ucla.edu>
8316
8317 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
8318 Problem reported by Akim Demaille.
8319
2a26b6c2
JD
83202006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
8321
8322 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8323
aefef0d6
PE
83242006-05-26 Paul Eggert <eggert@cs.ucla.edu>
8325
8326 * data/yacc.c (yy_reduce_print): Omit trailing white space in
8327 generated source code. Problem reported by Frans Englich in
8328 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
8329
fcd8e201
PE
83302006-05-22 Paul Eggert <eggert@cs.ucla.edu>
8331
8332 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
8333 shell, not within 'make', so that 'make' by an ordinary builder
8334 (using GNU make) does not worry about configuring gzip. This also
8335 works around a bug reported independently by Keith Thompson and by
8336 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
8337 stderr rather than stdout, messing up the build logs.
8338
7b5cdcbd
JD
83392006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8340
8341 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
8342 to make sure that YYID will never be unused. This fixes a 'make
8343 maintainer-check' failure caused by the recent changes to the 'Trivial
8344 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
8345 not used.
8346 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
8347
5ad0a449
JD
83482006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8349
8350 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
8351 state before an empty RHS is always resolved here. Only the location
8352 of that state is guaranteed to be resolved, and that's enough. This
8353 fixes the remaining bug reported by Derek M. Jones in
8354 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8355 * tests/glr-regression.at (Uninitialized location when reporting
8356 ambiguity): Test the above case.
8357 Also, the embedded comments in this test case claim it checks the case
8358 of an empty RHS that has inherited the initial location. However, the
8359 corresponding LHS was already resolved, so yyresolveLocations didn't
8360 actually have reason to modify it. Fix this by forcing
8361 nondeterministic operation at the beginning of the parse.
8362
50cce58e
PE
83632006-05-20 Paul Eggert <eggert@cs.ucla.edu>
8364
8365 * data/c.m4 (b4_yy_symbol_print_generate):
8366 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
8367 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
8368 of the bugs reported today by Derek M Jones in
8369 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8370 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
8371 defined to be a type name without parens or brackets.
8372 (Location Type): Similarly for YYLTYPE.
8373 * tests/regression.at (Trivial grammars): Put in a test for this
8374 bug that will be caught by 'make maintainer-check' (though not,
8375 alas, by 'make check' unless your compiler is picky).
8376
ab8d9dc5
PE
83772006-05-19 Paul Eggert <eggert@cs.ucla.edu>
8378
0d2c8934 8379 * NEWS: Version 2.2.
ab8d9dc5
PE
8380 * configure.ac (AC_INIT): Likewise.
8381
9138c575
JD
83822006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
8383
8384 * data/glr.c (yyreportTree): Make room in yystates for the state
8385 preceding the RHS. This fixes the segmentation fault reported by Derek
8386 M. Jones in
8387 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
8388 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
8389 to the user. Reported for yyreportTree by Derek M. Jones later in the
8390 same thread.
8391 * THANKS: Add Derek M. Jones.
8392 Update my email address.
8393 Fix typo in Steve Murphy's name.
8394
276f48df
PE
83952006-05-14 Paul Eggert <eggert@cs.ucla.edu>
8396
d6645148
PE
8397 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
8398 checking against YYLAST that caused the parser to miss a potential
8399 alternative in its diagnostic.
8400 Problem reported by Maria Jose Moron Fernandez in
8401 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
8402 * data/lalr1.cc (yysyntax_error_): Likewise.
8403 * data/yacc.c (yysyntax_error): Likewise.
8404 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
8405 tokens, in case we run into an older C compiler.
8406 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
8407 Use them to check for the off-by-one error fixed above.
8408
276f48df
PE
8409 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
8410 YYSIZE_T, not size_t.
8411 * tests/regression.at (Trivial grammars): New test, to catch
8412 the error fixed by the above patch.
8413
cd8b5791
AD
84142006-05-14 Akim Demaille <akim@lrde.epita.fr>
8415
8416 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
8417 scheme.
8418 Reported by Steve Murphy.
8419
34376418
AD
84202006-05-14 Akim Demaille <akim@lrde.epita.fr>
8421
8422 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
8423 * data/glr.cc: b4_location_flag is now b4_locations_flag.
8424
327afc7c
AD
84252006-05-14 Akim Demaille <akim@lrde.epita.fr>
8426
8427 Implement --trace=m4.
8428 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
8429 * src/output.c (output_skeleton): When set, pass -dV to m4.
8430
8431 Factor the handling of flags in m4.
8432 * src/output.c (prepare): Rename the muscle names debug, defines,
8433 error_verbose to debug_flag, defines_flag, error_verbose_flag.
8434 * data/c.m4: Adjust.
8435 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
8436 Use b4_define_flag_if to define other b4_FLAG_if macros.
8437 (b4_location_if): As a consequence, rename as...
8438 (b4_locations_if): this, for consistency.
8439 Adjust all the skeletons.
8440
ba9ecd19
AD
84412006-05-14 Akim Demaille <akim@lrde.epita.fr>
8442
8443 * etc/bench.pm: Shorten bench names.
8444
4e83ea15
AD
84452006-05-14 Akim Demaille <akim@lrde.epita.fr>
8446
8447 * src/output.h, src/output.c (error_verbose): Move to...
8448 * src/getargs.h, src/getargs.c: here.
8449 Sort the flags.
8450 Adjust dependencies.
8451
6e93d810
PE
84522006-05-13 Paul Eggert <eggert@cs.ucla.edu>
8453
8454 * data/c.m4 (b4_copyright): Put the special exception for Bison
8455 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
8456 uses changed. Suggested by Akim Demaille. Also, wrap the
8457 copyright notice, in case it is longer than 80 columns. Replace
8458 comma by newline after title.
6e93d810 8459
eaea13f5
PE
84602006-05-11 Paul Eggert <eggert@cs.ucla.edu>
8461
8462 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
8463 incompatibility, not a bug. Mention that it wasn't fixed as of
8464 flex 2.5.33.
8465
3cf084ec
AD
84662006-05-11 Akim Demaille <akim@lrde.epita.fr>
8467
8468 * examples/extexi: Enforce the precedence of concatenation over
8469 >>.
0a9f1c7d 8470 Reported by Tommy Nordgren.
3cf084ec 8471
32c96bd7
AD
84722006-05-11 Akim Demaille <akim@lrde.epita.fr>
8473
8474 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8475 with the member "token".
f94705b2 8476 Reported by Martin Nylin.
32c96bd7 8477
eaea13f5
PE
84782006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8479
8480 * data/glr.c: Switch to Bison 2.2 special-exception language in
8481 the copyright notice. Use more-regular format for titles and
8482 copyright notices.
8483 * data/glr.cc: Likewise.
8484 * data/location.cc: Likewise.
8485 * data/yacc.cc: Likewise.
8486 * doc/bison.texinfo (Conditions): Document this.
8487 * NEWS: likewise. Upgrade version to 2.2.
8488
6e2d1146
AD
84892006-04-27 Akim Demaille <akim@lrde.epita.fr>
8490
8491 * data/glr.cc: Remove dead code.
8492
47671055
PE
84932006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8494
8495 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8496 that variable and the line breaks the bootstrap. Problem reported
8497 by Juan M. Guerrero.
8498
ed2e6384
AD
84992006-04-24 Akim Demaille <akim@lrde.epita.fr>
8500
8501 * doc/bison.texinfo (Multiple start-symbols): New.
8502
3cedc2dc
AD
85032006-04-24 Akim Demaille <akim@lrde.epita.fr>
8504
8505 * etc/README, etc/bench.pl: New.
8506
b2ddc3f3
AD
85072006-04-03 Akim Demaille <akim@lrde.epita.fr>
8508
8509 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8510 rule.
8511 Reported by Mickael Labau.
8512 * tests/input.at (Torturing the Scanner): Test it.
8513
91e3ac9a
PE
85142006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8515
8516 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8517 Problem reported by Bob Rossi.
8518
85192006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8520
8521 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8522 and didn't really work.
8523 For the index, use @ifnotinfo, not @iftex.
8524 Minor cleanups of spacing and terminology.
8525
5cf61e93
AD
85262006-03-12 Akim Demaille <akim@lrde.epita.fr>
8527
8528 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8529 of AT_NAME_PREFIX when %name-prefix is not used.
8530
aa08666d
AD
85312006-03-12 Akim Demaille <akim@lrde.epita.fr>
8532
8533 Apply --prefix to C++ skeletons too: they change the namespace.
8534 The test suite already exercize these cases.
8535 * data/c++.m4 (b4_namespace): New.
8536 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8537 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8538 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8539 * doc/bison.texinfo: Document it.
8540 (Option Cross Key): Use @multitable in all formats. It looks
8541 nicer, even in TeX outputs.
8542 (Rules): Use the same code whatever the output type is.
8543 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8544 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8545 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 8546
45567173
AD
85472006-03-10 Akim Demaille <akim@lrde.epita.fr>
8548
8549 * TODO: Remove dead items.
8550
e9d8f881 85512006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
8552
8553 * doc/FAQ: Remove, merged into...
8554 * doc/bison.texinfo (FAQ): this.
8555 * doc/Makefile.am (EXTRA_DIST): Adjust.
8556
c095d689
AD
85572006-03-10 Akim Demaille <akim@lrde.epita.fr>
8558
8559 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8560 even if empty.
8561 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8562 * doc/bison.texinfo (Calc++ Scanner): Use it.
8563
6e0f8287
PE
85642006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8565
8566 Fix two nits reported by twlevo, plus one more that I discovered.
8567
8568 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8569 this is the usual Bison style.
8570 * src/location.h (location_print): Likewise.
8571
8572 * src/reader.h (token_name): Likewise.
8573
d6b771c3
PE
85742006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8575
8576 Fix some nits reported by twlevo.
8577 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8578 and "POSIX". Use more-modern syntax for URLs. Mention C++
8579 and ask for Java. Don't hardwire OS version numbers. Add
8580 copyright notice.
8581 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8582 * src/conflicts.c (solved_conflicts_obstack): Now static.
8583
1e137b71
JD
85842006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8585
8586 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8587 page. Say "you can use it" not "you may use it" as on the web page;
8588 we're describing capabilities not granting permission.
8589
73f2e47e
PE
85902006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8591
6d05403d
PE
8592 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8593 shadowing warnings. Use usual patter for iterating through RHS.
8594 * tests/glr-regression.at
8595 (Uninitialized location when reporting ambiguity):
8596 Modify yylex so that it uses its argument, rather than trying
8597 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8598 const char -> char const.
8599
73f2e47e
PE
8600 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8601 Don't use tabs inside commands; it messes up 'ps'.
8602 Problem reported by twlevo.
8603
8710fc41
JD
86042006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8605
8606 * tests/glr-regression.at (Uninitialized location when reporting
8607 ambiguity): New test case.
8608 * data/glr.c (yyresolveLocations): New function, which uses
8609 YYLLOC_DEFAULT.
8610 (yyresolveValue): Invoke yyresolveLocations before reporting an
8611 ambiguity.
8612 * doc/bison.texinfo (Default Action for Locations): Note
8613 YYLLOC_DEFAULT's usage for ambiguity locations.
8614 (GLR Semantic Actions): Cross-reference those notes.
8615
ae952af2
JD
86162006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8617
8618 * tests/glr-regression.at (Leaked semantic values when reporting
8619 ambiguity): Remove unnecessary union and type declarations.
8620 (Leaked lookahead after nondeterministic parse syntax error): New test
8621 case.
8622 * data/glr.c (yyparse): Check for zero stacks remaining before
8623 attempting to shift the lookahead so that you don't lose it.
8624
35ee866a
JD
86252006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8626
8627 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8628 * tests/glr-regression.at (Leaked semantic values when reporting
8629 ambiguity): New test case.
8630 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8631 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8632 now unnecessary yystackp parameter.
8633 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8634 destructors can be called.
8635
8636 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8637 in existing testcases.
8638
520181ab
JD
86392006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8640
8641 Don't leak semantic values for parent RHS when a user action cuts the
8642 parser, and clean up related code a bit.
8643 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
8644 cuts parse): Rename to...
8645 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
8646 for leaked parent RHS values.
8647 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8648 between an unresolved state (non-empty chain of semantic options) and
8649 an incomplete one (signaled by an empty chain).
ae952af2 8650 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
8651 successfully or unsuccessfully resolved yyGLRState to...
8652 (yyresolveValue): ... here so that yyresolveValue always leaves a
8653 yyGLRState with consistent data and thus is easier to understand.
8654 Remove the yyvalp and yylocp parameters since they are always just
8655 taken from the yys parameter. When reporting a discarded merged value
8656 in debugging output, note that it is incompletely merged. Document the
8657 interface.
8658 (yyresolveAction): If resolving any of the RHS states fails, destroy
8659 them all rather than leaking them. Thus, as long as user actions are
8660 written to clean up the RHS correctly, yyresolveAction always cleans up
8661 the RHS of a semantic option. Document the interface.
8662
18d9185c
PE
86632006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8664
8665 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8666 led to a segmentation fault in GNU Pascal. Problem reported
8667 by Waldek Hebisch.
8668
841a7737
JD
86692006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8670
8671 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8672 mid-rule action inside a nonterminal symbol in order to declare a
8673 destructor for its semantic value.
8674
fc3f467f
PE
86752006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8676
8677 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8678 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8679 __cplusplus && ! defined _STDLIB_H && !
8680 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8681 defined free))]: Include <stdlib.h> rather than rolling our own
8682 declarations of malloc and free, to avoid problems with
8683 incompatible declarations (using 'throw') C++'s stdlib.h. This
8684 should fix Debian bug 340012
8685 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8686 reported by Guillaume Melquiond.
8687
a3af26dd
PE
86882006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8689
4d7bc38c
PE
8690 * NEWS: Clarify symbols versus types in unused-value warnings.
8691
a3af26dd
PE
8692 * configure.ac (AC_INIT): Bump version number.
8693
4e26c69e
PE
86942006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8695
8696 * NEWS: Version 2.1a.
8697 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8698 since C99 requires this.
8699
498e897c
PE
87002006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8701
8702 * m4/c-working.m4: New file.
8703 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8704
57bb17ca
PE
87052006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8706
8707 * Makefile.maint: Merge from coreutils.
8708
0be105dc
PE
87092006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8710
8711 More portability fixes for problems summarized by Nelson H. F. Beebe.
8712
8713 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8714 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8715 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8716 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8717 messes up because C++ code is compiled in 32-bit mode but linked
8718 in 64-bit mode.
8719
6fc0c024
PE
87202006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8721
8722 More portability fixes for problems summarized by Nelson H. F. Beebe.
8723
7870f699
PE
8724 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8725 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8726
6fc0c024
PE
8727 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8728 nodist_PROGRAMS, since we don't need to actually compile the
8729 example if we're just doing a plain 'make'. This avoids bothering
8730 the installer unnecessarily about problems due to weird C++
8731 compilers.
8732
fe6c2fde
PE
87332006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8734
8735 More portability fixes for problems summarized by Nelson H. F. Beebe.
8736
8737 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8738 than #include "...", and compile with -I'.'. The old method was
8739 not portable, according to Posix and the C standard, and it does
8740 not work with Sun C 5.7, where previous #line directives affect
8741 the working directory used in later #include "..." directives.
8742
927b425b
JMG
87432006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8744
8745 Various DJGGP specific issues in /djgpp
8746
d9735e9e
PE
87472006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8748
8749 More portability fixes for problems summarized by Nelson H. F. Beebe.
8750
8751 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8752 '#include <map>' works and that you can apply ++ to iterators.
8753
5a6755af
PE
87542006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8755
67a0dc4f
PE
8756 Work around portability problems summarized by Nelson H. F. Beebe in
8757 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8758
8c86f0ef
PE
8759 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8760 that '#include <string>' works.
8761
de35dd59
PE
8762 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8763 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8764 "warning: sorry: semantics of inline function static data `const
8765 unsigned char translate_table[262]' are wrong (you'll wind up with
8766 multiple copies)".
8767
67a0dc4f
PE
8768 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8769 or, xor to not_, and_, or_, and xor_, respectively. This works
8770 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8771 random system header somewhere that includes the equivalent of
8772 <iso646.h>.
8773
5a6755af
PE
8774 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8775 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 8776 Suite Version 2.0.
5a6755af 8777
3f001415
JD
87782006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8779
8780 During deterministic GLR operation, user actions should be able to
8781 influence the parse by changing yychar. To make this easier to fix and
8782 to make glr.c easier to evolve in general, don't maintain yytoken in
8783 parallel with yychar; just compute yytoken when needed.
8784 * tests/glr-regression.at (Incorrect lookahead during deterministic
8785 GLR): Check that setting yychar in a user action has the intended
8786 effect.
8787 * data/glr.c (yyGLRStack): Remove yytokenp member.
8788 (yyclearin): Don't set *yytokenp.
8789 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8790 yychar rather than *yytokenp to determine the current lookahead.
8791 Compute yytoken locally when needed.
8792 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8793 point to.
8794
8795 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8796 after `--report' documentation.
8797
e2a8c0f5
PE
87982006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8799
8800 * src/parse-gram.y (grammar_declaration): Location of printer
8801 symbol is @1, not list->location. Bug reported by twlevo.
8802 * tests/input.at (Incompatible Aliases): Adjust to above change.
8803
6b702268
PE
88042006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8805
27622431
PE
8806 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8807 all the test at once. This makes the output easier to read in the
8808 normal case.
8809
6b702268
PE
8810 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8811 got from <http://bro-ids.org/download.html>. The bug is that
8812 when two actions appeared in succession, the second one was
8813 scanned before the first one was added to the grammar rule
8814 as a midrule action. Bison then output the incorrect warning
8815 "parse.y:905.17-906.36: warning: unused value: $3".
8816 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8817 associated with a value.
8818 (rhs): Don't invoke grammar_current_rule_action_append.
8819 (action): Invoke it here instead.
8820 * src/reader.c (grammar_midrule_action): Now extern.
8821 (grammar_current_rule_action_append): Don't invoke
8822 grammar_midrule_action; that is now the scanner's job.
8823 * src/reader.h (last_string, last_braced_code_loc):
8824 (grammar_midrule_action): New decls.
8825 * src/scan-gram.l (last_string): Now extern, sigh.
8826 (last_braced_code_loc): New extern variable.
8827 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8828 rule already has an action.
8829 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8830 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8831 Add some tests to check that the above changes fixed the bug.
8832
d40ba6c2
PE
88332006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8834
8835 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8836 All used changed. Check whether the symbol has a destructor,
8837 not whether it is typed.
8838 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8839 that the values are still reported as unused. All line numbers
8840 adjusted.
8841
401aace6
PE
88422006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8843
8844 Work around a bug in bro 0.8, which underparenthesizes its
8845 definition of YYLLOC_DEFAULT.
8846 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8847 their arguments.
8848 * data/lalr1.cc: Likewise.
8849 * data/yacc.cc: Likewise.
8850
06f01bc4
PE
88512006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8852
401aace6
PE
8853 Work around a bug in Pike 7.0, and give the Pike folks a
8854 better way to override the usual int widths.
8855 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8856 user can override the types.
8857 (short): #undef, to work around a bug in Pike 7.0.
8858 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8859 (union yyalloc.yyss): Use yytype_int16 rather than short.
8860 All uses changed.
8861 (yysigned_char): Remove.
8862 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8863 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8864 * tests/regression.at (Web2c Actions): Adjust to above changes.
8865
8866 * src/reader.c (check_and_convert_grammar): New function.
8867 (reader): Close the input file even if something went wrong during
8868 parsing. Minor file descriptor leak reported by twlevo.
8869
06f01bc4
PE
8870 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8871 to pacify gcc -Wswitch-default.
8872 * src/scan-gram.l (adjust_location): Use a default: break; case
8873 to pacify gcc -Wswitch-default.
8874 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8875 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8876 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8877 Move these decls to scan-skel.l, since they don't need to be
8878 visible elsewhere.
8879 * src/scan-skel.l: Accept the above decls.
8880 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8881 is used.
8882
02650b7f
PE
88832006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8884
8885 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8886 since we don't want to insist on a version number at the start
8887 of the changelog every time.
8888 * Makefile.maint: Sync from coreutils a bit better.
8889 (sc_trailing_blank): Renamed from sc_trailing_space.
8890 All uses changed.
8891 (sc_no_if_have_config_h, sc_require_config_h):
8892 (sc_prohibit_assert_without_use): New rules.
8893 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8894 (sc_dd_max_sym_length): Fix leading spaces in rule.
8895 (sc_system_h_headers): Prefix with @.
8896 (sc_useless_cpp_parens, m4-check): Output line numbers.
8897 (changelog-check): Allow version only in head.
8898 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8899 satisfy new Makefile.maint rule.
8900 * data/glr.c: Likewise.
8901 * data/glr.cc: Likewise.
8902 * data/lalr1.cc: Likewise.
8903 * data/yacc.c: Likewise.
8904 * lib/ebitsetv.c: Likewise.
8905 * lib/lbitset.c: Likewise.
8906 * lib/subpipe.c: Likewise.
8907 * lib/timevar.c: Likewise.
8908 * src/system.h: Likewise.
8909 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8910 * djgpp/Makefile.maint: Add copyright notice.
8911 * djgpp/README.in: Likewise.
8912 * djgpp/config.bat: Likewise.
8913 * djgpp/config.site: Likewise.
8914 * djgpp/config_h.sed: Likewise.
8915 * djgpp/djunpack.bat: Likewise.
8916 * djgpp/config.sed: Fix copyright notice to match standard format.
8917 * djgpp/subpipe.h: Likewise.
8918 * lib/bitsetv-print.c: Likewise.
8919 * lib/bitsetv.c: Likewise.
8920 * lib/subpipe.h: Likewise.
8921 * lib/timevar.c: Likewise.
8922 * lib/timevar.h: Likewise.
8923 * djgpp/subpipe.c: Use standard recipe for config.h.
8924 * lib/abitset.c: Likewise.
8925 * lib/bitset.c: Likewise.
8926 * lib/bitset_stats.c: Likewise.
8927 * lib/bitsetv-print.c: Likewise.
8928 * lib/bitsetv.c: Likewise.
8929 * lib/ebitsetv.c: Likewise.
8930 * lib/get-errno.c: Likewise.
8931 * lib/lbitset.c: Likewise.
8932 * lib/subpipe.c: Likewise.
8933 * lib/timevar.c: Likewise.
8934 * lib/vbitset.c: Likewise.
8935 * tests/local.at: Likewise.
8936 * src/scan-gram.l: Don't include verify.h, since system.h does
8937 that for us.
8938 * .x-sc_require_config_h: New file.
8939 * .x-sc_unmarked_diagnostics: New file.
8940
287c78f6
PE
89412006-01-20 Paul Eggert <eggert@cs.ucla.edu>
8942
287c78f6
PE
8943 Be a bit more systematic about using 'abort'.
8944 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
8945 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
8946 Put 'default: abort ();' before some other case, to satisfy older
8947 pedantic compilers.
8948 * lib/bitset_stats.c (bitset_stats_init): Likewise.
8949 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
8950 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
8951 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
8952 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
8953 (get_decision_str, get_orientation_str, get_node_alignment_str):
8954 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
8955 (get_linestyle_str, get_arrowstyle_str): Likewise.
8956 * src/conflicts.c (resolve_sr_conflict):
8957 Use a default case rather than one for the one remaining enum
8958 value, to catch invalid enum values as well.
8959 * src/lalr.c (set_goto_map, map_goto):
8960 Prefer "assert (FOO);" to "if (!FOO) abort ();".
8961 * src/nullable.c (nullable_compute, token_definitions_output):
8962 Likewise.
8963 * src/reader.c (packgram, reader): Likewise.
8964 * src/state.c (transitions_to, state_new, state_reduction_find):
8965 Likewise.
8966 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
8967 (symbol_pack): Likewise.
8968 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
8969 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
8970 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
8971 * src/system.h: Don't include <assert.h>.
8972 (assert): New macro.
8973
8974 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
8975 (Destructor Decl, Parser Function, Pure Calling):
8976 Describe rules for braces inside C code more carefully.
287c78f6 8977
c66dfadd
PE
89782006-01-19 Paul Eggert <eggert@cs.ucla.edu>
8979
c21493b8
PE
8980 Fix some porting glitches found by Nelson H. F. Beebe.
8981 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
8982 compilers that don't understand that abort () does not return.
8983 * src/state.c (transitions_to): Likewise.
8984 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8985 that '#include <cstdlib>' works.
8986 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
8987 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
8988 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
8989 for the benefit of some pre-C99 compilers.
8990
b6e3facf
PE
8991 * bootstrap: Undo changes to gnulib files that autoreconf made.
8992
c66dfadd
PE
8993 Minor fixups to get 'make maintainer-check' to work.
8994 * configure.ac: Don't use -Wnested-externs, as it's incompatible
8995 with the new verify.h implementation.
8996 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
8997 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
8998 * data/yacc.c (YYUSE): Likewise.
8999 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
9000 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
9001 * src/parse-gram.y (declaration): Don't pass a string constant
9002 to a function that expects char *, since GCC might complain
9003 about the constant value.
9004 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
9005 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
9006 before #defining them.
9007 * tests/glr-regression.at
9008 (Incorrectly initialized location for empty right-hand side in GLR):
9009 In yyerror, use the msg arg.
9010 (Corrupted semantic options if user action cuts parse):
9011 (Incorrect lookahead during deterministic GLR):
9012 (Incorrect lookahead during nondeterministic GLR):
9013 Don't name a local var 'index'; it shadows string.h's 'index'.
9014
ed94ef2a
AD
90152006-01-19 Akim Demaille <akim@epita.fr>
9016
9017 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
9018 location, not just parts of it.
9019
e9ad4aec
PE
90202006-01-18 Paul Eggert <eggert@cs.ucla.edu>
9021
d6ca7905
PE
9022 * NEWS: Document the fact that multiple %unions are now allowed.
9023 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
9024 * TODO: This feature is now implemented, so remove it from
9025 the wishlist.
d6ca7905 9026
ef1b70e0
PE
9027 * Makefile.maint: Merge with coreutils Makefile.maint.
9028 (CVS_LIST): Use build-aux version if available.
9029 (VERSION_REGEXP): New macro.
9030 (syntax-check-rules): Add sc_no_if_have_config_h,
9031 sc_prohibit_assert_without_use, sc_require_config_h,
9032 sc_useless_cpp_parens.
9033 (sc_obsolete_symbols): Check for O_NDELAY.
9034 (sc_dd_max_sym_length): Track coreutils.
9035 (sc_unmarked_diagnostics): Look in all files, not just *.c.
9036 (sc_useless_cpp_parens): New rule.
9037 (news-date-check): Look for version or today's date.
9038 (changelog-check): Don't require version number near head.
9039 (copyright-check): Use current year instead of hardwiring 2005.
9040 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
9041 (announcement): Add --gpg-key-ID.
9042
9043 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
9044 with "file system".
9045
2073ce56 9046 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
9047 array. Problem reported by twlevo.
9048 * src/reader.c (packgram): Prepend a new sentinel before ritem.
9049 * src/lalr.c (build_relations): Rely on new sentinel.
9050 * src/gram.c (gram_free): Adjust to new sentinel.
9051
b7691f15
JD
90522006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
9053
9054 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
9055 yylookaheadNeeds. All uses updated.
9056 (yysplitStack): Rename local yynewLookaheadStatuses to
9057 yynewLookaheadNeeds.
9058 * data/glr-regression.at (Incorrect lookahead during nondeterministic
9059 GLR): In comments, change `lookahead status' to `lookahead need'.
9060
ddee1b06
PH
90612006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9062
9063 * data/glr.c (yysplitStack): A little stylistic rewrite.
9064
12f4614d
PH
90652006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9066
9067 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
9068
32c29292
JD
90692006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
9070
9071 * doc/bison.texinfo: Fix some typos.
9072 (GLR Semantic Actions): New subsection discussing special
9073 considerations because GLR semantic actions might be deferred.
9074 (Actions): Mention look-ahead usage of yylval.
9075 (Actions and Locations): Mention look-ahead usage of yylloc.
9076 (Special Features for Use in Actions): Add YYEOF entry and mention it
9077 in the yychar entry.
9078 In the yychar entry, remove mention of the local yychar case (pure
9079 parser) since this is irrelevant information when writing semantic
148d66d8 9080 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
9081 yychar is otherwise described as an external variable.
9082 In the yychar entry, don't call it the `current' look-ahead since it
9083 isn't when semantic actions are deferred.
9084 In the yychar and yyclearin entries, add note about deferred semantic
9085 actions.
9086 Add yylloc and yylval entries discussing look-ahead usage.
9087 (Look-Ahead Tokens): When discussing yychar, don't call it the
9088 `current' look-ahead, and do mention yylval and yylloc.
9089 (Error Recovery): Cross-reference `Action Features' when mentioning
9090 yyclearin.
148d66d8 9091 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
9092 look-ahead.
9093 In the yylloc and yylval entries, mention look-ahead usage.
9094
de366a2f 90952006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
9096
9097 * tests/glr-regression.at: Update copyright year to 2006.
9098
bf70fa87
JD
90992006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9100
9101 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
9102 use during nondeterministic operation to track which stacks have
9103 actually needed the current lookahead.
9104 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
9105 Allocate, deallocate, resize, and otherwise shuffle space for
9106 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
9107 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
9108 appropriately during nondeterministic operation.
9109 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
9110 members to store the current lookahead to be used by the deferred
9111 user action.
9112 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
9113 from which the RHS is taken. Set the lookahead members of the new
9114 yySemanticOption according to the lookahead status for stack yyk.
9115 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
9116 yyaddDeferredAction.
9117 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
9118 members of yySemanticOption before invoking yyuserAction, and then set
9119 them back to their current values afterward.
9120 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
9121 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
9122 * tests/glr-regression.at: Remove `.' from the ends of recent test case
9123 titles for consistency.
9124 (Leaked merged semantic value if user action cuts parse): In order to
9125 suppress lint warnings, use arguments in merge function, and assign
9126 char value < 128 in main.
9127 (Incorrect lookahead during deterministic GLR): New test case.
9128 (Incorrect lookahead during nondeterministic GLR): New test case.
9129
05449a2c
JD
91302006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9131
de366a2f 9132 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
9133 !yyvaluep as signal that no semantic value is available to print.
9134 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
9135 to print a semantic value.
9136
4158e0a1 91372006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 9138
4158e0a1
JD
9139 * tests/glr-regression.at: For consistency with my newer test cases,
9140 don't thank myself.
9141
d659304d
JD
91422006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
9143
9144 * data/glr.c (yyresolveValue): When merging semantic options, if at
9145 least one user action succeeds but a later one cuts the parse, then
9146 destroy the semantic value before returning rather than leaking it.
9147 (yyresolveStates): If a user action cuts the parse and thus
9148 yyresolveValue fails, ignore the (unset) semantic value rather than
9149 corrupting the yyGLRState, and empty the semantic options list since
9150 the user actions should have called all necessary destructors.
9151 Simplify code with YYCHK.
9152 * tests/glr-regression.at (Corrupted semantic options if user action
9153 cuts parse): New test case.
9154 (Undesirable destructors if user action cuts parse): New test case.
9155 Before applying any of this patch, this test case never actually failed
9156 for me... but only because the corrupted semantic options usually
9157 masked this bug.
9158 (Leaked merged semantic value if user action cuts parse): New test
9159 case.
9160
6ec2c0f2
AD
91612006-01-05 Akim Demaille <akim@epita.fr>
9162
9163 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
9164
1b9c21fb
PE
91652006-01-04 Paul Eggert <eggert@cs.ucla.edu>
9166
9167 * data/c.m4 (b4_c_modern): New macro, with a new provision for
9168 _MSC_VER. Problem reported by Cenzato Marco.
9169 (b4_c_function_def): Use it.
9170 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
9171 b4_c_modern.
9172 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
9173 than rolling our own.
9174
84866159
AD
91752006-01-04 Akim Demaille <akim@epita.fr>
9176
9177 Also warn about non-used mid-rule values.
9178 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
9179 member.
9180 (symbol_list_new): Adjust.
9181 * src/reader.c (symbol_typed_p): New.
9182 (grammar_rule_check): Use it.
9183 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
9184 Check its rule.
9185 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
9186 Use it.
9187 * tests/actions.at (Exotic Dollars): Adjust.
9188
378f4bd8
AD
91892006-01-04 Akim Demaille <akim@epita.fr>
9190
9191 * src/reader.c (grammar_midrule_action): If $$ is set in a
9192 mid-rule, move the `used' bit to its lhs.
9193 * tests/input.at (Unused values): New.
9194 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
9195
e2a21b6f
PE
91962006-01-03 Paul Eggert <eggert@cs.ucla.edu>
9197
54662697
PE
9198 * doc/bison.texinfo (Bison Options): Say more accurately what
9199 --yacc does.
9200 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
9201 about declarations in the grammar when in Yacc mode, as POSIX does
9202 not require a diagnostic when the grammar uses extensions.
9203
9204 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
9205
073f9288
PE
9206 Warn about dubious constructions like "%token T T".
9207 Reported by twlevo.
9208 * src/symtab.h (struct symbol.declared): New member.
9209 * src/symtab.c (symbol_new): Initialize it to false.
9210 (symbol_class_set): New arg DECLARING, specifying whether
9211 this is a declaration that we want to warn about, if there
9212 is more than one of them. All uses changed.
9213
1221b78a
PE
9214 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
9215 Allow multiple %union directives, whose contents concatenate.
9216 * src/parse-gram.y (grammar_declaration): Likewise.
9217 Use muscle_code_grow, so that we don't need stype_line any more.
9218 All uses changed.
9219
9220 * src/muscle_tab.c (muscle_grow): Fix comment.
9221
e2a21b6f
PE
9222 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
9223 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
9224 Update copyright year to 2006.
9225
8f7e3cf9
AD
92262006-01-03 Akim Demaille <akim@epita.fr>
9227
9228 Have glr.cc pass (some of) the calc.at tests.
9229 * data/glr.cc (b4_parse_param_orig): New.
9230 (b4_parse_param): Improve its definition, and bound it more
9231 clearly in the skeleton.
9232 (b4_epilogue): Append, instead of prepending, in order to keep
9233 #line consistency.
9234 Simplify the generation of auxiliary functions: locations and
9235 purity are mandated.
9236 (b4_global_tokens_and_yystype): Honor it.
9237 * data/location.cc (c++.m4): Don't include it.
9238 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9239 and AT_SKEL_CC_IF.
9240 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9241 AT_LALR1_CC_IF.
9242 Be sure to initialize the first position's filename.
9243 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9244 mandated anyway.
9245 (AT_CHECK_CALC_GLR_CC): New.
9246 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9247
3953ed88
AD
92482006-01-02 Akim Demaille <akim@epita.fr>
9249
9250 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9251 c.m4.
0a96ba81 9252 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
9253 * data/glr.cc: Do not include stack.hh.
9254
9ecafbbf
AD
92552006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9256
9257 * data/glr.c: Reformat whitespace with tabs.
9258 (b4_lpure_formals): Remove this unused m4 macro.
9259 * tests/cxx-type.at: Reformat whitespace with tabs.
9260 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9261 since it's a member. Rename type to isNterm for clarity.
9262
c4d497a0
AD
92632005-12-29 Akim <akim@sulaco.local>
9264
9265 Let glr.cc catch up with symbol_value_print.
9266 * data/glr.cc (b4_yysymprint_generate): Replace by...
9267 (b4_yy_symbol_print_generate): this.
9268 (yy_symbol_print, yy_symbol_value_print): Declare them.
9269
4517da37
PE
92702005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9271
9272 * src/location.h (boundary): Note that a line or column equal
9273 to INT_MAX indicates an overflow.
9274 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9275 (rule_length_overflow, increment_rule_length, add_column_width):
9276 New functions.
9277 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9278 (<SC_BRACED_CODE>"}"):
9279 Use increment_rule_length rather than incrementing it by hand.
9280 (adjust_location, handle_syncline): Diagnose overflow.
9281 (handle_action_dollar, handle_action_at):
9282 Fix bug with monstrosities like $-2147483648.
9283 Remove now-unnecessary checks.
9284 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9285 (convert_ucn_to_byte): Verify assumptions.
9286 (handle_syncline): New arg LOC. All callers changed.
9287 Don't store through a value derived from char const * pointer.
9288
9289 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9290 GCC warnings.
9291
e3233bf6
PE
92922005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9293
9294 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9295 Remove unnecessary forward static decls.
9296
8f3596a6
AD
92972005-12-27 Akim Demaille <akim@epita.fr>
9298
9299 * src/reader.c (grammar_current_rule_check): Also check that $$
9300 is used.
9301 Take the rule to check as argument, hence rename as...
9302 (grammar_rule_check): this.
9303 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9304 Rename as...
9305 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9306 (grammar_midrule_action, grammar_symbol_append): Now static.
9307 * tests/torture.at (input): Don't rely on the default action
9308 being always performed.
9309 * tests/calc.at: "Set" $$ even when the action is "cut" with
9310 YYERROR or other.
9311 * tests/actions.at (Exotic Dollars): Instead of using unused
9312 values, check that the warning is issued.
9313
721be13c
PE
93142005-12-22 Paul Eggert <eggert@cs.ucla.edu>
9315
9316 * NEWS: Improve wording for unused-value warnings.
9317
a0af42fc
AD
93182005-12-22 Akim Demaille <akim@epita.fr>
9319
9320 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
9321 (b4_yysymprint_generate): Rename as...
9322 (b4_yy_symbol_print_generate): this.
9323 Generate yy_symbol_print instead of yysymprint.
9324 Generate also yy_symbol_value_print, and use it.
9325
affac613
AD
93262005-12-22 Akim Demaille <akim@epita.fr>
9327
721be13c 9328 * NEWS: Warn about unused values.
affac613
AD
9329 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
9330 a `used' member.
9331 (symbol_list_n_get, symbol_list_n_used_set): New.
9332 (symbol_list_n_type_name_get): Use symbol_list_n_get.
9333 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
9334 * src/reader.c (grammar_current_rule_check): Check that values are
9335 used.
9336 * src/symtab.c (symbol_print): Accept 0.
9337 * tests/existing.at: Remove the type information.
9338 Empty the actions.
9339 Remove useless actions (beware of mid-rule actions: perl -000
9340 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
9341 * tests/actions.at (Exotic Dollars): Use unused values.
9342 * tests/calc.at: Likewise.
9343 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9344 Likewise.
9345
9346 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
9347 rule_useful_p.
9348
9d9b8b70
PE
93492005-12-21 Paul Eggert <eggert@cs.ucla.edu>
9350
8bb4c753
PE
9351 Undo 2005-12-01 tentative license wording change. The wording is
9352 still being reviewed by the lawyers, and we don't want to wait for
9353 them before publishing a test release. For now, revert to the
9354 previous wording.
9355 * NEWS: Undo 2005-12-01 change.
9356 * data/glr.c: Revert to previous license wording.
9357 * data/glr.cc: Likewise.
9358 * data/lalr1.cc: Likewise.
9359 * data/location.cc: Likewise.
9360 * data/yacc.c: Likewise.
9361
9d9b8b70
PE
9362 * NEWS: Reword %destructor vs YYABORT etc.
9363 * data/glr.c: Use American spacing, for consistency.
9364 * data/glr.cc: Likewise.
9365 * data/lalr1.cc: Likewise.
9366 * data/yacc.c: Likewise.
9367 * data/yacc.c: Reformat comments slightly.
9368 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
9369 for consistency. Fix some spelling errors and reword recently-included
9370 text slightly.
9371 * tests/cxx-type.at: Cast results of malloc, for C++.
9372
2c3b392a
AD
93732005-12-21 Joel E. Denny <address@hidden>
9374
9375 * tests/cxx-type.at: Construct a tree, count the parents of shared
9376 nodes, and free each node once and only once. Previously, the memory
9377 for semantic values was leaked instead.
9378
d6cff4dc
AD
93792005-12-21 Joel E. Denny <address@hidden>
9380
9381 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
9382 (yylval, yylloc): If pure, #define to yystackp->yyval and
9383 yystackp->yyloc similar to yychar and yynerrs.
9384 (yyparse): If pure, remove local yylval and yylloc. Add local
9385 yystackp to accommodate pure definitions of yylval and yylloc.
9386 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
9387 yylvalp and yyllocp to &yylval and &yylloc.
9388 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
9389 namespace. Previously, nerrs and char were missing, but lval and lloc
9390 weren't necessary.
9391 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
9392 yylvalp and yyllocp parameters since, if pure, these are now always
9393 accessible through yystackp. If not pure, they are still accessible
9394 globally.
9395 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
9396 `if (YYID (N))' to pacify lint.
9397
a85284cf
AD
93982005-12-21 Akim Demaille <akim@epita.fr>
9399
9400 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
9401 destroy the RHS symbols of a rule.
9402 * data/yacc.c (yylen): Initialize to 0.
9403 Keep its value to the number of items to possibly shift.
9404 In particular, a regular successful parse that ends on YYFINAL by
9405 a (internal) YYACCEPT must not have yylen != 0.
9406 (yyerrorlab, yyreturn): Pop the RHS.
9407 Reorder a bit to emphasize the `shifting' bits of code.
9408 (YYPOPSTACK): Now accept a number of items to pop.
9409 * data/lalr1.cc: Likewise.
9410 * data/glr.c: Formatting changes.
9411 Use goto instead of fall through.
9412 * doc/bison.texinfo (Destructor Decl): Complete.
9413
d508c281
JMG
94142005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9415
9416 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9417 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
9418 * djgpp/config.bat: Replace every occurence of the file name
9419 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9420 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9421 * djgpp/config.sed: Replace every occurence of the file name
9422 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9423 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9424 * djgpp/djunpack.bat: DJGPP specific file.
9425 * djgpp/fnchange.lst: DJGPP specific file.
9426 * djgpp/README.in: Add new information about how to unpack the bison
9427 source on MSDOS and other systems which have 8.3 file name restrictions
9428 using djunpack.bat and fnchange.lst.
9429
3e7a2cd9
PE
94302005-12-12 Paul Eggert <eggert@cs.ucla.edu>
9431
9432 * bootstrap (build_cvs_prefix): Remove; unused.
9433 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
9434 when getting gnulib.
9435
94362005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
9437
9438 * data/glr.c: Reorder typedef declarations for structs to match order
9439 of struct declarations.
9440 Rename yystack everywhere to yystackp except in yyparse where it's not
9441 a pointer.
9442 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
9443 consistency.
9444 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
9445 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
9446 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
9447 lint.
9448
877519f8
PE
94492005-12-09 Paul Eggert <eggert@cs.ucla.edu>
9450
0eca5a39
PE
9451 * tests/sets.at (Accept): Fix typos in regular expression used to
9452 sed out the final state number.
9453
2cec9080
PE
9454 Work around portability problem on Solaris 10: flex-generated
9455 files include <stdio.h> before <config.h>, which messes up
9456 because the latter defines __EXTENSIONS__. Address the problem
9457 by creating two new little files that include <config.h> first,
9458 then include the flex-generated files. Rewrite everyone else
9459 to include <config.h> first, as well.
9460 * lib/timevar.c: Always include "config.h".
9461 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
9462 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
9463 (EXTRA_bison_SOURCES): New macro.
9464 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9465 * src/system.h: Don't include config.h.
9466 * src/LR0.c: Include <config.h> first.
9467 * src/assoc.c: Likewise.
9468 * src/closure.c: Likewise.
9469 * src/complain.c: Likewise.
9470 * src/conflicts.c: Likewise.
9471 * src/derives.c: Likewise.
9472 * src/files.c: Likewise.
9473 * src/getargs.c: Likewise.
9474 * src/gram.c: Likewise.
9475 * src/lalr.c: Likewise.
9476 * src/location.c: Likewise.
9477 * src/main.c: Likewise.
9478 * src/muscle_tab.c: Likewise.
9479 * src/nullable.c: Likewise.
9480 * src/output.c: Likewise.
9481 * src/parse-gram.y: Likewise.
9482 * src/print.c: Likewise.
9483 * src/print_graph.c: Likewise.
9484 * src/reader.c: Likewise.
9485 * src/reduce.c: Likewise.
9486 * src/relation.c: Likewise.
9487 * src/state.c: Likewise.
9488 * src/symlist.c: Likewise.
9489 * src/symtab.c: Likewise.
9490 * src/tables.c: Likewise.
9491 * src/uniqstr.c: Likewise.
9492 * src/vcg.c: Likewise.
9493
877519f8
PE
9494 * src/parse-gram.y: Fix minor problems uncovered by lint.
9495 (current_lhs, current_lhs_location): Now static.
9496 (current_assoc): Remove unused variable.
9497
9498 Cleanups so that Bison-generated parsers have less lint.
9499 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9500 Prepend /*ARGSUSED*/, for lint's sake.
9501 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9502 definition if 'lint' is defined.
9503 (YYID): New macro (or function, if lint).
9504 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9505 * data/yacc.c: Likewise.
9506 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9507 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9508 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9509 is C++ only.
9510 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9511 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9512 Use YYID(0) rather than 0, for lint.
9513 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9514 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9515
f5228370
PE
95162005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9517
9518 * tests/glr-regression.at
9519 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9520 Close memory leak reported by twlevo.
9521
69ce078b
PE
95222005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9523
6ff99711
PE
9524 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9525 all stacks.
9526 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
9527 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9528 New test case.
9529 (Duplicated user destructor for lookahead): This test now is expected
9530 to succeed.
9531
af3412cd
PE
95322005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9533
32b5b719 9534 * NEWS: Document the following change.
af3412cd
PE
9535 * data/yacc.c: Say "parser skeleton" rather than "file", since
9536 it's no longer just a file.
9537 * data/glr.c: Grant a special exception for C GLR parsers, that
9538 reads like the already-existing exception for C LALR(1) parsers.
9539 * data/glr.cc: Likewise.
9540 * data/lalr1.cc: Likewise.
9541 * data/location.cc: Likewise.
9542 * data/yacc.c: Reword the "written by" statement to clarify that
9543 it was the parser skeleton, not the entire output file.
9544 * data/glr.c: Written by Paul Hilfinger.
9545 * data/glr.cc: Written by Akim Demaille.
9546 * data/lalr1.cc: Likewise.
9547
035aa4a0
PE
95482005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9549
d9963c85
PE
9550 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9551 Fix typos in previous change that broke 'make check'.
9552 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9553 supported in C.
9554 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9555 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9556 We can revert this once things settle down.
9557
035aa4a0
PE
9558 * src/conflicts.c (conflicts_print): Don't print file name twice
9559 when %expect fails because there were no conflicts.
9560 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9561 change.
9562 * tests/conflicts.at (%expect not enough, %expect too much):
9563 (%expect with reduce conflicts): Adjust to new behavior.
9564
95652005-11-18 Akim Demaille <akim@epita.fr>
9566
9567 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9568 errors.
9569 * NEWS: Document this.
9570 * doc/bison.texinfo (Expect Decl): Likewise.
9571
d1ff7a7c
AD
95722005-11-16 Akim Demaille <akim@epita.fr>
9573
9574 Generalize the display of semantic values and locations in traces.
9575 * data/glr.c (yy_reduce_print): Fix indices (again).
9576 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9577 literal integers.
9578 * data/lalr1.cc (yyreduce_print): Rename as...
9579 (yy_reduce_print): this.
9580 Display values and locations.
9581 * data/yacc.c (yy_reduce_print): Likewise.
9582 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9583 (yysymprint): Move higher to be visible from yy_reduce_print).
9584 (yyparse): Adjust.
9585 * tests/calc.at: Adjust the expected length of the traces.
9586
6de5398d
AD
95872005-11-14 Akim Demaille <akim@epita.fr>
9588
9589 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9590 from 1 to N, while values and location start at 0.
9591 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9592
a1373f55
AD
95932005-11-14 Akim Demaille <akim@epita.fr>
9594
9595 * data/glr.c (yy_reduce_print): Fix the $ number.
9596
613d8952
AD
95972005-11-14 Akim Demaille <akim@epita.fr>
9598
9599 "Use" parse parameters.
9600 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9601 * data/glr.c, data/glr.cc: Use them.
9602 * data/glr.c (YYUSE): Have a C++ definition that supports
9603 non-pointer types.
9604
b2741627
AD
96052005-11-14 Akim Demaille <akim@epita.fr>
9606
9607 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9608
5059b5c8
AD
96092005-11-14 Akim Demaille <akim@epita.fr>
9610
42249483
AD
9611 * data/glr.cc: New.
9612 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 9613
4626a15d
AD
96142005-11-12 Akim Demaille <akim@epita.fr>
9615
9616 Let position and location be PODs.
9617 * data/location.cc (position::initialize, location::initialize): New.
9618 (position::position, location::location): Define only if
9619 b4_location_constructors is defined.
9620 * data/lalr1.cc (b4_location_constructors): Define it for backward
9621 compatibility.
9622 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9623
96242005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
9625
9626 * data/lalr1.cc: Move the body of the ctor and dtor into the
9627 parser file (instead of the header).
9628 Wrap the implementations in a "namespace yy".
9629
96302005-11-12 Akim Demaille <akim@epita.fr>
9631
9632 Have glr.c include its header file when created.
9633 * data/glr.c (b4_shared_declarations): New.
9634 Output them verbatim in the parser if !%defines, otherwise
9635 output then in the header file, and include it instead.
9636
1989d947
AD
96372005-11-11 Akim Demaille <akim@epita.fr>
9638
9639 * data/glr.c: Comment changes.
9640
96412005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
9642
9643 When yydebug, report semantic and location values for reductions.
9644 * data/glr.c (yy_reduce_print): Report the semantic values and the
9645 locations.
9646 (YY_REDUCE_PRINT): Adjust.
9647 (yyglrReduce): Use them.
9648 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9649 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9650 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9651 traces.
9652
02998094
AD
96532005-11-10 Akim Demaille <akim@epita.fr>
9654
9655 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9656 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9657 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9658
5210672f
PE
96592005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9660
9661 * m4/cxx.m4, examples/Makefile.am: Don't build
9662 examples/calc++ if no C++ compiler is available. (trivial change)
9663
a8991a1d
AD
96642005-11-09 Akim Demaille <akim@epita.fr>
9665
9666 * src/scan-skel.l: Use a couple of asserts.
9667
36b5e963
AD
96682005-11-03 Akim Demaille <akim@epita.fr>
9669
9670 In some (weird) cases, the final state number is incorrect.
9671 Reported by Alexandre Duret-Lutz.
9672 * src/LR0.c (state_list_append): Remove the computation of
9673 final_state.
9674 (save_reductions): Do it here.
9675 (get_state): Alpha conversion.
9676 (generate_states): Use a for loop.
9677 * src/gram.h (item_number_is_rule_number)
9678 (item_number_is_symbol_number): New.
9679 * src/state.c: Use assert.
9680 * src/system.h: Include assert.h.
9681 * tests/sets.at (Accept): New.
9682
44e7ead1
PH
96832005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9684
9685 * data/glr.c (yyfill): Adjust comment.
36b5e963 9686 (yyresolveAction): Initialize default location properly
44e7ead1
PH
9687 for empty right-hand sides.
9688 (yydoAction): Ditto.
9689 Add comment explaining apparently dead code.
36b5e963
AD
9690 * tests/glr-regression.at
9691 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 9692 New test.
36b5e963 9693
e10a80ee
PE
96942005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9695
9696 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9697 gnulib when interrupted. This fixes some race conditions and
9698 works around some portability problems (one noted by Paul
9699 Hilfinger).
9700
067b32ee
AD
97012005-10-22 Akim <akim@epita.fr>
9702
9703 * Makefile.cfg: Adjust to config -> build-aux.
9704 Reported by twledo.
9705
4b367315
AD
97062005-10-21 Akim Demaille <akim@epita.fr>
9707
9708 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9709 the %parse-params.
9710 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9711 * data/yacc.c (b4_Pure_if): Rename as...
9712 (b4_yacc_pure_if): this.
9713 (YY_SYMBOL_PRINT, yyparse): Adjust.
9714 * doc/bison.texinfo: Formatting changes.
9715
24cc23d9
AD
97162005-10-21 Akim Demaille <akim@epita.fr>
9717
9718 Finish the transition config -> build-aux.
9719 * configure.ac, Makefile.am: Use build-aux.
9720 * config/prev-version, config/announce-gen, config/Makefile.am:
9721 Move to...
9722 * build-aux/prev-version, build-aux/announce-gen,
9723 * build-aux/Makefile.am: here.
9724
d4476375
AD
97252005-10-14 Akim Demaille <akim@epita.fr>
9726
9727 * examples/calc++/test: Use set -x only when VERBOSE.
9728
302c0aee
PE
97292005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9730
9731 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9732 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9733
7625ec2c
AD
97342005-10-13 Akim Demaille <akim@epita.fr>
9735
9736 * src/scan-skel.l: Output the base name parts of the parser and
9737 header file names.
302c0aee 9738 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
9739 additional checks.
9740 Use this to exercise C++ outputs in subdirs.
9741 Reported by Oleg Smolsky.
9742
ba0fe3c7
PE
97432005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9744
9745 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9746 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9747 Problem reported by John P. Hartmann.
9748 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9749 already defined it.
9750
9b8a5ce0
AD
97512005-10-12 Akim Demaille <akim@epita.fr>
9752
9753 * src/parse-gram.y (version_check): Exit 63 to please missing
9754 (stands for "version mismatch).
9755 * tests/input.at, doc/bison.texinfo: Adjust.
9756
4f6e011e
PE
97572005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9758
9759 Work around portability problems with Visual Age C compiler
9760 (xlc and xlC_r) reported by John P. Hartmann.
9761 * data/location.cc (initial_column, initial_line): Remove.
9762 All uses replaced by 0 and 1.
9763 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9764 that xlc complains about.
9765 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 9766 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 9767 as __STDC__.
4d7aa45e
PE
9768 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9769 __STDC_VERSION__. Use it everywhere instead of looking at
9770 __STDC__ and __cplusplus.
4f6e011e 9771
a1b3bf8c
AD
97722005-10-10 Akim Demaille <akim@epita.fr>
9773
9774 * examples/calc++/test: Be quiet unless VERBOSE.
9775
412e44aa
PE
97762005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9777
2a4647a3
PE
9778 * data/c.m4 (yydestruct, yysymprint):
9779 Use YYUSE instead of casting to void.
9780 * data/glr.c (YYUSE): New macro.
9781 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9782 Use it instead of rolling our own.
9783 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9784 (YYCHK1):
9785 Use /*CONSTCOND*/ to suppress lint warnings.
9786 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9787 (YY_STACK_PRINT): Use 'false' not '0'.
9788 (YYUSE): New macro.
9789 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9790 * data/yacc.c (YYUSE): New macro.
9791 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9792 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9793 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9794
9795
412e44aa
PE
9796 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9797 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9798
88c6637f
PE
97992005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9800
2f4f028d
PE
9801 Undo the parts of the unlocked-I/O change that substituted
9802 putc or puts for printf. This might hurt performance a bit,
9803 but some people prefer the printf style.
9804 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9805 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9806 All uses replaced by YYFPRINTF and YYDPRINTF.
9807 * data/yacc.c: Likewise.
9808 * lib/bitset.c (bitset_print): Likewise.
9809 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9810 putc and puts.
9811 * lib/lbitset.c (debug_lbitset): Likewise.
9812 * src/closure.c (print_firsts, print_fderives): Likewise.
9813 * src/gram.c (grammar_dump): Likewise.
9814 * src/lalr.c (look_ahead_tokens_print): Likewise.
9815 * src/output.c (escaped_output): Likewise.
9816 (user_actions_output): Break apart two printfs.
9817 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9818 * src/reduce.c (reduce_print): Likewise.
9819 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9820 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9821
88c6637f
PE
9822 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9823 Use assignments rather than casts-to-void to suppress
9824 unused-variable warnings. This pacifies 'lint'.
9825 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9826 unused-variable warnings.
9827
fb32e373
JMG
98282005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9829
9830 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9831
edb8f44f
PE
98322005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9833
fb9c0b33
PE
9834 Use unlocked I/O for a minor performance improvement on hosts like
9835 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9836 is to use the gnlib unlocked-io module, and to prefer putc and
9837 puts to printf when either will work (since the latter doesn't
9838 come in an unlocked flavor).
9839 * bootstrap (gnulib_modules): Add unlocked-io.
9840 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9841 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9842 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9843 and similarly for puts and putc and printf.
9844 * data/yacc.c: Likewise.
9845 * lib/bitset.c (bitset_print): Likewise.
9846 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9847 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9848 to printf.
9849 * lib/lbitset.c (debug_lbitset): Likewise.
9850 * src/closure.c (print_firsts, print_fderives): Likewise.
9851 * src/gram.c (grammar_dump): Likewise.
9852 * src/lalr.c (look_ahead_tokens_print): Likewise.
9853 * src/output.c (escaped_output): Likewise.
9854 (user_actions_output): Coalesce two printfs.
2f4f028d 9855 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
9856 * src/reduce.c (reduce_print): Likewise.
9857 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 9858 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 9859
edb8f44f
PE
9860 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9861 this confuses xgettext.
9862
b50d2359
AD
98632005-10-02 Akim Demaille <akim@epita.fr>
9864
9865 * bootstrap (gnulib_modules): Add strverscmp.
9866 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9867 * m4/.cvsignore: Add strverscmp.m4.
9868 * src/parse-gram.y (%require): New token, new rule.
9869 (version_check): New.
9870 * src/scan-gram.l (%require): Adjust.
9871 * tests/input.at (AT_REQUIRE): New.
9872 Use it.
9873 * doc/bison.texinfo (Require Decl): New.
9874 (Calc++ Parser): Use %require.
9875
21667f64
AD
98762005-10-02 Akim Demaille <akim@epita.fr>
9877
9878 * data/location.cc: New.
9879
2b81e969
AD
98802005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9881 Akim Demaille <akim@epita.fr>
9882
9883 Make sure -odir/foo.cc creates dir/location.hh etc.
9884 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9885 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9886 (spec_defines_file): Now const.
9887 (dir_prefix): New.
9888 (short_base_name): Remove.
9889 * src/files.c: Adjust.
9890 (dirname.h): Include.
9891 (base_name): Don't prototype it.
9892 (finput): Remove, duplicates gram_in.
9893 (full_base_name, short_base_name): Replace by...
9894 (all_but_ext, all_but_tab_ext): these.
9895 (compute_base_names): Rename as...
9896 (compute_file_name_parts): this.
9897 Update to compute the new variables, including dir_prefix.
9898 Adjust dependencies.
9899 * src/output.c (prepare): Output them.
9900 * src/reader.c: Adjust to use gram_in, not finput.
9901 * src/scan-skel.l (@dir_prefix@): New.
9902
ad6a9b97
JMG
99032005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9904
9905 * lib/subpipe.c: New function end_of_output_subpipe() added
9906 to allow support for non-posix systems. This is a no-op function
9907 for posix systems.
9908
9909 * lib/subpipe.h: New function end_of_output_subpipe() added
9910 to allow support for non-posix systems. This is a no-op function
9911 for posix systems.
9912
9913 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
9914 handle the lack of pipe/fork functionality on non-posix systems.
9915
9916 * djgpp/Makefile.maint: DJGPP specific file.
9917
9918 * djgpp/README.in: DJGPP specific file.
9919
9920 * djgpp/config.bat: DJGPP specific configuration file.
9921
9922 * djgpp/config.sed: DJGPP specific configuration file.
9923
9924 * djgpp/config.site: DJGPP specific configuration file.
9925
9926 * djgpp/config_h.sed: DJGPP specific configuration file.
9927
9928 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
9929
9930 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
9931
fc695704
AD
99322005-10-02 Akim Demaille <akim@epita.fr>
9933
9934 * data/location.cc: New, extract from...
9935 * data/lalr1.cc: here.
9936 (location.hh): Include it after the user prologue, in case the
9937 filename type is defined by the user.
9938 Forward declation location and position before the pre-prologue.
9939 (yyresult_): Rename as...
9940 (yyresult): this, it's a local variable, not an attribute.
9941 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
9942
99432005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
9944
9945 * examples/extexi: Restore the #line generation.
9946
fb9712a9
AD
99472005-09-30 Akim Demaille <akim@epita.fr>,
9948 Alexandre Duret-Lutz <adl@gnu.org>
9949
9950 Move the token type and YYSTYPE in the parser class.
9951 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
9952 (parser::token): New, from the moved free definition of tokens.
9953 (parser::semantic_value): Now a full definition instead of an
9954 indirection to YYSTYPE.
9955 (b4_post_prologue): No longer included in the header file, but
9956 in the implementation file.
9957 * doc/bison.texi (C+ Language Interface): Update.
9958 * src/parse-gram.y: Support unary %define.
9959 * tests/actions.at: Define global_tokens_and_yystype for backward
9960 compatibility until we update the tests.
9961 * tests/calc.at: Idem.
9962 (first_line, first_column, last_line, last_column): Define for lalr1.cc
9963 to simplify the code.
9964
55f0c7b1
PE
99652005-09-29 Paul Eggert <eggert@cs.ucla.edu>
9966
9967 Port to SunOS 4.1.4, which lacks strtoul and strerror.
9968 Ah, the good old days! Problem reported by Peter Klein.
9969 * bootstrap (gnulib_modules): Add strerror, strtoul.
9970 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
9971 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
9972
fb9712a9 99732005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
9974
9975 * data/c.m4 (b4_error_verbose_if): New.
9976 * data/lalr1.cc: Use it.
9977 (YYERROR_VERBOSE_IF): Remove.
9978 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
9979 parser members, replaced by...
9980 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
9981 local variables.
9982 (yysyntax_error_): Takes the state number as argument.
9983 (yyreduce_print_): Use the argument yyrule, not the former
9984 attribute yyn_.
9985
8a6f72f3
PE
99862005-09-26 Paul Eggert <eggert@cs.ucla.edu>
9987
9988 * bootstrap (gnulib_modules): Add verify.
9989 * lib/.cvsignore: Add verify.h.
9990 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
9991 * src/system.h (verify): Remove.
9992 Include verify.h instead.
9993 * src/tables.c (tables_generate): Use new API for 'verify'.
9994
0d50976f
PE
99952005-09-21 Paul Eggert <eggert@cs.ucla.edu>
9996
ebc3737e
PE
9997 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
9998 local variables whose names begin with 'yy'.
9999 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10000 Trivial changes from Joel E. Denny.
10001
0d50976f
PE
10002 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
10003 it itself.
10004 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
10005 don't use alloca any more.
10006
10007 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
10008 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 10009 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
10010 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
10011 to match yacc.c, to test more hosts.
10012
a05b79df
PE
100132005-09-20 Paul Eggert <eggert@cs.ucla.edu>
10014
55289366
PE
10015 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
10016 doesn't affect behavior.
10017 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
10018 Solaris, AIX, MSC.
10019 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
10020 This works a bit better with glibc, if user code has already included
10021 stdlib.h.
10022 * doc/bison.texinfo (Bison Parser): Document that users can't
10023 arbitrarily use malloc and free for other purposes. Document
10024 that <alloca.h> and <malloc.h> might be included.
10025 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
10026 user must declare alloca.
10027
a05b79df
PE
10028 * HACKING (release): Forwarn the Translation Project about
10029 stable releses.
10030
3ab2ca22
AD
100312005-09-20 Akim Demaille <akim@epita.fr>
10032
10033 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
10034
a9739e7c
PE
100352005-09-19 Paul Eggert <eggert@cs.ucla.edu>
10036
a702593e
PE
10037 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
10038 (YYSTACK_ALLOC_MAXIMUM): Use it.
10039 (yysyntax_error): New function.
10040 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
10041 multiple syntax errors are reported, and alloca is being used.
10042 Instead, reallocate buffers twice as big each time, so that
10043 we waste at most half the allocated memory. Start with a small
10044 (128-byte) buffer that will suffice in most cases anyway.
10045 Use yysyntax_error to do most of the work.
10046
10047 * doc/bison.texinfo (Error Reporting, Table of Symbols):
10048 yynerrs is the number of errors reported, not the number of
10049 errors encountered.
10050
a9739e7c
PE
10051 * tests/glr-regression.at (Duplicated user destructor for lookahead):
10052 Mark it as expected to fail.
10053 Cast result of malloc; problem reported by twlevo@xs4all.nl.
10054 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
10055 Don't start user-code symbols with "yy", to avoid name space problems.
10056
f479c6c6
AD
100572005-09-19 Akim Demaille <akim@epita.fr>
10058
10059 Remove the traits, failed experiment.
10060 It never proved useful, and anyway because of the current
10061 definition, it was not possible to have several specialization of
10062 this traits, making it useless.
10063 * data/lalr1.cc (yy:traits): Remove.
10064 Inline its definitions in the parser class.
10065
e2586f82
AD
100662005-09-19 Akim Demaille <akim@epita.fr>
10067
10068 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
10069 least Mac OSX with a /usr/local install of gettext.
10070
2e8cf949
AD
100712005-09-19 Akim Demaille <akim@epita.fr>
10072
10073 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
10074 and yytoken for similarity with the other skeletons.
10075
c7fb0b90
AD
100762005-09-19 Akim Demaille <akim@epita.fr>
10077
4e26c69e 10078 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 10079
1bd0deda
PE
100802005-09-16 Paul Eggert <eggert@cs.ucla.edu>
10081
10082 * NEWS: Version 2.1.
10083
10084 * NEWS: Remove notice of yytname change, since it was never in an
10085 official release.
10086 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
10087 diagnostic.
10088 * src/output.c (prepare): Likewise.
10089 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
10090 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
10091 is not defined. This is an awful hack, but it's enough for now.
10092 All callers changed.
10093 * tests/glr-regression-at (make_value): Args are const pointers now,
10094 to avoid GCC warning.
10095 (Duplicated user destructor for lookahead): New test. Currently
10096 skipped. It fails on my host but I'm not sure it'll always fail.
10097
100982005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
10099
10100 * src/symtab.h (struct symbol): Declare the printer and destructor
10101 as const, to avoid accidental calls to free.
10102 (symbol_destructor_set, symbol_printer_set): Adjust.
10103 * src/symtab.c: Adjust.
10104
1bd0deda 101052005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
10106
10107 * data/c.m4 (b4_token_enums): New.
10108 (b4_token_defines): Rename as...
10109 (b4_token_enums_defines): this.
10110 (b4_token_defines): New, output only the #defines.
10111 * data/yacc.c, data/glr.c: Adjust.
10112 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
10113 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
10114 as default values.
10115
dbcdae2d
AD
101162005-09-16 Akim Demaille <akim@epita.fr>
10117
10118 * data/lalr1.cc (yylex_): Remove, inline its code.
10119 (yyreport_syntax_error_): Remove, replaced by...
10120 (yysyntax_error_): this which returns a string and leaves to the
10121 caller the call to the users' error function.
10122 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
10123 Move from members of the parser object...
10124 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
10125 to local variables of the parse function.
10126
70d8f291
AD
101272005-09-16 Akim Demaille <akim@epita.fr>
10128
10129 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
10130 since it's in Bison's name space.
10131
b47dbebe
PE
101322005-09-15 Paul Eggert <eggert@cs.ucla.edu>
10133
ae199bf1
PE
10134 * data/glr.c (yyresolveValue): Add default case to pacify
10135 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
10136
b47dbebe
PE
10137 * NEWS: Document when yyparse started to return 2.
10138 * doc/bison.texinfo (Parser Function): Document when yyparse
10139 returns 2.
10140
10141 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
10142 (b4_filename_type): Renamed back from b4_file_name_type. All uses
10143 changed.
10144 (class position): file_name -> filename (reverting). All uses changed.
10145
101462005-09-14 Paul Eggert <eggert@cs.ucla.edu>
10147
10148 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
10149 do anything if $@ exists. This reverts part of the 2005-07-07
10150 patch.
10151
00292f66
PE
101522005-09-11 Paul Eggert <eggert@cs.ucla.edu>
10153
10154 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
10155 contains obsolete information and isn't worth distributing as a
10156 separate file anyway.
10157 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
10158 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
10159 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
10160 (yyparse): Abort if user code uses longjmp to throw an unexpected
10161 value.
10162
a420f962
PE
101632005-09-09 Paul Eggert <eggert@cs.ucla.edu>
10164
00292f66
PE
10165 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
10166 Suggested by twlevo@xs4all.nl.
10167
127287e9
PE
10168 * data/glr.c (YYCHK1): Do not assume YYE is in range.
10169 This avoids a diagnostic from gcc -Wswitch-enum.
10170 Problem reported by twlevo@xs4all.nl.
10171
a420f962
PE
10172 * doc/bison.texinfo: Don't use "filename", as per GNU coding
10173 standards. Use "file name" or "file" or "name", depending on
10174 the context.
10175 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
10176 not to hack/foo.tab.c.
10177 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
10178 * data/glr.c: b4_filename -> b4_file_name.
10179 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
10180 All uses changed.
10181 (class position): filename -> file_name. All uses changed.
10182 * data/yacc.c: b4_filename -> b4_file_name.
10183 * lib/bitset.h: filename -> file_name in local vars.
10184 * lib/bitset_stats.c: Likewise.
10185 * src/files.c: Likewise.
10186 * src/scan-skel.l ("@output ".*\n): Likewise.
10187 * src/files.c (file_name_split): Renamed from filename_split.
10188 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
10189
101902005-09-08 Paul Eggert <eggert@cs.ucla.edu>
10191
10192 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
10193 to accommodate latest gnulib.
10194
10195 * tests/glr-regression.at (Duplicate representation of merged trees):
10196 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
10197
10198 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
10199 needed.
10200
42a6501d
PE
102012005-08-26 Paul Eggert <eggert@cs.ucla.edu>
10202
10203 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
10204 All uses changed. Invoke user destructor after an error during a
10205 split parse (trivial change from Joel E. Denny).
10206
10207 * tests/glr-regression.at
10208 (User destructor after an error during a split parse): New test case.
10209 Problem reported by Joel E. Denny in:
10210 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
10211
ef9a1faf
PE
102122005-08-25 Paul Eggert <eggert@cs.ucla.edu>
10213
5b4aaf78
PE
10214 * README-cvs: Give URLs for recommended tools.
10215 Mention Gzip version problem, and bootstrapping issues.
10216 Remove troubleshooting section, as it's somewhat obsolete.
10217
b5240ba5
PE
10218 * bootstrap (no_cache): New var, to accommodate different wget
10219 variants. Use it instead of '-C off'. Problem reported by
10220 twlevo@xs4all.nl.
10221
ef9a1faf
PE
10222 * data/glr.c (yydestroyStackItem): New function.
10223 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
10224 debugging information. Problem reported by Joel E. Denny.
10225
e6efa9da
AD
102262005-08-25 Akim Demaille <akim@epita.fr>
10227
10228 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
10229
adc90f13
PE
102302005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10231
10232 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10233 Don't invoke destructor on unresolved entries.
10234 * tests/glr-regression.at
10235 (User destructor for unresolved GLR semantic value): New test case.
10236 Problem reported by Joel E. Denny in:
10237 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10238
f9315de5
PE
102392005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10240
15d29c1f
PE
10241 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10242 Add strnlen.c.
10243 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10244 lib-prefix.m4, po.m4.
10245
dd5f2af2
PE
10246 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10247 in yydestruct diagnostic, since it might not be an error.
10248 Problem reported by Joel Denny near end of
10249 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 10250 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
10251 * data/yacc.c (yyreturn): Likewise.
10252 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10253
10254 * src/files.c: Remove obsolete FIXME comment.
10255
10256 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10257 with the other templates, and to fix bogus run-on messages such
10258 as the one reported at the end of
10259 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10260 All callers changed to avoid the newline.
10261 (yyprocessOneStack): Output two lines rather than one, to accommodate
10262 the above change. This changes the debug output format slightly.
10263
f9315de5
PE
10264 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10265 reported by Joel E. Denny in
10266 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10267 (trivial change).
10268 * tests/glr-regression.at (Duplicate representation of merged trees):
10269 New test, from Joel E. Denny in:
10270 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10271 * THANKS: Add Joel E. Denny.
10272
10273 * configure.ac (AC_INIT): Bump to 2.0c.
10274
04098407
PE
102752005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10276
10277 * NEWS: Version 2.0b.
10278
ca5d2013
PE
10279 * Makefile.am (SUBDIRS): Put examples before tests, so that
10280 "make check" doesn't finish with "All 1 tests passed".
10281
3d54b576
PE
10282 * tests/regression.at (Token definitions): Don't rely on
10283 AT_PARSER_CHECK for data that contains backslashes. It currently
10284 uses 'echo', and 'echo' isn't portable if its argument contains
10285 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10286 that the byte '\0xff' is not printable in the C locale; it is,
10287 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10288 not printable, so use '\0x81' to test.
10289
d53ae497
PE
10290 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10291 version of GCC, since the macro is used with non-GCC compilers.
10292
fc01665e
PE
10293 Fix core dump reported by Pablo De Napoli in
10294 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10295 * tests/regression.at (Invalid inputs with {}): New test.
10296 * src/parse-gram.y (token_name): Translate type before using
10297 it as an index.
10298
04098407
PE
10299 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10300 the user's name space. All uses changed to __attribute__
10301 ((__unused__)).
10302 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10303 Add __attribute__ ((__noreturn__)).
10304
10305 * etc/clcommit: Remove. We weren't using it, and it failed
10306 "make maintainer-distcheck".
10307 * Makefile.maint: Merge from coreutils.
10308 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10309 (syntax-check-rules): Change list of rules as described below.
10310 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10311 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10312 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10313 (sc_trailing_space): New rules.
10314 (sc_xalloc_h_in_src): Remove.
10315 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
10316 (sc_space_tab, sc_error_exit_success, sc_changelog):
10317 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
10318 (makefile-check, po-check, author_mark_check):
10319 (makefile_path_separator_check, copyright-check):
10320 Use grep -n, to make it easier to find violations.
10321 Use CVS_LIST and CVS_LIST_EXCEPT.
10322 (header_regexp, h_re): Remove.
10323 (dd_c): New macro.
10324 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
10325 (my-distcheck): Use more-modern GCC flags.
10326 (signatures, %.asc): Remove.
10327 (rel-files, announcement): Remove signatures.
10328 Restore old updating code, even though we don't use it, so
10329 that we're the same as coreutils.
10330 (alpha, beta, major): Depend on news-date-check.
10331 Make the upload commands.
10332
10333 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
10334 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
10335 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
10336 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
10337 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
10338 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
10339 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
10340 * tests/sets.at: Likewise.
10341
10342 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
10343 we comment out the Autoconf version number.
10344 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
10345 it's error-prone and "make maintainer-distcheck" rejects it.
10346
10347 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
10348 Indent calls to "error" to pacify "make maintainer-distcheck",
10349 when the calls are not intended to be translated.
10350 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
10351
10352 * src/Makefile.am (DEFS): Use +=, to pacify
10353 "make maintainer-distcheck".
10354 (bison_SOURCES): Add scan-skel.h.
10355 (sc_tight_scope): New rule, from coreutils.
10356
10357 * src/files.c (src_extension, header_extension):
10358 Now static, not extern.
10359 * src/getargs.c (short_options): Likewise.
10360 * src/muscle_tab.c (muscle_table): Likewise.
10361 * src/parse-gram.y (current_class, current_type, current_prec):
10362 Likewise.
10363 * src/reader.c (grammar_end, previous_rule_end): Likewise.
10364 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
10365 * src/main.c (main): Cast bindtextdomain and textdomain calls to
10366 void, to avoid warning when NLS is disabled.
10367 * src/output.c: Include scan-skel.h.
10368 (scan_skel): Remove decl, since scan-skel.h does this.
10369 (output_skeleton):
10370 Indent calls to "error" to pacify "make maintainer-distcheck".
10371 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
10372 * src/reader.h (gram_end, gram_lineno): New decls to pacify
10373 "make maintainer-distcheck".
10374 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
10375 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
10376 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
10377 (skel_lex_destroy, scan_skel): Move these decls to...
10378 * src/scan-skel.h: New file.
10379 * src/uniqstr.c (uniqstr_assert):
10380 Indent calls to "error" to pacify "make maintainer-distcheck".
10381
10382 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
10383 not @VAR@.
10384
10385 * tests/torture.at: Revamp to avoid misuse of atoi that
10386 "make maintainer-distcheck" complained about.
10387
10388 * examples/extexi (message): Don't print a message more than once,
10389 and omit line-number decoration that makes Emacs compile think
10390 that informative messages are worth worrying about.
10391
103922005-07-22 Paul Eggert <eggert@cs.ucla.edu>
10393
10394 * configure.ac: Update version number.
10395
10396 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
10397 accidentally.
10398 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
10399 autogenerated by the maintainer.
10400 * examples/calc++/.cvsignore: Add *.yy.
10401
10402 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
10403 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10404 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10405
10406 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
10407
10408 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
10409 from maintainer-distcheck about casting the argument of 'free'.
10410
10411 * NEWS: Mention recent yytname changes.
10412 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
10413
10414 * bootstrap: For translations that have not yet been upgraded to
10415 the new runtime-po domain, prime the pump by extracting the
10416 relevant strings from the obsolete translations. This code can be
10417 removed once the bison-runtime domain has been translated by each
10418 team.
10419
10420 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
10421 now that token names are already quoted.
10422
10423 Fix problem reported by Anthony Heading.
10424 * data/glr.c (YYTOKEN_TABLE): New macro.
10425 (yytname): Define if YYTOKEN_TABLE.
10426 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
10427 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
10428 (YYERROR_VERBOSE): Define the same way the other skeletons do.
10429 * src/output.c (prepare_symbols): Output token_table_flag.
10430
0ffda363
PE
104312005-07-21 Paul Eggert <eggert@cs.ucla.edu>
10432
10433 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
10434 again if the first call fails.
10435
10436 * data/glr.c (yytnamerr): New function.
10437 (yyreportSyntaxError): Use it to dequote most string literals.
10438 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
10439 with other skeletons. All uses changed.
10440 (yytnameerr_): New function.
10441 (yyreport_syntax_error): Use it to dequote most string literals.
10442 * data/yacc.c (yytnamerr): New function.
10443 (yyerrlab): Use it to decode most string literals.
10444 * doc/bison.texinfo (Decl Summary, Calling Convention):
10445 Clarify quoting convention of yytname.
10446 * src/output.c (prepare_symbols): Quote all names. This undoes
10447 the 2005-04-17 change, which is now accomplished (mostly) via
10448 changes in the parsers as described above.
10449 * tests/regression.at (Token definitions, Web2c Actions):
10450 Undo most 2005-04-17 change here, too.
10451
104522005-07-20 Paul Eggert <eggert@cs.ucla.edu>
10453
10454 Fix more problems reported by twlevo@xs4all.nl.
10455 * tests/cxx-type.at: Don't pipe output of ./types through sed to
10456 remove trailing spaces. This loses the exit status of ./types,
10457 and isn't needed since ./types shouldn't be emitting trailing
10458 spaces.
10459 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
10460 as the stack isn't valid in that case.
10461
10462 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10463 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10464 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10465 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10466 is used.
10467 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10468 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10469 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10470 Likewise.
10471
10472 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10473 overly-picky compilers that reject 'char *foo = "bar";'.
10474
10475 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10476 to FILE * parameter, not to stderr. This fixes a typo introduced
10477 in the 2005-07-12 change.
10478
10479 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10480 warnings from GCC 4.
10481
10482 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10483 (yyglrShiftDefer, yysplitStack):
10484 Remove unused parameters b4_pure_formals. All uses changed.
10485 (yyglrShift): Remove unused parameters b4_user_formals.
10486 All uses changed.
10487 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10488
6100a9aa
PE
104892005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10490
258b75ca
PE
10491 Destructor cleanups and regularization among the three skeletons.
10492 * NEWS: Document the behavior changes.
10493 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10494 stack before failing, as the cleanup code will do it for us now.
10495 * data/lalr1.cc (yyerrlab): Likewise.
10496 * data/glr.c (yyparse): Pop everything off the stack before
10497 freeing it, so that destructors get called properly.
10498 * data/lalr1.cc (yyreturn): Likewise.
10499 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10500 This is more consistent.
10501 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10502 why destructors might be called. 1.875 -> 2.1.
10503 (Destructor Decl, Decl Summary, Table of Symbols):
10504 Some English-language cleanups for %destructor.
10505 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10506 Add output line for destructor of start symbol.
10507 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10508 because of that same extra output line.
10509
1a059451
PE
10510 * NEWS: Document minor wording changes in diagnostics of
10511 Bison-generated parsers.
10512 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10513 Remove unused formals. All uses changed.
10514 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10515 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10516 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10517 Rename yyoverflowab to yyexhaustedlab.
10518 When memory exhaustion occurs during syntax-error reporting,
10519 report it separately rather than in a single diagnostic; this
10520 eases translation.
10521 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10522 (Memory Exhausted): Renamed from Parser Stack Overflow.
10523 Revamp wording slightly to prefer "memory exhaustion".
10524 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10525
97460c78
PE
10526 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10527
30757c8c
PE
10528 Add i18n support to the GLR skeleton. Partially fix the C++
10529 skeleton; a C++ expert needs to finish this. Remove debugging
10530 msgids; there's little point to having them translated, since they
10531 can be understood only by someone who can read the
10532 (English-language) source code.
10533
10534 Generate runtime-po/bison-runtime.pot automatically, so that we
10535 don't have to worry about garbage getting in that file. We'll
10536 make sure after the next official release that old msgids don't
10537 get lost. See
10538 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10539
10540 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10541 Now auto-generated.
10542 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10543 Fix typos in explanations of the runtime file.
10544 * bootstrap: Change gettext keyword from YYI18N to YY_.
10545 Use standard Makefile.in.in in runtime-po, since we'll arrange
10546 for backward-compatible bison-runtime.po files in a different way.
10547 * data/glr.c (YY_): New macro, from yacc.c.
10548 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10549 Translate messages intended for users.
10550 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10551 the wording in the other skeletons. We don't know that the memory
10552 is virtual.
10553 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10554 Use same method that yacc.c uses.
10555 Don't translate debugging messages.
10556 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10557 it doesn't work (yet), and requires C++ expertise to fix.
10558 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10559 Move defn to a more logical place, to be consistent with other
10560 skeletons.
10561 Don't translate debugging messages.
10562 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10563 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10564 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10565 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10566
ac8c5689
PE
10567 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10568 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10569 void, not int.
10570 * tests/glr-regression.at (Badly Collapsed GLR States):
10571 Likewise.
10572 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10573 yylex should return 0 at EOF rather than aborting.
10574
6100a9aa
PE
10575 Improve tests for stack overflow in GLR parser.
10576 Problem reported by twlevo@xs4all.nl.
10577 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10578 All uses removed.
10579 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10580 can handle the problem.
10581 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10582 (yyparse): New local variable yyresult to record the result.
10583 Use result of setjmp to set it, rather than storing itinto
10584 struct.
10585 (yyDone): Remove label.
10586 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10587 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10588 if YYABORT is used).
10589 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10590 yyparse status; put status > 1 into diagnostic.
10591 Check that status==2 works.
10592 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10593 Use exit status 3 for failure to open (which shouldn't happen).
10594
15f40952
PE
105952005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10596
67fd79c4
PE
10597 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10598 1 on syntax error; just let yyparse do its thing.
10599 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10600 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10601 (Exploding the Stack Size with Alloca):
10602 (Exploding the Stack Size with Malloc):
10603 Expect exit status 2, not 1, since the parser is supposed to blow
10604 its stack. Problem reported by twlevo@xs4all.nl.
10605
15f40952
PE
10606 * data/glr.c (yyparse): Don't assume that the initial calls
10607 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10608 Print a stack-overflow message and fail instead.
10609 Initialize the line-number information before creating the stack,
10610 so that the stack-overflow message can report line zero safely.
10611
f32c66b5
PE
106122005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10613
a22ff96f 10614 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
10615 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10616 (yyuserMerge): Provide a default case if b4_mergers is empty.
10617 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10618 * tests/glr-regression.at
10619 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 10620 Add casts to pacify C++ compilers.
1beb0b24
PE
10621 * tests/glr-regression.at (Improper merging of GLR delayed action
10622 sets): Declare yylex before using it.
f32c66b5 10623 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
10624 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10625 test for valgrind; valgrind is independent of g++.
10626 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10627 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10628 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10629 Use a destructor, so that we can expand the stack. Change
10630 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 10631
d741bd1b
PE
106322005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10633
10634 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10635 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10636
0410a6e0
PE
106372005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10638
10639 * PACKAGING: New file, suggested by Bruno Haible and taken from
10640 similar wording in gettext's PACKAGING file.
10641 * NEWS: Mention PACKAGING.
10642 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10643
f7ab6a50
PE
106442005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10645
baf785db 10646 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
10647 * bootstrap: Get runtime translations into runtime-po.
10648 Create runtime-po files automatically, if possible.
10649 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10650 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10651 does not infringe on the user's name space.
10652 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10653 * doc/bison.texinfo (Internationalization): Revamp the English
10654 and Texinfo syntax a bit, to try to make it clearer.
10655 (Bison Options, Option Cross Key): Mention --print-localedir.
10656 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10657 YYENABLE_NLS. Quote a bit more.
10658 * runtime-po/.cvsignore: New file.
10659 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10660 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10661 * runtime-po/quot.sed: Likewise.
10662 * runtime-po/boldquot.sed: Likewise.
10663 * runtime-po/en@quot.header: Likewise.
10664 * runtime-po/en@boldquot.header: Likewise.
10665 * runtime-po/insert-header.sin: Likewise.
10666 * runtime-po/remove-potcdate.sin: Likewise.
10667 * runtime-po/Makevars: Likewise.
10668 * runtime-po/LINGUAS: Likewise.
10669 * runtime-po/de.po: Likewise; we will rely on the translation project
10670 to maintain this, so "bootstrap" should get it.
0410a6e0 10671 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
10672 its value.
10673 * src/main.c (main): Bind the bison-runtime domain, too.
10674
106752005-07-12 Bruno Haible <bruno@clisp.org>
10676
10677 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10678 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10679 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10680 * runtime-po: New directory.
10681 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10682 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10683 * runtime-po/Rules-quot: New file, copied from po/.
10684 * runtime-po/quot.sed: Likewise.
10685 * runtime-po/boldquot.sed: Likewise.
10686 * runtime-po/en@quot.header: Likewise.
10687 * runtime-po/en@boldquot.header: Likewise.
10688 * runtime-po/insert-header.sin: Likewise.
10689 * runtime-po/remove-potcdate.sin: Likewise.
10690 * runtime-po/Makevars: New file.
10691 * runtime-po/POTFILES.in: New file.
10692 * runtime-po/LINGUAS: New file.
10693 * runtime-po/bison-runtime.pot: New file.
10694 * runtime-po/de.po: New file.
10695 * m4/bison.m4: New file.
10696 * Makefile.am (SUBDIRS): Add runtime-po.
10697 (aclocaldir, aclocal_DATA): New variables.
10698 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10699 Define aclocaldir.
10700 * src/getargs.c (usage): Document --print-localedir option.
10701 (PRINT_LOCALEDIR_OPTION): New enum item.
10702 (long_options): Add --print-localedir option.
10703 (getargs): Handle --print-localedir option.
10704 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10705 (Internationalization): New section.
10706
22dda0f0
AD
107072005-07-12 Akim Demaille <akim@epita.fr>
10708
10709 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10710 for consistency with the rest of the code.
10711 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10712 Add separators.
10713
82b248ad
AD
107142005-07-12 Akim Demaille <akim@epita.fr>
10715
10716 * src/parse-gram.y: Use %printer instead of YYPRINT.
10717
fa0e9314
AD
107182005-07-12 Akim Demaille <akim@epita.fr>
10719
867a3e00
AD
10720 * src/symtab.h, src/symtab.c (symbol_print): New.
10721 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10722 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10723
107242005-07-12 Akim Demaille <akim@epita.fr>
10725
10726 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
10727 b4_at_dollar and b4_dollar_dollar.
10728
e054b190
PE
107292005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10730
10731 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10732 and Pennello's paper.
10733
34160ec4
PE
107342005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10735
407d4a75
PE
10736 * data/yacc.c (yyparse): Undo previous patch. Instead,
10737 set yylsp[0] and yyvsp[0] only if the initial action
10738 sets yylloc and yylval, respectively.
10739
34160ec4
PE
10740 * data/yacc.c (yyparse): In the initial action, set
10741 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10742 This avoids the use of undefined variables if the initial
10743 action does not set yylloc and/or yylval.
10744
c3d5a4a7
PE
107452005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10746
b34d96c1
PE
10747 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10748 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10749 Remove from CVS. These files are automatically generated.
10750 * examples/extexi: Clarify that this file is now part of Bison,
10751 not GNU M4, and that it works with any POSIX-compatible Awk.
10752 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10753 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10754 so that we also get calc++-parser.yy. Geneate it.
10755 Use $(AWK), not gawk, since any conforming Awk will do.
10756 Put comment before action, since older 'make' can't handle comment
10757 in action.
10758 $(BUILT_SOURCES): List all built sources, not just some of them.
10759 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10760 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10761 $($(calc_sources_generated)): Remove unnecessary test for existence
10762 of target. (This had a shell syntax error anyway; a stray "x".)
10763 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10764 calc++-parser.yy.
10765 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10766
c3d5a4a7
PE
10767 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10768 implied by the other modules.
10769
828c373b
AD
107702005-07-06 Akim Demaille <akim@epita.fr>
10771
10772 Bind examples/calc++ to the package.
10773 * examples/calc++/Makefile: Remove, replaced by...
10774 * examples/calc++/Makefile.am: ... this new file.
10775 * examples/calc++/test: Remove input.
10776 * examples/calc++/compile: Remove.
10777 * examples/Makefile.am: New.
10778 * configure.ac, Makefile.am: Adjust.
10779 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10780
63cb01d6
PE
107812005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10782
fd2df2ed
PE
10783 * data/glr.c (yyFail): Drastically simplify; since the format argument
10784 never had any % directives, we can simply pass it to yyerror.
10785 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10786 be modified later, as that is the usual style in glr.c.
10787 Problems reported by Paul Hilfinger.
10788
63cb01d6
PE
10789 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10790 and size overflow errors.
10791 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10792 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10793 (YYSIZEMAX): New macro.
10794 (yystpcpy): New function, taken from yacc.c.
10795 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10796 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10797 so that we don't have to maintain their signatures.
10798 (yyFail): Check for buffer overflow, by using vsnprintf rather
10799 than vsprintf. Allocate a bigger buffer if possible.
10800 Report an error if buffer allocation fails.
10801 (yyStackOverflow): New function.
10802 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10803 the initialization was successful. It might fail if storage was
10804 exhausted.
10805 (yyexpandGLRStack): Add more checks for storage allocation failure.
10806 Use yyStackOverflow to report failures.
10807 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10808 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10809 Don't assume stack number fits in int.
10810 (yysplitStack): Check for storage allocation failure.
10811 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10812 can print diagnostics on storage allocation failure. All callers
10813 changed.
10814 (yyresolveValue): Use yybool for boolean.
10815 (yyreportSyntaxError): Check for size-calculation overflow.
10816 This code is taken from yacc.c.
10817 (yyparse): Check for storage allocation errors when allocating
10818 the initial stack.
10819
1c59e0a1
AD
108202005-07-05 Akim Demaille <akim@epita.fr>
10821
10822 Extract calc++ from the documentation.
10823 * doc/bison.texinfo (Calc++): Add the extraction marks.
10824 * examples/extexi: New, from the aborted GNU Programming 2E.
10825 Separate the different paragraph of a file with empty lines.
10826 * examples/Makefile: Use it to extract the whole calc++ example.
10827
8a0adb01
AD
108282005-06-24 Akim Demaille <akim@epita.fr>
10829
10830 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10831 class typedefs.
10832
12545799
AD
108332005-06-22 Akim Demaille <akim@epita.fr>
10834
10835 * doc/bison.texinfo (C++ Language Interface): First stab.
10836 (C++ Parsers): Remove.
10837
99be0235
AD
108382005-06-22 Akim Demaille <akim@epita.fr>
10839
10840 * data/lalr1.cc (yylex_): Honor %lex-param.
10841
0ffd4fd1
AD
108422005-06-22 Akim Demaille <akim@epita.fr>
10843
10844 Start a set of simple examples.
10845 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10846 * examples/calc++/calc++-driver.hh,
10847 * examples/calc++/calc++-parser.yy,
10848 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10849 * examples/calc++/compile, examples/calc++/test: New.
10850
0925ebb4
PE
108512005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10852
10853 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10854 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10855 which stems from the 2005-05-27 patch.
10856
43d3b664
PH
108572005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10858
10859 * data/glr.c: Modify treatment of unused parameters to permit use
10860 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10861
3062864d
PE
108622005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10863
10864 Fix infringement on user name space reported by Janos Zoltan Szabo.
10865 * data/yacc.c (yyparse): strlen -> yystrlen.
10866
989b5b8e
AD
108672005-05-30 Akim Demaille <akim@epita.fr>
10868
10869 * data/lalr1.cc (_): New.
10870 Translate the various messages.
10871
bedf57f5
PE
108722005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10873
10874 Fix infringement on user name space reported by Bruno Haible.
10875 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10876 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10877 the user's name space.
10878 (alloca): Include <stdlib.h> to get it, if it's not built in.
10879 (YYMALLOC, YYFREE): Define only if needed.
10880 (malloc, free): Declare, but only if needed, as this infringes on
10881 the user name space.
10882
4d1801f1
PE
108832005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10884
10885 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10886 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10887 with %d format.
10888 * lib/ebitset.c (min, max): Undef before defining.
10889 * lib/vbitset.c (min, max): Likewise.
10890 * lib/subpipe.c (create_subpipe): Save local variables in case
10891 vfork clobbers them.
10892
108932005-05-24 Bruno Haible <bruno@clisp.org>
10894
10895 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10896 error message syntax used by gcc-4.0.
10897
b94a9e1e
PE
108982005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10899
85ac3861
PE
10900 * README: Mention m4 1.4.3. Remove obsolete advice about
10901 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10902
b94a9e1e
PE
10903 * bootstrap: Remove workaround for problem I encountered with
10904 gettext 0.14.1; it seems to be fixed now.
10905
51c30d21
PE
109062005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10907
009ce67d
PE
10908 * NEWS: Version 2.0a.
10909
f2a97c62
PE
10910 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10911 the previous change.
10912
c8775f93
PE
10913 Various maintainer cleanups.
10914 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
10915 conftest*, for benefit of CVS commands run at the same time as
10916 "configure". Add build-aux, since "bootstrap" now creates it and
10917 its subfiles.
10918 * Makefile.cfg (move_if_change): Remove.
10919 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
10920 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
10921 (po_repo, do-po-update, po-update, wget_files, get-targets):
10922 (config.guess-url_prefix, config.sub-url_prefix):
10923 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
10924 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
10925 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
10926 Remove.
10927 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
10928 this is now the recommended name.
10929 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
10930 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
10931 ylwrap. These files now go into build-aux.
10932 * config/move-if-change: Remove.
10933 * config/prev-version.txt: Bump from 1.75 to 2.0.
10934
3ea5f0ec
PE
10935 * bootstrap: Add stdio-safer, unistd-safer modules.
10936 Remove m4/glibc2.m4 (introduced by latest gnulib, but
10937 we don't need it).
10938 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
10939 fopen-safer.c, stdio-safer.h, unistd-safer.h.
10940 * lib/subpipe.c: Include "unistd-safer.h".
10941 (create_subpipe): Make sure all the newly-created
10942 file descriptors are > 2, so that diagnostics don't
10943 get sent down them (which might cause Bison to hang, in theory).
10944 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
10945 * src/files.c (xfopen): Use fopen_safer, not fopen.
10946
51c30d21
PE
10947 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
10948 yesterday's yacc.c fix.
10949
cea1469d
PE
109502005-05-21 Paul Eggert <eggert@cs.ucla.edu>
10951
3ea5f0ec
PE
10952 * data/glr.c, data/lalr1.cc: Update copyright date.
10953
cea1469d
PE
10954 Fix a destructor bug reported by Wolfgang Spraul in
10955 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
10956 * data/yacc.c (yyabortlab): Don't call destructor, and
10957 don't set yychar to EMPTY.
10958 (yyoverflowlab): Don't call destructor.
10959 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
10960 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
10961 since we no longer output the message "discarding lookahead token
10962 end of input ()".
10963
5e6f62f2
PH
109642005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10965
10966 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
10967 fix a small glitch in debugging output.
10968 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
10969 after YY_SYMBOL_PRINT where needed.
10970
10971 (struct yyGLRState): Add some comments.
10972 (struct yySemanticOption): Add some comments.
10973 (union yyGLRStackItem): Add comment.
10974
10975 (yymergeOptionSets): Correct this to properly perform the union,
10976 avoiding infinite reported by Michael Rosien.
10977 Update comment.
10978
10979 * tests/glr-regression.at: Add test for GLR merging error reported
10980 by M. Rosien.
cea1469d 10981
0fb669f9
PE
109822005-05-13 Paul Eggert <eggert@cs.ucla.edu>
10983
10984 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
10985 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
10986 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
10987 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
10988 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
10989 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
10990 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
10991 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
10992 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
10993 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
10994 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
10995 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
10996 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
10997 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
10998 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
10999 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
11000 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
11001 src/derives.h, src/files.c, src/files.h, src/getargs.c,
11002 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
11003 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
11004 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
11005 src/output.h, src/parse-gram.c, src/parse-gram.h,
11006 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
11007 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
11008 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
11009 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
11010 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
11011 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
11012 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
11013 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
11014 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
11015 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
11016 tests/reduce.at, tests/regression.at, tests/sets.at,
11017 tests/synclines.at, tests/testsuite.at, tests/torture.at:
11018 Update FSF postal mail address.
11019
51f4735e
PE
110202005-05-11 Paul Eggert <eggert@cs.ucla.edu>
11021
11022 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
11023 Problem reported by Ralf Menzel.
11024
80ce3401
PE
110252005-05-01 Paul Eggert <eggert@cs.ucla.edu>
11026
11027 * tests/actions.at: Test that stack overflow invokes destructors.
11028 From Marcus Holland-Moritz.
11029 * data/yacc.c (yyerrlab): Move the code that destroys the stack
11030 from here....
11031 (yyreturn): to here. That way, destructors are called properly
11032 even if the stack overflows, or the user calls YYACCEPT or
11033 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
11034 (yyoverflowlab): Destroy the lookahead.
11035
110362005-04-24 Paul Eggert <eggert@cs.ucla.edu>
11037
11038 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
11039
72f000b0
PE
110402005-04-17 Paul Eggert <eggert@cs.ucla.edu>
11041
11042 * NEWS: Bison-generated C parsers no longer quote literal strings
11043 associated with tokens.
11044 * src/output.c (prepare_symbols): Don't escape strings,
11045 since users don't want to see C escapes.
11046 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
11047 in diagnostics.
c19683bb 11048 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
11049 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
11050
1094323f
PE
110512005-04-16 Paul Eggert <eggert@cs.ucla.edu>
11052
11053 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
11054 the data size is known to be too small and we can't increase it.
11055 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
11056
ca407bdf
PE
110572005-04-15 Paul Eggert <eggert@cs.ucla.edu>
11058
11059 * src/parse-gram.y: Include quotearg.h.
11060 (string_as_id): Quote $1 before using it as a key, since the
11061 lexer no longer quotes it for us.
11062 (string_content): Don't strip quotes, since lexer no longer
11063 quotes it for us.
11064 * src/scan-gram.l: Include quotearg.h.
11065 ("\""): Omit quote.
11066 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
11067 a key, since the rest of the lexer doesn't quote it.
11068 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
11069 * tests/regression.at (Token definitions): Check for backslashes
11070 in token strings.
11071
11072 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
11073 (YYSIZE_T): Define to unsigned long int when using an older compiler.
11074 (yyparse): Revamp code to generate long syntax error message, to
11075 make it easier to translate, and to avoid problems with arithmetic
11076 overflow. Change "virtual memory" to "memory" in diagnostic, since
11077 we don't know whether the memory is virtual.
11078
1ce59070
PE
110792005-04-13 Paul Eggert <eggert@cs.ucla.edu>
11080
11081 * NEWS: Bison-generated C parsers now use the _ macro to
11082 translate strings.
11083 * data/yacc.c (_) [!defined _]: New macro.
11084 All English strings wrapped inside this macro.
11085 * doc/bison.texinfo (Bison Parser): Document _.
11086 * po/POTFILES.in: Include src/parse-gram.c, since it now
11087 includes translateable strings that parse-gram.y doesn't.
11088
a749a695
PE
110892005-04-12 Paul Eggert <eggert@cs.ucla.edu>
11090
11091 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
11092 reverting the 2004-10-11 change to this function.
11093 (symbol_check_alias_consistency): Don't call symbol_type_set
11094 if the type name is already correct.
11095 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
11096
8fb1053b
PE
110972005-03-25 Paul Eggert <eggert@cs.ucla.edu>
11098
11099 * tests/regression.at (Token definitions): Don't use a token named
11100 c, as that generates a "#define c ..." that runs afoul of buggy
11101 stdlib.h that uses the identifier c as a member of struct
11102 drand48_data. Problem reported by Horst Wente.
11103
ff498c4a
PE
111042005-03-21 Paul Eggert <eggert@cs.ucla.edu>
11105
11106 * bootstrap: Change translation URL from
11107 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
11108 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
11109 redirection glitches. Problem reported by twlevo@xs4all.nl.
11110
65211d70
PE
111112005-03-20 Paul Eggert <eggert@cs.ucla.edu>
11112
11113 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
11114 after operands; POSIX says this isn't portable for the c99 command.
11115
9577fb1f
PE
111162005-03-18 Paul Eggert <eggert@cs.ucla.edu>
11117
11118 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
11119 immediately if a data overrun has occurred; this may help us track
11120 down what may be a spurious failure on MacOS.
11121
78b178f7
PE
111222005-03-17 Paul Eggert <eggert@cs.ucla.edu>
11123
a2599d0f
PE
11124 Respond to problems reported by twlevo@xs4all.nl.
11125
11126 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
11127
78b178f7
PE
11128 * src/vcg.h: Comment fix.
11129 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
11130 (G_CMAX): Change to -1 instead of INT_MAX.
11131
11132 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 11133
7296e729
PE
111342005-03-15 Paul Eggert <eggert@cs.ucla.edu>
11135
11136 * src/tables.c (state_number_to_vector_number): Put it inside an
11137 "#if 0", since it's not currently used. Problem reported by
11138 Roland McGrath.
11139
05ac60f3
PE
111402005-03-06 Paul Eggert <eggert@cs.ucla.edu>
11141
11142 * src/output.c (escaped_output): Renamed from
11143 escaped_file_name_output, since we now use it for symbol tags as
11144 well. All uses changed.
11145 (symbol_destructors_output, symbol_printers_output):
11146 Escape symbol tags too.
11147 Problem reported by Matyas Forstner in
11148 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
11149
11150 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
11151 not needed.
11152 * src/output.c (user_actions_output, token_definitions_output,
11153 symbol_destructors_output, symbol_printers_output): Likewise.
11154 * src/reader.c (prologue_augment): Likewise.
11155 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
11156
11157 * src/vcg.c (output_edge): Don't quote linestyle arg.
11158 Problem reported by twlevo@xs4all.nl.
11159
7eb453ac
PE
111602005-02-28 Paul Eggert <eggert@cs.ucla.edu>
11161
11162 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
11163 example, reported by Derek M Jones. Also, make the example even
11164 more outrageous, to better illustrate how bad the problem is.
11165
4c04c52a
PE
111662005-02-24 Paul Eggert <eggert@cs.ucla.edu>
11167
11168 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
11169 putsym. Typo reported by Sebastian Piping.
11170
a61e1620
PE
111712005-02-23 Paul Eggert <eggert@cs.ucla.edu>
11172
11173 * doc/bison.texinfo (Language and Grammar): some -> same
11174 (Epilogue): int he -> in the
11175 Typos reported by Sebastian Piping via Justin Pence.
11176
9ec93868
PE
111772005-02-07 Paul Eggert <eggert@cs.ucla.edu>
11178
11179 * tests/glr-regression.at (Improper handling of embedded actions
11180 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
11181 embedded actions and $-N in GLR parsers", work around an Autoconf bug
11182 with dollar signs in test names.
11183 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
11184 for a similar reason.
11185
73ce7e7e
PE
111862005-01-28 Paul Eggert <eggert@cs.ucla.edu>
11187
11188 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
11189 wants to redefine G_VIEW.
11190
2e72b98e
PE
111912005-01-27 Paul Eggert <eggert@cs.ucla.edu>
11192
11193 * src/vcg.c (get_view_str): Remove case for normal_view.
11194 Problem reported by twlevo@xs4all.nl.
11195
e0d634e5
PE
111962005-01-24 Paul Eggert <eggert@cs.ucla.edu>
11197
ccf830a4
PE
11198 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
11199 Problem reported by twlevo@xs4all.nl.
11200
e0d634e5
PE
11201 * doc/bison.texinfo: Change @dircategory from "GNU programming
11202 tools" to "Software development". Requested by Richard Stallman
11203 via Karl Berry.
11204
7bbc8cb0
PE
112052005-01-23 Paul Eggert <eggert@cs.ucla.edu>
11206
11207 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
11208 Problem reported by twlevo@xs4all.nl.
11209
08b770bc
PE
112102005-01-21 Paul Eggert <eggert@cs.ucla.edu>
11211
11212 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
11213 keyword; it's not needed with modern compilers, and it doesn't
11214 affect correctness with older compilers. Suggested by
11215 twlevo@xs4all.nl.
11216
95f22ad2
PE
112172005-01-17 Paul Eggert <eggert@cs.ucla.edu>
11218
11219 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
11220 gcc -Wswitch-default.
11221 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11222 * data/yacc.c (yyparse): Likewise.
11223
d229d15c
PE
112242005-01-12 Paul Eggert <eggert@cs.ucla.edu>
11225
11226 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
11227 already. Let config.h define any nonstandard values.
11228
ecadd90f
PE
112292005-01-10 Paul Eggert <eggert@cs.ucla.edu>
11230
11231 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11232 for the benefit of slower hosts. Problem reported by
11233 Nelson H. F. Beebe.
11234
213744b5
PE
112352005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11236
11237 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11238 being defined and not used.
11239 * data/lalr1.cc (yyparse): Likewise.
11240 Use "if (false)" rather than "if (0)".
11241
249d3236
PE
112422005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11243
11244 * TODO: Mention that we should allow NUL bytes in tokens.
11245
987cc1fb
PE
112462005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11247
11248 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11249 Problem reported by Hans Aberg.
11250
08fe02d9
PE
112512005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11252
11253 * src/getargs.c (version): Happy new year; update overall
11254 program copyright date from 2004 to 2005.
11255
11256 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11257 Problem reported by Hans Aberg.
11258 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11259 (Output file names.): Add a test for the case when standard output
11260 is closed.
11261
010c0266
PE
112622004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11263
11264 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11265 to fix an oversight in the Bison 2.0 manual.
11266
da12206a
PE
112672004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11268
11269 * NEWS: Version 2.0. Reformat the existing news items since
11270 1.875, so that related items are grouped together.
3a4734aa 11271 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
11272 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11273
c935d934
PE
11274 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11275 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11276 otherwise, we're not testing alloca. Unfortunately there's no
11277 simple way to consult HAVE_ALLOCA here.
11278
da12206a
PE
11279 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11280 for yymsg, too.
11281
11282 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11283 hand. This avoids a warning about comparing int to size_t when
11284 GCC warnings are enabled.
11285
0a2c5137
PE
112862004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11287
d7e14fc0
PE
11288 * NEWS: Bison-generated parsers no longer default to using the
11289 alloca function (when available) to extend the parser stack, due
11290 to widespread problems in unchecked stack-overflow detection.
11291 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11292 responsibility to set it to a positive value. This lets the user
11293 specify a value that is not a preprocessor constant.
11294 * data/yacc.c (YYMAXDEPTH): Likewise.
11295 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11296 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11297 to be a compile-time constant. However, explain the constraints on it.
11298 Also, explain the constraints on YYINITDEPTH.
11299 (Table of Symbols): Explain that alloca is no longer the default.
11300 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11301 to 1.
11302
0a2c5137
PE
11303 * doc/bison.texinfo (Location Default Action): Mention that n must
11304 be zero when k is zero. Suggested by Frank Heckenbach.
11305
e019c247
AD
113062004-12-22 Akim Demaille <akim@epita.fr>
11307
11308 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11309 (parser::state_type, parser::semantic_type, parser::location_type):
11310 Private, not public.
11311 (parser::parse): Return ints, not bool.
11312 Returning a bool introduces a problem: 0 corresponds to false, and
11313 it seems weird to return false on success. Returning true changes
11314 the conventions for yyparse.
11315 Alternatively we could return void and send an exception.
11316 There is no clear consensus (yet?).
11317 (state_stack, semantic_stack, location_stack): Rename as...
11318 (state_stack_type, semantic_stack_type, location_stack_type): these.
11319 Private, not public.
11320 * tests/c++.at: New.
11321 * tests/testsuite.at, tests/Makefile.am: Adjust.
11322
72731bb7
AD
113232004-12-21 Akim Demaille <akim@epita.fr>
11324
11325 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
11326
9a0d8bec
AD
113272004-12-21 Akim Demaille <akim@epita.fr>
11328
11329 Don't impose std::string for filenames.
11330
11331 * data/lalr1.cc (b4_filename_type): New.
11332 (position::filename): Use it.
11333 (parser.hh): Move the inclusion of stack.hh and location.hh below
11334 the user code, so that needed headers for the filename type can be
11335 included first.
72731bb7
AD
11336 Forward declare them before the user code.
11337 * tests/Makefile.am (check-local, installcheck-local): Pass
11338 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 11339
99880de5
AD
113402004-12-20 Akim Demaille <akim@epita.fr>
11341
11342 Use more STL like names: my_class instead of MyClass.
11343
11344 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
11345 (SemanticStack, SemanticType, StateStack, StateType)
11346 (TokenNumberType, Stack, Slice, Traits, Parser::location)
11347 (Parser::value): Rename as...
11348 (location_stack, location_type, rhs_number_type, semantic_stack)
11349 (semantic_type, state_stack, state_type, token_number_type, stack)
11350 (slice, traits, parser::yylloc, parser::yylval): these.
11351
11352 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
11353
9bec482e
PE
113542004-12-19 Paul Eggert <eggert@cs.ucla.edu>
11355
11356 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
11357 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11358
f6fbd3da
PE
113592004-12-17 Paul Eggert <eggert@cs.ucla.edu>
11360
11361 Remove uses of 'short int' and 'unsigned short int'. This raises
11362 some arbitrary limits. It uses more memory but nowadays that's
11363 not much of an issue.
11364
11365 This change does not affect the generated parsers; that's a different
11366 task, as some users will want to conserve memory there.
11367
11368 Ideally we should use size_t to represent all object counts, and
11369 something like ptrdiff_t to represent signed differences of object
11370 counts; but that will require more code-cleanup than I have the
11371 time to do right now.
11372
11373 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
11374 Use size_t, not int or short int, to count objects.
11375 * src/closure.c (nritemset, closure): Likewise.
11376 * src/closure.h (nritemset, closure): Likewise.
11377 * src/nullable.c (nullable_compute): Likewise.
11378 * src/print.c (print_core): Likewise.
11379 * src/print_graph.c (print_core): Likewise.
11380 * src/state.c (state_compare, state_hash): Likewise.
11381 * src/state.h (struct state): Likewise.
11382 * src/tables.c (default_goto, goto_actions): Likewise.
11383
11384 * src/gram.h (rule_number, rule): Use int, not short int.
11385 * src/output.c (prepare_rules): Likewise.
11386 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
11387 errs, reductions): Likewise.
11388 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
11389 Likewise.
11390 * src/tables.c (vector_number, tally, action_number,
11391 ACTION_NUMBER_MINIMUM): Likewise.
11392 * src/output.c (muscle_insert_short_int_table): Remove.
11393
efeed023
AD
113942004-12-17 Akim Demaille <akim@epita.fr>
11395
11396 * data/lalr1.cc: Extensive Doxygenation.
11397 (error_): Rename as...
11398 (error): this, since it is visible to the user.
11399 Adjust callers.
11400 (Parser::message): Now an automatic variable from...
11401 (Parser::yyreport_syntax_error_): here.
11402 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
11403 Parser::error.
11404 * tests/input.at: Escape $.
11405
bc82c5a5
PE
114062004-12-16 Paul Eggert <eggert@cs.ucla.edu>
11407
11408 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
11409 Parenthesize rhs to avoid obscure problems with mistakes like
11410 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
11411 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11412 b4_rhs_location): Likewise.
11413 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11414 b4_rhs_location): Likewise.
11415
fd19f271
AD
114162004-12-16 Akim Demaille <akim@epita.fr>
11417
11418 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
11419 yacc.c: be sure to stay within yycheck_.
11420 * tests/actions.at: Re-enable C++ tests.
11421
10454ea4
AD
114222004-12-16 Akim Demaille <akim@epita.fr>
11423
11424 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
11425 real.
11426
c5b95ccf
AD
114272004-12-16 Akim Demaille <akim@epita.fr>
11428
11429 Use #define to handle the %name-prefix.
11430
11431 * data/glr.c, data/yacc.c: Comment changes.
11432 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
11433 so that one can refer to yylex in the parser file, and have it
11434 renamed, as is the case with other skeletons.
11435
617a8f12
AD
114362004-12-16 Akim Demaille <akim@epita.fr>
11437
11438 Move lalr1.cc internals into yy*.
11439
11440 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
11441 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
11442 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
11443 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
11444 (empty_, final_, terror_, errcode_, ntokens_)
11445 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
11446 (looka_, ilooka_, error_range_, nerrs_):
11447 Rename as...
11448 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
11449 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
11450 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
11451 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
11452 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
11453 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
11454 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
11455 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
11456 these.
11457
1e547e6e
PE
114582004-12-15 Paul Eggert <eggert@cs.ucla.edu>
11459
11460 Fix some problems reported by twlevo at xs4all.
11461 * src/symtab.c (symbol_new): Report an error if the input grammar
11462 contains too many symbols. This is better than calling abort() later.
11463 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
11464 (struct node, struct graph):
11465 Rename member expand to stretch. All uses changed.
11466 (struct graph): Remove member layoutalgorithm. All uses removed.
11467 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11468 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11469 All uses changed.
11470 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11471
735d6bd4
AD
114722004-12-15 Akim Demaille <akim@epita.fr>
11473
11474 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11475 Add more Doxygen comments.
11476 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11477 (report_syntax_error_, translate_): Rename as...
11478 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11479 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11480
2e1f5829
AD
114812004-12-15 Akim Demaille <akim@epita.fr>
11482
11483 * data/lalr1.cc (lex_): Rename as...
11484 (yylex_): this.
11485 Move the trace here.
11486 Take the %name-prefix into account.
11487 Reported by Alexandre Duret-Lutz.
11488
a3cb6248
AD
114892004-12-15 Akim Demaille <akim@epita.fr>
11490
11491 Simplify the C++ parser constructor.
11492
11493 * data/lalr1.cc (debug_): Rename as...
11494 (yydebug_): so that the parser's internals are always in the yy*
11495 pseudo namespace.
11496 Adjust uses.
11497 (b4_parse_param_decl): Remove the leading comma as it is now only
11498 called as unique argument list.
11499 (Parser::Parser): Remove the constructor accepting a location and
11500 an initial debugging level.
11501 Remove from the other ctor the argument for the debugging level.
11502 (debug_level_type, debug_level, set_debug_level): New.
11503
11504 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11505 constructor calls.
11506
07fed891
AD
115072004-12-15 Akim Demaille <akim@epita.fr>
11508
11509 Remove b4_root related material: failure experiment
a3cb6248 11510 (which goal was to allow to derive from a class).
07fed891
AD
11511
11512 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11513 definitions and uses.
11514
e603eaa5
PE
115152004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11516
11517 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11518 not 2, since it's not portable to subtract 1 from the start of an
11519 array. The new item 0 is never set or used. All uses changed.
11520
11521 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11522 the default definition of YYLLOC_DEFAULT. Problem reported
11523 by Frank Heckenbach.
11524
fafb007d
PE
115252004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11526
11527 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11528 the normal case and one for the error case. Just use the
11529 first one uniformly. Problem reported by Frank Heckenbach.
11530 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11531 use exactly the same macro in both places.
11532 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11533 so that the normal-case YYRHSLOC works for the error case too.
11534 All uses changed.
11535 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11536 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11537 * doc/bison.texinfo (Location Default Action): Don't claim that
11538 we have an array of locations. Use the same macro for both glr
11539 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11540 the index is 0.
11541
48814dcd
PE
115422004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11543
a4e1a53b
PE
11544 * HACKING: Update email addresses to send announcements to.
11545
48814dcd
PE
11546 * configure.ac (AC_INIT): Bump version to 1.875f.
11547
337116ba
PE
115482004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11549
11550 * NEWS: Version 1.875e.
11551 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11552
11553 * src/scan-skel.l: Include "complain.h", for "fatal".
11554
11555 * src/relation.h (relation_print, relation_digraph):
11556 Relation sizes are of type relation_node, not size_t (this is
11557 merely a doc fix, since the two types are equivalent).
11558 (relation_transpose): Relation sizes are of type relation_node,
11559 not int.
11560 * src/relation.c: Likewise.
11561 (top, infinity): Now of type relation_node, not int.
11562 (traverse, relation_transpose): Use relation_node, not int.
11563
11564 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11565 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11566 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11567
11568 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 11569 specifying whether the test should be skipped. Use it tp
337116ba 11570 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 11571 fail on some hosts, and should be skipped.
337116ba 11572
da2a7671
PE
115732004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11574
11575 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11576 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11577 unless otherwise specified below.
11578
11579 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11580 to allocate kernel_base, kernel_items, kernel_size, since
11581 they needn't be initialized to 0.
11582 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11583 * src/closure.c (new_closure): Likewise, for itemset.
11584 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11585 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11586 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11587 (build_relations): Likewise for edge, states1, includes.
11588 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11589 * src/reader.c (packgram): Likewise, for ritem, rules.
11590 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11591 * src/relation.c (relation_digraph): Likewise for VERTICES.
11592 (relation_transpose): Likewise for new_R, end_R.
11593 * src/symtab.c (symbols_token_translations_init): Likewise for
11594 token_translations.
11595 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11596 (token_actions): Likewise for yydefact, actrow, conflrow,
11597 conflict_list.
11598 (save_column): Likewise for froms[symno], tos[symno].
11599 (goto_actions): Likewise for state_count.
11600 (pack_table): Likewise for base, pos, check.
11601 (tables_generate): Likewise for width.
11602
11603 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11604 for initial core. Just have a separate core, so we needn't worry
11605 about whether kernel_size and kernel_base are initialized.
11606
11607 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11608 kernel_size, kernel_items): Remove unnecessary initialization.
11609 * src/conflicts.c (conflicts): Likewise.
11610 * src/derives.c (derives): Likewise.
11611 * src/muscle_tablc (muscle_insert): Likewise.
11612 * src/relation.c (relation_digraph): Likewise.
11613 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11614 conflrow, conflict_table, conflict_list, table, check):
11615 Likewise.
11616
11617 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11618 This is because all callers pass unsigned int.
11619 * src/closure.h (new_closure): Likewise.
11620
11621 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11622 (build_relations): Initialize includes[i] in all cases.
11623 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11624 and rules[ruleno].precsym. Initialize members in order.
11625 * src/relation.c (relation_transpose): Always initialize new_R[i]
11626 and end_R[i].
11627 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11628
11629 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11630 conflict_list[0] was always 0, but now it isn't initialized.
11631
11632 * src/table.c (table_grow): When conflict_table grew, the grown
11633 area wasn't cleared. Fix this.
11634
11635 * lib/.cvsignore: Add strdup.c, strdup.h.
11636 * m4/.cvsignore: Add strdup.m4.
11637
00baeeac
PE
116382004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11639
11640 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11641 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11642 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11643 ngotos + 1 without checking for overflow.
11644 (build_relations): Use END_NODE, not -1, to denote end of edges.
11645 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11646 build_relations): Use goto_number, not int, for goto numbers.
11647 * src/tables.c (save_column, default_goto): Likewise.
11648
be3d9d42
AD
116492004-11-23 Akim Demaille <akim@epita.fr>
11650
11651 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11652 of #defining from yystype.
11653 Don't typedef yystype, C++ does not need it.
11654 This lets it possible to forward declare it as union.
11655
78e526d5
PE
116562004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11657
11658 * bootstrap (gnulib_modules): Add extensions.
11659 Problem reported by Jim Meyering.
11660
afbb696d
PE
116612004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11662
11663 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11664 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11665 src/system.h, src/tables.c: XFREE -> free, to accommodate
11666 recent change to gnulib xalloc.h.
78e526d5 11667 Problem reported by Jim Meyering.
afbb696d 11668
c1f8f16a
AD
116692004-11-17 Akim Demaille <akim@epita.fr>
11670
11671 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11672
db7e5eb5 116732004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
11674 Alexandre Duret-Lutz <adl@gnu.org>
11675
11676 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11677 changes.
11678 (YYCDEBUG): Adjust.
11679 Use it instead of cdebug_.
11680 (Parser::debug_stream, Parser::set_debug_stream): New.
11681 (Parser::symprint_): Define cdebug_ for temporary backward
11682 compatibility.
11683 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11684 debug_stream ().
11685
68e11668
AD
116862004-11-17 Akim Demaille <akim@epita.fr>
11687
11688 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11689 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11690 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11691 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11692
97cbc73e
PE
116932004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11694
11695 * data/glr.c (yyloc_default): Remove; not used.
11696 Problem reported by Frank Heckenbach.
11697
e342c3be
AD
116982004-10-25 Akim Demaille <akim@epita.fr>
11699
11700 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11701 Introduce another definition to address simple location arrays.
11702 (yyGLRStack): New member: yyerror_range.
11703 (yyrecoverSyntaxError, yyparse): Update it.
11704 (yyrecoverSyntaxError): Use it when shifting the error token to
11705 have an accurate range, equivalent to the one computed by both
11706 yacc.c and lalr1.cc.
11707 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11708 that column numbers start at column 0, as per GNU Coding
11709 Standards, the others tests, and the doc.
11710 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11711 Adjust to the above change (first column is 0).
11712 And adjust the location of the "<error>", now covering the whole
11713 line.
11714
93602feb 117152004-10-22 Akim Demaille <akim@epita.fr>
04098407 11716 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
11717
11718 Remove some arbitrary limits on goto numbers and relations.
11719 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11720 initial values, since they're never used.
11721 (set_goto_map): ngotos is now unsigned, so test for overflow
11722 by seeing whether it wraps around to zero.
11723 * src/lalr.h (goto_number): Now size_t, not short int.
11724 (GOTO_NUMBER_MAXIMUM): Remove.
11725 * src/relation.c (relation_print, traverse, relation_transpose):
11726 Check for END_NODE rather than looking at sign.
11727 * src/relation.h (END_NODE): New macro.
11728 (relation_node): Now size_t, not short int.
11729
dba08b04
PE
117302004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11731
11732 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11733 keyword, not an identifier. Problem reported by Baron Schwartz in
11734 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11735
df09ef2e
AD
117362004-10-11 Akim Demaille <akim@epita.fr>
11737
11738 * src/symtab.c (symbol_check_alias_consistency): Also check
11739 type names, destructors, and printers.
11740 Reported by Alexandre Duret-Lutz.
11741 Recode the handling of associativity and precedence in terms
11742 of symbol_precedence_set.
11743 Accept no redeclaration at all, not even equal to the previous
11744 value.
11745 (redeclaration): New.
11746 Use it to factor redeclaration complaints.
11747 (symbol_make_alias): Don't set the type of the alias, let
11748 symbol_check_alias_consistency do it as for other features.
11749 * src/symtab.h (symbol): Add new member prec_location, and
11750 type_location.
11751 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11752 * tests/input.at (Incompatible Aliases): New.
11753
146bc99d
PE
117542004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11755
11756 .cvsignore fixes to accommodate gnulib changes,
11757 and the practice of naming build directories "_build".
11758 * .cvsignore: Add "_*". Sort.
11759 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11760 * m4/.cvsignore: Add "*_gl.m4".
11761
e503aa60
AD
117622004-10-06 Akim Demaille <akim@epita.fr>
11763
11764 * src/parse-gram.y (add_param): Fix the truncation of trailing
11765 spaces.
11766
b4a20338
AD
117672004-10-05 Akim Demaille <akim@epita.fr>
11768
11769 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11770 whether the reducion was empty or not. This leaves room to
11771 improve the use of YYLLOC_DEFAULT in such a case.
11772 lalr1.cc is still experimental, so changing this is acceptable.
11773 And finally, there are probably not many users who changed the
11774 handling of locations in GLR, so changing is admissible too.
11775
11776 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11777 empty reduction, set @$ to an empty location ending the previously
11778 stacked symbol.
11779 Adjust uses to make sure the code is triggered on empty
11780 reductions.
11781 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11782 expected output: empty reductions have empty locations.
11783
f85a5e6f
AD
117842004-09-29 Akim Demaille <akim@epita.fr>
11785
11786 * data/lalr1.cc: Move towards a more standard C++ coding style
11787 for templates: Class < T > -> Class<T>.
11788
b203fc2c
AD
117892004-09-29 Akim Demaille <akim@epita.fr>
11790
11791 * data/lalr1.cc: Reinstall the former ctor, for sake of
11792 compatibility, but warn it will be removed.
11793 Move towards a more standard C++ coding style (i.e., type *var ->
11794 type* var).
11795
5b7e1e73
PE
117962004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11797
3fee967f
PE
11798 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11799 since it's less likely to work if NULs are involved in the future.
5b7e1e73 11800
0dcca5c2
AD
118012004-09-27 Akim Demaille <akim@epita.fr>
11802
11803 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11804
6dde1c82
AD
118052004-09-27 Akim Demaille <akim@epita.fr>
11806
11807 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 11808 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
11809 and argument names.
11810 (b4_cc_constructor_call): Likewise.
11811
b233d555
AD
118122004-09-24 Akim Demaille <akim@epita.fr>
11813
11814 * src/parse-gram.y (add_param): Strip the leading and trailing
11815 blanks from a formal argument declaration.
11816 (YY_LOCATION_PRINT): New.
11817
619404e3
AD
118182004-09-24 Akim Demaille <akim@epita.fr>
11819
11820 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11821 after the location.
11822
dd8d9022
AD
118232004-09-24 Akim Demaille <akim@epita.fr>
11824
11825 * doc/bison.texinfo (Table of Symbols): Sort.
11826
0092f063
AD
118272004-09-21 Akim Demaille <akim@epita.fr>
11828
11829 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11830 the useless parentheses.
11831 Suggested by Paul Eggert.
11832
451364ed
AD
118332004-09-20 Akim Demaille <akim@epita.fr>
11834
11835 Let the initial-action act on the look-ahead, and use it for the
11836 "initial push" (corresponding to an hypothetical beginning-of-file).
11837 And let lalr1.cc honor %initial-action.
11838
11839 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11840 example.
11841 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11842 (Parser::Parser): Remove the ctor that used to initialize it.
11843 (Parser::parse): Like in the other skeletons, issue the "starting
11844 parse" message before any action.
11845 Honor %initial-action.
11846 Initialize the stacks with the lookahead.
11847 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11848 look-ahead.
11849 Push them in the stacks.
11850 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11851
18d192f0
AD
118522004-09-20 Akim Demaille <akim@epita.fr>
11853
11854 * doc/bison.texinfo (Initial Action Decl): New.
11855
b8458aa5
AD
118562004-09-20 Akim Demaille <akim@epita.fr>
11857
11858 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11859 clearer criterion to define it.
11860 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11861 When reducing on an empty RHS, use the latest stacked location as
11862 location.
11863 yylloc is not always available.
11864 * data/glr.c: Likewise.
11865 Also, honor initial-actions.
11866
3fc16193
AD
118672004-09-20 Akim Demaille <akim@epita.fr>
11868
11869 * data/yacc.c (YY_LOCATION_PRINT): New.
11870 Define when we know YYLTYPE's structure, i.e., when the default
11871 YYLLOC_DEFAULT is used.
11872 * data/c.m4 (b4_yysymprint_generate): Use it.
11873 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11874 value of the result.
11875 (error_start_): Replace with...
11876 (error_range_): this location array.
11877 This allows to replace code relying on the implementation of
11878 locations by portable code.
11879 * data/yacc.c (yylerrsp): Replace with...
11880 (yyerror_range): this.
11881 Every time a token is popped, update yyerror_range[0], to have an
11882 accurate location for the error token.
11883 * data/glr.c (YY_LOCATION_PRINT): New.
11884 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11885 deference a pointer.
11886 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11887 report the location in %printers.
11888
11889 * src/scan-skel.l: Instead of abort, report error messages to ease
11890 understanding skeleton scanning failures.
11891
ecfe33e7
AD
118922004-09-16 Akim Demaille <akim@epita.fr>
11893
11894 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11895 (iterator, const_iterator): these, to be more in the C++ spirit.
11896 Also, return reverse iterators so that when displaying the stack
11897 we display its bottom first.
11898 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11899 from yacc.c.
11900 We should probably use vector here though.
11901
1576d44d
AD
119022004-09-16 Akim Demaille <akim@epita.fr>
11903
11904 Have more complete shift traces.
11905
11906 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11907 to report Shifts instead of ad hoc YYDPRINTF invocations,
11908 including for the error token.
11909 * data/lalr1.cc (symprint_): Output the location.
11910 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11911 output the location within the %printer.
11912 Activate GLR tests, at least to make sure they compile properly.
11913 They still don't pass though.
11914 * tests/calc.at: Adjust expect verbose output, since now "Entering
11915 state..." is on a different line than the "Shifting" message.
11916
9c66f418
AD
119172004-09-08 Akim Demaille <akim@epita.fr>
11918
11919 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
11920 Bison directive from the Bison file to the invocation of this
11921 macro, so that these directives are passed to
11922 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
11923 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
11924 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
11925 the extra Bison directives instead of the whole series.
11926 Change the grammar so that there are recoverable errors, and
11927 unrecoverable errors. Now we can have the parser give up before
11928 consuming the whole input. As a result we now can observe that
11929 the lookahead is freed when needed.
11930 Change the parser source to parse argv[1] instead of a hard coded
11931 string.
11932 Simplify yylex, and give a value and location to EOF.
11933 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
11934 passed directives already coded in the file.
11935 Add some tests to check the location of "error".
11936 For some tests, the C++ parser is correct, and not yacc.c.
11937 For other tests, they provide different, but unsatisfying, values,
11938 so keep the C++ value so that at least one parser is "correct"
11939 according to the test suite.
11940 (Actions after errors): Remove, this is subsumed by the
11941 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
11942
52d5733f
AD
119432004-09-06 Akim Demaille <akim@epita.fr>
11944
11945 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 11946 (Parser::pop): New.
52d5733f
AD
11947 Use it.
11948
a0e68930
AD
119492004-09-06 Akim Demaille <akim@epita.fr>
11950
11951 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
11952 argument, an informative message.
11953 Call YY_SYMBOL_PRINT.
11954 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
11955 * data/lalr1.cc (destruct_): Likewise.
11956 In addition, no longer depend on b4_yysymprint_generate and
11957 b4_yydestruct_generate to generate these functions, do it "by
11958 hand".
11959
e757bb10
AD
119602004-09-03 Akim Demaille <akim@epita.fr>
11961
11962 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
11963 invoked, yydestruct the lookahead.
11964 * tests/calc.at (Calculator $1): Update the expected lengths of
11965 traces: there is an added line for the discarded lookahead.
11966 * doc/bison.texinfo (Destructor Decl): Some rewording.
11967 Define "discarded" symbols.
11968
0fe1f06d
AD
119692004-09-02 Akim Demaille <akim@epita.fr>
11970
11971 * data/lalr1.cc (translate_, destruct_): No reason to be static.
11972
284acc8b
AD
119732004-09-02 Akim Demaille <akim@epita.fr>
11974
11975 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
11976 (YYDSYMPRINTF): Rename as...
11977 (YY_SYMBOL_PRINT): this.
11978 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
11979 two.
11980 Use it instead of direct symprint_ calls.
11981 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
11982 one.
11983
a5eb1ed2
AD
119842004-09-02 Akim Demaille <akim@epita.fr>
11985
b7c72fe1
AD
11986 * data/lalr1.cc (b4_yysymprint_generate): New.
11987 (symprint_): New member function, defined when YYDEBUG.
11988 Use it consistently instead of token/nterm debugging output by
11989 hand.
a5eb1ed2
AD
11990 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
11991 %printer calls to use cdebug_ when using lalr1.cc.
11992
417141dd
AD
119932004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
11994
11995 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
11996 with #ifdef YYDEBUG.
11997
2fa09258
AD
119982004-08-26 Akim Demaille <akim@epita.fr>
11999
12000 * doc/bison.texinfo (Implementing Loops): Rename as...
12001 (Implementing Gotos/Loops): this.
12002
9378b508
PE
120032004-08-13 Paul Eggert <eggert@cs.ucla.edu>
12004
12005 Adjust to latest gnulib.
12006 * bootstrap (gnulib_modules): Add xalloc-die.
12007 Set LC_ALL=C so that file names sort consistently.
12008 Prefer the gnulib copies of gettext.m4, glibc21.m4,
12009 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
12010 uintmax_t.m4, ulonglong.m4.
12011 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
12012 po.m4 since we are now using _gl.m4 instead.
12013
87a8ad5c
PE
120142004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
12015
12016 * src/scan-action.l: Remove. Scanning of semantic actions is
12017 handled in scan-gram.l.
12018
dca81a78
PE
120192004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
12020
12021 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
12022
12023 * src/location.h (struct): The file member is a uniqstr.
12024 (equal_boundaries): Use UNIQSTR_EQ for comparison.
12025
c9cbf7c5
PE
120262004-07-22 Paul Eggert <eggert@cs.ucla.edu>
12027
12028 Fix bug with non-%union parsers that have printers or destructors,
12029 which led to a Bison core dump. Reported by Peter Fales in
12030 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 12031
c9cbf7c5
PE
12032 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
12033 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
12034 not to our own type.
12035 * src/output.c (symbol_destructors_output, symbol_printers_output):
12036 Don't assume %union.
12037 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
12038 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
12039 UNION-FLAG. All callers changed.
12040 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
12041 Use type char, not unsigned int, when declaring an array of char;
12042 this lets us remove a cast.
12043 (Printers and Destructors): Add non-%union test cases.
12044
fa7e68c3
PE
120452004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12046
12047 * doc/bison.texinfo: Minor editorial changes, mostly to the new
12048 GLR writeups. E.g., avoid frenchspacing and the future tense,
12049 change "lookahead" to "look-ahead", and change "wrt" to "with
12050 respect to".
2fa09258 12051
fa7e68c3
PE
120522004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12053
12054 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
12055 New sections, split off from the GLR Parsers section. Put the new
12056 Simple GLR Parser near the start of the GLR section, for clarity.
12057 Rewrite connective text.
12058
99a9344e
PE
120592004-06-21 Frank Heckenbach <frank@g-n-u.de>
12060
12061 * doc/bison.texinfo (Simple GLR Parsers): New section.
12062
8dd162d3
PE
120632004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12064
12065 * NEWS, TODO, doc/bison.texinfo:
12066 Use "look-ahead" instead of "lookahead", to be consistent.
12067 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
12068 while we're fixing "look-ahead".
12069 * src/conflicts.c (shift_set): Renamed from shiftset.
12070 (look_ahead_set): Renamed from lookaheadset.
12071 * src/print.c: Likewise.
12072 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
12073 name for "lookahead".
12074 (report_types, usage): Likewise.
12075 * src/getargs.h (report_look_ahead_tokens): Renamed from
12076 report_lookaheads.
12077 * src/lalr.c (compute_look_ahead_tokens): Renamed from
12078 compute_lookaheads.
12079 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
12080 (look_ahead_tokens_print): Renamed from lookaheads_print.
12081 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
12082 state_rule_lookaheads_print.
12083 * src/state.h: Likewise.
12084 (reductions.look_ahead_tokens): Renamed from lookaheads.
12085 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
12086 AT_DATA_LOOKAHEADS_GRAMMAR.
12087
57a90331
PE
120882004-06-03 Paul Eggert <eggert@cs.ucla.edu>
12089
12090 * README: Update location of patched M4 distribution.
12091
8ed3234a
PE
120922004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
12093
12094 Don't assume the C++ compiler takes the same arguments as the C compiler
12095 (trivial change).
12096 * configure.ac (O0CXXFLAGS): New var.
12097 * tests/atlocal.in (CXXFLAGS): Use it.
12098
07971983
PE
120992004-05-29 Paul Eggert <eggert@cs.ucla.edu>
12100
12101 Fix some "make check" problems with C++ reported by
12102 Albert Chin-A-Young for Tru64 C++ in this thread:
12103 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
12104
12105 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
12106 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12107 Output to a .cc file for C++, not to a .c file.
12108 * tests/calc.at (AT_CHECK_CALC): Likewise.
12109 * tests/regression.at (AT_CHECK_DANCER): Likewise.
12110 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
12111
29058652
PE
121122004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
12113
12114 * tests/calc.at, tests/actions.at: Workaround for SGI
12115 C++ compiler. (trivial change)
12116
62cb8a99
PE
121172004-05-27 Paul Eggert <eggert@cs.ucla.edu>
12118
fd418816
PE
12119 Spent a few hours checking out which prerequisite versions the
12120 current sources actually require. I went all the way back to
12121 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
12122 a seemingly endless set of combinations of versions more recent
12123 than that. The bottom line is that the current sources require
12124 fairly recent versions of the build tools, and it'll be some work
12125 to change this.
12126 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
12127 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
12128 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
12129 Add comments explaining why those particular versions are
12130 currently needed.
2fa09258 12131
62cb8a99
PE
12132 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
12133 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 12134 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
12135
12136 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
12137 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
12138
caa52c10
PE
121392004-05-26 Paul Eggert <eggert@cs.ucla.edu>
12140
12141 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
12142 0.11.5. Suggested by Bruno Haible.
12143 * bootstrap: Remove gettext version checking.
12144
12145 * doc/bison.texinfo (Decl Summary): Also mention that %union
12146 can depend on prerequisite types. Problem reported by Tim
12147 Van Holder.
12148
4bfd5e4e
PE
121492004-05-25 Paul Eggert <eggert@cs.ucla.edu>
12150
2cef3017
PE
12151 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
12152 * README-alpha: Don't tell people not to package this.
12153
b9c85d5c
PE
12154 * bootstrap: Don't assume $(...) works; use `...` instead.
12155 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
12156 gettext better.
12157
4bfd5e4e
PE
12158 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
12159 put into the -d output file, and mention what to do if YYSTYPE is
12160 defined as a macro.
12161
6a36ff94
PE
121622004-05-24 Paul Eggert <eggert@cs.ucla.edu>
12163
6712933e
PE
12164 Undo change made earlier today: it caused autopoint to not bring
12165 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
12166 autopoint's.
12167
12168 * bootstrap: Check that gettext version matches what's in
12169 configure.ac. Warn users to ignore robots.txt ERROR 404.
12170 * bootstrap: Undo today's earlier change (logged below).
12171 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 12172
6a36ff94
PE
12173 The gettext version checking is causing more trouble than it's
12174 curing; remove it. Problem reported by Paul Hilfinger.
12175
12176 * bootstrap: Issue a warning that one can expect a message
12177 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
12178 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
12179
209ea708
PE
121802004-05-23 Paul Eggert <eggert@cs.ucla.edu>
12181
12182 Ensure that the C++ compiler used for testing actually works on a
12183 simple test program; if not, skip the C++-related tests. Problem
12184 reported by Vin Shelton in:
161a71f3 12185 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
12186
12187 * m4/cxx.m4: New file.
12188 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
12189 * tests/atlocal.in (BISON_CXX_WORKS): Add.
12190 * tests/local.at (AT_COMPILE_CXX): Use it.
12191
41ca2549
PE
121922004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12193
383e69dc
PE
12194 * data/glr.c (yylloc): Output this macro even if locations are not
12195 being generated, as the GLR parser needs it even in that case.
12196 Problem reported by Troy A. Johnson
12197 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
12198
41ca2549
PE
12199 * configure.ac (AC_INIT): Update to 1.875e.
12200
e476c87d
PE
122012004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12202
12203 * NEWS: Version 1.875d.
12204 * configure.ac (AC_INIT): Likewise.
12205 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
12206
12207 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
12208 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
12209 lalr1.cc runs afoul of the first, and the last two are no longer
12210 supported by GCC 3.4.0.
12211 * README: Mention GNU m4 1.4 or later; mention m4 patches.
12212 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
12213
233a88ad
PE
122142004-05-06 Paul Eggert <eggert@cs.ucla.edu>
12215
12216 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
12217 unsigned int, for compatibility with latest gnulib hash module.
12218 * src/state.c (state_hash, state_hasher): Likewise.
12219 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
12220 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 12221
12ffdd28
PE
122222004-05-03 Paul Eggert <eggert@cs.ucla.edu>
12223
12224 * NEWS: Unescaped newlines are no longer allowed in char & strings.
12225
12226 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
12227 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
12228 character and string literals.
12229 (unexpected_end): New function.
12230 (unexpected_eof): Use it.
12231 (unexpected_newline): New function.
12232 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12233 actions.
e476c87d 12234
12ffdd28
PE
12235 * NEWS: Document %expect-rr.
12236
12237 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12238 Fix typo by replacing $1 with $option.
12239 Remove more 'intl'-related files.
9668e2be 12240 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
12241
12242 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12243 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12244 strtoul.c.
12245 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12246 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12247 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12248 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12249 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12250 * src/.cvsignore: Add *.output.
12251
12252 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12253 gets copied to the output file.
e476c87d 12254
1f65350a
PE
122552004-04-28 Paul Eggert <eggert@twinsun.com>
12256
12257 Get files from the gnulib and po repositories, instead of relying
12258 on them being in our CVS. Upgrade to latest versions of gnulib
12259 and Automake.
12260
12261 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12262 * bootstrap: Bootstrap from gnulib and po repositories.
12263 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12264 * README-cvs: Document these changes. Remove version numbers from
12265 mentions of build tools, since they change so often. Mention Flex.
12266
12267 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12268 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
12269 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12270 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 12271 does this for us.
12ffdd28
PE
12272 (AC_ISC_POSIX): Remove; we no longer support this
12273 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
12274 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12275 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12276 Do not check for C89 headers, except for locale.h which is used
12277 by the Yacc library and must port to K&R hosts.
12278 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12279 Do not check for C89 functions, except for setlocale which is
12280 used by the Yacc library.
12281 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12282 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12283 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12284 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12285 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12286 AM_GNU_GETTEXT): Remove; now done by:
12287 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12288 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12289 for us.
12290
12291 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12292 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12293 Define to empty, as gnulib.mk will do the rest for us.
12294 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12295 for us.
12296 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12297 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12298
12299 * src/files.c: Include gnulib's xstrndup.h.
12300
12301 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12302 (REALLOC): Use xnrealloc, for likewise.
12303 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12304 (strnlen, memrchr): Remove decls; functions no longer used.
12305 Include <stpcpy.h>.
12306
12307 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12308 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12309 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12310 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12311 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12312 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12313 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12314 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
12315 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
12316 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
12317 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
12318 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12319 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
12320 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
12321 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
12322 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
12323 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
12324 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
12325 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
12326 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
12327 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
12328 Remove, as these files are now generated automatically
12329 by bootstrap or automake.
12330
12331 * po/ChangeLog: Remove: all but one entry was a duplicate
12332 of this file, and I moved that 2000-11-02 entry here.
12333
12334 * config/.cvsignore: Add Makefile, depcomp, install-sh.
12335 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
12336 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
12337 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
12338 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
12339 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
12340 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
12341 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
12342 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
12343 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
12344 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
12345 xstrndup.h.
12346 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
12347 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
12348 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
12349 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
12350 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
12351 * src/.cvsignore: Remove *_.c.
12352
12353
12354 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
12355 support it. (The latest stable gzip doesn't.)
12356
123572004-04-27 Paul Eggert <eggert@twinsun.com>
12358
12359 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
12360 case, as stos_ is now used by destructors due to the 2004-02-09
12361 change.
12362
12363 Remove more K&R C support.
12364 * lib/libiberty.y (PARAMS): Remove. All uses removed.
12365 * lib/subpipe.c (errno): Remove decl.
12366 Include <stdlib.h> unconditionally.
12367 (EXIT_FAILURE): Remove macro.
12368 * src/complain.c (vfprintf, strerror): Remove.
12369 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
12370 unconditionally.
12371 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
12372 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
12373 (strchr, strspn, memchr): Remove decls.
12374 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
12375 unconditionally. Do not declare perror.
12376 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
12377 unconditionally.
12378
12379 * src/complain.c (_): Remove useless defn, as system.h defines this.
12380
12381 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
12382 with latest obstack.h.
12383 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
12384 to procedure types, as obstack.h now does that for us.
12385 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
12386
12387 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
12388 so that this include file can stand alone.
12389 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
12390 does this now. Include subpipe.h first after config.h, to
12391 test whether it can stand alone.
12392
12393 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
12394 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
12395 unused declaration.
12396
12397 * tests/synclines.at (%union synch line): Put a dummy member in
12398 the union, because empty unions aren't allowed in C. Caught
12399 by GCC 3.4.0.
12400
4f16766c
PE
124012004-04-13 Jim Meyering <jim@meyering.net>
12402
12403 * src/conflicts.c (conflicts_print): Correct format string typo:
12404 use `%%' to produce literal `%'. (trivial change)
12405
779e7ceb
PE
124062004-03-30 Paul Eggert <eggert@twinsun.com>
12407
12408 * src/getargs.c (version): Update copyright year to 2004.
12409
12410 * data/c.m4 (b4_int_type): Use 'short int' rather than
12411 'short', and similarly for 'long', 'unsigned', etc.
12412 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
12413 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
12414 yy_yypstack, yydumpstack): Likewise.
12415 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
12416 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
12417 Likewise.
12418 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
12419 yy_stack_print, yyparse): Likewise.
12420 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
12421 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
12422 * lib/bitset.c (bitset_print): Likewise.
12423 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
12424 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12425 * lib/bitsetv.c (bitsetv_dump): Likewise.
12426 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
12427 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
12428 Likewise.
12429 * src/LR0.c (allocate_itemsets): Likewise.
12430 * src/gram.h (rule_number, rule): Likewise.
12431 * src/lalr.h (goto_number): Likewise.
12432 * src/nullable.c (nullable_compute): Likewise.
12433 * src/output.c (prepare_rules): Likewise.
12434 * src/relation.c (relation_print, relation_digraph): Likewise.
12435 * src/relation.h (relation_node): Likewise.
12436 * src/state.h (state_number, transitions, errs, reductions,
12437 struct state): Likewise.
12438 * src/symtab.h (symbol_number, struct symbol): Likewise.
12439 * src/tables.c (vector_number, tally, action_number,
12440 default_goto, goto_actions): Likewise.
12441 * tests/existing.at (GNU Cim Grammar): Likewise.
12442 * tests/regression.at (Web2c Actions): Likewise.
12443
12444 * src/output.c (muscle_insert_short_int_table): Renamed from
12445 muscle_insert_short_table. All uses changed.
12446
d6328241
PH
124472004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12448
12449 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
12450 (declaration): Replace expected_conflicts with expected_sr_conflicts.
12451 Add %expect-rr rule.
4f16766c 12452
d6328241
PH
12453 * src/scan-gram.l: Recognize %expect-rr.
12454
4f16766c 12455 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 12456 expected_conflicts.
4f16766c 12457 (expected_rr_conflicts): Declare.
d6328241
PH
12458
12459 * src/conflicts.c (expected_sr_conflicts): Rename from
12460 expected_conflicts.
12461 (expected_rr_conflicts): Define.
12462 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
12463 for GLR parsers.
12464 Use expected_sr_conflicts in place of expected_conflicts.
12465 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 12466
d6328241 12467 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 12468
1452af69
PE
124692004-03-08 Paul Eggert <eggert@gnu.org>
12470
12471 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 12472 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
12473
12474 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12475 in lalr1.cc.
12476 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12477 * src/scan-gram.l (scan_integer): New function.
12478 ({int}): Use it.
12479 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12480 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12481 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12482 Say "long int", not "long", for uniformity with GNU style.
12483
006d217d
PE
124842004-02-25 Paul Eggert <eggert@twinsun.com>
12485
12486 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12487 compilers. This fixes a problem with Intel's C++ compiler being
12488 chatty, reported by Guido Trentalancia in
161a71f3 12489 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 12490
c2729758
ADL
124912004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12492
12493 Support %destructor and merge error locations in lalr1.cc.
12494
12495 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12496 (Parser::stos_): Define unconditionally.
12497 (Parser::destruct_): New method. Generate its body with
12498 b4_yydestruct_generate.
12499 (Parser::error_start_): New attribute.
12500 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12501 token which are discarded.
12502 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12503 error_start_ when erroneous token are discarded.
12504 (Parser::parse) <yyerrlab1>: Compute the location of the error
12505 token so that it covers all the discarded tokens.
12506 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12507 it can be called with `%skeleton "lalr1.cc"', and do that.
12508
dd0e0635
PE
125092004-02-02 Paul Eggert <eggert@twinsun.com>
12510
12511 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12512 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12513 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12514 There's no need to mention top_builddir since Automake does that
12515 for us.
12516 (INCLUDES): Remove, as Automake says it's obsolescent.
12517 Contents migrated into AM_CPPFLAGS as described above.
12518 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12519
125202004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12521
12522 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12523 (yyreportSyntaxError): Handle case where lookahead token is
12524 YYEMPTY.
12525
be16239b
PH
125262004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12527
12528 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12529 resulting parsers are compilable with C++.
12530
5fa90832
PE
125312003-12-23 Paul Eggert <eggert@twinsun.com>
12532
12533 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12534 * src/output.c (output_skeleton): Rename local var.
12535 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12536 Bison tokens, as this runs afoul of the 2003-10-07 change that
12537 disallowed NUL bytes in character constants or string literals.
12538
12539 * tests/local.at: Require Autoconf 2.59's Autotest.
12540 * tests/testsuite.at: Don't include local.at, since we now assume
12541 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12542 including it.
12543 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12544 multiple inclusion warnings.
dd0e0635 12545
b165c324
AD
125462003-12-02 Akim Demaille <akim@epita.fr>
12547
12548 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12549 conditions.
12550 From Bruno Haible.
12551
26e06a21
ADL
125522003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12553
12554 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12555
92ac3705
PE
125562003-10-07 Paul Eggert <eggert@twinsun.com>
12557
6a5ecb38
PE
12558 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12559 if testsuite doesn't exist.
12560
92ac3705
PE
12561 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12562 literals, unfortunately.
12563 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12564 Complain about NUL bytes in character constants or string literals.
12565
91d2c560
PE
125662003-10-05 Paul Eggert <eggert@twinsun.com>
12567
12568 * NEWS: Don't document %no-default-prec, as it's still
12569 too experimental.
12570 * doc/bison.texinfo: Document %no-default-prec only if
12571 the defaultprec flag is set. Normally it's not.
12572
0cc3da3a
PE
125732003-10-04 Paul Eggert <eggert@twinsun.com>
12574
12575 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12576 non-modifiable lvalue, instead of a modifiable one.
12577 * doc/bison.texinfo (Actions): Document that $$ can
12578 be assigned to. Do not claim that $$ and $N are
12579 array element references: user code should not rely on this.
12580
22fccf95
PE
125812003-10-01 Paul Eggert <eggert@twinsun.com>
12582
12583 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12584 (grammar_declaration): Use it.
12585 * src/scan-gram.l: New token %no-default-prec.
12586 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12587 * NEWS, doc/bison.texinfo: Document the above.
12588
fc8f2965
AD
125892003-10-01 Akim Demaille <akim@epita.fr>
12590
12591 VCG no longer supports long_straight_phase.
12592
12593 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12594 * src/print_graph.c (print_graph): Adjust.
12595
39a06c25
PE
125962003-09-30 Frank Heckenbach <frank@g-n-u.de>
12597 and Paul Eggert <eggert@twinsun.com>
12598
12599 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12600 Table of Symbols): Document %default-prec.
12601 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12602 (grammar_declaration): Set default_prec on %default-prec.
12603 * src/scan-gram.l (%default-prec): New token.
12604 * src/reader.h (default_prec): New flag.
12605 * src/reader.c: Likewise.
12606 (packgram): Handle it.
12607 * tests/conflicts.at (%default-prec without %prec,
12608 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 12609
39a06c25
PE
126102003-09-30 Paul Eggert <eggert@twinsun.com>
12611
12612 * tests/testsuite.at: Include local.at, not input.at, fixing
12613 a typo in the 2003-08-25 patch.
12614
62b6aef9
AD
126152003-08-27 Akim Demaille <akim@epita.fr>
12616
12617 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12618 GCC warnings.
12619
89e1cc61
AD
126202003-08-26 Akim Demaille <akim@epita.fr>
12621
12622 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12623 "<\#" to avoid magic from Gnus when posting parts of this script.
12624
a08460b0
AD
126252003-08-26 Akim Demaille <akim@epita.fr>
12626
12627 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12628 (Parser::parse): here.
12629 Adjust: nerrs and errstatus is now replaced by...
12630 (Parser::nerrs_, Parser::errstatus_): New.
12631
603f1cfd
AD
126322003-08-25 Akim Demaille <akim@epita.fr>
12633
12634 * config/announce-gen, Makefile.cfg: New.
12635 * Makefile.am: Adjust.
12636 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12637 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12638
cd3684cf
AD
126392003-08-25 Akim Demaille <akim@epita.fr>
12640
12641 When reducing initial empty rules, Bison parser read an initial
12642 location that is not defined. This results in garbage, and that
12643 affects Bison's own parser. Therefore we need (i) to extend Bison
12644 to support a means to initialize this location, and (ii) to use
12645 this CVS Bison to fix CVS Bison's parser.
12646
12647 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12648 with...
12649 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12650 * src/parse-gram.y: Adjust.
12651 (%initial-action): New.
12652 (%error-verbose): Since we require CVS Bison, there is no reason
12653 not to use it.
12654 * src/scan-gram.l: Adjust.
12655 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12656 * data/yacc.c (yyparse): Use b4_initial_action.
12657
4e03e201
AD
126582003-08-25 Akim Demaille <akim@epita.fr>
12659
12660 * doc/bison.texinfo: Don't promote stdout for error messages.
12661
8c182d05
AD
126622003-08-25 Akim Demaille <akim@epita.fr>
12663
12664 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12665 From Alexandre Duret-Lutz.
12666
6a60c4cf
PE
126672003-08-25 Akim Demaille <akim@epita.fr>
12668
12669 Version 1.875c.
12670
25f66e1a
AD
126712003-08-25 Akim Demaille <akim@epita.fr>
12672
12673 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12674 Use them.
12675
5348bfbe
AD
126762003-08-25 Akim Demaille <akim@epita.fr>
12677
12678 * data/lalr1.cc (Parser::reduce_print_): New.
12679 Use it.
12680
47301314
AD
126812003-08-25 Akim Demaille <akim@epita.fr>
12682
12683 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12684 error recovery loops. This patch is based on
161a71f3 12685 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
12686 Also, augment the similarity between lalr1.cc and yacc.c.
12687 Note: the locations of error recovery rules are not correct yet.
12688
12689 * data/lalr1.cc: Comment changes to augment the similarity between
12690 lalr1.cc and yacc.c.
12691 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12692 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12693 yyerrlab), when hitting EOF, pop the whole stack here instead of
12694 merely falling thru the default error handling mechanism.
12695 (yyerrorlab): New label, with the old contents of YYERROR,
12696 plus the following change: pop the stack of rhs corresponding
12697 to the production that invoked YYERROR. That is how Yacc
12698 behaves (required by POSIX).
12699 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12700 fail.
12701
1f7a61ff
AD
127022003-08-25 Akim Demaille <akim@epita.fr>
12703
12704 Tune local.at so that people can "autom4te -l autotest calc.at -o
12705 calc" for instance, to extract a sub test suite.
12706
12707 * tests/testsuite.at: Move the initialization, Autotest version
12708 requirement, and AT_TESTED invocation into...
12709 * tests/local.at: here.
12710 * tests/testsuite.at: Include it for compatibility with Autoconf
12711 2.57.
12712 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12713 be ignore.
12714
327b5b56
PE
127152003-08-04 Paul Eggert <eggert@twinsun.com>
12716
12717 Rework code slightly to avoid gcc -Wtraditional warnings.
12718 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12719 The returned value is now stored in *YY0. All callers changed.
12720 * src/output.c (merge_output): Adjust to the above change.
12721
0051e3ed
PE
127222003-07-26 Paul Eggert <eggert@twinsun.com>
12723
12724 * data/glr.c (YYASSERT): New macro.
12725 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12726 yyresolveStates, yyprocessOneStack):
12727 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12728 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 12729
137437c6
PE
127302003-07-25 Paul Eggert <eggert@twinsun.com>
12731
5b620e06
PE
12732 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12733 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 12734 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
12735 by Frank Heckenbach, though I have omitted the structure-initialization
12736 part of his glr-knr.diff patch since I recall that the Portable
12737 C Compiler didn't require that change.
12738
137437c6
PE
12739 Let the user specify how to allocate and free memory.
12740 Derived from a suggestion by Frank Heckenbach in
161a71f3 12741 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
12742 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12743 All uses of free, malloc, realloc changed to use these macros,
12744 and unnecessary casts removed.
12745 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12746
ddb85ca5
PE
127472003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12748
12749 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12750 use s.empty() rather than s == "" to test for empty string; see
161a71f3 12751 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
12752 (trivial change)
12753
39910e09
AD
127542003-06-25 Akim Demaille <akim@epita.fr>
12755
12756 * config/depcomp, config/install-sh: Update from masters.
12757
0ae99356
PE
127582003-06-20 Paul Eggert <eggert@twinsun.com>
12759
12760 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12761 and return properly parenthesized result.
12762 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12763 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12764 Remove unnecessary parentheses from uses.
12765 * doc/bison.texinfo (Location Default Action): Describe the
12766 conventions for parentheses.
12767
cd05d13c
PE
127682003-06-19 Paul Eggert <eggert@twinsun.com>
12769
81fd08ca
PE
12770 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12771 yyreportTree): Do not assume that size_t is the same width as int,
12772 when printing sizes. Print sizes using an unsigned format.
12773 Problem reported by Frank Heckenbach in
161a71f3 12774 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 12775
cd05d13c
PE
12776 Port to Forte Developer 7 C compiler.
12777 * data/glr.c (struct YYLTYPE): If locations are not being used,
12778 declare a single dummy member, as empty structs do not conform
12779 to the C standard.
12780 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12781 the Forte Developer 7 C compiler complains that end-of-loop
12782 code is not reached.
12783
4dcf140b
PE
127842003-06-17 Paul Eggert <eggert@twinsun.com>
12785
12786 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12787 avoid warnings from picky compilers about redefinition of PARAMS.
12788
8dd76bee
PE
127892003-06-17 Paul Eggert <eggert@twinsun.com>
12790
12791 Version 1.875b.
12792
12793 * NEWS: Document 1.875b.
12794
12795 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12796 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12797 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12798 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12799 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12800 per recent gettext manual's suggestion.
12801 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12802 Use prototypes, not old-style definitions.
12803 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12804 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12805 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12806 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12807 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12808 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12809 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12810 vbitset_or_and_cmp, vbitset_copy): Likewise.
12811
12812 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12813 Do not include <stdlib.h>.
12814 (PARAMS): Define unconditionally for C89.
12815 (ATTRIBUTE_NORETURN): Remove.
12816 (ATTRIBUTE_UNUSED): Define unconditionally.
12817
12818 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 12819 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
12820 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12821 * lib/vbitset.c, lib/vbitset.h: New files.
12822 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12823 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12824 from libbitset.
12825
12826 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12827 `How Can I Reset @code{yyparse}', since texinfo does not allow
12828 arbitrary @ in node names.
12829
12830 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12831 shouldn't be needed according to the gettext 0.12.1 documentation
12832 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 12833 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 12834 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 12835 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 12836
8dd76bee
PE
12837 * lib/.cvsignore: Add stdbool.h.
12838 * m4/.cvsignore: Add nls.m4, po.m4.
12839
12840 Upgrade to CVS gnulib.
12841 * stdbool_.h: File renamed from stdbool.h.in.
12842 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12843 AC_HEADER_STDBOOL.
12844 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12845 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12846 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12847 (MOSTLYCLEANFILES): New var.
12848 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12849 (stdbool.h): New rule.
12850 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12851 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12852 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12853 m4/quote.m4: Upgrade to today's gnulib.
12854
12855 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12856 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12857 the tests right now.
12858 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12859 yyerror are declared before use; C99 requires this.
12860
25005f6a
PH
128612003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12862
12863 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12864 first.
12865 (yyrecoverSyntaxError): Correct the logic for setting and testing
12866 yyerrState.
12867 Correct comment on handling EOF.
12868 Allow states with only a default reduction, rather than failing
8dd76bee 12869 (I can't quite reconstruct why these were not allowed before).
25005f6a 12870
137437c6 12871 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 12872 buffer overruns, corrupting state.
8dd76bee
PE
12873
12874 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
12875 definition.
12876 * src/reader.h (max_left_semantic_context): New variable declaration.
12877 * src/scan-gram.l (max_left_semantic_context): Define.
12878 (handle_action_dollar): Update max_left_semantic_context.
12879 * data/glr.c (YYMAXLEFT): New definition.
12880 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12881 (yyresolveAction): Ditto.
12882
12883 Fixes to problems with location handling in GLR parsers reported by
12884 Frank Heckenbach (2003/06/05).
12885
12886 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12887 (YYRHSLOC): Add parentheses, and define only if locations used.
12888 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12889 locations not used.
12890 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12891 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 12892
25005f6a
PH
12893 * tests/cxx-type.at: Exercise location information; update tests
12894 to differentiate output with and without locations.
8dd76bee 12895 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
12896 because default YYLTYPE not yet defined.
12897 Change semantic actions to compute strings, rather than printing
12898 them directly (to test proper passing of semantics values). Change
12899 output to prefix notation and update test data and expected results.
12900 (yylex): Track locations.
12901 (stmtMerge): Return value rather than printing, and include arguments
12902 in value.
8dd76bee 12903
711f40b7
PE
129042003-06-03 Paul Eggert <eggert@twinsun.com>
12905
12906 Avoid warnings generated by GCC 2.95.4 when Bison is
12907 configured with --enable-gcc-warnings.
12908 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12909 yy::]b4_parser_class_name[::translate_,
12910 yy::Stack::operator[] (unsigned),
12911 yy::Stack::operator[] (unsigned) const,
12912 yy::Slice::operator[] (unsigned),
12913 yy::Slice::operator[] (unsigned) const):
12914 Rename local vars to avoid warnings.
12915 * tests/glr-regression.at (Improper handling of embedded actions
12916 and $-N in GLR parsers): Remove unused local variable from yylex.
12917 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
12918 (void) as arg when not pure, since we now assume C89 when building
12919 Bison. Pacify GCC by using parameter.
12920
ac695f7d
PE
129212003-06-02 Paul Eggert <eggert@twinsun.com>
12922
12923 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
12924 yy::Location::lines, yy::Location::columns): Rename arguments
12925 to avoid shadowing; this removes a warning generated by GCC 3.3.
12926
26ec81e0
PE
129272003-06-01 Paul Eggert <eggert@twinsun.com>
12928
12929 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
12930 to g++, as GCC 3.3 complains if you do it.
12931 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
12932 everything that WARNING_CFLAGS has, except omit warnings
12933 not suitable for C++.
12934 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
12935 * tests/atlocal.in (CXXFLAGS): New var.
12936 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
12937
12938 Fix a GLR parser bug I reported in February; see
161a71f3 12939 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
12940 The problem was that GLR parsers did not conform to the C standard,
12941 because actions like { $1 = $2 + $3; } expanded to expressions
12942 that invoked YYFILL in separate subexpressions, and YYFILL assigned
12943 to a local variable. The C standard says that expressions
12944 like (var = f ()) + (var = f ()) have undefined behavior.
12945 Another problem was that GCC sometimes issues warnings that
12946 yyfill and its parameters are unused.
12947
12948 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
12949 as possibly unused.
12950 (yyfill): New function.
12951 (YYFILL): Use it.
12952 (yyuserAction): Change type of yynormal to bool, so that it matches
12953 the new yyfill signature. Mark it as possibly unused.
12954
12955
12956 Follow up on a bug I reported in February, where a Bison-generated
12957 parser can loop. Provide a test case and a fix for yacc.c. I
12958 don't have a fix for lalr1.cc or for glr.c, unfortunately.
12959 The original bug report is in:
161a71f3 12960 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
12961
12962 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
12963 macro's size was becoming unwieldy.
12964 (yyerrlab): Do not discard an empty lookahead symbol, as this
12965 might destroy garbage.
12966 (yyerrorlab): New label, with the old contents of YYERROR,
12967 plus the following change: pop the stack of rhs corresponding
12968 to the production that invoked YYERROR. That is how Yacc
12969 behaves, and POSIX requires this behavior.
12970 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
12971 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
12972 Define 'alarm' to do nothing if unistd.h is not available.
12973 Add a new rule "exp: '-' error;" to test the above change to
12974 data/yacc.c. Use 'alarm' to abort any test taking longer than
12975 10 seconds, as it's probably looping.
12976 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
12977 Also, the new yacc.c generates two fewer diagnostics for an
12978 existing test.
12979
d0829076
PE
129802003-05-24 Paul Eggert <eggert@twinsun.com>
12981
c6ae27df
PE
12982 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
12983 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
12984 This fixes a problem reported by John Bowman when the Compaq/HP
12985 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
12986 -ansi -Wall -gall).
12987 * data/yacc.c (union yyalloc): Likewise.
12988 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 12989
d0829076
PE
12990 Switch from 'int' to 'bool' where that makes sense.
12991
12992 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
12993 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
12994 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
12995 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
12996 Return or accept bool, not int. All callers changed.
12997 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
12998 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
12999 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
13000 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
13001 bitset_or_and_cmp_): Likewise.
13002 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
13003 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
13004 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
13005 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
13006 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
13007 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
13008 bitset_stats_or_and_cmp): Likewise.
13009 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
13010 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
13011 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
13012 ebitset_xor_cmp): Likewise.
13013 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
13014 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
13015 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
13016 lbitset_xor_cmp): Likewise.
13017 * lib/bbitset.h: Include <stdbool.h>.
13018 (struct bitset_vtable): The following members now return bool, not
13019 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
13020 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
13021 or_and_cmp).
13022 * src/conflicts.c (count_rr_conflicts): Likewise.
13023 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
13024 All uses changed.
13025 * lib/ebitset.c (ebitset_obstack_init): Likewise.
13026 * lib/lbitset.c (lbitset_obstack_init): Likewise.
13027 * src/getargs.c (debug_flag, defines_flag, locations_flag,
13028 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13029 graph_flag): Likewise.
13030 * src/getargs.h (debug_flag, defines_flag, locations_flag,
13031 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13032 graph_flag): Likewise.
13033 * src/output.c (error_verbose): Likewise.
13034 * src/output.h (error_verbose): Likewise.
13035 * src/reader.c (start_flag, typed): Likewise.
13036 * src/reader.h (typed): Likewise.
13037 * src/getargs.c (LOCATIONS_OPTION): New constant.
13038 (long_options, getargs): Use it.
13039 * src/lalr.c (build_relations): Use bool, not int.
13040 * src/nullable.c (nullable_compute): Likewise.
13041 * src/print.c (print_reductions): Likewise.
13042 * src/tables.c (action_row, pack_vector): Likewise.
13043 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
13044 * src/output.c (prepare): Use it.
13045 * src/output.c (token_definitions_output,
13046 symbol_destructors_output, symbol_destructors_output): Use string,
13047 not boolean integer, to keep track of whether to output separator.
13048 * src/print_graph.c (print_core): Likewise.
13049 * src/state.c (state_rule_lookaheads_print): Likewise.
13050
13051 * config/install-sh: Sync from automake 1.7.5.
13052
6b2584b7
PE
130532003-05-14 Paul Eggert <eggert@twinsun.com>
13054
13055 * src/parse-gram.y (rules_or_grammar_declaration): Require a
13056 semicolon after a grammar declaration, in the interest of possible
13057 future changes to the Bison input language.
13058 Do not allow a stray semicolon at the start of the grammar.
13059 (rhses.1): Allow one or more semicolons after any rule, including
13060 just before "|" as required by POSIX.
13061 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
13062 grammar.
13063
caf37a36
ADL
130642003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
13065
13066 %parse-param support for lalr1.cc.
13067
13068 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
13069 b4_cc_constructor_calls, b4_cc_constructor_call,
13070 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
13071 definitions.
13072 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
13073 parse-param arguments.
13074 (yy::b4_parser_class_name): Declare instance variables to
13075 hold parse-param arguments.
13076 * tests/calc.at: s/value/semantic_value/ because value clashes
13077 with a member of yy::b4_parser_class_name. Adjust C++ code
13078 to handle %parse-param. Enable %parse-param test in C++.
13079
3ab37077
PE
130802003-05-12 Paul Eggert <eggert@twinsun.com>
13081
13082 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
13083 English a bit. Fix fclose typo. Change "const char" to "char
13084 const", and use ANSI C rather than K&R for "main". Suggest
13085 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
13086 and suggest yy_switch_to_buffer.
13087
130882003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
13089
13090 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
13091 C89. This avoids a diagnostic on compilers that define __STDC__
13092 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 13093 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 13094
e743727f
PE
130952003-05-03 Paul Eggert <eggert@twinsun.com>
13096
13097 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
13098 Do not overrun array bounds.
13099 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 13100 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 13101
916708d5
AD
131022003-04-29 Akim Demaille <akim@epita.fr>
13103
13104 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
13105 * src/getargs.c, src/getargs.h: here, as bool, not int.
13106 (nondeterministic_parser): New.
13107 * src/parse-gram.y, src/scan-gram.l: Support
13108 %nondeterministic-parser.
13109 * src/output.c (prepare): Use nondeterministic_parser instead
13110 of glr_parser where appropriate.
13111 * src/tables.c (conflict_row, action_row, save_row)
13112 (token_actions, token_actions, pack_vector): Ditto.
13113
a06ea4aa
AD
131142003-04-29 Akim Demaille <akim@epita.fr>
13115
13116 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
13117
211074ca
AD
131182003-04-29 Akim Demaille <akim@epita.fr>
13119
13120 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
13121 with %pure-parser and %locations to exercise the patch from Yakov
13122 Markovitch below.
13123
6175ffe3
PE
131242003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
13125
13126 * data/yacc.c: (b4_lex_param): Corrected for the case where
13127 %lex-param is provided and %pure-parser isn't.
13128
b1e95857
PE
131292003-04-27 Paul Eggert <eggert@twinsun.com>
13130
13131 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 13132 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
13133 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
13134 if it is not defined.
13135 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
13136
acda9df6
PE
131372003-04-26 Paul Eggert <eggert@twinsun.com>
13138
3470c57b
PE
13139 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
13140 Declare to be of type suitable for the ninf value itself, not of
13141 type suitable for the corresponding table, since the latter might
13142 be unsigned but the ninf value might be negative. This fixes a
13143 bug reported by Alexandre Duret-Lutz in
161a71f3 13144 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 13145
acda9df6
PE
13146 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
13147 invokes it. We shouldn't invoke it twice because it will attempt
13148 to put error.o in the archive twice. This fixes a glitch reported
13149 by Martin Mokrejs in
161a71f3 13150 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 13151
b5250f26
PE
131522003-04-21 Paul Eggert <eggert@twinsun.com>
13153
13154 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
13155 to gnulib.
13156
089ac0f1
PE
131572003-04-21 Yakov Markovitch <Markovitch@iso.ru>
13158
13159 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
13160 Fix obvious typo that results in uncompilable GLR parsers
13161 when both %pure-parser and %locations are used. (trivial change)
13162
5ededac6
PE
131632003-04-17 Paul Eggert <eggert@twinsun.com>
13164
1b8f2fff
PE
13165 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
13166 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
13167 Do not insert the expected token via unput, as this runs afoul
13168 of a POSIX-compatibility bug in flex 2.5.31.
13169 All uses changed to BEGIN the parent state,
13170 since we no longer insert the expected token via unput.
13171 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
13172 that is no longer emitted after the above change.
13173
5ededac6
PE
13174 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
13175 the first one. This change is from Paul Hilfinger, and it fixes
13176 regression reported by Werner Lemberg in
161a71f3 13177 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
13178
13179 (resolve_sr_conflict): Don't invoke state_errs_set
13180 unless one or more tokens have been explicitly made errors.
13181 Otherwise, the above change causes Bison to abort.
13182
13183 * tests/existing.at (GNU pic Grammar): New test case, taken from
13184 Lemberg's email.
13185
b8be9132
AD
131862003-03-31 Akim Demaille <akim@epita.fr>
13187
13188 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
13189
d423d460
AD
131902003-03-31 Akim Demaille <akim@epita.fr>
13191
13192 * src/output.c (prepare_symbols): Avoid trailing spaces in the
13193 output.
13194
c7e441b4
AD
131952003-03-31 Akim Demaille <akim@epita.fr>
13196
13197 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
13198 From Paul Hilfinger.
13199
231897ad
AD
132002003-03-29 Akim Demaille <akim@epita.fr>
13201
13202 * m4/error.m4: Do not put under dynamic conditions some code which
13203 expansion is under static control.
13204
5b066063
AD
132052003-03-29 Akim Demaille <akim@epita.fr>
13206
13207 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
13208
22a74fec
AD
132092003-03-29 Akim Demaille <akim@epita.fr>
13210
13211 * doc/bison.texinfo (Strings are Destroyed): New.
13212
0eee27e7
PE
132132003-03-13 Paul Eggert <eggert@twinsun.com>
13214
13215 * .cvsignore: Add configure.lineno.
13216 * src/.cvsignore: Add yacc.
13217 * tests/.cvsignore: Add testsuite.log.
13218 * doc/fdl.texi: Sync with latest FSF version.
13219
f61aad93
PE
132202003-03-12 Paul Eggert <eggert@twinsun.com>
13221
537636c7
PE
13222 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
13223 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
13224 cursor, instead of leaving it undefined. This fixes a bug
13225 reported by Tim Van Holder in
161a71f3 13226 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
13227 * tests/input.at (Torturing the Scanner): Test the scanner on
13228 an empty input file, which was Tim Van Holder's test case.
13229
13230 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13231 <sys/resource.h> can be included, include sys/time.h and
13232 sys/times.h first, if available. This works around the SunOS
13233 4.1.4 porting bug reported by Bruce Becker in
161a71f3 13234 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
13235
13236 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13237 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13238 AC_HEADER_SYS_WAIT.
13239
f61aad93
PE
13240 Merge changes from gnulib. This was prompted because the CVS
13241 snapshot didn't build on Solaris 7 due to strnlen problems.
13242
13243 These changes need to be merged back into gnulib:
13244 * lib/hash.c: Include <stdbool.h> unconditionally.
13245 * m4/onceonly.m4 (m4_quote): New macro.
13246 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13247 Quote AC_FOREACH variable-expansions properly.
13248 The 2003-01-03 obstack.h change also needs merging.
13249 {end of changes requiring merging}
5b066063 13250
f61aad93
PE
13251 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13252 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13253 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13254 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13255 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13256 New files, imported from gnulib.
13257 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13258 above.
13259
13260 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13261 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13262 gnulib sources.
13263
13264 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13265 Add.
13266 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13267 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13268 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13269 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13270 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13271 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13272 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13273 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13274 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13275 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13276 (jm_PREREQ_ARGMATCH): Remove.
13277 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13278 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13279
13280 * src/system.h: Include <stdbool.h> unconditionally.
13281
13282 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13283 assuming at least C89 in the bitset code for some time now.
13284
d2ffe116
AD
132852003-03-03 Akim Demaille <akim@epita.fr>
13286
13287 * ro.po: New.
13288
052826fd
AD
132892003-03-02 Akim Demaille <akim@epita.fr>
13290
13291 * doc/bison.texinfo (Table of Symbols): Reactivate the
13292 documentation for %lex-param, and %parse-param.
13293
c4749565
AD
132942003-03-02 Akim Demaille <akim@epita.fr>
13295
13296 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13297 generate verbose error messages.
13298 Use the number of tokens as an upper bound in yytname, as it
13299 cannot be a non terminal.
13300
d5286af1
AD
133012003-03-02 Akim Demaille <akim@epita.fr>
13302
13303 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13304 message.
13305
22e304a6
AD
133062003-03-02 Akim Demaille <akim@epita.fr>
13307
22e304a6
AD
13308 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13309 Use them to exercise yycheck overrun.
13310 Based on Andrew Suffield's grammar.
13311
67a25fed
AD
133122003-03-02 Akim Demaille <akim@epita.fr>
13313
13314 Create tests/local.at for Bison generic testing macros.
13315
13316 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
13317 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
13318 This new file.
13319 * tests/calc.at (AT_CHECK_CALC): Adjust.
13320 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
13321 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
13322 * tests/local.at: here.
13323 (AT_COMPILE_CXX): Tags the tests using it as c++.
13324 Ignore the test if CXX is not functional.
13325
9c2b381f
PE
133262003-03-01 Paul Eggert <eggert@twinsun.com>
13327
13328 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
13329 not loc->end, since loc->end might contain garbage and this leads
13330 to undefined behavior on some platforms.
13331 (id_loc, token_start): Use (IF_LINTed) initial values that do not
13332 depend on *loc, so that the reader doesn't give the the false
13333 impression that *loc is initialized.
13334 (<INITIAL>"%%"): Do not bother setting code_start, since its value
13335 does not survive the return.
13336
0433ba88
AD
133372003-03-01 Akim Demaille <akim@epita.fr>
13338
13339 * src/scan-gram.l (code_start): Always initialize it when entering
13340 into yylex, as SC_EPILOGUE is activated *before* the corresponding
13341 yylex invocation. An alternative would be making it static, but
13342 then it starts with the second %%'s beginning, instead of its end.
13343
b305ea69
PE
133442003-02-28 Paul Eggert <eggert@twinsun.com>
13345
13346 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
13347 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 13348 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 13349
c3d25e01
PE
133502003-02-26 Paul Eggert <eggert@twinsun.com>
13351
13352 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
13353 Remove Sequent/Pyramid discussion (nobody uses them any more).
13354 Merge VMS and MS-DOS discussion; these ports may well be dead
13355 but let's keep mentioning them for now. Put <> around email
13356 addresses. Add copyright notice.
13357
c267ffbc
PE
133582003-02-24 Paul Eggert <eggert@twinsun.com>
13359
13360 * data/glr.c (yy_reduce_print): yylineno -> yylno,
13361 to avoid collision with flex use of yylineno.
13362 Problem reported by Bruce Lilly in
161a71f3 13363 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
13364 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13365 * data/yacc.c (yy_reduce_print): Likewise.
13366
13367 * config/depcomp: Sync with Automake 1.7.3.
13368
f939fc12
AD
133692003-02-21 Akim Demaille <akim@epita.fr>
13370
13371 * data/lalr1.cc: Use temporary variables instead of casts to
13372 change integer types.
13373 Suggested by Paul Eggert.
13374
95923bd6
AD
133752003-02-21 Akim Demaille <akim@epita.fr>
13376
13377 * doc/bison.texinfo: Use "location" consistently to refer to @n,
13378 to avoid confusions with lalr1.cc's notion of Position.
13379 Suggested by Paul Eggert.
13380
2cdc240e
AD
133812003-02-20 Akim Demaille <akim@epita.fr>
13382
13383 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
13384 before initial_columns.
13385 (location.hh): Use consistent variable names when defining the
13386 operator<<.
13387 Use "last" so that we subtract from Positions, not from unsigned.
13388
5d003116
AD
133892003-02-20 Akim Demaille <akim@epita.fr>
13390
13391 * data/lalr1.cc (position.hh): New subfile, including the extended
13392 and Doxygen'ed documentation of class Position.
13393 (location.hh): Use it.
13394 Document a` la Doxygen.
ba1ecc07 13395 With the help of Benoit Perrot.
5d003116 13396
d02b25f9
AD
133972003-02-20 Akim Demaille <akim@epita.fr>
13398
13399 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
13400 AT_YACC_IF.
13401 Redefine AT_YYERROR_SEES_LOC_IF using it.
13402 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
13403 not defined.
13404 Don't use the location in yy::Parser::error_ and
13405 yy::Parser::print_ when not %locations.
13406 Activate more lalr1.cc tests.
13407
0d1c3a04
AD
134082003-02-19 Akim Demaille <akim@epita.fr>
13409
13410 * data/lalr1.cc: When displaying a line number, be sure to make it
13411 an int.
13412
60a777aa
AD
134132003-02-19 Akim Demaille <akim@epita.fr>
13414
13415 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
13416 Remove, useless.
13417 (YYABORT, YYACCEPT, YYERROR): New.
13418 * tests/calc.at: Renable the lalr1.cc test.
13419
0b86fc41
AD
134202003-02-19 Akim Demaille <akim@epita.fr>
13421
13422 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
13423 error recovery, mixing with/without pops and discarding of the
13424 lookahead.
13425 Exercise YYERROR.
13426 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
13427
da99a5dc
PE
134282003-02-17 Paul Eggert <eggert@twinsun.com>
13429
13430 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
13431 * tests/testsuite.at (AT_COMPILE): Use them.
13432 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 13433 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 13434
93b8c255
PE
134352003-02-12 Paul Eggert <eggert@twinsun.com>
13436
13437 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
13438 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 13439 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
13440 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
13441 Check for malloc failure, for consistency with yacc.c.
13442 (yytname_size): Remove, for consistency with yacc.c.
13443
13444 The bug still remains in data/lalr1.cc, as I didn't have time
13445 to fix it there.
13446
7548fed2
AD
134472003-02-06 Akim Demaille <akim@epita.fr>
13448
13449 * configure.ac (GXX): Rename as...
13450 (CXX): this, to keep the original Autoconf semantics.
13451 Require 2.57.
13452 * data/lalr1.cc: Fix b4_copyright invocations.
13453 If YYDEBUG is not defined, don't depend upon name_ being defined.
13454 (location.hh): Include string and iostream.
13455 (Position::filename): New member.
13456 (Position::Position ()): New.
13457 (operator<< (Position)): New.
13458 (operator- (Position, int)): New.
13459 (Location::first, Location::last): Rename as...
13460 (Location::begin, Location::end): these, to mock the conventional
13461 iterator names.
13462 (operator<< (Location)): New.
13463 * tests/atlocal.in (CXX): New.
13464 * tests/testsuite.at (AT_COMPILE_CXX): New.
13465 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13466 locations in a more synthetic way.
13467 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13468 lalr1.cc is used.
13469 Adjust the C locations to match those from Emacs: first column is
13470 column 0.
13471 Change all the expected results.
13472 Conform to the GCS: simplify the locations when applicable.
13473 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13474 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13475 these CPP macros with the m4 macros new defined by...
13476 (AT_CHECK_PUSHDEFS): this, i.e.:
13477 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 13478 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
13479 New macros.
13480 (AT_CHECK_POPDEFS): Undefine them.
13481 (AT_CHECK_CALC_LALR1_CC): New.
13482 Use it for the first lalr1.cc test.
13483
43a176ef
AD
134842003-02-04 Akim Demaille <akim@epita.fr>
13485
13486 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13487 Location as is defined.
13488
fc049e9c
AD
134892003-02-04 Akim Demaille <akim@epita.fr>
13490
13491 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13492 name_ being defined.
13493
a737b216
PE
134942003-02-03 Paul Eggert <eggert@twinsun.com>
13495
13496 * src/gram.h (start_symbol): Remove unused decl.
13497
13498 Use more-consistent naming conventions for local vars.
13499
13500 * src/derives.c (derives_compute): Change type of local var from
13501 int to rule_number.
13502 * src/gram.c (grammar_rules_partial_print): Likewise.
13503 * src/print.c (print_core): Likewise.
13504 * src/reduce.c (reduce_grammar_tables): Likewise.
13505
13506 * src/gram.c (grammar_dump): Change name of item_number *
13507 local var from r to rp.
13508 * src/nullable.c (nullable_compute): Likewise.
13509
13510 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13511
13512 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13513 for symbol or symbol_number var.
13514 * src/reader.c (grammar_start_symbol_set): Likewise.
13515 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13516 Likewise.
13517 * src/state.c (transitions_to): Likewise.
13518 * src/state.h: Likewise.
13519 * src/tables.c (symbol_number_to_vector_number): Likewise.
13520
13521 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13522 char * var.
13523
13524 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13525 var.
13526
13527 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13528 var.
13529
13530 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13531 Use str, not s, for char * var. Use ch, not c, for character var.
13532 Use size for size var.
13533
13534 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13535 char * var.
13536 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13537 uniqstr var.
13538 * src/uniqstr.h: Likewise.
13539
13540 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13541 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13542 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13543 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13544 param to have same name as that of enum, so that we don't use
13545 "s" to stand for a non-state.
13546
68e93ad5
AD
135472003-02-02 Akim Demaille <akim@epita.fr>
13548
13549 * src/scan-skel.l: Scan more than one inert character per yylex
13550 invocation.
13551
92898986
PE
135522003-02-01 Paul Eggert <eggert@twinsun.com>
13553
13554 Version 1.875a.
13555
1d9d5d71
PE
13556 * po/LINGUAS: Add ms.
13557
0435d061
AD
135582003-01-30 Akim Demaille <akim@epita.fr>
13559
13560 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13561
6029a57f
PH
135622003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13563
13564 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13565 of $1.
0435d061
AD
13566
13567 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 13568 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 13569 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 13570
6029a57f
PH
13571 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13572 (b4_rhs_location): Ditto.
0435d061 13573 (yyfill): New function to copy from stack tree into array
6029a57f 13574 incrementally.
0435d061
AD
13575 (yyuserAction): Modify to allow incremental move of semantic values
13576 to rhs array when in GLR mode.
13577 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
13578 as needed.
13579 Remove dummy use of yystack, as there is now a guaranteed use.
13580 (yydoAction): Modify to allow incremental move of semantic values
13581 to rhs array when in GLR mode.
13582 (yyresolveAction): Ditto.
13583 (yyglrShiftDefer): Update comment.
0435d061 13584 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
13585 (yyglrReduce): Ditto.
13586 (yydoAction): Ditto
0435d061 13587
6029a57f
PH
13588 * tests/glr-regr1.at: Rename to ...
13589 * tests/glr-regression.at: Add new regression test for the problems
13590 described above (adapted from S. Eken).
13591 Update copyright notice.
13592 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13593 * tests/Makefile.am: Ditto.
13594
6cee6297
PE
135952003-01-28 Paul Eggert <eggert@twinsun.com>
13596
13597 * data/lalr1.cc: Do not use @output_header_name@ unless
13598 b4_defines_flag is set. This fixes two bugs reported by
13599 Tim Van Holder in
161a71f3
PE
13600 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13601 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 13602
b2a836b5
PE
136032003-01-21 Paul Eggert <eggert@twinsun.com>
13604
13605 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13606 we don't need to worry about yyerrlab1 being reported as an
13607 "unused label" by non-GCC C compilers. The downside is that if
13608 locations are used then a couple of statements are duplicated each
13609 time YYERROR is invoked, but the upside is that the warnings
13610 should vanish.
13611 (yyerrlab1): Move code to YERROR.
13612 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13613 This reverts some of the 2002-12-27 change.
13614
4196b931
PE
136152003-01-17 Paul Eggert <eggert@twinsun.com>
13616
13617 * src/output.c (symbol_printers_output): Fix typo that led
13618 to core dump. Problem reported by Antonio Rus in
161a71f3 13619 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 13620
3ae831b4
AD
136212003-01-13 Akim Demaille <akim@epita.fr>,
13622 Quoc Peyrot <chojin@lrde.epita.fr>,
13623 Robert Anisko <anisko_r@lrde.epita.fr>
13624
13625 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13626 when the stacks contain one element, as the loop would otherwise
13627 free the last state, and then use the top state (the one we just
13628 popped). This means that the initial elements will not be freed
13629 explicitly, as is the case in yacc.c; it is not a problem, as
13630 these elements have fake values.
13631
e3aa65c5
PE
136322003-01-11 Paul Eggert <eggert@twinsun.com>
13633
13634 * NEWS: %expect-violations are now just warnings, reverting
13635 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13636 bootstrapping problem reported by Matthias Klose; see
161a71f3 13637 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
13638 * src/conflicts.c (conflicts_print): Likewise.
13639 * tests/conflicts.at (%expect not enough, %expect too much,
13640 %expect with reduce conflicts): Likewise.
13641 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13642 that the warning is enabled if the number of conflicts changes
13643 (not necessarily increases).
13644
13645 * src/getargs.c (version): Update copyright year.
13646
f0057011
AD
136472003-01-09 Akim Demaille <akim@epita.fr>
13648
13649 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13650
1ee6d2a0
PE
136512003-01-08 Paul Eggert <eggert@twinsun.com>
13652
13653 * Makefile.maint (WGETFLAGS):
13654 New macro, containing "-C off" to disable proxy caches.
13655 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13656 (rel-check): Use $(WGET) instead of wget.
13657
d4fd77c4
PE
136582003-01-06 Paul Eggert <eggert@twinsun.com>
13659
13660 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13661 the GLR paper of Scott, Johnstone and Hussain.
13662
464c6927
PE
136632003-01-04 Paul Eggert <eggert@twinsun.com>
13664
d600ee67
PE
13665 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13666 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13667 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13668 (EXTRA_LIBRARIES): New var, for liby.a.
13669 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13670 (EXTRA_SCRIPTS): New var, for yacc.
13671
464c6927
PE
13672 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13673 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13674 Problem reported by Nelson H. F. Beebe.
13675
136762003-01-03 Paul Eggert <eggert@twinsun.com>
13677
13678 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13679 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13680 when compiling Bison 1.875's `bitset bset = obstack_alloc
13681 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13682
13683 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13684 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13685 grow to a huge size with typical invocation.
d600ee67 13686
464c6927
PE
13687 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13688 Use the pattern recommended by Autoconf 2.57, except also protect
13689 against double-definition.
13690 * src/system.h: Likewise.
13691 Portability issues reported by Nelson H. F. Beebe.
d600ee67 13692
464c6927
PE
13693 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13694 All uses changed. Provide a definition in both C and C++.
13695 (yytrue, yyfalse): Define even if defined (__cplusplus).
13696
13697 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13698 Reported by Nelson H. F. Beebe.
d600ee67 13699
464c6927
PE
13700 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13701
0f42c7d5
PE
137022003-01-02 Paul Eggert <eggert@twinsun.com>
13703
13704 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13705 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13706 Bug reported by Nelson H. F. Beebe.
13707
dc546b0f
PE
137082003-01-01 Paul Eggert <eggert@twinsun.com>
13709
13710 * Version 1.875.
13711
2c09b6a7
PE
137122002-12-30 Paul Eggert <eggert@twinsun.com>
13713
13714 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13715 Moved here from...
13716 (<INITIAL>","): Here. This causes stray "," to be treated
13717 more uniformly.
13718
dc546b0f 13719 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
13720 last brace in braced code when not in Yacc mode, for compatibility
13721 with Bison 1.35. This resurrects the 2001-12-15 patch to
13722 src/reader.c.
13723
13724 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13725 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13726
535c0f63
PE
137272002-12-28 Paul Eggert <eggert@twinsun.com>
13728
13729 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13730 that of SYM's type. This fixes Debian bug 168069, reported by
13731 Thomas Olsson.
d600ee67 13732
963fcc17
PE
137332002-12-28 Paul Eggert <eggert@twinsun.com>
13734
13735 Version 1.75f.
13736
13737 Switch back to the Yacc style of conflict reports, undoing some
13738 of the 2002-07-30 change.
13739 * doc/bison.texinfo (Understanding): Use Yacc style for
13740 conflict reports. Also, use new way of locating rules.
13741 * src/conflicts.c (conflict_report):
13742 Renamed from conflict_report_yacc, removing the old
13743 'conflict_report'. Translate the entire conflict report at once,
13744 so that we don't assume that "," has the same interpretation in
13745 all languages.
13746 (conflicts_output): Use Yacc-style conflict report for each state,
13747 instead of our more-complicated style.
13748 (conflicts_print): Use Yacc-style conflict report, except print
13749 the input file name when not emulating Yacc.
13750 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13751 Conflicted Reduction, %expect not enough, %expect too much,
13752 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13753 * tests/existing.at (GNU Cim Grammar): Likewise.
13754 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13755
13756 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13757 fatal): Don't invoke fflush; it's not needed and it might even be
13758 harmful for stdout, as stdout might not be open.
13759 * src/reduce.c (reduce_print): Likewise.
13760
b1efe548
PE
137612002-12-27 Paul Eggert <eggert@twinsun.com>
13762
13763 Fix a bug where error locations were not being recorded correctly.
13764 This problem was originally reported by Paul Hilfinger in
161a71f3 13765 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
13766
13767 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13768 top of the location stack's error locations.
13769 (yyerrlab): Set it. When discarding a token, push its location
13770 onto yylerrsp so that we don't lose track of the error's end.
13771 (yyerrlab1): Now is only the target of YYERROR, so that we can
13772 properly record the location of the action that failed. For GCC
13773 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13774 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13775 (yyerrlab2): New label, which yyerrlab now falls through to.
13776 Compute the error's location by applying YYLLOC_DEFAULT to
13777 the locations of all the symbols that went into the error.
13778 * doc/bison.texinfo (Location Default Action): Mention that
13779 YYLLOC_DEFAULT is also invoked for syntax errors.
13780 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13781 Error locations include the locations of all the tokens that were
13782 discarded, not just the last token.
d600ee67 13783
983c5c2c
PE
137842002-12-26 Paul Eggert <eggert@twinsun.com>
13785
b1efe548
PE
13786 * src/files.c: Include quote.h.
13787 (compute_output_file_names): Warn if we detect conflicting
13788 outputs to the same file. This should catch the misunderstanding
13789 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13790
13791 * src/conflicts.c (conflicts_print): If the user specifies
13792 "%expect N", report an error if there are any reduce/reduce
13793 conflicts. This is what the manual says should happen.
13794 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13795 * tests/conflicts.at (%expect with reduce conflicts): New test.
13796
983c5c2c
PE
13797 Don't use m4_include on relative file names, as it doesn't work as
13798 desired if there happens to be a file with that name under ".".
d600ee67 13799
983c5c2c
PE
13800 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13801 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13802 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13803 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13804 * src/output.c (output_skeleton): Use full path names when
13805 specifying a file to include; don't rely on include path, as
13806 it's unreliable when the working file contains a file with
13807 that name.
d600ee67 13808
983c5c2c
PE
138092002-12-25 Paul Eggert <eggert@twinsun.com>
13810
13811 Remove obsolete references to bison.simple and bison.hairy.
13812 Problem mentioned by Aubin Mahe in
161a71f3 13813 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
13814 * data/glr.c: Comment fix.
13815 * doc/bison.1: Remove references. Also, mention "yacc".
13816
13817 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13818 with -g option.
13819
13820 * src/parse-gram.y (declaration): Use enum "report_states" rather
13821 than its numeric value 1.
13822
13823 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13824 opening a new one. This fixes Debian bug 165349, reported by
13825 Bruce Stephens.
13826
23f2d9dc
PE
138272002-12-24 Paul Eggert <eggert@twinsun.com>
13828
13829 Version 1.75e.
13830
13831 * Makefile.maint (cvs-update): Don't assume that the shell
13832 supports $(...), as Solaris sh doesn't.
13833
13834 * src/parse-gram.y (lloc_default): Remove test for empty
13835 nonterminals at the end, since it didn't change the result.
13836
138372002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
13838
13839 If the user does not define YYSTYPE as a macro, Bison now declares it
13840 using typedef instead of defining it as a macro. POSIX requires this.
13841 For consistency, YYLTYPE is also declared instead of defined.
13842
13843 %union directives can now have a tag before the `{', e.g., the
13844 directive `%union foo {...}' now generates the C code
13845 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13846 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13847 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13848 instead of `yyltype'.
13849
13850 `yystype' and `yyltype' are now obsolescent macros instead of being
13851 typedefs or tags; they are no longer documented and will be
13852 withdrawn in a future release.
13853
13854 * data/glr.c (b4_location_type): Remove.
13855 (YYSTYPE): Renamed from yystype.
13856 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13857 (struct YYLTYPE): Renamed from struct yyltype.
13858 (YYLTYPE): Renamed from yyltype.
13859 (yyltype, yystype): New (and obsolescent) macros,
13860 for backward compatibility.
13861 * data/yacc.c: Likewise.
13862
13863 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13864 does not specify a union tag. This is for compatibility with
13865 Solaris 9 yacc.
13866
13867 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13868 const *, since it is now modified by stripping surrounding { }.
13869 (current_braced_code): Remove.
13870 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13871 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13872 trailing " {...}". Now of type <chars>.
13873 (grammar_declaration): Adjust to bundled tokens.
13874 (code_content): Remove; stripping is now done by add_param.
13875 (print_token_value): Print contents of bundled tokens.
13876 (token_name): New function.
13877
13878 * src/reader.h (braced_code, current_braced_code): Remove.
13879 (token_name): New decl.
13880
13881 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13882 token_type, not braced_code code_kind. All uses changed.
13883 (SC_PRE_CODE): New state, for scanning after a keyword that
13884 has (or usually has) an immediately-following braced code.
13885 (token_type): New local var, to keep track of which token type
13886 to return when scanning braced code.
13887 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 13888 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
13889 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13890 instead of returning a token type immediately.
13891 (<INITIAL>"{"): Set token type.
13892 (<SC_BRACED_CODE>"}"): Use it.
13893 (handle_action_dollar, handle_action_at): Now returns bool
13894 indicating success. Fail if ! current_rule; this prevents a core dump.
13895 (handle_symbol_code_dollar, handle_symbol_code_at):
13896 Remove; merge body into caller.
13897 (handle_dollar, handle_at): Complain in invalid contexts.
13898
13899 * NEWS, doc/bison.texinfo: Document the above.
13900 * NEWS: Fix years and program names in copyright notice.
13901
879ca4f8
PE
139022002-12-17 Paul Eggert <eggert@twinsun.com>
13903
13904 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13905 Reporting, Table of Symbols): Omit mentions of %lex-param and
13906 %parse-param from the documentation for now.
13907
1c5fe69d
PE
139082002-12-15 Paul Eggert <eggert@twinsun.com>
13909
13910 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13911 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13912 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
13913 disagreed with the Bison documentation. Bug
13914 reported by Andrew Walrond.
d600ee67 13915
1c5fe69d
PE
13916 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
13917 as the caller now does that.
13918 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
13919 (YYEMPTY): Parenthesize right hand side, since others use it.
13920 (yyparse): Don't assume that our generated code is the only code
13921 that sets yychar.
13922
d1de5372
PE
139232002-12-13 Paul Eggert <eggert@twinsun.com>
13924
13925 Version 1.75d.
13926
13927 POSIX requires a "yacc" command.
13928 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
13929 (MOSTLYCLEANFILES): Add yacc.
13930 (yacc): New rule.
1c5fe69d 13931 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
13932 as an alias for bison y.
13933
13934 * po/LINGUAS: Add da.
d600ee67 13935
d1de5372
PE
13936 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
13937 problem with latest <getopt.h>.
13938 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
13939
13940 * doc/fdl.texi: Upgrade to 1.2.
13941 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
13942 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
13943 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
13944 gnulib.
13945 * config/install-sh: Sync with autotools.
13946
13947 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 13948 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
13949 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
13950 locations are requested.
13951 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
13952 locations are requested.
13953
d0f3fe23
PE
139542002-12-12 Paul Eggert <eggert@twinsun.com>
13955
13956 Remove unportable casts and storage allocation tricks.
13957 While we're at it, remove almost all casts, since they
13958 usually aren't needed and are a sign of trouble.
13959
13960 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
13961
13962 * src/derives.c (derives_compute): Do not subtract NTOKENS from
13963 the pointer DSET returned by malloc; this isn't portable.
13964 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
13965 Similarly for DERIVES.
13966 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
13967 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
13968 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
13969
13970 * src/derives.c (derives_compute): Do not bother invoking
13971 int_of_rule_number, since rule numbers are integers.
13972
13973 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
13974 rather than XMALLOC (char, N).
13975
13976 * src/files.c (filename_split): Rewrite to avoid cast.
13977
13978 * src/gram.h (symbol_number_as_item_number,
13979 item_number_as_symbol_number, rule_number_as_item_number,
13980 item_number_as_rule_number):
13981 Now inline functions rather than macros, to avoid casts.
13982 * src/state.h (state_number_as_int): Likewise.
13983 * src/tables.c (state_number_to_vector_number,
13984 symbol_number_to_vector_number): Likewise.
13985
13986 * src/gram.h (int_of_rule_number): Remove; no longer used.
13987
13988 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
13989 since the resulting storage is always stored into.
13990
13991 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
13992 where it's needed.
13993
13994 * src/muscle_tab.c (muscle_m4_output):
13995 Now inline. Return bool, not int.
13996 * src/state.c (state_compare): Likewise.
13997 * src/symtab.c (symbol_check_defined,
13998 symbol_check_alias_consistency, symbol_pack, symbol_translation,
13999 hash_compare_symbol, hash_symbol):
14000 Likewise.
14001 * src/uniqstr.c (uniqstr_print): Likewise.
14002 * src/muscle_tab.c (muscle_m4_output_processor):
14003 New function, to avoid casts.
14004 * src/state.c (state_comparator, stage_hasher): Likewise.
14005 * src/symtab.c (symbol_check_defined_processor,
14006 symbol_check_alias_consistency_processor, symbol_pack_processor,
14007 symbol_translation_processor, hash_symbol_comparator,
14008 hash_symbol_hasher): Likewise.
14009 * src/uniqstr.c (uniqstr_print_processor): Likewise.
14010 * src/muscle_tab.c (muscles_m4_output):
14011 Use new functions instead of casting old functions unportably.
14012 * src/state.c (state_hash_new): Likewise.
14013 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
14014 symbols_token_translations_init):
14015 Likewise.
14016 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
14017
14018 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
14019 var instead of casting to long, to avoid casts.
14020 (prepare_states): Use MALLOC rather than alloca, so that we don't
14021 have to worry about alloca.
14022 * src/state.c (state_hash_lookup): Likewise.
14023
14024 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
14025 local var instead of casting to unsigned char, to avoid casts.
14026
14027 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
14028 STATE_ALLOC): Remove.
14029 (transitions_new, errs_new, reductions_new, state_new): Use malloc
14030 rather than calloc, and use offsetof to avoid allocating slightly
14031 too much storage.
14032 (state_new): Initialize all members.
14033
14034 * src/state.c (state_hash): Use unsigned accumulator, not signed.
14035
14036 * src/symtab.c (symbol_free): Remove; unused.
14037 (symbol_get): Remove cast in lhs of assignment.
14038 (symbols_do): Now static. Accept generic arguments, not
14039 hashing-related ones.
14040
14041 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
14042 (symbol_processor): Remove.
14043 (symbols_do): Remove decl; now static.
14044
14045 * src/system.h (alloca): Remove; decl no longer needed.
14046 (<stddef.h>): Include, for offsetof.
14047 (<inttypes.>, <stdint.h>): Include if available.
14048 (uintptr_t): New type, if system lacks it.
14049 (CALLOC, MALLOC, REALLOC): New macros.
14050 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
14051 new macros.
14052
14053 * src/tables.c (table_size): Now int, to pacify GCC.
14054 (table_grow, table_ninf_remap): Use signed table size.
14055 (save_row): Don't bother initializing locals when not needed.
14056 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
14057 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
14058
14059 * src/vcg.h: Correct misspellings.
14060
14061 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
14062
14063
14064 * src/getargs.c (getargs): Don't assume EOF == -1.
14065
26b4a969
PE
140662002-12-09 Paul Eggert <eggert@twinsun.com>
14067
14068 Change identifier spellings to avoid collisions with names
14069 that are reserved by POSIX.
14070
14071 Don't use names ending in _t, since POSIX reserves them.
14072 For consistency, remove _e and _s endings -- they're weren't
14073 needed to remove ambiguity. All uses changed.
14074 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
14075 turn was just renamed from struniq_t.
14076 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
14077 which in turn was just renamed from struniq_processor_t.
14078 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
14079 in turn was renamed from hash_compare_struniq_t.
14080 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
14081 (state_list): Renamed from state_list_t.
14082 * src/assoc.h (assoc): Renamed from assoc_t.
14083 * src/conflicts.c (enum conflict_resolution): Renamed from
14084 enum conflict_resolution_e.
14085 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
14086 (rule_list): Renamed from rule_list_t.
14087 * src/getargs.h (enum trace): Renamed from enum trace_e.
14088 (enum report): Renamed from enum report_e.
14089 * src/gram.h (item_number): Renamed from item_number_t.
14090 (rule_number): Renamed from rule_number_t.
14091 (struct rule_s): Remove the "rule_s" part; not used.
14092 (rule): Renamed from rule_t.
14093 (rule_filter): Renamed from rule_filter_t.
14094 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
14095 (goto_list): Renamed from goto_list_t.
14096 * src/lalr.h (goto_number): Renamed from goto_number_t.
14097 * src/location.h (location): Renamed from location_t.
14098 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
14099 and moved here from:
14100 * src/muscle_tab.h (muscle_entry_t): here.
14101 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
14102 (rule_list): Renamed from rule_list_t.
14103 * src/print_graph.c (static_graph): Renamed from graph.
14104 * src/reader.h (braced_code): Renamed from braced_code_t.
14105 Remove brace_code_e tag.
14106 * src/relation.h (relation_node): Renamed from relation_node_t.
14107 (relation_nodes): Renamed from relation_nodes_t.
14108 (relation): Renamed from relation_t.
14109 * src/state.h (state_number): Renamed from state_number_t.
14110 (struct state): Renamed from struct state_s.
14111 (state): Renamed from state_t.
14112 (transitions): Renamed from transitions_t. Unused (and
14113 misspelled) transtion_s tag removed.
14114 (errs): Renamed from errs_t. Unused errs_s tag removed.
14115 (reductions): Renamed from reductions_t. Unused tag
14116 reductions_s removed.
14117 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
14118 (struct symbol_list): Renamed from struct symbol_list_s.
14119 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
14120 (struct symbol): Renamed from struct symbol_s.
14121 (symbol): Renamed from symbol_t.
14122 * src/tables.c (vector_number): Renamed from vector_number_t.
14123 (action_number): Renamed from action_t.
14124 * src/tables.h (base_number): Renamed from base_t.
14125 * src/vcg.h (enum color): Renamed from enum color_e.
14126 (enum textmode): Renamed from enum textmode_e.
14127 (enum shape): Renamed from enum shape_e.
14128 (struct colorentry): Renamed from struct colorentry_s.
14129 (struct classname): Renamed from struct classname_s.
14130 (struct infoname): Renamed from struct infoname_s.
14131 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
14132 (enum decision): Renamed from enum decision_e.
14133 (enum orientation): Renamed from enum orientation_e.
14134 (enum alignment): Renamed from enum alignment_e.
14135 (enum arrow_mode): Renamed from enum arrow_mode_e.
14136 (enum crossing_type): Renamed from enum crossing_type_e.
14137 (enum view): Renamed from enum view_e.
14138 (struct node): Renamed from struct node_s.
14139 (node): Renamed from node_t.
14140 (enum linestyle): Renamed from enum linestyle_e.
14141 (enum arrowstyle): Renamed from enum arrowstyle_e.
14142 (struct edge): Renamed from struct edge.
14143 (edge): Renamed from edge_t.
14144 (struct graph): Renamed from struct graph_s.
14145 (graph): Renamed from graph_t.
14146 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
14147 Rename value_t -> value.
14148 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
14149 value_t_as_yystype -> value_as_yystype.
14150
14151 Don't include <errno.h> in the mainstream code, since it
14152 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
14153 * lib/get-errno.c, lib/get-errno.h: New files.
14154 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
14155 get-errno.c.
14156 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
14157 * src/output.c (output_skeleton): Likewise.
14158 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
14159 instead of errno.
14160 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
14161 Likewise.
14162 (handle_action_dollar, handle_action_at): Likewise.
14163 * src/system.h: Do not include <errno.h>.
14164 (TAB_EXT): Renamed from EXT_TAB.
14165 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
14166
14167 Avoid str[a-z]*, since <string.h> reserves that name space.
14168 Change all instances of "struniq" in names to "uniqstr", and
14169 likewise for "STRUNIQ" and "UNIQSTR".
14170 * src/uniqstr.c: Renamed from src/struniq.c.
14171 * src/uniqstr.h: Renamed from src/struniq.h.
14172 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
14173 * src/files.c (strsuffix): Remove; unused.
14174 (concat2): Renamed from stringappend. Now static.
14175 * src/files.h (strsuffix, stringappend): Remove; unused.
14176 * src/parse-gram.y (<chars>): Renamed from <string>.
14177 (<uniqstr>): Renamed from <struniq>.
14178 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
14179 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
14180 (struct graph_s.expand): Renamed from struct graph_s.stretch.
14181 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
14182 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
14183 (N_EXPAND): Renamed from N_STRETCH.
14184
14185 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
14186 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
14187 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
14188 Remove; unused.
14189 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
14190 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
14191 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
14192 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
14193 (BASE_MAXIMUM): Renamed from BASE_MAX.
14194 (BASE_MINIMUM): Renamed from BASE_MIN.
14195 (ACTION_MAX): Remove; unused.
14196 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
14197 Unnecessary casts removed from above defines.
14198
14199
14200 Fix misspelling in names.
14201 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
14202 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
14203 G_NODE_ALIGNEMENT.
14204
14205
14206 * lib/timevar.c (timevar_report): Renamed from time_report,
14207 for consistency with other names.
14208 * lib/timevar.h (timevar_report): New decl.
14209 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
14210
14211
14212 Sort include-file uses.
14213
14214 Reorder all include files under src to be in the order "system.h".
14215 then the ../lib include files in angle brackets (alphabetized),
14216 then the . include files in double-quotes (alphabetized). Fix
14217 dependency breakages encountered in this process, as follows:
14218 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
14219 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
14220 * src/state.h: Include "symtab.h".
14221
996b1c7e
PE
142222002-12-08 Paul Eggert <eggert@twinsun.com>
14223
14224 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
14225 since this causes problems when __file__ contains character
14226 sequences like "@" that are treated specially by src/scan-skel.l.
14227 Instead, just use the file's basename. This fixes the bug
14228 reported by Martin Mokrejs in
161a71f3 14229 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 14230
e19c4e5d
PE
142312002-12-06 Paul Eggert <eggert@twinsun.com>
14232
14233 Add support for rules that do not have trailing semicolons, as
14234 POSIX requires. Improve the quality of locations in Bison
14235 diagnostics.
26b4a969 14236
e19c4e5d
PE
14237 * src/location.c: Include <quotearg.h>.
14238 (empty_location): Now const.
14239 (location_print): New function. Follow the recommendation of the
14240 GNU Coding Standards for locations that span file boundaries.
14241 * src/location.h: Do not include <quotearg.h>; no longer needed.
14242 (boundary): New type.
14243 (location_t): Use it. This allows locations to span file boundaries.
14244 All member uses changed: file -> start.file or end.file (as needed),
14245 first_line -> start.line, first_column -> start.column,
14246 last_line -> end.line, last_column -> end.column.
14247 (equal_boundaries): New function.
14248 (LOCATION_RESET, LOCATION_STEP): Remove.
14249 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14250 (empty_location): Now const.
14251 (location_print): New decl.
14252 * src/parse-gram.y (lloc_default): New function, which handles
14253 empty locations more accurately.
14254 (YYLLOC_DEFAULT): Use it.
14255 (%token COLON): Remove.
14256 (%token ID_COLON): New token.
26b4a969 14257 (rules): Use it.
e19c4e5d
PE
14258 (declarations, rules): Remove trailing semicolon.
14259 (declaration, rules_or_grammar_declaration):
14260 Allow empty (";") declaration.
14261 (symbol_def): Remove empty actions; no longer needed.
14262 (rules_or_grammar_declaration): Remove trailing semicolon.
14263 (semi_colon.opt): Remove.
14264 * src/reader.h: Include location.h.
14265 (scanner_cursor): New decl.
14266 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14267 rolling our own.
14268 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14269 of *loc.
14270 (STEP): Remove. No longer needed, now that adjust_location does
14271 the work. All uses removed.
14272 (scanner_cursor): New var.
14273 (adjust_location): Renamed from extend_location. It now sets
14274 *loc and adjusts the scanner cursor. All uses changed.
14275 Don't bother testing for CR.
14276 (handle_syncline): Remove location arg; now updates scanner cursor.
14277 All callers changed.
14278 (unexpected_end_of_file): Now accepts start boundary of token or
14279 comment, not location. All callers changed. Update scanner cursor,
14280 not the location.
14281 (SC_AFTER_IDENTIFIER): New state.
14282 (context_state): Renamed from c_context. All uses changed.
14283 (id_loc, code_start, token_start): New local vars.
14284 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14285 processing of Yacc white space and equivalents here.
14286 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14287 instead of returning ID immediately, since we need to search for
14288 a subsequent colon.
14289 (<INITIAL>"'", "\""): Save token_start.
14290 (<INITIAL>"%{", "{", "%%"): Save code_start.
14291 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14292 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14293 BEGIN context_state at end, not INITIAL.
14294 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14295 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14296 Return correct token start.
14297 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14298 the start of a character, string or multiline comment is found.
14299 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14300 Reduction): Adjust reported locations to match the more-precise
14301 results now expected.
14302 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14303 * tests/reduce.at (Useless Rules, Reduced Automaton,
14304 Underivable Rules): Likewise.
14305 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14306 or "|"' now that so many other tokens are allowed by the new grammar.
14307
14308 * src/complain.h (current_file): Remove duplicate decl;
14309 current_file is now owned by files.h.
14310 * src/complain.c, src/scan-gram.l: Include files.h.
14311
143122002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 14313
e19c4e5d
PE
14314 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
14315 promotes to int; it might be unsigned int.
14316 * data/yacc.c (yy_reduce_print): Likewise.
14317
14318 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
14319 be #defined in the prologue, not in the Bison declarations.
14320 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 14321
b64755e3
PE
143222002-12-02 Paul Eggert <eggert@twinsun.com>
14323
14324 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
14325 * lib/strtoul.c: New file, from gnulib.
14326 This fixes a porting bug reported by Peter Klein in
161a71f3 14327 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 14328
6e746484
PE
143292002-11-30 Paul Eggert <eggert@twinsun.com>
14330
b64755e3
PE
14331 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
14332 and put only a forward declaration in the prologue. This is for
14333 consistency with the other scanner helper functions.
14334
6ba55592
PE
14335 Type clashes now generate warnings, not errors, since it
14336 appears that POSIX may allow some grammars with type clashes.
14337 * src/reader.c (grammar_current_rule_check): Warn about
14338 type clashes instead of complaining.
14339 * tests/input.at (Type Clashes): Expect warnings, not complaints.
14340
6e746484
PE
14341 Add Yacc library, since POSIX requires it.
14342 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
14343 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
14344 * lib/main.c, lib/yyerror.c: New files.
14345
14346 gram_error can be static; it need not be extern.
14347 * src/reader.h (gram_error): Remove decl.
14348 * src/parse-gram.y (gram_error): Now static. Add static decl.
14349 (print_token_value): Omit parameter names from forward decl,
14350 for consistency.
14351
88510f9c
PE
143522002-11-29 Paul Eggert <eggert@twinsun.com>
14353
6e746484
PE
14354 * doc/bison.texinfo: Emphasize that yylex and yyerror must
14355 be declared before being used. E.g., one should typically
14356 declare them in the prologue. Use GNU coding style in examples.
14357 Put "const" consistently after the type it modifies. Mention
14358 that C99 supports "inline". Mention that yyerror traditionally
14359 returns "int".
14360
88510f9c
PE
14361 %parse-param and %lex-param now take just one argument, the
14362 declaration; the argument name is deduced from the declaration.
14363
14364 * doc/bison.texinfo (Parser Function, Pure Calling, Error
14365 Reporting, Table of Symbols): Document this.
14366 * src/parse-gram.y (add_param): New function.
14367 (COMMA): Remove.
14368 (declaration): Implement new rule for %parse-param and %lex-param.
14369 * src/scan-gram.l: "," now elicits a warning, rather than being
14370 a token; this is more compatible with byacc.
14371 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
14372
bb92250c
PE
143732002-11-27 Paul Eggert <eggert@twinsun.com>
14374
14375 Rename identifiers to avoid real and potential collisions.
14376
14377 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
14378 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 14379 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
14380 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
14381 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
14382 * src/parse-gram.y (print_token_value): Renamed from yyprint.
14383 All uses changed.
14384 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
14385 The name "yycontrol" violates the name space rules, and this stuff
14386 wasn't being used anyway.
14387 (input): Remove action; this stuff wasn't being used.
14388 (gram_error): Rename local variable yylloc -> loc.
14389 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
14390 (YY_DECL): Don't use "yy" at start of local variables.
14391 All uses changed, e.g., yylloc -> loc.
14392 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
14393 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
14394 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
14395 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
14396
14397 * src/parse-gram.y (gram_error): loc is now const *.
14398 * src/reader.h (gram_error): Likewise.
14399
3af4feb2
PE
144002002-11-24 Paul Eggert <eggert@twinsun.com>
14401
14402 Version 1.75c.
14403
14404 * tests/actions.at (Actions after errors): Use an output format
14405 more similar to that of the Printers and Destructors test.
14406 Test the position of the ';' token too.
14407 (Printers and Destructors): Likewise.
14408 (Printers and Destructors: %glr-parser): Remove for now, to avoid
14409 unnecessarily alarming people when the test fails.
14410
14411 * data/yacc.c (yyerrlab1): Move this label down, so that the
14412 parser does not discard the lookahead token if the user code
14413 invokes YYERROR. This change is required for POSIX conformance.
14414
14415 * lib/error.c: Sync with gnulib.
14416
144172002-11-22 Paul Eggert <eggert@twinsun.com>
14418
14419 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
14420 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
14421 * lib/xmalloc.c: Likewise.
26b4a969 14422
58004308
PE
144232002-11-20 Paul Eggert <eggert@twinsun.com>
14424
14425 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
14426
144272002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 14428
58004308
PE
14429 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
14430 should use `if (! x) abort ();' rather than `assert (x);', and
14431 anyway it's one less thing to worry about configuring.
14432
14433 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
14434 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
14435 and replace all instances of assert with abort.
14436 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
14437 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
14438
14439 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
14440 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
14441 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
14442 hash_find_entry, hash_rehash, hash_insert): Likewise.
14443 * src/conflicts.c (resolve_sr_conflict): Likewise.
14444 * src/lalr.c (set_goto_map, map_goto): Likewise.
14445 * src/nullable.c (nullable_compute): Likewise.
14446 * src/output.c (prepare_rules, token_definitions_output): Likewise.
14447 * src/reader.c (packgram, reader): Likewise.
14448 * src/state.c (state_new, state_free, state_transitions_set,
14449 state_reduction_find): Likewise.
14450 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
14451 symbol_pack): Likewise.
14452 * src/tables.c (conflict_row, pack_vector): Likewise.
14453 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14454 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14455 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
14456 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
14457
14458 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
14459 (ARGMATCH_CONSTRAINT): New macro.
14460 (ARGMATCH_ASSERT): Use it.
14461
14462 * src/system.h (verify): New macro.
14463 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
14464 rather than assert.
14465 * src/tables.c (tables_generate): Likewise.
14466
14467 * src/struniq.c (struniq_assert): Now returns void, and aborts
14468 if the assertion is false.
14469 (struniq_assert_p): Remove.
14470 * src/struniq.h: Likewise.
14471
76ae8198
PE
144722002-11-18 Paul Eggert <eggert@twinsun.com>
14473
14474 * data/glr.c (yygetLRActions): Replace `yyindex' with
14475 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14476 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 14477 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 14478
d3c4e709
AD
144792002-11-18 Akim Demaille <akim@epita.fr>
14480
14481 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14482 space.
14483 From Tim Van Holder.
14484
8d8a7238
PE
144852002-11-17 Paul Eggert <eggert@twinsun.com>
14486
14487 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14488 to "SyntaxError" for consistency with my 2002-11-15 change.
14489
14490 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14491 not define to {}, since this breaks the common use of `YYDPRINTF
14492 ((...));' if a single statement is desired (e.g. before `else').
14493 Work around GCC warnings by surrounding corresponding calls with
14494 {} if needed.
14495 (yyhasResolvedValue): Remove unused function.
14496 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14497 loop body.
14498 (yyreportSyntaxError): Renamed from yyreportParseError.
14499 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14500 All uses changed.
14501 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14502 extern when possible. Remove unused initializations.
14503
b0937b22
AD
145042002-11-16 Akim Demaille <akim@epita.fr>
14505
14506 Augment the similarity between GLR and LALR traces.
14507
14508 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14509 (YY_REDUCE_PRINT): New.
14510 (yyparse): Use them.
14511 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14512 YYDPRINT here.
14513 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14514 state reached after the reduction/recovery, since...
14515 (yyparse, yyprocessOneStack): Report the state we are entering in.
14516
c5e3e510
AD
145172002-11-16 Akim Demaille <akim@epita.fr>
14518
14519 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14520 Add support for --trace=skeleton.
14521 * src/scan-skel.l: %option debug.
14522 Scan strings of non-@ or \n instead of character by character.
14523 (scan_skel): Handle trace_skeleton.
14524 (QPUTS): New.
14525 (@output_parser_name@, @output_header_name@): ``Restore'' their
14526 support (used to be M4 macros).
14527 * data/yacc.c: Quote larger chunks, a la glr.c.
14528 * data/lalr1.cc: Likewise.
14529 The header guards are no longer available, so use some other
14530 string than `YYLSP_NEEDED'.
14531
4c6cc1db
AD
145322002-11-16 Akim Demaille <akim@epita.fr>
14533
14534 Make the ``Printers and Destructors'' test more verbose, taking
14535 `yacc.c''s behavior as (possibly wrong) reference.
14536
14537 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14538 instead of fprint on stdout.
14539 Set and report the last_line of the symbols.
14540 Consistently display values and locations.
14541
6d9e8019
PE
145422002-11-16 Paul Eggert <eggert@twinsun.com>
14543
14544 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14545
6e649e65
PE
145462002-11-15 Paul Eggert <eggert@twinsun.com>
14547
b25d88f6
PE
14548 * tests/actions.at (Actions after errors): New test case.
14549
6e649e65
PE
14550 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14551 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14552 tests/action.at, tests/calc.at, tests/conflicts.at,
14553 tests/cxx-type.at, tests/regression.at:
14554 "parse error" -> "syntax error" for POSIX compatibility.
14555 "parsing stack overflow..." -> "parser stack overflow" so
14556 that code matches Bison documentation.
14557
0f39aab9
AD
145582002-11-15 Akim Demaille <akim@epita.fr>
14559
14560 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14561 take two BRACED_CODE, not two string_content.
14562 Free the scanner's obstack when we are done.
14563 (code_content): New.
14564 * tests/calc.at: Adjust.
14565 * doc/bison.texinfo: Adjust.
14566 Also, make sure to include the `,' for these declarations.
14567
761c1926
AD
145682002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14569
14570 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14571 definition; avoids potential autoreconf problems.
14572
b0f98b10
AD
145732002-11-15 Akim Demaille <akim@epita.fr>
14574
14575 Always check the value returned by yyparse.
14576
14577 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14578 returned by yyparse.
14579 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14580 Adjust calls.
14581 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14582 returned by yyparse.
14583
970785f1
PH
145842002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14585
14586 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14587 on input.at test.
14588
8fcc7db1
PE
145892002-11-14 Paul Eggert <eggert@twinsun.com>
14590
7ec1b48e
PE
14591 * src/output.c (output_skeleton): Call xfopen instead of
14592 duplicating xfopen's body.
14593
cfff7583 14594 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 14595 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 14596
8fcc7db1
PE
14597 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14598 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14599 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14600 file twice in the grammar, as an extra check.
14601
14602 * tests/input.at (Torturing the Scanner): Surround the
14603 backslash-newline tests with "#if 0", to make it less likely that
14604 we'll run into compiler bugs. Bring back solitary \ inside
14605 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 14606 test backslash-newline in C character constant.
8fcc7db1 14607
4e8d992c
AD
146082002-11-14 Akim Demaille <akim@epita.fr>
14609
14610 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14611 status of the compiler.
f32b346d 14612 Calling `exit 1' is no longer needed.
4e8d992c
AD
14613 Reported by Nelson H. F. Beebe.
14614
9501dc6e
AD
146152002-11-14 Akim Demaille <akim@epita.fr>
14616
14617 * tests/atlocal.in (CPPFLAGS): We have config.h.
14618 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14619 New.
14620 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14621 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14622 * tests/regression.at, tests/torture.at: Use them for all the
14623 grammars that are to be compiled.
14624 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14625 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14626 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14627
18b519c0
AD
146282002-11-14 Akim Demaille <akim@epita.fr>
14629
14630 * doc/bison.texinfo: Various formatting changes (alignments in
14631 samples, additional @group/@end group, GCS in samples.
14632 Use @deffn instead of simple @table to define the directives,
14633 macros, variables etc.
14634
9a86cdb9
PE
146352002-11-13 Paul Eggert <eggert@twinsun.com>
14636
daa33def 14637 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 14638 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 14639
daa33def 14640 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 14641 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
14642 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14643 * tests/headers.at (export YYLTYPE): Likewise.
14644
14645 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 14646 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 14647
9a86cdb9
PE
14648 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14649 comments, since they're not portable. Use GNU coding style.
14650
9c1e26bd
AD
146512002-11-13 Akim Demaille <akim@epita.fr>
14652
14653 * data/yacc.c: Leave bigger chunks of quoted text.
14654 (YYDSYMPRINTF): New.
14655 Use it to report symbol activities.
14656 * data/glr.c (YYDSYMPRINTF): New.
14657 Use it.
14658
87f721cc
PE
146592002-11-12 Paul Eggert <eggert@twinsun.com>
14660
14661 Version 1.75b.
14662
14663 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14664 (yyglrReduce): Return yyok, not 0.
14665 This should avoid the enumerated-type warnings reported
464c6927 14666 by Nelson H. F. Beebe in
161a71f3 14667 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
14668
14669 * lib/bbitset.h (BITSET_INLINE): Remove.
14670 * lib/bitset.h [! BITSET_INLINE]: Remove.
14671 (bitset_set, bitset_reset, bitset_test): Rename local vars
14672 to avoid shadowing warnings by GCC.
14673
14674 * data/glr.c (inline): Remove #define. It's the user's
14675 responsibility to #define it away, just like 'const'.
464c6927 14676 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 14677 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 14678
87f721cc
PE
14679 * Makefile.maint (po-check): Scan .l and .y files instead of the
14680 .c and the .h files that they generate. This fixes the bug
14681 reported by Tim Van Holder in:
161a71f3 14682 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
14683 Look for N_ as well as for _. Try to avoid matching #define for
14684 N_ and _.
14685 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14686 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14687 * src/scan-gram.l: Revamp regular expressions so that " and '
14688 do not confuse xgettext.
14689
14690 * src/struniq.h (struniq_new): Do not declare the return type
14691 to be 'const'; this violates the C standard.
14692 * src/struniq.c (struniq_new): Likewise.
14693
be14ade5
AD
146942002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14695
14696 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14697 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14698 linker.
14699
05291fbc
AD
147002002-11-12 Akim Demaille <akim@epita.fr>
14701
14702 * Makefile.maint: Sync with Autoconf:
14703 (local_updates): New.
14704
1f5fd52e
AD
147052002-11-12 Akim Demaille <akim@epita.fr>
14706
14707 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14708
283f1e64
AD
147092002-11-12 Akim Demaille <akim@epita.fr>
14710
14711 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14712 locations.
14713
886b69d1
AD
147142002-11-12 Akim Demaille <akim@epita.fr>
14715
14716 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14717 not yyvalue.
14718
3df37415
AD
147192002-11-12 Akim Demaille <akim@epita.fr>
14720
14721 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14722 Use it to test the GLR parser.
14723
7bd6c77e
AD
147242002-11-12 Akim Demaille <akim@epita.fr>
14725
14726 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14727 defines it.
14728 * data/glr.c (yystos): New.
14729 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14730 (YYDSYMPRINT): New.
14731 (yyval): Don't define it, it is handled via M4.
14732 (yyrecoverParseError): Free verbosely the discarded symbols.
14733 * data/yacc.c (yysymprint): Remove, rather...
14734 (b4_yysymprint_generate): invoke.
14735 * data/c.m4 (b4_yysymprint_generate): New.
14736 Accept pointers as arguments, as opposed to the version from
14737 yacc.c.
14738 (b4_yydestruct_generate): Likewise.
14739 * tests/cations.at (Printers and Destructors): Use Bison directives
14740 instead of CPP macros.
14741 Don't rely on internal details.
14742
b0400cc6
AD
147432002-11-12 Akim Demaille <akim@epita.fr>
14744
14745 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14746 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14747 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14748 it against YYEMPTY and so forth), work on yytoken (i.e., set
14749 it to YYEMPTY etc.).
14750 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14751 (b4_symbol_actions): Remove.
14752 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14753 for 0, end-of-input.
14754
72f889cc
AD
147552002-11-12 Akim Demaille <akim@epita.fr>
14756
14757 * doc/bison.texinfo (Destructor Decl): New.
14758
b1ae9233
AD
147592002-11-12 Akim Demaille <akim@epita.fr>
14760
14761 * src/tables.c (tables_generate): Use free for pointers that
14762 cannot be NULL, not XFREE.
14763 (pack_vector): Use assert, not fatal, for bound violations.
14764 * src/state.c (state_new): Likewise.
14765 * src/reader.c (reader): Likewise.
14766 * src/lalr.c (set_goto_map): Likewise.
72f889cc 14767 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
14768 the file name.
14769
7ec2d4cd
AD
147702002-11-12 Akim Demaille <akim@epita.fr>
14771
14772 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14773 Restore.
14774 * src/scan-gram.l (last_string): Is global to the file, not to
14775 yylex.
14776 * src/parse-gram.y (input): Don't append the epilogue here,
14777 (epilogue.opt): do it here, and free the scanner's obstack.
14778 * src/reader.c (epilogue_set): Rename as...
14779 (epilogue_augment): this.
14780 * data/c.m4 (b4_epilogue): Defaults to empty.
14781
573a6cd3
AD
147822002-11-12 Akim Demaille <akim@epita.fr>
14783
14784 * src/getargs.c (long_options): Remove duplicates.
14785 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14786 Remove.
14787 * doc/bison.rnh: Remove.
14788 * doc/bison.texinfo (VMS Invocation): Remove.
14789
95612cfa
AD
147902002-11-12 Akim Demaille <akim@epita.fr>
14791
14792 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14793 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14794
14795 Use struniq for symbols.
14796
14797 * src/symtab.h (symbol_t): The tag member is a struniq.
14798 (symbol_type_set): Adjust.
14799 * src/symtab.c (symbol_new): Takes a struniq.
14800 (symbol_free): Don't free the tag member.
14801 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14802 (hash_compare_symbol, hash_symbol): these.
14803 Use the fact that tags as struniqs.
14804 (symbol_get): Use struniq_new.
14805 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14806 Returns a strniq.
14807 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14808 and type members are struniqs.
14809 * src/reader.c (get_merge_function)
14810 (grammar_current_rule_merge_set): Adjust.
14811 (TYPE, current_type): Are struniq.
14812
14813 Use struniq for file names.
14814
14815 * src/files.h, src/files.c (infile): Split into...
14816 (grammar_file, current_file): these.
14817 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14818 * src/reduce.c (reduce_print): Likewise.
14819 * src/getargs.c (getargs): Likewise.
14820 * src/complain.h, src/complain.c: Likewise.
14821 * src/main.c (main): Call struniqs_new early enough to use it for
14822 file names.
14823 Don't free the input file name.
14824
3e6656f9
AD
148252002-11-12 Akim Demaille <akim@epita.fr>
14826
14827 * src/symtab.c (symbol_free): Remove dead deactivated code:
14828 type_name are properly removed.
14829 Don't use XFREE to free items that cannot be NULL.
14830 * src/struniq.h, src/struniq.c: New.
14831 * src/main.c (main): Initialize/free struniqs.
14832 * src/parse-gram.y (%union): Add astruniq member.
14833 (yyprint): Adjust.
14834 * src/scan-gram.l (<{tag}>): Return a struniq.
14835 Free the obstack bit that used to store it.
14836 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14837
7672019c
PE
148382002-11-11 Paul Eggert <eggert@twinsun.com>
14839
14840 Revamp to fix many (but not all) of the C- and M4-related quoting
14841 problems. Among other things, this fixes the Bison bug reported
14842 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 14843 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
14844
14845 Use new @ escapes consistently. Represent brackets with @{ and @}
14846 rather than @<:@ and @:>@, since this works a bit better with dumb
14847 editors like vi. Represent @ with @@, since @ is now consistently
14848 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14849 __ofile__, to avoid unexpected expansions. Similarly, use @output
14850 rather than #output.
14851
14852 * data/c.m4 (b4_copyright): Omit file name from comment, since
14853 the file name could contain "*/".
14854 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14855 be quoted. All uses changed.
14856
14857 * data/glr.c: Use new @ escapes consistently.
14858 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14859 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14860 Remove, since they couldn't handle arbitrary characters in file
14861 names.
14862 * data/lalr1.cc: Likewise.
14863 * data/yacc.c: Likewise.
14864
14865 * src/files.c (output_infix): Remove; all uses removed.
14866 * src/files.h: Likewise.
14867
14868 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14869 mishandled funny characters in file names, and anyway it isn't
14870 needed any more.
14871 * data/yacc.c: Likewise.
14872 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14873
14874 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14875 * data/yacc.c: Likewise.
14876
14877 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14878 strings now.
14879 (muscle_init): Quote filename as a C string.
14880 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14881 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14882 * src/output.c (escaped_file_name_output): New function.
14883 (prepare_symbols): Quote tokens for M4.
14884 (prepare): Don't insert output_infix, output_prefix,
14885 output_parser_name, output_header_name; this is now down by scan-skel.
14886 Insert skeleton as a C string.
14887
14888 * src/output.c (user_actions_output, symbol_destructors_output,
14889 symbol_printers_output): Quote filenames for C and M4.
14890 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14891
14892 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14893 escapes other than \\ and \'; this simplifies the code.
14894 (<SC_STRING>): Likewise, for \\ and \".
14895 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14896 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14897 Use new escapes @{ and @} for [ and ].
14898
14899 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14900 them with auto vars.
14901 Switch to new escape scheme, where @ is the escape character uniformly.
14902 Abort if a stray escape character is found. Avoid unbounded input
14903 buffer when parsing non-escaped text.
14904
14905 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14906 __oline__, #output, $@, and @{ do not have unintended meanings.
14907
acea4f3b
PE
149082002-11-09 Paul Eggert <eggert@twinsun.com>
14909
14910 Fix the test failure due to GCC warnings described in
161a71f3 14911 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
14912 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
14913 evaluate to 0 if it's impossible for NINF to be in the respective
14914 table.
14915 (yygetLRActions, yyrecoverParseError): Use them.
14916
14917 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
14918 counted in the token inserted at end of file. Now takes
14919 location_t *, not location_t, so that the location can be
14920 adjusted. All uses changed.
14921
14922 * tests/regression.at (Invalid inputs): Adjust wording in
14923 diagnostic to match the new behavior.
14924
14925 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
14926 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
14927 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
14928 abort ();'. This reduces the runtime of the "Many lookaheads"
14929 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
14930 GCC 3.2.
14931
20ef1ad5
PE
149322002-11-07 Paul Eggert <eggert@twinsun.com>
14933
14934 * src/parse-gram.y (CHARACTER): Remove unused token.
14935 All uses removed.
14936
14937 * src/scan-gram.l: Remove stack option. We no longer use the
14938 stack, since the stack was never deeper than 1; instead, use the
14939 new auto var c_context to record the stacked value.
14940
14941 Remove nounput option. At an unexpected end of file, we now unput
14942 the minimal input necessary to end cleanly; this simplifies the
14943 code.
14944
14945 Avoid unbounded token sizes where this is easy.
14946
14947 (unexpected_end_of_file): New function.
14948 Use it to systematize the error message on unexpected EOF.
14949 (last-string): Now auto, not static.
14950 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
14951 (scanner_last_string_free): Remove; not used.
14952 (percent_percent_count): Move decl to just before use.
14953 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
14954 not the (never otherwised-used) CHARACTER.
14955
93724f13
AD
149562002-11-07 Akim Demaille <akim@epita.fr>
14957
14958 Let yyerror always receive the msg as last argument, so that
14959 yyerror can be variadic.
14960
14961 * data/yacc.c (b4_yyerror_args): New.
14962 Use it when calling yyerror.
14963 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
14964 Use it when calling yyerror.
14965 * doc/bison.texinfo (Error Reporting): Adjust.
14966 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
14967 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
14968
6e40b4eb
AD
149692002-11-06 Akim Demaille <akim@epita.fr>
14970
14971 #line should have quoted strings.
14972 Ideally, this should be done by m4_quotearg.
14973
14974 * src/scan-skel.l: Include quotearg.h.
14975 Quote __ofile__.
14976 * src/output.c (symbol_printers_output)
14977 (symbol_destructors_output): Quote the file name.
14978
2dfbfc12
AD
149792002-11-06 Akim Demaille <akim@epita.fr>
14980
14981 * tests/regression.at (Invalid inputs): Adjust to the recent
14982 messages.
14983
437c2d80
AD
149842002-11-06 Akim Demaille <akim@epita.fr>
14985
14986 Restore --no-lines.
14987 Reported by Jim Kent.
14988
14989 * data/c.m4 (b4_syncline): New.
14990 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
14991 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
14992 * src/output.c (user_actions_output): Likewise.
14993 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 14994 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 14995
900c5db5
AD
149962002-11-06 Akim Demaille <akim@epita.fr>
14997
14998 * src/main.c (main): Free `infile'.
14999 * src/scan-gram.l (handle_syncline): New.
15000 Recognize `#line'.
15001 * src/output.c (user_actions_output, symbol_destructors_output)
15002 (symbol_printers_output): Use the location's file name, not
15003 infile.
15004 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15005
e183b123 150062002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 15007
e183b123 15008 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 15009 either has GLR conflict entries.
e183b123 15010
193eb6b7
PE
150112002-11-05 Paul Eggert <eggert@twinsun.com>
15012
e183b123
PE
15013 * src/scan-gram.l: Use more accurate diagnostics, e.g.
15014 "integer out of range" rather than "invalid value".
15015 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
15016 accordingly.
15017
193eb6b7
PE
15018 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
15019 Also, remove one static variable in the scanner.
15020
15021 * src/scan-gram.l (braces_level): Now auto, not static.
15022 Initialize to zero if the compiler is being picky.
15023 (INITIAL): Clear braces_level instead of incrementing it.
15024 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
15025 as POSIX 1003.1-2001 requires.
15026 * src/system.h (IF_LINT): New macro, taken from coreutils.
15027 * configure.ac: Define "lint" if --enable-gcc-warnings.
15028
29c01725
AD
150292002-11-05 Akim Demaille <akim@epita.fr>
15030
15031 * src/scan-gram.l: When it starts with `%', complain about the
15032 whole directive, not just that `invalid character: %'.
15033
8aeac3ca
AD
150342002-11-04 Akim Demaille <akim@epita.fr>
15035
15036 * Makefile.maint: Update from Autoconf.
15037 (update, cvs-update, po-update, do-po-update): New.
15038
793a58bb
AD
150392002-11-04 Akim Demaille <akim@epita.fr>
15040
15041 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
15042 and yyerror.
15043 Have yyerror `use' its arguments.
15044 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
15045 returns true when location & yacc & pure & parse-param.
15046 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
15047
c4d720cd
AD
150482002-11-04 Akim Demaille <akim@epita.fr>
15049
15050 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
15051 clashes.
15052 * src/scan-gram.l: Use [\'] instead of ['] to pacify
15053 font-lock-mode.
15054 Use complain_at.
15055 Use quote, not quote_n since LOCATION_PRINT no longer uses the
15056 slot 0.
15057
613a0dc5
PE
150582002-11-03 Paul Eggert <eggert@twinsun.com>
15059
15060 * src/reader.c (get_merge_function, grammar_current_rule_check):
15061 Use consistent diagnostics for reporting type name clashes.
15062 Quote the types with <>, for consistency with Yacc.
15063 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
15064
2a8d363a
AD
150652002-11-03 Akim Demaille <akim@epita.fr>
15066
15067 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
15068 New.
15069 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
15070 (b4_parse_param): Remove.
15071 Use b4_identification.
15072 Propagate b4_pure_args where needed to pass them to yyerror.
15073 * data/glr.m4 (b4_parse_param): Remove.
15074 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
15075 (b4_lpure_formals): New.
15076 Use b4_identification.
15077 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
15078 b4_user_formals and b4_user_args.
15079 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
15080 (yyreportAmbiguity): When using a pure parser, also need
15081 the location, and the parse-params.
15082 Adjust callers.
15083 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
15084 When using a pure parser, also need the parse-params.
15085 Adjust callers.
15086 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
15087 (%pure-parser + %parse-param) LALR and GLR parsers.
15088 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
15089 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
15090 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
15091 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
15092 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
15093 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
15094 * doc/bison.texinfo: Untabify the whole file.
15095 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
15096 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
15097 (Error Reporting): Adjust to these new directives.
15098 Document %error-verbose, deprecate YYERROR_VERBOSE.
15099
9e32add8
AD
151002002-11-03 Akim Demaille <akim@epita.fr>
15101
15102 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
15103 AT_CHECK_CALC_GLR invocations to use % directives, instead of
15104 command line options.
15105 * tests/cxx-type.at: Formatting changes.
15106
b02d90a5
PE
151072002-11-03 Paul Eggert <eggert@twinsun.com>
15108
15109 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
15110 to count columns correctly, and to check for invalid inputs.
9e32add8 15111
b02d90a5
PE
15112 Use mbsnwidth to count columns correctly. Account for tabs, too.
15113 Include mbswidth.h.
15114 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
15115 (extend_location): New function.
15116 (YY_LINES): Remove.
15117
15118 Handle CRLF in C code rather than in Lex code.
15119 (YY_INPUT): New macro.
15120 (no_cr_read): New function.
15121
15122 Scan UCNs, even though we don't fully handle them yet.
15123 (convert_ucn_to_byte): New function.
15124
15125 Handle backslash-newline correctly in C code.
15126 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
15127 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
15128 all uses changed.
15129 (tag, splice): New EREs. Do not allow NUL or newline in tags.
15130 Use {splice} wherever C allows backslash-newline.
15131 YY_STEP after space, newline, vertical-tab.
15132 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 15133
b02d90a5
PE
15134 (letter, id): Don't assume ASCII; e.g., spell out a-z.
15135
15136 ({int}, handle_action_dollar, handle_action_at): Check for integer
15137 overflow.
9e32add8 15138
b02d90a5
PE
15139 (YY_STEP): Omit trailing semicolon, so that it's more like C.
15140
15141 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
15142 as well as \000. Check for UCHAR_MAX, not 255.
15143 Allow \x with an arbitrary positive number of digits, as in C.
15144 Check for overflow here.
15145 Allow \? and UCNs, for compatibility with C.
15146
15147 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
15148 with quote slot used by complain_at.
15149
15150 * tests/input.at: Add tests for backslash-newline, m4 quotes
15151 in symbols, long literals, and funny escapes in strings.
15152
15153 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
15154 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
15155 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
15156 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
15157 * m4/mbswidth.m4: New file, from GNU coreutils.
15158
15159 * doc/bison.texinfo (Grammar Outline): Document // comments.
15160 (Symbols): Document that trigraphs have no special meaning in Bison,
15161 nor is backslash-newline allowed.
15162 (Actions): Document that trigraphs have no special meaning.
15163
15164 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
15165 no longer used.
15166
151672002-11-02 Paul Eggert <eggert@twinsun.com>
15168
15169 * src/reader.c: Don't include quote.h; not needed.
15170 (get_merge_function): Reword warning to be consistent with
15171 type clash diagnostic in grammar_current_rule_check.
15172
15173 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
15174 bug in trigraph handling.
15175
15176 * src/output.c (prepare_symbols): When printing token names,
15177 escape "[" as "@<:@" and likewise for "]".
15178
15179 * src/system.h (errno): Remove declaration, as we are now
15180 assuming C89 or better, and C89 guarantees errno.
15181
762b212b
PE
151822002-10-30 Paul Eggert <eggert@twinsun.com>
15183
15184 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
15185 Check for close failures.
15186 * src/files.h (xfclose): Return void, not int, since it always
15187 returned zero.
15188 * src/files.c (xfclose): Likewise. Report I/O error if ferror
15189 indicates one.
15190 * src/output.c (output_skeleton): Use xfclose rather than fclose
15191 and ferror. xfclose now checks ferror.
15192
15193 * data/glr.c (YYLEFTMOST_STATE): Remove.
15194 (yyreportTree): Use a stack-based leftmost state. This avoids
15195 our continuing battles with bogus warnings about initializers.
15196
56100c60
AD
151972002-10-30 Akim Demaille <akim@epita.fr>
15198
15199 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
15200 #if.
15201
51b4a04c
PH
152022002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15203
15204 * tests/glr-regr1.at: New test for reported regressions.
15205 * tests/testsuite.at: Add glr-regr1.at test.
15206 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 15207
bf1ebda2
PE
152082002-10-24 Paul Eggert <eggert@twinsun.com>
15209
5c16c6b1
PE
15210 Version 1.75a.
15211
bf1ebda2
PE
15212 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
15213 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
15214 we use malloc. Don't assume 'A' through 'Z' are contiguous.
15215 Don't assume strdup exists; POSIX says its an XSI extension.
15216 Check for buffer overflow on input.
15217
b526ee61
AD
152182002-10-24 Akim Demaille <akim@epita.fr>
15219
15220 * src/output.c (output_skeleton): Don't disable M4sugar comments
15221 too soon: it results in comments being expanded.
15222 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
15223 first output.
15224
f1886bb2
AD
152252002-10-24 Akim Demaille <akim@epita.fr>
15226
15227 * data/yacc.c (m4_int_type): New.
15228 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
15229 char' as only yacc.c wants K&R portability.
15230 * data/glr.c (yysigned_char): Remove.
15231 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15232 Reported by Quoc Peyrot.
15233
c5576256
PE
152342002-10-23 Paul Eggert <eggert@twinsun.com>
15235
15236 * src/main.c (main): With --trace=time, report times even if a
15237 non-fatal error occurs. Formerly, the times were reported in some
15238 such cases but not in others.
15239 * src/reader.c (reader): Just return if a complaint has been issued,
15240 instead of exiting, so that 'main' can report times.
15241
27b0ffea
AD
152422002-10-22 Akim Demaille <akim@epita.fr>
15243
15244 * src/system.h: Include sys/types.
15245 Reported by Bert Deknuydt.
15246
223a7883
PE
152472002-10-23 Paul Eggert <eggert@twinsun.com>
15248
15249 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15250 Suggested by Art Haas.
15251
152522002-10-22 Paul Eggert <eggert@twinsun.com>
15253
15254 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15255 decl; not needed any more.
15256 * src/main.c (main): Use return to exit, undoing yesterday's change.
15257 The last OS that we could find where this wouldn't work is
15258 SunOS 3.5, and that's too old to worry about now.
15259
15260 * data/glr.c (struct yyltype): Define members even when not
15261 doing locations. This is more consistent with yacc.c, and it
15262 works around the following bug reports:
161a71f3
PE
15263 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15264 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 15265
223a7883
PE
15266 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15267 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15268 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15269
8b76775a
AD
152702002-10-22 Akim Demaille <akim@epita.fr>
15271
15272 * data/README: New.
15273
6db10d14
PE
152742002-10-21 Paul Eggert <eggert@twinsun.com>
15275
15276 Be consistent about 'bool'; the old code used an enum in one
15277 module and an int in another, and this violates the C standard.
15278 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15279 * configure.ac (AC_HEADER_STDBOOL): Add.
15280 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15281 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15282 * src/symtab.c (hash_compare_symbol_t): Likewise.
15283 * src/system.h (bool, false, true): Use a definition consistent
15284 with ../lib/hash.c. All uses changed.
15285
15286 * src/complain.c (warning_issued): Renamed from warn_message_count,
15287 so that we needn't worry about integer overflow (!).
15288 Now of type bool. All uses changed.
15289 (complaint_issued): Renamed from complain_message_count; likewise.
15290
15291 * src/main.c (main): Use exit to exit with failure.
27b0ffea 15292
6db10d14
PE
15293 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15294 rather than 1 and 0.
15295 * src/main.c (main): Likewise.
15296 * src/getargs.c (getargs): Likewise.
15297 * src/reader.c (reader): Likewise.
15298
15299 * src/getarg.c (getargs): Remove duplicate code for
15300 "Try `bison --help'".
15301
15302 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15303 What was that "2" for?
15304
15305 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15306 * src/getargs.c (usage): Likewise.
15307
15308 * src/getargs.c (getargs): When there are too few operands, report
15309 the last one. When there are too many, report the first extra
15310 one. This is how diffutils does it.
15311
92a060fd
PE
153122002-10-20 Paul Eggert <eggert@twinsun.com>
15313
15314 Remove K&R vestiges.
15315 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
15316 * src/complain.c (VA_START): Remove. Assume prototypes.
15317 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
15318 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
15319 fatal): Assume prototypes.
15320 * src/complain.h: Assume prototypes.
15321 * src/system.h (PARAMS): Remove.
15322 Include <limits.h> unconditionally, since it's guaranteeed even
15323 for a freestanding C89 compiler.
15324 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
15325 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 15326
e7cb57c0
AD
153272002-10-20 Akim Demaille <akim@epita.fr>
15328
15329 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
15330 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
15331 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
15332 (yyresolveStates, yyresolveAction, yyresolveStack)
15333 (yyprocessOneStack): Use them.
15334 (yy_reduce_print): New.
15335 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
15336
0245f82d
AD
153372002-10-20 Akim Demaille <akim@epita.fr>
15338
15339 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
15340 arguments and output `void'.
15341 (b4_c_function): Rename as...
15342 (b4_c_function_def): this.
15343 (b4_c_function_decl, b4_c_ansi_function_def)
15344 (b4_c_ansi_function_decl): New.
15345 Change the interpretation of the arguments: before `int, foo', now
15346 `int foo, foo'.
15347 * data/yacc.c (yyparse): Prototype and define thanks to these.
15348 Adjust b4_c_function_def uses.
15349 * data/glr.c (yyparse): Likewise, but ANSI only.
15350
39912f52
AD
153512002-10-20 Akim Demaille <akim@epita.fr>
15352
15353 * src/output.c (prepare): Move the definition of `tokens_number',
15354 `nterms_number', `undef_token_number', `user_token_number_max'
15355 to...
15356 (prepare_tokens): Here.
15357 (prepare_tokens): Rename as...
15358 (prepare_symbols): this.
15359 (prepare): Move the definition of `rules_number' to...
15360 (prepare_rules): here.
15361 (prepare): Move the definition of `last', `final_state_number',
15362 `states_number' to...
15363 (prepare_states): here.
15364 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
15365
20c1e2ad
AD
153662002-10-20 Akim Demaille <akim@epita.fr>
15367
15368 * src/tables.h, src/tables.c, src/output.c: Comment changes.
15369
21964f43
AD
153702002-10-20 Akim Demaille <akim@epita.fr>
15371
15372 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
15373 * data/c.m4: here.
15374
66d30cd4
AD
153752002-10-20 Akim Demaille <akim@epita.fr>
15376
15377 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
15378 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
15379 `pair'.
15380 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
15381 `name' to...
15382 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
15383 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
15384 These.
15385
95f2c9fe
PE
153862002-10-19 Paul Eggert <eggert@twinsun.com>
15387
15388 Do not create a temporary file, as that involves security and
15389 cleanup headaches. Instead, use a pair of pipes.
15390 Derived from a suggestion by Florian Krohm.
15391 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
15392 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
15393 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
15394 (BISON_PREREQ_SUBPIPE): Add.
15395 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
15396 Add subpipe.h, subpipe.c.
15397 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
15398 * po/POTFILES.in: Add lib/subpipe.c.
15399 * src/output.c: Include "subpipe.h".
15400 (m4_invoke): Remove decl.
15401 (scan_skel): New decl.
15402 (output_skeleton): Use pipe rather than temporary file for m4 input.
15403 Check that m4sugar.m4 is readable, to avoid deadlock.
15404 Check for pipe I/O error.
15405 * src/scan-skel.l (readpipe): Remove decl.
15406 (scan_skel): New function, to be used in place of m4_invoke.
15407 Read from stream rather than file.
66d30cd4 15408
95f2c9fe
PE
15409 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
15410 float, as this generates a warning on Solaris 8 + GCC 3.2 with
15411 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
15412 this generates a more-accurate value anyway.
15413
15414 * lib/timevar.c (timervar_accumulate): Rename locals to
15415 avoid confusion with similarly-named more-global.
15416 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
15417
15418 * src/output.c (prepare): Use xstrdup to convert char const *
15419 to char *, to avoid GCC warning.
15420
c19988b7
AD
154212002-10-19 Akim Demaille <akim@epita.fr>
15422
15423 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
15424 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
15425 Use them to have `calc.y' ready for %pure-parser.
15426 * data/yacc.c (YYLEX): Pass a yylex return type to
15427 b4_c_function_call.
15428
ae7453f2
AD
154292002-10-19 Akim Demaille <akim@epita.fr>
15430
15431 Prototype support of %lex-param and %parse-param.
15432
15433 * src/parse-gram.y: Add the definition of the %lex-param and
15434 %parse-param tokens, plus their rules.
15435 Drop the `_' version of %glr-parser.
15436 Add the "," token.
15437 * src/scan-gram.l (INITIAL): Scan them.
15438 * src/muscle_tab.c: Comment changes.
15439 (muscle_insert, muscle_find): Rename `pair' as `probe'.
15440 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
15441 (muscle_entry_s): The `value' member is no longer const.
15442 Adjust all dependencies.
15443 * src/muscle_tab.c (muscle_init): Adjust: use
15444 MUSCLE_INSERT_STRING.
15445 Initialize the obstack earlier.
15446 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
15447 (muscle_pair_list_grow): New.
15448 * data/c.m4 (b4_c_function_call, b4_c_args): New.
15449 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
15450 * tests/calc.at: Use %locations, not --locations.
15451 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
15452
0e575721
AD
154532002-10-19 Akim Demaille <akim@epita.fr>
15454
15455 * src/getargs.c (usage): Take status as argument and exit
15456 accordingly.
15457 Report the traditional `Try ... --help' message when status != 0.
15458 (usage, version): Don't take a FILE * as arg, it is pointless.
15459 (getargs): When there is an incorrect number of arguments, make it
15460 an error, and report it GNUlically thanks to `usage ()'.
15461
724ce7f5
PE
154622002-10-18 Paul Eggert <eggert@twinsun.com>
15463
3a781eb2
PE
15464 * data/glr.c (yyreportParseError): Don't assume that sprintf
15465 yields the length of the printed string, as this is not true
15466 on SunOS 4.1.4. Reported by Peter Klein.
15467
724ce7f5
PE
15468 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15469 * tests/conflicts.at (%nonassoc and eof): Likewise.
15470 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15471
473d0a75
AD
154722002-10-17 Akim Demaille <akim@epita.fr>
15473
15474 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15475 * src/getargs.c (trace_types, trace_args): Adjust.
15476 * src/reader.c (grammar_current_rule_prec_set)
15477 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15478 Standardize error messages.
15479 And s/@prec/%prec/!
15480 (reader): Use trace_flag to enable scanner/parser debugging,
15481 instead of an adhoc scheme.
15482 * src/scan-gram.l: Remove trailing debugging code.
15483
e76d2469
PE
154842002-10-16 Paul Eggert <eggert@twinsun.com>
15485
93e2236a
PE
15486 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15487 MUSCLE_TAB_H.
15488
e76d2469
PE
15489 * NEWS: Officially drop support for building Bison with K&R C,
15490 since it didn't work anyway and it's not worth worrying about.
15491 * Makefile.maint (wget_files): Remove ansi2knr.c.
15492 (ansi2knr.c-url_prefix): Remove.
15493 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15494 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15495 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15496
5bd1c419
PE
154972002-10-15 Paul Eggert <eggert@twinsun.com>
15498
15499 Stop using the "enum_" trick for K&R-style function definitions;
15500 it confused me, and I was the author! Instead, assume that people
15501 who want to use K&R C compilers (when using these modules in GCC,
15502 perhaps?) will run ansi2knr.
15503
15504 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15505 All uses of "enum_" changed to "enum ".
15506 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15507 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 15508
5bd1c419
PE
15509 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15510 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15511 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15512 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15513 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15514 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15515 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15516 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15517 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15518 Use function prototypes; this removes the need for declaring
15519 static functions simply to provide their prototypes.
15520 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15521 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15522 bitset_count_, bitset_create, bitset_dump, bitset_first,
15523 bitset_free, bitset_init, bitset_last, bitset_next,
15524 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15525 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15526 bitset_print, bitset_release_memory, bitset_toggle_,
15527 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15528 debug_bitset): Likewise.
15529 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15530 * lib/bitset_stats.c (bitset_log_histogram_print,
15531 bitset_percent_histogram_print, bitset_stats_and,
15532 bitset_stats_and_cmp, bitset_stats_and_or,
15533 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15534 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15535 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15536 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15537 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15538 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15539 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15540 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15541 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15542 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15543 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15544 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15545 bitset_stats_zero): Likewise.
15546 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15547 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15548 bitsetv_dump, debug_bitsetv): Likewise.
15549 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15550 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15551 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15552 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15553 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15554 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15555 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15556 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15557 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15558 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15559 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15560 Likewise.
15561 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15562 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15563 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15564 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15565 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15566 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15567 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15568 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15569 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15570 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15571 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 15572
ae26e1f0
AD
155732002-10-14 Akim Demaille <akim@epita.fr>
15574
15575 Version 1.75.
15576
d43baf71
AD
155772002-10-14 Akim Demaille <akim@epita.fr>
15578
15579 * tests/Makefile.am (maintainer-check-posix): New.
15580
7ebc83e3
AD
155812002-10-14 Akim Demaille <akim@epita.fr>
15582
15583 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15584 member.
15585
05846dae
AD
155862002-10-14 Akim Demaille <akim@epita.fr>
15587
15588 * src/tables.c (table_ninf_remap): base -> tab.
15589 Reported by Matt Rosing.
15590
1318e37d
PE
155912002-10-14 Paul Eggert <eggert@twinsun.com>
15592
447fbb17
PE
15593 * tests/action.at, tests/calc.at, tests/conflicts.at,
15594 tests/cxx-type.at, tests/headers.at, tests/input.at,
15595 tests/regression.at, tests/synclines.at, tests/torture.at:
15596 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15597 so that the tests still work even if POSIXLY_CORRECT is set.
15598 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 15599
1318e37d
PE
15600 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15601 for portability to K&R hosts. Fix typo: signed char is guaranteed
15602 only to 127, not to 128.
15603 * data/glr.c (yysigned_char): New type.
15604 * data/yacc.c (yysigned_char): Likewise.
15605 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15606
cc0f0794
PE
156072002-10-13 Paul Eggert <eggert@twinsun.com>
15608
5038f418
PE
15609 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15610 true due to limited range of data type" warning from GCC.
15611
cc0f0794
PE
15612 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15613 by wrapping enum yytokentype's definition inside #ifndef
15614 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15615
6fed0802
AD
156162002-10-13 Akim Demaille <akim@epita.fr>
15617
15618 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15619 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15620
32f0598d
AD
156212002-10-13 Akim Demaille <akim@epita.fr>
15622
15623 * Makefile.maint: Update from Autoconf 2.54.
15624 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15625
7ea9a33f
AD
156262002-10-13 Akim Demaille <akim@epita.fr>
15627
15628 * src/print.c (print_state): Separate the list of solved conflicts
15629 from the other items.
15630 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15631
ea99527d
AD
156322002-10-13 Akim Demaille <akim@epita.fr>
15633
15634 Let nondeterministic skeletons be usable with deterministic
15635 tables.
15636
15637 With the patch, GAWK compiled by GCC without -O2 passes its test
15638 suite using a GLR parser driven by LALR tables. It fails with -O2
15639 because `struct stat' gives two different answers on my machine:
15640 88 (definition of an auto var) and later 96 (memset on this var).
15641 Hence the stack is badly corrumpted. The headers inclusion is to
15642 blame: if I move the awk.h inclusion before GLR's system header
15643 inclusion, the two struct stat have the same size.
15644
15645 * src/tables.c (pack_table): Always create conflict_table.
15646 (token_actions): Always create conflict_list.
15647 * data/glr.c (YYFLAG): Remove, unused.
15648
f377f69f
AD
156492002-10-13 Akim Demaille <akim@epita.fr>
15650
15651 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15652 (O0FLAGS): New.
15653 (VALGRIND, GXX): New.
15654 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15655 * tests/bison.in: Run $PREBISON a pre-command.
15656 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15657 (maintainer-check-g++): New.
15658 * Makefile.am (maintainer-check): New.
15659
2a1fe6ed
AD
156602002-10-13 Akim Demaille <akim@epita.fr>
15661
15662 * data/glr.c: Formatting changes.
15663 Tweak some trace messages to match yacc.c's.
15664
f50adbbd
AD
156652002-10-13 Akim Demaille <akim@epita.fr>
15666
15667 GLR parsers sometimes raise parse errors instead of performing the
15668 default reduction.
15669 Reported by Charles-Henry de Boysson.
15670
15671 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 15672 check the length of the traces when %glr.
f50adbbd
AD
15673 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15674 GLR's traces.
15675 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15676 Test GLR parsers.
15677 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15678 (yyltype): Remove the yy prefix from the member names.
15679 (yytable): Complete its comment.
15680 (yygetLRActions): Map error action number from YYTABLE from
15681 YYTABLE_NINF to 0.
15682 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15683 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15684 not satisfying as we could compare an YYACTION computed from
15685 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15686 only value for error actions.
15687 (yyreportParseError): In verbose parse error messages, don't issue
15688 `error' in the list of expected tokens.
15689 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15690 next action to perform to match glr.c's decoding.
15691 (yytable): Complete its comment.
15692
bcbad5b9
PE
156932002-10-13 Paul Eggert <eggert@twinsun.com>
15694
15695 Fix problem reported by Henrik Grubbstroem in
161a71f3 15696 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
15697 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15698 because the Bison parser reads the second action before reducing
15699 the first one.
15700 * src/scan-gram.l (rule_length): New static var.
15701 Use it to keep track of the rule length in the scanner, since
15702 we can't expect the parser to be in lock-step sync with the scanner.
15703 (handle_action_dollar, handle_action_at): Use this var.
15704 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 15705
14904b89
PE
157062002-10-12 Paul Eggert <eggert@twinsun.com>
15707
1fe611e5
PE
15708 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15709 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15710 Include <sys/time.h> when checking for clock_t and struct tms.
15711 Use same include order as source.
15712 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 15713 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 15714
1fe611e5
PE
15715 * lib/timevar.c: Update copyright date and clarify comments.
15716 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 15717
1fe611e5
PE
15718 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15719 GCC version as of today, then merge Bison's changes.
15720 Change "GCC" to "Bison" in copyright notice. timevar.def's
15721 author is Akim, so change that too.
15722
98194095
PE
15723 * src/reader.c (grammar_current_rule_check):
15724 Don't worry about the default action if $$ is untyped.
15725 Prevents bogus warnings reported by Jim Gifford in
161a71f3 15726 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 15727
14904b89
PE
15728 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15729 * data/glr.c, data/lalr1.cc, data/yacc.c:
15730 Output token definitions before the first part of user declarations.
15731 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 15732 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 15733
ff6dca18
PE
157342002-10-11 Paul Eggert <eggert@twinsun.com>
15735
15736 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15737 (yyparse): here. This undoes some of the 2002-07-25 change.
15738 Compatibility problem reported by Ralf S. Engelschall with
15739 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15740
eb714592
AD
157412002-10-11 Akim Demaille <akim@epita.fr>
15742
15743 * tests/regression.at Characters Escapes): New.
15744 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15745 characters.
15746 Reported by Jan Nieuwenhuizen.
15747
b7195100
AD
157482002-10-11 Akim Demaille <akim@epita.fr>
15749
15750 * po/id.po: New.
15751
f28a0f2d
PE
157522002-10-10 Paul Eggert <eggert@twinsun.com>
15753
15754 Portability fixes for bitsets; this also avoids several GCC
15755 warnings.
15756
15757 * lib/abitset.c: Include <stddef.h>, for offsetof.
15758 * lib/lbitset.c: Likewise.
15759
15760 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15761 properly for vectors of objects. Do not assume that adding a
15762 header size to a multiple of a word size yields a value that is
15763 properly aligned for the whole union.
15764 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15765
15766 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15767 unique names for structures.
15768 * lib/ebitset.c (ebitset_bytes): Likewise.
15769 * lib/lbitset.c (lbitset_bytes): Likewise.
15770
15771 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15772 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15773 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15774 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15775 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15776 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15777 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15778 to improve the type-checking that GCC can do.
15779 * lib/bitset.c (bitset_op4_cmp): Likewise.
15780 * lib/bitset_stats.c (bitset_stats_count,
15781 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15782 bitset_stats_copy, bitset_stats_disjoint_p,
15783 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15784 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15785 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15786 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15787 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15788 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15789 bitset_stats_or_and_cmp): Likewise.
15790 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15791 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15792 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15793 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15794
15795 * lib/abitset.h: Include bitset.h, not bbitset.h.
15796 * lib/ebitset.h: Likewise.
15797 * lib/lbitset.h: Likewise.
15798
15799 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15800 All instances of parameters of type enum bitset_opts are now of
15801 type enum_bitset_opts, to conform to the C Standard, and similarly
15802 for enum_bitset_type.
15803 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15804 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15805
15806 Do not use "struct bitset_struct" to mean different things in
15807 different modules. Not only is this confusing, it violates
15808 the C Standard, which requires that structure types in different
15809 modules must be compatible if one is to be passed to the other.
15810 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15811 All instances of "struct bitset_struct *" replaced with "bitset".
15812 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15813 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15814 struct lbitset_struct, struct bitset_stats_struct): New types.
15815 All uses of struct bitset_struct changed to union bitset_union,
15816 etc.
ba0fe3c7 15817 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
15818 struct bitset_struct): Remove.
15819 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15820 struct bitset_struct): Remove.
15821 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15822 bitset_struct): Remove.
15823 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15824 Likewise.
15825
15826 Do not call a function of type T using a call that assumes the
15827 function is of a different type U. Standard C requires that a
15828 function must be called with a type that is compatible with its
15829 definition.
15830 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15831 New decls.
15832 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15833 New functions.
15834 * lib/ebitset.c (PFV): Remove.
15835 * lib/lbitset.c (PFV): Likewise.
15836 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15837 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15838 decls.
15839 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15840 (ebitset_vtable): Use them.
15841 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15842 lbitset_xor): New functions.
15843 (lbitset_vtable): Use them.
15844
15845 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15846 Declare.
15847
15848 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15849 GCC warning.
15850 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15851 Use offsetof, for simplicity.
15852
6fbe4984
PE
158532002-10-06 Paul Eggert <eggert@twinsun.com>
15854
15855 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15856 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 15857 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
15858 which was inadvertently undone by the 2002-09-30 patch.
15859 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15860 the same width as int.
15861
420f93c8
PE
158622002-10-04 Paul Eggert <eggert@twinsun.com>
15863
15864 Version 1.50.
15865
15866 * configure.ac (AC_INIT), NEWS: Increment version number.
15867
15868 * doc/bison.texinfo: Minor spelling, grammar, and white space
15869 fixes.
15870 (Symbols): Mention that any negative value returned from yylex
15871 signifies end-of-input. Warn about negative chars. Mention
15872 the portable Standard C character set.
15873
15874 The GNU coding standard says CFLAGS and YFLAGS are reserved
15875 for the installer to set.
15876 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15877 * src/Makefile.am (AM_CFLAGS): Likewise.
15878 (AM_YFLAGS): Renamed from YFLAGS.
15879
15880 Fix some MAX and MIN problems.
15881 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15882 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15883 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15884 * src/reader.c (reader): Use it.
15885
15886 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15887 POSIX 1003.1-2001 has removed fgrep.
15888
158892002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15890
15891 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15892 interpreted as signed.
15893 * lib/ebitset.c (ebitset_list): Fix bug.
15894
ff68026d
PE
158952002-10-01 Paul Eggert <eggert@twinsun.com>
15896
15897 More fixes for 64-bit hosts and large bitsets.
15898
15899 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15900 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15901 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15902 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15903 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15904 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15905 bitset_count_): Likewise.
15906 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15907 bitset_first, bitset_last): Likewise.
15908 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15909 bitset_stats_list_reverse, bitset_stats_size,
15910 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15911 Likewise.
15912 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15913 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15914 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15915 bitsetv_reflexive_transitive_closure): Likewise.
15916 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
15917 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
15918 Likewise.
15919 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
15920 Likewise.
420f93c8 15921
ff68026d
PE
15922 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
15923 Use size_t, not unsigned int, to count bytes.
15924 * lib/abitset.h (abitset_bytes): Likewise.
15925 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
15926 Likewise.
15927 * lib/bitset.h (bitset_bytes): Likewise.
15928 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
15929 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
15930 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15931 * lib/ebitset.c (ebitset_bytes): Likewise.
15932 * lib/ebitset.h (ebitset_bytes): Likewise.
15933 * lib/lbitset.c (lbitset_bytes): Likewise.
15934 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 15935
ff68026d
PE
15936 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
15937 abitset_subset_p, abitset_disjoint_p, abitset_and,
15938 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
15939 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
15940 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
15941 abitset_or_and, abitset_or_and_cmp):
15942 Use bitset_windex instead of unsigned int.
15943 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15944 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
15945 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
15946 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
15947 Likewise.
15948 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 15949
ff68026d
PE
15950 * lib/bitset.c (bitset_print):
15951 Use proper printf formats for widths of integer types.
15952 * lib/bitset_stats.c (bitset_percent_histogram_print,
15953 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
15954 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
15955 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
15956 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 15957
ff68026d
PE
15958 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
15959 BITSET_SIZE_MAX): New macros.
15960 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
15961 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
15962 to BITSET_WINDEX_MAX.
15963
15964 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
15965 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
15966 since we now return the bitset_bindex type (not int).
15967
15968 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
15969 when computing sizes.
15970 * lib/ebitset.c (ebitset_elts_grow): Likewise.
15971
15972 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
15973 and avoid cast to unsigned.
15974
6aa452a6
AD
159752002-09-30 Akim Demaille <akim@epita.fr>
15976
15977 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
15978 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
15979 Updates from Michael Hayes.
15980
927f7817
AD
159812002-09-30 Art Haas <ahaas@neosoft.com>
15982
15983 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
15984 invocations.
15985 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
15986 defined.
15987
9738f41e
AD
159882002-09-27 Akim Demaille <akim@epita.fr>
15989
15990 Version 1.49c.
15991
a5c75d7f
AD
159922002-09-27 Akim Demaille <akim@epita.fr>
15993
15994 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
15995 (Because of AC_LIBSOURCE).
15996
8280e179
AD
159972002-09-27 Akim Demaille <akim@epita.fr>
15998
15999 Playing with Autoscan.
16000
16001 * configure.ac: Remove the old LIBOBJ tweaks.
16002 (AC_REPLACE_FUNCS): Add strrchr and strtol.
16003 * lib/strrchr.c: New.
16004 * lib/strtol.c: New, from the Coreutils 4.5.1.
16005
ae64af35
AD
160062002-09-27 Akim Demaille <akim@epita.fr>
16007
16008 Playing with Autoscan.
16009
16010 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
16011 * lib/Makefile.am (libbison_a_SOURCES): No longer include
16012 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
16013 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
16014 Coreutils 4.5.1.
16015
d1a1114f
AD
160162002-09-24 Akim Demaille <akim@epita.fr>
16017
16018 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
16019 (Frequently Asked Questions, Parser Stack Overflow): New.
16020
b906441c
AD
160212002-09-13 Akim Demaille <akim@epita.fr>
16022
16023 Playing with autoscan.
16024
16025 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
16026 * src/files.c (skeleton_find): Remove, unused.
16027 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
16028 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
16029
bd701811
AD
160302002-09-13 Akim Demaille <akim@epita.fr>
16031
16032 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
16033 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
16034
e0a13e7b
AD
160352002-09-13 Akim Demaille <akim@epita.fr>
16036
16037 * configure.ac: Require 2.54.
16038 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
16039 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
16040 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
16041 Remove, provided by Autoconf macros.
16042
c97011bf
AD
160432002-09-12 Akim Demaille <akim@epita.fr>
16044
16045 * m4/prereq.m4: Update, from Coreutils 4.5.1.
16046
d862b1be
AD
160472002-09-12 Akim Demaille <akim@epita.fr>
16048
16049 * m4/prereq.m4: Update, from Fileutils 4.1.5.
16050 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
16051 Reported by Martin Mokrejs.
16052
3d38c03a
AD
160532002-09-10 Akim Demaille <akim@epita.fr>
16054
16055 * src/parse-gram.y: Associate a human readable string to each
16056 token type.
16057 * tests/regression.at (Invalid inputs): Adjust.
16058
b6347355
AD
160592002-09-10 Gary V. Vaughan <gary@gnu.org>
16060
16061 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
16062 with an Autoconf-2.5x style configure.ac.
16063
09ba4ab2
PE
160642002-09-06 Paul Eggert <eggert@twinsun.com>
16065
16066 * doc/bison.texinfo (Conditions): Make explicit that the GPL
16067 exception applies only to yacc.c. This is a modification of a
16068 patch originally suggested by Akim Demaille.
16069
21846f69
AD
160702002-09-06 Akim Demaille <akim@epita.fr>
16071
09ba4ab2
PE
16072 * data/c.m4 (b4_copyright): Move the GPL exception comment from
16073 here to...
16074 * data/yacc.c: here.
16075
21846f69
AD
16076 * data/lalr1.cc (struct yyltype): Don't define it, since we use
16077 LocationType.
16078 (b4_ltype): Default to yy::Location from location.hh.
16079
c0ad8bf3
AD
160802002-09-04 Jim Meyering <jim@meyering.net>
16081
16082 * data/yacc.c: Guard the declaration of yytoknum also with
16083 `#ifdef YYPRINT', so it is declared only when used.
16084
3a93251e
AD
160852002-09-04 Akim Demaille <akim@epita.fr>
16086
16087 * configure.in: Rename as...
16088 * configure.ac: this.
16089 Bump to 1.49c.
16090
427c0dda
AD
160912002-09-04 Akim Demaille <akim@epita.fr>
16092
16093 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
16094 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
16095 translate maintainer only messages.
16096
6a254321
PE
160972002-08-12 Paul Eggert <eggert@twinsun.com>
16098
645e30d1
PE
16099 Version 1.49b.
16100
6a254321
PE
16101 * Makefile.am (SUBDIRS): Remove intl.
16102 (DISTCLEANFILES): Remove.
16103 * NEWS: Mention that GNU M4 is now required. Clarify what is
16104 meant by "larger grammars". Mention the pt_BR translation.
16105 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
16106 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
16107 Bump version from 0.11.2 to 0.11.5.
16108 (BISON_PREREQ_STAGE): Remove.
16109 (AM_GNU_GETTEXT): Use external gettext.
16110 (AC_OUTPUT): Remove intl/Makefile.
16111
16112 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
16113
16114 * data/glr.c: Include string.h, for strlen.
16115 (yyreportParseError): Use size_t for yysize.
16116 (yy_yypstack): No longer nested inside yypstates, as nested
16117 functions are not portable. Do not assume size_t is the
16118 same width as int.
16119 (yypstates): Do not assume that ptrdiff_t is the same width
16120 as int, and similarly for yyposn and YYINDEX.
16121
16122 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
16123
16124 * lib/Makefile.am (INCLUDES): Do not include from the intl
16125 directory, which has been removed.
16126 * src/Makefile.am (INCLUDES): Likewise.
16127
16128 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
16129 (bitsets_sources, additional_bitsets_sources, timevars_sources):
16130 New vars.
16131
16132 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
16133 * tests/Makefile.am (EXTRA_DIST): Likewise.
16134
16135 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
16136 Do not assume that bitset_windex is the same width as unsigned.
16137
16138 * lib/abitset.c (abitset_unused_clear): Do not assume that
16139 bitset_word is the same width as int.
16140 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
16141 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
16142 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
16143 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
16144 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
16145
16146 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
16147 portability to one's complement hosts!).
16148 * lib/ebitset.c (ebitset_op1): Likewise.
16149 * lib/lbitset.c (lbitset_op1): Likewise.
16150
16151 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
16152 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
16153 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
16154 Sync with fileutils.
16155 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
16156 lib/gettext.h: Sync with diffutils.
16157
16158 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
16159 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
16160
16161 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
16162 PROTOTYPES to check for prototypes, and "defined __STDC__" to
16163 check for void *.
16164
16165 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
16166 size_t; the old version tried to do this but casted improperly.
16167 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
16168 (bitset_test): Now returns int, not unsigned long.
16169
16170 * lib/bitset_stats.c: Include "gettext.h".
16171 (_): New macro.
16172 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
16173 name locals "index", as it generates unnecessary warnings on some
16174 hosts that have an "index" function.
16175
16176 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
16177 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
16178 they need translation.
16179 * src/LR0.c (state_list_append, new_itemsets, get_state,
16180 append_states, generate_states): Likewise.
16181 * src/assoc.c (assoc_to_string): Likewise.
16182 * src/closure.c (print_closure, set_firsts, closure): Likewise.
16183 * src/gram.c (grammar_dump): Likewise.
16184 * src/injections.c (injections_compute): Likewise.
16185 * src/lalr.c (lookaheads_print): Likewise.
16186 * src/relation.c (relation_transpose): Likewise.
16187 * src/scan-gram.l: Likewise.
16188 * src/tables.c (table_grow, pack_vector): Likewise.
16189
16190 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
16191 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
16192 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
16193 * m4/mbstate_t.m4: Sync with fileutils.
16194 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
16195
16196 * po/LINGUAS: Add pt_BR.
16197 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
16198 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
16199 lib/timevar.c.
16200 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
16201 manual recommends.
16202 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
16203
16204 * src/complain.c (strerror_r): Remove decl; not needed.
16205 (strerror): Use same pattern as ../lib/error.c.
16206
16207 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
16208
16209 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
16210
16211 * src/main.c (main): Cast result of bindtextdomain and textdomain
16212 to void, to avoid a GCC warning when --disable-nls is in effect.
16213
16214 * src/scan-gram.l: Use strings rather than escapes when possible,
16215 to minimize the number of warnings from xgettext.
16216 (handle_action_dollar, handle_action_at): Don't use isdigit,
16217 as it mishandles negative chars and it may not work as expected
16218 outside the C locale.
16219
16220 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
16221 this is a GCC extension and is not portable to other compilers.
16222
16223 * src/system.h (alloca): Use same pattern as ../lib/error.c.
16224 Do not include <ctype.h>; no longer needed.
16225 Do not include <malloc.h>; no longer needed (and generates
16226 warnings on OpenBSD 3.0).
16227
16228 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
16229 it's not portable.
16230
16231 * tests/regression.at: Do not use 'cc -c input.c -o input';
16232 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16233
16234 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16235 exit status as failure, not just exit status 1. Sun C exits
16236 with status 2 sometimes.
16237
16238 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16239 Use it for the two large tests.
16240
c8f002c7
AD
162412002-08-02 Akim Demaille <akim@epita.fr>
16242
16243 * src/conflicts.c (conflicts_output): Don't output rules never
16244 reduced here, since anyway that computation doesn't work.
16245 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16246 (rule_useless_p, rule_never_reduced_p): New.
16247 (grammar_rules_partial_print): Use a filter instead of a range.
16248 Display the title only if needed.
16249 (grammar_rules_print): Adjust.
16250 (grammar_rules_never_reduced_report): New.
16251 * src/tables.c (action_row): Move the computation of rules never
16252 reduced to...
16253 (token_actions): here.
16254 * src/main.c (main): Make the parser before making the report, so
16255 that rules never reduced are computed.
16256 Call grammar_rules_never_reduced_report.
16257 * src/print.c (print_results): Report rules never reduced.
16258 * tests/conflicts.at, tests/reduce.at: Adjust.
16259
cd08e51e
AD
162602002-08-01 Akim Demaille <akim@epita.fr>
16261
16262 Instead of attaching lookaheads and duplicating the rules being
16263 reduced by a state, attach the lookaheads to the reductions.
16264
16265 * src/state.h (state_t): Remove the `lookaheads',
16266 `lookaheads_rule' member.
16267 (reductions_t): Add a `lookaheads' member.
16268 Use a regular array for the `rules'.
16269 * src/state.c (reductions_new): Initialize the lookaheads member
16270 to 0.
16271 (state_rule_lookaheads_print): Adjust.
16272 * src/state.h, src/state.c (state_reductions_find): New.
16273 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16274 (count_rr_conflicts): Adjust.
16275 * src/lalr.c (LArule): Remove.
16276 (add_lookback_edge): Adjust.
16277 (state_lookaheads_count): New.
16278 (states_lookaheads_initialize): Merge into...
16279 (initialize_LA): this.
16280 (lalr_free): Adjust.
16281 * src/main.c (main): Don't free nullable and derives too early: it
16282 is used by --verbose.
16283 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16284
bb0027a9
AD
162852002-08-01 Akim Demaille <akim@epita.fr>
16286
16287 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16288 `rule_number_t**'.
16289 (set_derives, free_derives): Rename as...
16290 (derives_compute, derives_free): this.
16291 Adjust all dependencies.
16292 * src/nullable.c (set_nullable, free_nullable): Rename as...
16293 (nullable_compute, nullable_free): these.
16294 (rule_list_t): Store rule_t *, not rule_number_t.
16295 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16296 pointers, instead of their numbers.
16297 * src/main.c (main): Call nullable_free, and derives_free earlier,
16298 as they were lo longer used.
16299
3325ddc4
AD
163002002-08-01 Akim Demaille <akim@epita.fr>
16301
16302 * lib/timevar.c (get_time): Include children time.
16303 * src/lalr.h (LA, LArule): Don't export them: used with the
16304 state_t.
16305 * src/lalr.c (LA, LArule): Static.
16306 * src/lalr.h, src/lalr.c (lalr_free): New.
16307 * src/main.c (main): Call it.
16308 * src/tables.c (pack_vector): Check whether loc is >= to the
16309 table_size, not >.
16310 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16311 (tables_generate): do it, since that's also it which allocates
16312 them.
16313 Don't free LA and LArule, main does.
16314
c6f1a33c
AD
163152002-07-31 Akim Demaille <akim@epita.fr>
16316
16317 Separate parser tables computation and output.
16318
16319 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
16320 (conflict_list, conflict_list_cnt, table, check, table_ninf)
16321 (yydefgoto, yydefact, high): Move to...
16322 * src/tables.h, src/tables.c: here.
16323 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16324 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16325 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
16326 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
16327 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
16328 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
16329 (action_row, save_row, token_actions, save_column, default_goto)
16330 (goto_actions, sort_actions, matching_state, pack_vector)
16331 (table_ninf_remap, pack_table, prepare_actions): Move to...
16332 * src/tables.c: here.
16333 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
16334 * src/output.c (token_actions, output_base, output_conflicts)
16335 (output_check): Merge into...
16336 (prepare_actions): this.
16337 (actions_output): Rename as...
16338 (user_actions_output): this.
16339 * src/main.c (main): Call tables_generate and tables_free.
16340
1509d42f
AD
163412002-07-31 Akim Demaille <akim@epita.fr>
16342
16343 Steal GCC's --time-report support.
16344
16345 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
16346 stolen/adjusted from GCC.
16347 * m4/stage.m4: Remove time related checks.
16348 * m4/timevar.m4: New.
16349 * configure.in: Adjust.
16350 * src/system.h: Adjust to using timevar.h.
16351 * src/getargs.h, src/getargs.c: Support trace_time for
16352 --trace=time.
16353 * src/main.c (stage): Remove.
16354 (main): Replace `stage' invocations with timevar calls.
16355 * src/output.c: Insert pertinent timevar calls.
16356
273a74fa
AD
163572002-07-31 Akim Demaille <akim@epita.fr>
16358
16359 Let --trace have arguments.
16360
16361 * src/getargs.h (enum trace_e): New.
16362 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
16363 (long_options, short_options): --trace/-T takes an optional
16364 argument.
16365 Change all the uses of trace_flag to reflect the new flags.
16366 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
16367
16368 Strengthen `stage' portability.
16369
16370 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
16371 * configure.in: Use it.
16372 Don't check for malloc.h and sys/times.h.
16373 * src/system.h: Include them when appropriate.
16374 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
16375 times and struct tms are available.
16376
217598da
AD
163772002-07-30 Akim Demaille <akim@epita.fr>
16378
16379 In verbose parse error message, don't report `error' as an
16380 expected token.
16381 * tests/actions.at (Printers and Destructors): Adjust.
16382 * tests/calc.at (Calculator $1): Adjust.
16383 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
16384 error message, do not report the parser accepts the error token in
16385 that state.
16386
52489d44
AD
163872002-07-30 Akim Demaille <akim@epita.fr>
16388
16389 Normalize conflict related messages.
16390
16391 * src/complain.h, src/complain.c (warn, complain): New.
16392 * src/conflicts.c (conflicts_print): Use them.
16393 (conflict_report_yacc): New, extracted from...
16394 (conflicts_print): here.
16395 * tests/conflicts.at, tests/existing.at: Adjust.
16396
e8832397
AD
163972002-07-30 Akim Demaille <akim@epita.fr>
16398
16399 Report rules which are never reduced by the parser: those hidden
16400 by conflicts.
16401
16402 * src/LR0.c (save_reductions): Don't make the final state too
16403 different: save its reduction (accept) instead of having a state
16404 without any action (no shift or goto, no reduce).
16405 Note: the final state is now a ``regular'' state, i.e., the
16406 parsers now contain `reduce 0' as default reduction.
16407 Nevertheless, since they decide to `accept' when yystate =
16408 final_state, they still will not reduce rule 0.
16409 * src/print.c (print_actions, print_reduction): Adjust.
16410 * src/output.c (action_row): Track reduced rules.
16411 (token_actions): Report rules never reduced.
16412 * tests/conflicts.at, tests/regression.at: Adjust.
16413
caf23d24
AD
164142002-07-30 Akim Demaille <akim@epita.fr>
16415
16416 `stage' was accidently included in a previous patch.
16417 Initiate its autoconfiscation.
16418
16419 * configure.in: Look for malloc.h and sys/times.h.
16420 * src/main.c (stage): Adjust.
16421 Report only when trace_flag.
16422
640748ee
AD
164232002-07-29 Akim Demaille <akim@epita.fr>
16424
16425 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
16426 state_number_t.
16427 (errs_t): symbol_t*, not symbol_number_t.
16428 (reductions_t): rule_t*, not rule_number_t.
16429 (FOR_EACH_SHIFT): New.
16430 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
16431 * src/print.c, src/print_graph.c: Adjust.
16432
88bce5a2
AD
164332002-07-29 Akim Demaille <akim@epita.fr>
16434
16435 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
16436
16437 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
16438 (endtoken, accept): these.
16439 * src/reader.c (reader): Set endtoken's default tag to "$end".
16440 Set undeftoken's tag to "$undefined" instead of "$undefined.".
16441 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
16442 Adjust.
16443
1bfb97db
AD
164442002-07-29 Akim Demaille <akim@epita.fr>
16445
16446 * src/reduce.c (reduce_grammar): When the language is empty,
16447 complain about the start symbol, not the axiom.
16448 Use its location.
16449 * tests/reduce.at (Empty Language): New.
16450
fc5734fe
AD
164512002-07-26 Akim Demaille <akim@epita.fr>
16452
16453 * src/reader.h, src/reader.c (gram_error): ... can't get
16454 yycontrol without making too strong assumptions on the parser
16455 itself.
16456 * src/output.c (prepare_tokens): Use the real 0th value of
16457 token_translations instead of `0'.
16458 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
16459 visible here.
16460 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
16461 for the time being: %locations ought to provide it to yyerror.
16462
3650b4b8
AD
164632002-07-25 Akim Demaille <akim@epita.fr>
16464
16465 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16466 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16467 * tests/regression.at (Web2c Actions): Adjust.
16468
4b3d3a8e
AD
164692002-07-25 Akim Demaille <akim@epita.fr>
16470
16471 Stop storing rules from 1 to nrules + 1.
16472
16473 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16474 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16475 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16476 Iterate from 0 to nrules.
16477 Use rule_number_as_item_number and item_number_as_rule_number.
16478 Adjust to `derive' now containing possibly 0.
16479 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16480 Handle the `- 1' part in rule numbers from/to item numbers.
16481 * src/conflicts.c (log_resolution): Fix the message which reversed
16482 shift and reduce.
16483 * src/output.c (action_row): Initialize default_rule to -1.
16484 (token_actions): Adjust.
16485 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16486 expected output.
16487 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16488
4a2a22f4
AD
164892002-07-25 Akim Demaille <akim@epita.fr>
16490
16491 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16492 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16493 (b4_c_knr_arg_decl): New.
16494 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16495 yyreport_parse_error.
16496
b8df3223
AD
164972002-07-25 Akim Demaille <akim@epita.fr>
16498
16499 * data/yacc.c (yyreport_parse_error): New, extracted from...
16500 (yyparse): here.
16501 (yydestruct, yysymprint): Move above yyparse.
16502 Be K&R compliant.
16503
a762e609
AD
165042002-07-25 Akim Demaille <akim@epita.fr>
16505
16506 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16507 replace...
16508 (b4_sint_type, b4_uint_type): these.
16509 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16510 * tests/regression.at (Web2c Actions): Adjust.
16511
12b0043a
AD
165122002-07-25 Akim Demaille <akim@epita.fr>
16513
16514 * src/gram.h (TIEM_NUMBER_MAX): New.
16515 (item_number_of_rule_number, rule_number_of_item_number): Rename
16516 as...
16517 (rule_number_as_item_number, item_number_as_rule_number): these.
16518 Adjust dependencies.
16519 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16520 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16521 (symbol_number_to_vector_number): New.
16522 (order): Of vector_number_t* type.
16523 (base_t, BASE_MAX, BASE_MIN): New.
16524 (froms, tos, width, pos, check): Of base_t type.
16525 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16526 (actrow): Of action_number_t type.
16527 (conflrow): Of unsigned int type.
16528 (table_ninf, base_ninf): New.
16529 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16530 (muscle_insert_int_table, muscle_insert_base_table)
16531 (muscle_insert_rule_number_table): New.
16532 (prepare_tokens): Output `toknum' as int_table.
16533 (action_row): Returns a rule_number_t.
16534 Use ACTION_MIN, not SHRT_MIN.
16535 (token_actions): yydefact is rule_number_t*.
16536 (table_ninf_remap): New.
16537 (pack_table): Use it for `base' and `table'.
16538 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16539 replaced with...
16540 (YYPACT_NINF, YYTABLE_NINF): these.
16541 (yypact, yytable): Compute their types instead of hard-coded
16542 `short'.
16543 * tests/regression.at (Web2c Actions): Adjust.
16544
5dde258a
AD
165452002-07-19 Akim Demaille <akim@epita.fr>
16546
16547 * src/scan-gram.l (id): Can start with an underscore.
16548
a945ec39
AD
165492002-07-16 Akim Demaille <akim@epita.fr>
16550
16551 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16552 Adjust all former `associativity' dependencies.
16553 * src/symtab.c (symbol_new): Default associativity is `undef', not
16554 `right'.
16555 (symbol_check_alias_consistence): Adjust.
16556
fae437e8
AD
165572002-07-09 Akim Demaille <akim@epita.fr>
16558
16559 * doc/bison.texinfo: Properly set the ``header'' part.
16560 Use @dircategory ``GNU programming tools'' as per Texinfo's
16561 documentation.
16562 Use @copying.
16563
1a715ef2
AD
165642002-07-09 Akim Demaille <akim@epita.fr>
16565
16566 * lib/quotearg.h: Protect against multiple inclusions.
16567 * src/location.h (location_t): Add a `file' member.
16568 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16569 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16570 `error_one_per_line' support.
16571
a5d50994
AD
165722002-07-09 Akim Demaille <akim@epita.fr>
16573
16574 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16575 * src/reader.c (lineno): Remove.
16576 Adjust all dependencies.
16577 (get_merge_function): Take a location and use complain_at.
16578 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16579 * tests/regression.at (Invalid inputs, Mixing %token styles):
16580 Adjust.
16581
b275314e
AD
165822002-07-09 Akim Demaille <akim@epita.fr>
16583
16584 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16585 recovery rule, and forbid extensions when --yacc.
16586 (gram_error): Use complain_at.
16587 * src/reader.c (reader): Exit if there were parse errors.
16588
865b9df1
AD
165892002-07-09 Akim Demaille <akim@epita.fr>
16590
16591 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16592 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16593 Reported by R Blake <blakers@mac.com>.
16594
c76e14da
AD
165952002-07-09 Akim Demaille <akim@epita.fr>
16596
16597 * data/yacc.c: Output the copyright notive in the header.
16598
7db2ed2d
AD
165992002-07-03 Akim Demaille <akim@epita.fr>
16600
16601 * src/output.c (froms, tos): Are state_number_t.
16602 (save_column): sp, sp1, and sp2 are state_number_t.
16603 (prepare): Rename `final' as `final_state_number', `nnts' as
16604 `nterms_number', `nrules' as `rules_number', `nstates' as
16605 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16606 unused.
16607 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16608 * data/lalr1.cc (nsym_): Remove, unused.
16609
e68e0410
AD
166102002-07-03 Akim Demaille <akim@epita.fr>
16611
16612 * src/lalr.h, src/lalr.c (goto_number_t): New.
16613 * src/lalr.c (goto_list_t): New.
16614 Propagate them.
16615 * src/nullable.c (rule_list_t): New.
16616 Propagate.
16617 * src/types.h: Remove.
16618
e1a4f3a4
AD
166192002-07-03 Akim Demaille <akim@epita.fr>
16620
16621 * src/closure.c (print_fderives): Use rule_rhs_print.
16622 * src/derives.c (print_derives): Use rule_rhs_print.
16623 (rule_list_t): New, replaces `shorts'.
16624 (set_derives): Add comments.
16625 * tests/sets.at (Nullable, Firsts): Adjust.
16626
536545f3
AD
166272002-07-03 Akim Demaille <akim@epita.fr>
16628
16629 * src/output.c (prepare_actions): Free `tally' and `width'.
16630 (prepare_actions): Allocate and free `order'.
16631 * src/symtab.c (symbols_free): Free `symbols'.
16632 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16633 * src/output.c (m4_invoke): Move to...
16634 * src/scan-skel.l: here.
16635 (<<EOF>>): Close yyout, and free its name.
16636
8b752b00
AD
166372002-07-03 Akim Demaille <akim@epita.fr>
16638
16639 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16640
16641 * src/LR0.c (new_state): Merge into...
16642 (state_list_append): this.
16643 (new_states): Merge into...
16644 (generate_states): here.
16645 (set_states): Don't ensure a proper `errs' state member here, do it...
16646 * src/conflicts.c (conflicts_solve): here.
16647 * src/state.h, src/state.c: Comment changes.
16648 (state_t): Rename member `shifts' as `transitions'.
16649 Adjust all dependencies.
16650 (errs_new): For consistency, also take the values as argument.
16651 (errs_dup): Remove.
16652 (state_errs_set): New.
16653 (state_reductions_set, state_transitions_set): Assert that no
16654 previous value was assigned.
16655 (state_free): New.
16656 (states_free): Use it.
16657 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16658 temporary storage: use `errs' and `nerrs' as elsewhere.
16659 (set_conflicts): Allocate and free this `errs'.
16660
613f5e1a
AD
166612002-07-02 Akim Demaille <akim@epita.fr>
16662
16663 * lib/libiberty.h: New.
16664 * lib: Update the bitset implementation from upstream.
16665 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16666 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16667 * src/main.c: Adjust bitset stats calls.
16668
26e0cadc
PE
166692002-07-01 Paul Eggert <eggert@twinsun.com>
16670
16671 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16672 char, so that negative chars don't collide with $.
16673
1154cced
AD
166742002-06-30 Akim Demaille <akim@epita.fr>
16675
16676 Have the GLR tests be `warning' checked, and fix the warnings.
16677
16678 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16679 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16680 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16681 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16682 (yyaddDeferredAction): static.
16683 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16684 (yyreportParseError): yyprefix is const.
16685 yytokenp is used only when verbose.
16686 (yy__GNUC__): Replace with __GNUC__.
16687 (yypdumpstack): yyi is size_t.
16688 (yypreference): Un-yy local variables and arguments, to avoid
16689 clashes with `yyr1'. Anyway, we are not in the user name space.
16690 (yytname_size): be an int, as is compared with ints.
16691 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16692 Use them.
16693 * tests/cxx-gram.at: Use quotation to protect $1.
16694 Use AT_COMPILE to enable warnings hunts.
16695 Prototype yylex and yyerror.
16696 `Use' argc.
16697 Include `string.h', not `strings.h'.
16698 Produce and prototype stmtMerge only when used.
16699 yylex takes a location.
16700
97650f4e
AD
167012002-06-30 Akim Demaille <akim@epita.fr>
16702
16703 We spend a lot of time in quotearg, in particular when --verbose.
16704
16705 * src/symtab.c (symbol_get): Store a quoted version of the key.
16706 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16707 Adjust all callers.
16708
d2576365
AD
167092002-06-30 Akim Demaille <akim@epita.fr>
16710
16711 * src/state.h (reductions_t): Rename member `nreds' as num.
16712 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16713 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16714
ccaf65bc
AD
167152002-06-30 Akim Demaille <akim@epita.fr>
16716
16717 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16718 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16719 (shifts_to): Rename as...
16720 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16721 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16722 (TRANSITION_IS_DISABLED, transitions_to): these.
16723
87675353
AD
167242002-06-30 Akim Demaille <akim@epita.fr>
16725
16726 * src/print.c (print_shifts, print_gotos): Merge into...
16727 (print_transitions): this.
16728 (print_transitions, print_errs, print_reductions): Align the
16729 lookaheads columns.
16730 (print_core, print_transitions, print_errs, print_state,
16731 print_grammar): Output empty lines separator before, not after.
16732 (state_default_rule_compute): Rename as...
16733 (state_default_rule): this.
16734 * tests/conflicts.at (Defaulted Conflicted Reduction),
16735 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16736 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16737
ce4ccb4b
AD
167382002-06-30 Akim Demaille <akim@epita.fr>
16739
16740 Display items as we display rules.
16741
16742 * src/gram.h, src/gram.c (rule_lhs_print): New.
16743 * src/gram.c (grammar_rules_partial_print): Use it.
16744 * src/print.c (print_core): Likewise.
16745 * tests/conflicts.at (Defaulted Conflicted Reduction),
16746 (Unresolved SR Conflicts): Adjust.
16747 (Unresolved SR Conflicts): Adjust and rename as...
16748 (Resolved SR Conflicts): this, as was meant.
16749 * tests/regression.at (Web2c Report): Adjust.
16750
bc933ef1
AD
167512002-06-30 Akim Demaille <akim@epita.fr>
16752
16753 * src/print.c (state_default_rule_compute): New, extracted from...
16754 (print_reductions): here.
16755 Pessimize, but clarify the code.
16756 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16757
53d4308d
AD
167582002-06-30 Akim Demaille <akim@epita.fr>
16759
16760 * src/output.c (action_row): Let default_rule be always a rule
16761 number.
16762
574fb2d5
AD
167632002-06-30 Akim Demaille <akim@epita.fr>
16764
16765 * src/closure.c (print_firsts, print_fderives, closure):
16766 Use BITSET_EXECUTE.
16767 * src/lalr.c (lookaheads_print): Likewise.
16768 * src/state.c (state_rule_lookaheads_print): Likewise.
16769 * src/print_graph.c (print_core): Likewise.
16770 * src/print.c (print_reductions): Likewise.
16771 * src/output.c (action_row): Likewise.
16772 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16773
05811fd7
AD
167742002-06-30 Akim Demaille <akim@epita.fr>
16775
16776 * src/print_graph.c: Use report_flag.
16777
0e4d5753
AD
167782002-06-30 Akim Demaille <akim@epita.fr>
16779
16780 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16781 to...
16782 * src/relation.h, src/relation.c (traverse, relation_digraph)
16783 (relation_print, relation_transpose): New.
16784
24c7d800
AD
167852002-06-30 Akim Demaille <akim@epita.fr>
16786
16787 * src/state.h, src/state.c (shifts_to): New.
16788 * src/lalr.c (build_relations): Use it.
16789
9222837b
AD
167902002-06-30 Akim Demaille <akim@epita.fr>
16791
16792 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16793 (item_number_of_rule_number, rule_number_of_item_number): New.
16794 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16795 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16796 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16797 Propagate their use.
16798 Much remains to be done, in particular wrt `shorts' from types.h.
16799
260008e5
AD
168002002-06-30 Akim Demaille <akim@epita.fr>
16801
16802 * src/symtab.c (symbol_new): Initialize the `printer' member.
16803
8a731ca8
AD
168042002-06-30 Akim Demaille <akim@epita.fr>
16805
16806 * src/LR0.c (save_reductions): Remove, replaced by...
16807 * src/state.h, src/state.c (state_reductions_set): New.
16808 (reductions, errs): Rename as...
16809 (reductions_t, errs_t): these.
16810 Adjust all dependencies.
16811
32e1e0a4
AD
168122002-06-30 Akim Demaille <akim@epita.fr>
16813
16814 * src/LR0.c (state_list_t, state_list_append): New.
16815 (first_state, last_state): Now symbol_list_t.
16816 (this_state): Remove.
16817 (new_itemsets, append_states, save_reductions): Take a state_t as
16818 argument.
16819 (set_states, generate_states): Adjust.
16820 (save_shifts): Remove, replaced by...
16821 * src/state.h, src/state.c (state_shifts_set): New.
16822 (shifts): Rename as...
16823 (shifts_t): this.
16824 Adjust all dependencies.
16825 * src/state.h (state_t): Remove the `next' member.
16826
e5fb6710
AD
168272002-06-30 Akim Demaille <akim@epita.fr>
16828
16829 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16830 escaped in slot 0.
16831
c7ca99d4
AD
168322002-06-30 Akim Demaille <akim@epita.fr>
16833
16834 Use hash.h for the state hash table.
16835
16836 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16837 (allocate_storage): Use state_hash_new.
16838 (free_storage): Use state_hash_free.
16839 (new_state, get_state): Adjust.
16840 * src/lalr.h, src/lalr.c (states): Move to...
16841 * src/states.h (state_t): Remove the `link' member, no longer
16842 used.
16843 * src/states.h, src/states.c: here.
16844 (state_hash_new, state_hash_free, state_hash_lookup)
16845 (state_hash_insert, states_free): New.
16846 * src/states.c (state_table, state_compare, state_hash): New.
16847 * src/output.c (output_actions): Do not free states now, since we
16848 still need to know the final_state number in `prepare', called
16849 afterwards. Do it...
16850 * src/main.c (main): here: call states_free after `output'.
16851
df0e7316
AD
168522002-06-30 Akim Demaille <akim@epita.fr>
16853
16854 * src/state.h, src/state.c (state_new): New, extracted from...
16855 * src/LR0.c (new_state): here.
16856 * src/state.h (STATE_ALLOC): Move to...
16857 * src/state.c: here.
16858 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16859 * src/state.h, src/state.c: here.
16860
39f41916
AD
168612002-06-30 Akim Demaille <akim@epita.fr>
16862
16863 * src/reader.c (gensym): Rename as...
16864 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16865 (getsym): Rename as...
16866 (symbol_get): this.
16867
d57650a5
AD
168682002-06-30 Akim Demaille <akim@epita.fr>
16869
16870 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16871 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16872 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16873 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16874
5a08f1ce
AD
168752002-06-30 Akim Demaille <akim@epita.fr>
16876
16877 Make the test suite pass with warnings checked.
16878
16879 * tests/actions.at (Printers and Destructors): Improve.
16880 Avoid unsigned vs. signed issues.
16881 * tests/calc.at: Don't exercise the scanner here, do it...
16882 * tests/input.at (Torturing the Scanner): here.
16883
720623af
PH
168842002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16885
88e7e941 16886 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
16887 reorganize first lines parallel to yacc.c.
16888
fb8135fa
AD
168892002-06-28 Akim Demaille <akim@epita.fr>
16890
16891 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16892 (b4_token_enum, b4_token_defines): New, factored from...
16893 * data/lalr1.cc, data/yacc.c, glr.c: here.
16894
41442480
AD
168952002-06-28 Akim Demaille <akim@epita.fr>
16896
16897 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16898 unused variables.
16899 * src/output.c (merger_output): static.
16900
e0e5bf84
AD
169012002-06-28 Akim Demaille <akim@epita.fr>
16902
ba0fe3c7 16903 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
16904 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16905 pacify GCC.
16906 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 16907
676385e2
PH
169082002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16909
16910 Accumulated changelog for new GLR parsing features.
16911
6a254321 16912 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
16913 conflicts_total_count.
16914 * src/conflicts.h: Ditto.
16915 * src/output.c (token_actions): Use the new name.
16916 (output_conflicts): Change conflp => conflict_list_heads, and
16917 confl => conflict_list for better readability.
16918 * data/glr.c: Use the new names.
16919 * NEWS: Add self to GLR announcement.
e0e5bf84 16920
676385e2
PH
16921 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
16922
16923 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
16924 Akim Demaille.
16925
16926 * data/bison.glr: Change name to glr.c
16927 * data/glr.c: Renamed from bison.glr.
16928 * data/Makefile.am: Add glr.c
e0e5bf84
AD
16929
16930 * src/getargs.c:
16931
676385e2 16932 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 16933 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 16934
676385e2
PH
16935 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16936
16937 * data/bison.glr: Be sure to restore the
16938 current #line when returning to the skeleton contents after having
16939 exposed the input file's #line.
16940
16941 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16942
16943 * data/bison.glr: Bring up to date with changes to bison.simple.
16944
16945 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16946
16947 * data/bison.glr: Correct definitions that use b4_prefix.
16948 Various reformatting.
16949 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
16950 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
16951 yytokenp argument; now part of stack.
16952 (yychar): Define to behave as documented.
16953 (yyclearin): Ditto.
e0e5bf84 16954
676385e2
PH
16955 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16956
16957 * src/reader.h: Add declaration for free_merger_functions.
16958
16959 * src/reader.c (merge_functions): New variable.
16960 (get_merge_function): New function.
16961 (free_merger_functions): New function.
16962 (readgram): Check for %prec that is not followed by a symbol.
16963 Handle %dprec and %merge declarations.
16964 (packgram): Initialize dprec and merger fields in rules array.
16965
16966 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
16967 conflict_list_cnt, conflict_list_free): New variables.
16968 (table_grow): Also grow conflict_table.
e0e5bf84 16969 (prepare_rules): Output dprec and merger tables.
676385e2 16970 (conflict_row): New function.
e0e5bf84 16971 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
16972 default reduction in conflicted states for GLR parser so that there
16973 are spaces for the conflict lists.
16974 (save_row): Also save conflict information.
16975 (token_actions): Allocate conflict list.
16976 (merger_output): New function.
16977 (pack_vector): Pack conflict table, too.
16978 (output_conflicts): New function to output yyconflp and yyconfl.
16979 (output_check): Allocate conflict_tos.
16980 (output_actions): Output conflict tables, also.
16981 (output_skeleton): Output b4_mergers definition.
16982 (prepare): Output b4_max_rhs_length definition.
16983 Use 'bison.glr' as default skeleton for GLR parsers.
16984
16985 * src/gram.c (glr_parser): New flag.
16986 (grammar_free): Call free_merger_functions.
16987
16988 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
16989 all pairs of conflicting reductions, rather than just all tokens
16990 causing conflicts. Needed to size conflict tables.
e0e5bf84 16991 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
16992 interface.
16993 (conflicts_print): Ditto.
16994 (count_total_conflicts): New function.
16995
16996 * src/reader.h (merger_list): New type.
16997 (merge_functions): New variable.
16998
16999 * src/lex.h (tok_dprec, tok_merge): New token types.
17000
17001 * src/gram.h (rule_s): Add dprec and merger fields.
17002 (glr_parser): New flag.
17003
17004 * src/conflicts.h (count_total_conflicts): New function.
17005
17006 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
17007
17008 * doc/bison.texinfo (Generalized LR Parsing): New section.
17009 (GLR Parsers): New section.
17010 (Language and Grammar): Mention GLR parsing.
17011 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
17012 Correct typo ("tge" -> "the").
17013
17014 * data/bison.glr: New skeleton for GLR parsing.
17015
17016 * tests/cxx-gram.at: New tests for GLR parsing.
17017
17018 * tests/testsuite.at: Include cxx-gram.at.
17019
17020 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 17021
676385e2
PH
17022 * src/parse-gram.y:
17023
17024 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
17025
17026 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 17027
b5480d74 170282002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
17029
17030 * src/options.h, src/options.c: Remove.
17031 * src/getargs.c (short_options, long_options): New.
17032
60491a94
AD
170332002-06-27 Akim Demaille <akim@epita.fr>
17034
17035 * data/bison.simple, data/bison.c++: Rename as...
17036 * data/yacc.c, data/lalr1.cc: these.
17037 * doc/bison.texinfo (Environment Variables): Remove.
17038
9be0c25b
AD
170392002-06-25 Raja R Harinath <harinath@cs.umn.edu>
17040
17041 * src/getargs.c (report_argmatch): Initialize strtok().
17042
1ae72863
AD
170432002-06-20 Akim Demaille <akim@epita.fr>
17044
17045 * data/bison.simple (b4_symbol_actions): New, replaces...
17046 (b4_symbol_destructor, b4_symbol_printer): these.
17047 (yysymprint): Be sure to call YYPRINT only for tokens, and using
17048 user token numbers.
17049
87542d29
AD
170502002-06-20 Akim Demaille <akim@epita.fr>
17051
17052 * data/bison.simple (yydestructor): Rename as...
17053 (yydestruct): this.
17054
1a31ed21
AD
170552002-06-20 Akim Demaille <akim@epita.fr>
17056
17057 * src/symtab.h, src/symtab.c (symbol_type_set)
17058 (symbol_destructor_set, symbol_precedence_set): The location is
17059 the last argument.
17060 Adjust all callers.
17061
e776192e
AD
170622002-06-20 Akim Demaille <akim@epita.fr>
17063
17064 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
17065 internals.
17066 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
17067 Takes a location.
17068 * src/symtab.h, src/symtab.c (symbol_class_set)
17069 (symbol_user_token_number_set): Likewise.
17070 Adjust all callers.
17071 Promote complain_at.
17072 * tests/input.at (Type Clashes): Adjust.
17073
5c1180b3
AD
170742002-06-20 Akim Demaille <akim@epita.fr>
17075
17076 * data/bison.simple (YYLEX): Fix the declaration when
17077 %pure-parser.
17078
e3170060
AD
170792002-06-20 Akim Demaille <akim@epita.fr>
17080
17081 * data/bison.simple (yysymprint): Don't print the token number,
17082 just its name.
17083 * tests/actions.at (Destructors): Rename as...
17084 (Printers and Destructors): this.
17085 Also exercise %printer.
17086
253862fd
AD
170872002-06-20 Akim Demaille <akim@epita.fr>
17088
17089 * data/bison.simple (YYDSYMPRINT): New.
17090 Use it to remove many of the #if YYDEBUG/if (yydebug).
17091
366eea36
AD
170922002-06-20 Akim Demaille <akim@epita.fr>
17093
17094 * src/symtab.h, src/symtab.c (symbol_t): printer and
17095 printer_location are new members.
17096 (symbol_printer_set): New.
17097 * src/parse-gram.y (PERCENT_PRINTER): New token.
17098 Handle its associated rule.
17099 * src/scan-gram.l: Adjust.
17100 (handle_destructor_at, handle_destructor_dollar): Rename as...
17101 (handle_symbol_code_at, handle_symbol_code_dollar): these.
17102 * src/output.c (symbol_printers_output): New.
17103 (output_skeleton): Call it.
17104 * data/bison.simple (yysymprint): New. Cannot be named yyprint
17105 since there are already many grammar files with a user `yyprint'.
17106 Replace the calls to YYPRINT to calls to yysymprint.
17107 * tests/calc.at: Adjust.
17108 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
17109 taking advantage of parser very internal details (stack size!).
17110
4f25ebb0
AD
171112002-06-20 Akim Demaille <akim@epita.fr>
17112
17113 * src/scan-gram.l: Complete the scanner with the missing patterns
17114 to pacify Flex.
17115 Use `quote' and `symbol_tag_get' where appropriate.
17116
93b68a0e
AD
171172002-06-19 Akim Demaille <akim@epita.fr>
17118
17119 * tests/actions.at (Destructors): Augment to test locations.
17120 * data/bison.simple (yydestructor): Pass it the current location
17121 if locations are enabled.
17122 Prototype only when __STDC__ or C++.
17123 Change the argument names to move into the yy name space: there is
17124 user code here.
17125
58612f1d
AD
171262002-06-19 Akim Demaille <akim@epita.fr>
17127
74310291
AD
17128 * data/bison.simple (b4_pure_if): New.
17129 Use it instead of #ifdef YYPURE.
17130
171312002-06-19 Akim Demaille <akim@epita.fr>
17132
17133 * data/bison.simple (b4_location_if): New.
58612f1d
AD
17134 Use it instead of #ifdef YYLSP_NEEDED.
17135
f25bfb75
AD
171362002-06-19 Akim Demaille <akim@epita.fr>
17137
17138 Prepare @$ in %destructor, but currently don't bind it in the
17139 skeleton, as %location use is not cleaned up yet.
17140
17141 * src/scan-gram.l (handle_dollar, handle_destructor_at)
17142 (handle_action_at): New.
17143 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
17144 a braced_code_t and a location as additional arguments.
17145 (handle_destructor_dollar): Instead of requiring `b4_eval', just
17146 unquote one when outputting `b4_dollar_dollar'.
17147 Adjust callers.
17148 * data/bison.simple (b4_eval): Remove.
17149 (b4_symbol_destructor): Adjust.
17150 * tests/input.at (Invalid @n): Adjust.
17151
c732d2c6
AD
171522002-06-19 Zack Weinberg <zack@codesourcery.com>
17153
17154 * doc/bison.texinfo: Document ability to have multiple
17155 prologue sections.
17156
8c165d89
AD
171572002-06-18 Akim Demaille <akim@epita.fr>
17158
17159 * src/files.c (compute_base_names): When computing the output file
17160 names from the input file name, strip the directory part.
17161
ca98bf57
AD
171622002-06-18 Akim Demaille <akim@epita.fr>
17163
17164 * data/bison.simple.new: Comment changes.
17165 Reported by Andreas Schwab.
17166
0bfb02ff
AD
171672002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
17168
17169 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
17170 there are no `label `yyoverflowlab' defined but not used' warnings
17171 when yyoverflow is defined.
17172
24c0aad7
AD
171732002-06-18 Akim Demaille <akim@epita.fr>
17174
17175 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
17176 new member.
17177 (symbol_destructor_set): Adjust.
17178 * src/output.c (symbol_destructors_output): Output the destructor
17179 locations.
17180 Output the symbol name.
17181 * data/bison.simple (b4_symbol_destructor): Adjust.
17182
5719c109
AD
171832002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
17184 and Akim Demaille <akim@epita.fr>
17185
17186 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
17187 what's left on the stack when the error recovery hits EOF.
17188 * tests/actions.at (Destructors): Complete to exercise this case.
17189
9280d3ef
AD
171902002-06-17 Akim Demaille <akim@epita.fr>
17191
17192 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
17193 arguments is really empty, not only equal to `[]'.
17194 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
17195 member.
17196 (symbol_destructor_set): New.
17197 * src/output.c (symbol_destructors_output): New.
17198 * src/reader.h (brace_code_t, current_braced_code): New.
17199 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
17200 (handle_dollar): Rename as...
17201 (handle_action_dollar): this.
17202 (handle_destructor_dollar): New.
17203 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
17204 (grammar_declaration): Use it.
17205 * data/bison.simple (yystos): Is always defined.
17206 (yydestructor): New.
17207 * tests/actions.at (Destructors): New.
17208 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
17209
dafdc66f
AD
172102002-06-17 Akim Demaille <akim@epita.fr>
17211
17212 * src/symlist.h, src/symlist.c (symbol_list_length): New.
17213 * src/scan-gram.l (handle_dollar, handle_at): Compute the
17214 rule_length only when needed.
17215 * src/output.c (actions_output, token_definitions_output): Output
17216 the full M4 block.
17217 * src/symtab.c: Don't access directly to the symbol tag, use
17218 symbol_tag_get.
17219 * src/parse-gram.y: Use symbol_list_free.
17220
56c47203
AD
172212002-06-17 Akim Demaille <akim@epita.fr>
17222
17223 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
17224 (symbol_list_prepend, get_type_name): Move to...
17225 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
17226 (symbol_list_prepend, symbol_list_n_type_name_get): here.
17227 Adjust all callers.
17228 (symbol_list_free): New.
17229 * src/scan-gram.l (handle_dollar): Takes a location.
17230 * tests/input.at (Invalid $n): Adjust.
17231
1e0bab92
AD
172322002-06-17 Akim Demaille <akim@epita.fr>
17233
17234 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17235 (symbol_list_prepend): New.
17236 * src/parse-gram.y (%union): `list' is a new member.
17237 (symbols.1): New, replaces...
17238 (terms_to_prec.1, nterms_to_type.1): these.
17239 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17240 Take a location as additional argument.
17241 Adjust all callers.
17242
04e60654
AD
172432002-06-15 Akim Demaille <akim@epita.fr>
17244
17245 * src/parse-gram.y: Move %token in the declaration section so that
17246 we don't depend upon CVS Bison.
17247
10e5b8bd
AD
172482002-06-15 Akim Demaille <akim@epita.fr>
17249
17250 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17251 * src/print.c (print_core): Use it.
17252
9801d40c
AD
172532002-06-15 Akim Demaille <akim@epita.fr>
17254
17255 * src/conflicts.c (log_resolution): Accept the rule involved in
17256 the sr conflicts instead of the lookahead number that points to
17257 that rule.
17258 (flush_reduce): Accept the current lookahead vector as argument,
17259 instead of the index in LA.
17260 (resolve_sr_conflict): Accept the current number of lookahead
17261 bitset to consider for the STATE, instead of the index in LA.
17262 (set_conflicts): Adjust.
17263 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17264
c0263492
AD
172652002-06-15 Akim Demaille <akim@epita.fr>
17266
17267 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17268 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17269 Adjust all dependencies.
17270 * src/lalr.c (initialize_lookaheads): Split into...
17271 (states_lookaheads_count, states_lookaheads_initialize): these.
17272 (lalr): Adjust.
17273
9757c359
AD
172742002-06-15 Akim Demaille <akim@epita.fr>
17275
17276 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17277 out of...
17278 (grammar_rules_print): here.
17279 * src/reduce.c (reduce_output): Use it.
17280 * tests/reduce.at (Useless Rules, Reduced Automaton)
17281 (Underivable Rules): Adjust.
17282
6b98e4b5
AD
172832002-06-15 Akim Demaille <akim@epita.fr>
17284
17285 Copy BYacc's nice way to report the grammar.
17286
17287 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17288 New.
17289 Don't print the rules' location, it is confusing and useless.
17290 (rule_print): Use grammar_rhs_print.
17291 * src/print.c (print_grammar): Use grammar_rules_print.
17292
6b98e4b5
AD
172932002-06-15 Akim Demaille <akim@epita.fr>
17294
17295 Complete and rationalize `useless thing' warnings.
17296
17297 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17298 (symbol_tag_print): New.
17299 Use them everywhere in place of accessing directly the tag member.
17300 * src/gram.h, src/gram.c (rule_print): New.
17301 Use it where a rule used to be printed `by hand'.
17302 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17303 (reduce_grammar_tables): Report the useless rules.
17304 (reduce_print): Useless things are a warning, not an error.
17305 Report it as such.
17306 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17307 (Reduced Automaton, Underivable Rules): Adjust.
17308 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17309 * tests/conflicts.at (Unresolved SR Conflicts)
17310 (Solved SR Conflicts): Adjust.
17311
ee000ba4
AD
173122002-06-15 Akim Demaille <akim@epita.fr>
17313
17314 Let symbols have a location.
17315
17316 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
17317 (getsym): Adjust.
17318 Adjust all callers.
17319 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
17320 Use location_t, not int.
17321 * src/symtab.c (symbol_check_defined): Take advantage of the
17322 location.
17323 * tests/regression.at (Invalid inputs): Adjust.
17324
8efe435c
AD
173252002-06-15 Akim Demaille <akim@epita.fr>
17326
17327 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
17328 (input): Don't try to initialize yylloc here, do it in the
17329 scanner.
17330 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
17331 * src/gram.h (rule_t): Change line and action_line into location
17332 and action_location, of location_t type.
17333 Adjust all dependencies.
17334 * src/location.h, src/location.c (empty_location): New.
17335 * src/reader.h, src/reader.c (grammar_start_symbol_set)
17336 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
17337 (grammar_current_rule_symbol_append)
17338 (grammar_current_rule_action_append): Expect a location as argument.
17339 * src/reader.c (grammar_midrule_action): Adjust to attach an
17340 action's location as dummy symbol location.
17341 * src/symtab.h, src/symtab.c (startsymbol_location): New.
17342 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
17343 the line numbers.
17344
1921f1d7
AD
173452002-06-14 Akim Demaille <akim@epita.fr>
17346
17347 Grammar declarations may be found in the grammar section.
17348
17349 * src/parse-gram.y (rules_or_grammar_declaration): New.
17350 (declarations): Each declaration may end with a semicolon, not
17351 just...
17352 (grammar_declaration): `"%union"'.
17353 (grammar): Branch to rules_or_grammar_declaration.
17354
4515534c
AD
173552002-06-14 Akim Demaille <akim@epita.fr>
17356
17357 * src/main.c (main): Invoke scanner_free.
17358
f958596b
AD
173592002-06-14 Akim Demaille <akim@epita.fr>
17360
17361 * src/output.c (m4_invoke): Extracted from...
17362 (output_skeleton): here.
17363 Free tempfile.
17364
2c569025
AD
173652002-06-14 Akim Demaille <akim@epita.fr>
17366
17367 * src/parse-gram.y (directives, directive, gram)
17368 (grammar_directives, precedence_directives, precedence_directive):
17369 Rename as...
17370 (declarations, declaration, grammar, grammar_declaration)
17371 (precedence_declaration, precedence_declarator): these.
17372 (symbol_declaration): New.
17373
592e8d4d
AD
173742002-06-14 Akim Demaille <akim@epita.fr>
17375
17376 * src/files.c (action_obstack): Remove, unused.
17377 (output_obstack): Remove it, and all its dependencies, as it is no
17378 longer needed.
17379 * src/reader.c (epilogue_set): Build the epilogue in the
17380 muscle_obstack.
17381 * src/output.h, src/output.c (muscle_obstack): Move to...
17382 * src/muscle_tab.h, src/muscle_tab.h: here.
17383 (muscle_init): Initialize muscle_obstack.
17384 (muscle_free): New.
17385 * src/main.c (main): Call it.
17386
0c15323d
AD
173872002-06-14 Akim Demaille <akim@epita.fr>
17388
17389 * src/location.h: New, extracted from...
17390 * src/reader.h: here.
17391 * src/Makefile.am (noinst_HEADERS): Merge into
17392 (bison_SOURCES): this.
17393 Add location.h.
17394 * src/parse-gram.y: Use location_t instead of Bison's.
17395 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
17396 Use location_t instead of ints.
17397
e96c9728
AD
173982002-06-14 Akim Demaille <akim@epita.fr>
17399
17400 * data/bison.simple, data/bison.c++: Be sure to restore the
17401 current #line when returning to the skeleton contents after having
17402 exposed the input file's #line.
17403
75d1fe16
AD
174042002-06-12 Akim Demaille <akim@epita.fr>
17405
17406 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
17407 eager.
17408 * tests/actions.at (Exotic Dollars): New.
17409
6c35d22c
AD
174102002-06-12 Akim Demaille <akim@epita.fr>
17411
17412 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
17413 ['"/] too eagerly.
17414 * tests/input.at (Torturing the Scanner): New.
17415
1d6412ad
AD
174162002-06-11 Akim Demaille <akim@epita.fr>
17417
17418 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
17419 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
17420 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
17421 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
17422 * src/reader.c (reader): Use it.
17423
4cdb01db
AD
174242002-06-11 Akim Demaille <akim@epita.fr>
17425
17426 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
17427 Adjust all callers.
17428 (scanner_last_string_free): New.
17429
44995b2e
AD
174302002-06-11 Akim Demaille <akim@epita.fr>
17431
17432 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
17433 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
17434 (last_string, YY_OBS_FREE): New.
17435 Use them when returning an ID.
17436
e9955c83
AD
174372002-06-11 Akim Demaille <akim@epita.fr>
17438
17439 Have Bison grammars parsed by a Bison grammar.
17440
17441 * src/reader.c, src/reader.h (prologue_augment): New.
17442 * src/reader.c (copy_definition): Remove.
17443
17444 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
17445 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
17446 (grammar_current_rule_prec_set, grammar_current_rule_check)
17447 (grammar_current_rule_symbol_append)
17448 (grammar_current_rule_action_append): Export.
17449 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
17450 (symbol_list_action_append): Remove.
17451 Hook the routines from reader.
17452 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17453 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
17454
17455 * src/reader.c (read_declarations): Remove, unused.
17456
17457 * src/parse-gram.y: Handle the epilogue.
17458 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
17459 (grammar_start_symbol_set): this.
17460 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
17461 * src/reader.c (readgram): Remove, unused.
17462 (reader): Adjust to insert eoftoken and axiom where appropriate.
17463
17464 * src/reader.c (copy_dollar): Replace with...
17465 * src/scan-gram.h (handle_dollar): this.
17466 * src/parse-gram.y: Remove `%thong'.
17467
17468 * src/reader.c (copy_at): Replace with...
17469 * src/scan-gram.h (handle_at): this.
17470
17471 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17472 New.
17473
17474 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17475 time being.
17476
17477 * src/reader.h, src/reader.c (grammar_rule_end): New.
17478
17479 * src/parse.y (current_type, current_class): New.
17480 Implement `%nterm', `%token' support.
17481 Merge `%term' into `%token'.
17482 (string_as_id): New.
17483 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17484 type name.
17485
17486 * src/parse-gram.y: Be sure to handle properly the beginning of
17487 rules.
17488
17489 * src/parse-gram.y: Handle %type.
17490 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17491
17492 * src/parse-gram.y: More directives support.
17493 * src/options.c: No longer handle source directives.
17494
17495 * src/parse-gram.y: Fix %output.
17496
17497 * src/parse-gram.y: Handle %union.
17498 Use the prologue locations.
17499 * src/reader.c (parse_union_decl): Remove.
17500
17501 * src/reader.h, src/reader.c (epilogue_set): New.
17502 * src/parse-gram.y: Use it.
17503
17504 * data/bison.simple, data/bison.c++: b4_stype is now either not
17505 defined, then default to int, or to the contents of %union,
17506 without `union' itself.
17507 Adjust.
17508 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17509
17510 * src/output.c (actions_output): Don't output braces, as they are
17511 already handled by the scanner.
17512
17513 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17514 characters to themselves.
17515
17516 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17517 that the epilogue has a proper #line.
17518
17519 * src/parse-gram.y: Handle precedence/associativity.
17520
17521 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17522 a terminal.
17523 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17524 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17525 at all to define terminals that cannot be emitted.
17526
17527 * src/scan-gram.l: Escape M4 characters.
17528
17529 * src/scan-gram.l: Working properly with escapes in user
17530 strings/characters.
17531
17532 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17533 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17534 grammar.
17535 Use more modest sizes, as for the time being the parser does not
17536 release memory, and therefore the process swallows a huge amount
17537 of memory.
17538
17539 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17540 stricter %token grammar.
17541
17542 * src/symtab.h (associativity): Add `undef_assoc'.
17543 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17544 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17545
17546 * tests/regression.at (Invalid %directive): Remove, as it is now
17547 meaningless.
17548 (Invalid inputs): Adjust to the new error messages.
17549 (Token definitions): The new grammar doesn't allow too many
17550 eccentricities.
17551
17552 * src/lex.h, src/lex.c: Remove.
17553 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17554 (copy_character, copy_string2, copy_string, copy_identifier)
17555 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17556 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17557 (parse_action): Remove.
17558 * po/POTFILES.in: Adjust.
17559
2e047461
AD
175602002-06-11 Akim Demaille <akim@epita.fr>
17561
cd05d13c 17562 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
17563 rule's action member: return the action as a string.
17564 Don't require `rule_length' as an argument: compute it.
17565 (grammar_current_rule_symbol_append)
17566 (grammar_current_rule_action_append): New, eved out from
17567 (readgram): here.
17568 Remove `action_flag', `rulelength', unused now.
17569
9af3fbce
AD
175702002-06-11 Akim Demaille <akim@epita.fr>
17571
17572 * src/reader.c (grammar_current_rule_prec_set).
17573 (grammar_current_rule_check): New, eved out from...
17574 (readgram): here.
17575 Remove `xaction', `first_rhs': useless.
17576 * tests/input.at (Type clashes): New.
17577 * tests/existing.at (GNU Cim Grammar): Adjust.
17578
1485e106
AD
175792002-06-11 Akim Demaille <akim@epita.fr>
17580
17581 * src/reader.c (grammar_midrule_action): New, Eved out from
17582 (readgram): here.
17583
da4160c3
AD
175842002-06-11 Akim Demaille <akim@epita.fr>
17585
17586 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17587 New.
17588 (readgram): Use them as replacement of inlined code, crule and
17589 crule1.
17590
f6d0f937
AD
175912002-06-11 Akim Demaille <akim@epita.fr>
17592
17593 * src/reader.c (grammar_end, grammar_symbol_append): New.
17594 (readgram): Use them.
17595 Make the use of `p' as local as possible.
17596
69078d4b
AD
175972002-06-10 Akim Demaille <akim@epita.fr>
17598
17599 GCJ's parser requires the tokens to be defined before the prologue.
17600
17601 * data/bison.simple: Output the token definition before the user's
17602 prologue.
17603 * tests/regression.at (Braces parsing, Duplicate string)
17604 (Mixing %token styles): Check the output from bison.
17605 (Early token definitions): New.
17606
5e424082
AD
176072002-06-10 Akim Demaille <akim@epita.fr>
17608
17609 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17610 assigning twice the same user number to a token, so that we can
17611 use it in...
17612 * src/lex.c (lex): here.
17613 Also use `symbol_class_set' instead of hand written code.
17614 * src/reader.c (parse_assoc_decl): Likewise.
17615
44536b35
AD
176162002-06-10 Akim Demaille <akim@epita.fr>
17617
17618 * src/symtab.c, src/symtab.c (symbol_class_set)
17619 (symbol_user_token_number_set): New.
17620 * src/reader.c (parse_token_decl): Use them.
17621 Use a switch instead of ifs.
17622 Use a single argument.
17623
8b9f2372
AD
176242002-06-10 Akim Demaille <akim@epita.fr>
17625
17626 Remove `%thong' support as it is undocumented, unused, duplicates
17627 `%token's job, and creates useless e-mail traffic with people who
17628 want to know what it is, why it is undocumented, unused, and
17629 duplicates `%token's job.
17630
17631 * src/reader.c (parse_thong_decl): Remove.
17632 * src/options.c (option_table): Remove "thong".
17633 * src/lex.h (tok_thong): Remove.
17634
3ae2b51f
AD
176352002-06-10 Akim Demaille <akim@epita.fr>
17636
17637 * src/symtab.c, src/symtab.c (symbol_type_set)
17638 (symbol_precedence_set): New.
17639 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17640 (value_components_used): Remove, unused.
17641
2f1afb73
AD
176422002-06-09 Akim Demaille <akim@epita.fr>
17643
17644 Move symbols handling code out of the reader.
17645
17646 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17647 (axiom): Move to...
17648 * src/symtab.h, src/symtab.c: here.
17649
17650 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17651 * src/reader.c (startval): Rename as...
17652 * src/symtab.h, src/symtab.c (startsymbol): this.
17653 * src/reader.c: Adjust.
17654
17655 * src/reader.c (symbol_check_defined, symbol_make_alias)
17656 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17657 (token_translations_init)
17658 Move to...
17659 * src/symtab.c: here.
17660 * src/reader.c (packsymbols): Move to...
17661 * src/symtab.h, src/symtab.c (symbols_pack): here.
17662 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17663 argument.
17664
e9bca3ad
AD
176652002-06-03 Akim Demaille <akim@epita.fr>
17666
17667 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17668 then statements.
17669
86eff183
AD
176702002-06-03 Akim Demaille <akim@epita.fr>
17671
17672 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17673 structs with non literals.
17674 * src/scan-skel.l: never-interactive.
17675 * src/conflicts.c (enum conflict_resolution_e): No trailing
17676 comma.
17677 * src/getargs.c (usage): Split long literal strings.
17678 Reported by Hans Aberg.
17679
717be197
AD
176802002-05-28 Akim Demaille <akim@epita.fr>
17681
17682 * data/bison.c++: Use C++ ostreams.
17683 (cdebug_): New member.
17684
670ddffd
AD
176852002-05-28 Akim Demaille <akim@epita.fr>
17686
17687 * src/output.c (output_skeleton): Be sure to allocate enough room
17688 for `/' _and_ for `\0' in full_skeleton.
17689
769b430f
AD
176902002-05-28 Akim Demaille <akim@epita.fr>
17691
17692 * data/bison.c++: Catch up with bison.simple:
17693 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17694 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17695 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17696 and popping traces.
17697
7067cb36
PH
176982002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17699
17700 * src/output.c (output_skeleton): Put an explicit path in front of
17701 the skeleton file name, rather than relying on the -I directory,
17702 to partially alleviate effects of having a skeleton file lying around
17703 in the current directory.
769b430f 17704
4a713ec2
PH
177052002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17706
769b430f 17707 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
17708 obstack_printf should be obstack_fgrow1.
17709
b408954b
AD
177102002-05-26 Akim Demaille <akim@epita.fr>
17711
17712 * src/state.h (state_t): `solved_conflicts' is a new member.
17713 * src/LR0.c (new_state): Set it to 0.
17714 * src/conflicts.h, src/conflicts.c (print_conflicts)
17715 (free_conflicts, solve_conflicts): Rename as...
17716 (conflicts_print, conflicts_free, conflicts_solve): these.
17717 Adjust callers.
17718 * src/conflicts.c (enum conflict_resolution_e)
17719 (solved_conflicts_obstack): New, used by...
17720 (log_resolution): this.
17721 Adjust to attach the conflict resolution to each state.
17722 Complete the description with the precedence/associativity
17723 information.
17724 (resolve_sr_conflict): Adjust.
17725 * src/print.c (print_state): Output its solved_conflicts.
17726 * tests/conflicts.at (Unresolved SR Conflicts)
17727 (Solved SR Conflicts): Exercise --report=all.
17728
a49aecd5
AD
177292002-05-26 Akim Demaille <akim@epita.fr>
17730
17731 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17732 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17733 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17734 (token_number_t, item_number_as_token_number)
17735 (token_number_as_item_number, muscle_insert_token_number_table):
17736 Rename as...
17737 (symbol_number_t, item_number_as_symbol_number)
17738 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17739 these, since it is more appropriate.
17740
5504898e
AD
177412002-05-26 Akim Demaille <akim@epita.fr>
17742
17743 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17744 `Error:' lines.
17745 * data/bison.simple (yystos) [YYDEBUG]: New.
17746 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17747 error recovery.
17748 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17749
ec3bc396
AD
177502002-05-25 Akim Demaille <akim@epita.fr>
17751
17752 * doc/bison.texinfo (Debugging): Split into...
17753 (Tracing): this new section, its former contents, and...
17754 (Understanding): this new section.
17755 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17756 by...
17757 (report_flag): this.
17758 Adjust all dependencies.
17759 (report_args, report_types, report_argmatch): New.
17760 (usage, getargs): Report/support -r, --report.
17761 * src/options.h
17762 (struct option_table_struct): Rename as..,
17763 (struct option_table_s): this.
17764 Rename the `set_flag' member to `flag' to match with getopt_long's
17765 struct.
17766 * src/options.c (option_table): Split verbose into an entry for
17767 %verbose, and another for --verbose.
17768 Support --report/-r, so remove -r from the obsolete --raw.
17769 * src/print.c: Attach full item sets and lookaheads reports to
17770 report_flag instead of trace_flag.
17771 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17772
78df8250
PE
177732002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17774 and Paul Eggert <eggert@twinsun.com>
769b430f 17775
78df8250
PE
17776 * data/bison.simple (yyparse): Correct error handling to conform to
17777 POSIX and yacc. Specifically, after syntax error is discovered,
17778 do not reduce further before shifting the error token.
17779 Clean up the code a bit by removing the labels yyerrdefault,
17780 yyerrhandle, yyerrpop.
17781 * NEWS: Document the above.
17782
c0c9ea05
PH
177832002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17784
17785 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17786 type; it isn't always big enough, since it doesn't necessarily
17787 include non-terminals.
769b430f 17788 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
17789 the latter can be removed.
17790 (yy_token_number_type): Remove, only one use.
17791 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17792 don't use TokenNumberType as element type.
769b430f 17793
c0c9ea05
PH
17794 * tests/regression.at: Modify expected output to agree with change
17795 to yyr1 and yytranslate.
769b430f 17796
6390a83f
FK
177972002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17798
17799 * src/reader.c (parse_action): Use copy_character instead of
17800 obstack_1grow.
17801
db7c8e9a
AD
178022002-05-13 Akim Demaille <akim@epita.fr>
17803
17804 * tests/regression.at (Token definitions): Prototype yylex and
17805 yyerror.
17806
fcc61800
PH
178072002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17808
158c687b 17809 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
17810 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17811 32-bit arithmetic.
17812 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17813
5683e9b2
AD
178142002-05-07 Akim Demaille <akim@epita.fr>
17815
17816 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17817 avoid GCC warnings.
17818
0c2d3f4c
AD
178192002-05-07 Akim Demaille <akim@epita.fr>
17820
17821 Kill GCC warnings.
17822
17823 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17824 over the RHS of each rule.
17825 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17826 * src/state.h (state_t): Member `nitems' is unsigned short.
17827 * src/LR0.c (get_state): Adjust.
17828 * src/reader.c (packgram): Likewise.
17829 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17830 `Type'.
17831 (muscle_insert_int_table): Remove, unused.
17832 (prepare_rules): Remove `max'.
17833
1565b720
AD
178342002-05-06 Akim Demaille <akim@epita.fr>
17835
17836 * src/closure.c (print_firsts): Display of the symbol tags.
17837 (bitmatrix_print): Move to...
17838 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17839 here.
17840 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17841
cfaee611
AD
178422002-05-06 Akim Demaille <akim@epita.fr>
17843
17844 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17845 hash_do_for_each.
17846
458be8e0
AD
178472002-05-06 Akim Demaille <akim@epita.fr>
17848
17849 * src/LR0.c (new_state, get_state): Instead of using the global
17850 `kernel_size' and `kernel_base', have two new arguments:
17851 `core_size' and `core'.
17852 Adjust callers.
17853
a900a624
AD
178542002-05-06 Akim Demaille <akim@epita.fr>
17855
17856 * src/reader.c (packgram): No longer end `ritem' with a 0
17857 sentinel: it is not used.
17858
d4e7d3a1
AD
178592002-05-05 Akim Demaille <akim@epita.fr>
17860
17861 New experimental feature: display the lookaheads in the report and
17862 graph.
17863
17864 * src/print (print_core): When --trace-flag, display the rules
17865 lookaheads.
17866 * src/print_graph.c (print_core): Likewise.
17867 Swap the arguments.
17868 Adjust caller.
17869
39ceb25b
AD
178702002-05-05 Akim Demaille <akim@epita.fr>
17871
17872 * tests/torture.at (Many lookaheads): New test.
17873
5372019f
AD
178742002-05-05 Akim Demaille <akim@epita.fr>
17875
17876 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17877 (GENERATE_MUSCLE_INSERT_TABLE): this.
17878 (output_int_table, output_unsigned_int_table, output_short_table)
17879 (output_token_number_table, output_item_number_table): Replace with...
17880 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17881 (muscle_insert_short_table, muscle_insert_token_number_table)
17882 (muscle_insert_item_number_table): these.
17883 Adjust all callers.
17884 (prepare_tokens): Don't free `translations', since...
17885 * src/reader.h, src/reader.c (grammar_free): do it.
17886 Move to...
17887 * src/gram.h, src/gram.c (grammar_free): here.
17888 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17889 b4_translate_max.
17890
5df5f6d5
AD
178912002-05-05 Akim Demaille <akim@epita.fr>
17892
17893 * src/output.c (output_unsigned_int_table): New.
17894 (prepare_rules): `i' is unsigned.
17895 `prhs', `rline', `r2' are unsigned int.
17896 Rename muscle `rhs_number_max' as `rhs_max'.
17897 Output muscles `prhs_max', `rline_max', and `r2_max'.
17898 Free rline and r1.
17899 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17900 to compute types instead of constant types.
17901 * tests/regression.at (Web2c Actions): Adjust.
17902
b87f8b21
AD
179032002-05-04 Akim Demaille <akim@epita.fr>
17904
17905 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17906 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17907 Adjust dependencies.
17908 * src/output.c (token_definitions_output): Be sure not to output a
17909 `#define 'a'' when fed with `%token 'a' "a"'.
17910 * tests/regression.at (Token definitions): New.
17911
8bb936e4
PE
179122002-05-03 Paul Eggert <eggert@twinsun.com>
17913
17914 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
17915 for K&R C.
17916
179172002-05-03 gettextize <bug-gnu-gettext@gnu.org>
17918
17919 * Makefile.am (SUBDIRS): Remove intl.
17920 (EXTRA_DIST): Add config/config.rpath.
17921
53c71a12
AD
179222002-05-03 Akim Demaille <akim@epita.fr>
17923
17924 * data/bison.simple (m4_if): Don't output empty enums.
17925 And actually, output valid enum definitions :(.
17926
289dd0cf
AD
179272002-05-03 Akim Demaille <akim@epita.fr>
17928
17929 * configure.bat: Remove, completely obsolete.
17930 * Makefile.am (EXTRA_DIST): Adjust.
17931 Don't distribute config.rpath...
17932 * config/Makefile.am (EXTRA_DIST): Do it.
17933
db85e524
AD
179342002-05-03 Akim Demaille <akim@epita.fr>
17935
17936 * configure.in (GETTEXT_VERSION): New.
17937 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
17938
83ccf991
AD
179392002-05-03 Akim Demaille <akim@epita.fr>
17940
17941 * data/bison.simple (b4_token_enum): New.
17942 (b4_token_defines): Use it to output tokens both as #define and
17943 enums.
17944 Suggested by Paul Eggert.
17945 * src/output.c (token_definitions_output): Don't output spurious
17946 white spaces.
17947
1f418995
AD
179482002-05-03 Akim Demaille <akim@epita.fr>
17949
17950 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
17951
45119f04
RA
179522002-05-02 Robert Anisko <robert@lrde.epita.fr>
17953
17954 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17955 Update the stack class, give a try to deque as the default container.
17956
b2d52318
AD
179572002-05-02 Akim Demaille <akim@epita.fr>
17958
17959 * data/bison.simple (yyparse): Do not implement @$ = @1.
17960 (YYLLOC_DEFAULT): Adjust to do it.
17961 * doc/bison.texinfo (Location Default Action): Fix.
17962
3a8b4109
AD
179632002-05-02 Akim Demaille <akim@epita.fr>
17964
17965 * src/reader.c (parse_braces): Merge into...
17966 (parse_action): this.
17967
84614e13
AD
179682002-05-02 Akim Demaille <akim@epita.fr>
17969
17970 * configure.in (ALL_LINGUAS): Remove.
17971 * po/LINGUAS, hr.po: New.
17972
fdbcd8e2
AD
179732002-05-02 Akim Demaille <akim@epita.fr>
17974
17975 Remove the so called hairy (semantic) parsers.
17976
17977 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
17978 * src/gram.h, src/gram.c (semantic_parser): Remove.
17979 (rule_t): Remove the guard and guard_line members.
17980 * src/lex.h (token_t): remove tok_guard.
17981 * src/options.c (option_table): Remove %guard and %semantic_parser
17982 support.
17983 * src/output.c, src/output.h (guards_output): Remove.
17984 (prepare): Adjust.
17985 (token_definitions_output): Don't output the `T'
17986 tokens (???).
17987 (output_skeleton): Don't output the guards.
17988 * src/files.c, src/files.c (attrsfile): Remove.
17989 * src/reader.c (symbol_list): Remove the guard and guard_line
17990 members.
17991 Adjust dependencies.
17992 (parse_guard): Remove.
17993 * data/bison.hairy: Remove.
17994 * doc/bison.texinfo (Environment Variables): Remove occurrences of
17995 BISON_HAIRY.
17996
82b6cb3f
AD
179972002-05-02 Akim Demaille <akim@epita.fr>
17998
17999 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
18000 (parse_guard): Rename the formal argument `stack_offset' as
18001 `rule_length', which is more readable.
18002 Adjust callers.
18003 (copy_at, copy_dollar): Instead of outputting the hard coded
18004 values of $$, $n and so forth, output invocation to b4_lhs_value,
18005 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
18006 Note: this patch partially drops `semantic-parser' support: it
18007 always does `rule_length - n', where semantic parsers ought to
18008 always use `-n'.
82b6cb3f
AD
18009 * data/bison.simple, data/bison.c++ (b4_lhs_value)
18010 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
18011
6cbfbcc5
AD
180122002-05-02 Akim Demaille <akim@epita.fr>
18013
18014 * configure.in (AC_INIT): Bump to 1.49b.
18015 (AM_INIT_AUTOMAKE): Short invocation.
18016
b8548114
AD
180172002-05-02 Akim Demaille <akim@epita.fr>
18018
18019 Version 1.49a.
18020
c20cd1fa
AD
180212002-05-01 Akim Demaille <akim@epita.fr>
18022
18023 * src/skeleton.h: Remove.
18024
8a9566d4
AD
180252002-05-01 Akim Demaille <akim@epita.fr>
18026
18027 * src/skeleton.h: Fix the #endif.
18028 Reported by Magnus Fromreide.
18029
8c6d399a
PE
180302002-04-26 Paul Eggert <eggert@twinsun.com>
18031
18032 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
18033 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 18034 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 18035
2b7ed18a
RA
180362002-04-25 Robert Anisko <robert@lrde.epita.fr>
18037
18038 * src/scan-skel.l: Postprocess quadrigraphs.
18039
18040 * src/reader.c (copy_character): New function, used to output
18041 single characters while replacing `[' and `]' with quadrigraphs, to
18042 avoid troubles with M4 quotes.
18043 (copy_comment): Output characters with copy_character.
18044 (read_additionnal_code): Likewise.
18045 (copy_string2): Likewise.
18046 (copy_definition): Likewise.
18047
18048 * tests/calc.at: Exercise M4 quoting.
18049
34a89c50
AD
180502002-04-25 Akim Demaille <akim@epita.fr>
18051
18052 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
18053 between `!' and the command.
18054 Reported by Paul Eggert.
18055
0dd1580a
RA
180562002-04-24 Robert Anisko <robert@lrde.epita.fr>
18057
18058 * tests/calc.at: Exercise prologue splitting.
18059
18060 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
18061 `b4_post_prologue' instead of `b4_prologue'.
18062
18063 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
18064 muscles.
18065 (output): Free pre_prologue_obstack and post_prologue_obstack.
18066 * src/files.h, src/files.c (attrs_obstack): Remove.
18067 (pre_prologue_obstack, post_prologue_obstack): New.
18068 * src/reader.c (copy_definition): Add a parameter to specify the
18069 obstack to fill, instead of using attrs_obstack unconditionally.
18070 (read_declarations): Pass pre_prologue_obstack to copy_definition if
18071 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
18072
83c1796f
PE
180732002-04-23 Paul Eggert <eggert@twinsun.com>
18074
18075 * data/bison.simple: Remove unnecessary commentary and white
18076 space differences from 1_29-branch.
18077 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
18078
18079 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
18080 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
18081 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
18082 constructors or destructors.
18083
18084 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
18085
1207eeac
AD
180862002-04-23 Akim Demaille <akim@epita.fr>
18087
18088 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
18089 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
18090 location with columns.
18091 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
18092 All reported by Paul Eggert.
18093
78ab8f67
AD
180942002-04-22 Akim Demaille <akim@epita.fr>
18095
18096 * src/reduce.c (dump_grammar): Move to...
18097 * src/gram.h, src/gram.c (grammar_dump): here.
18098 Be sure to separate long item numbers.
18099 Don't read the members of a rule's prec if its nil.
18100
133c20e2
AD
181012002-04-22 Akim Demaille <akim@epita.fr>
18102
18103 * src/output.c (table_size, table_grow): New.
18104 (MAXTABLE): Remove, replace uses with table_size.
18105 (pack_vector): Instead of dying when the table is too big, grow it.
18106
9515e8a7
AD
181072002-04-22 Akim Demaille <akim@epita.fr>
18108
18109 * data/bison.simple (yyr1): Its type is that of a token number.
18110 * data/bison.c++ (r1_): Likewise.
18111 * tests/regression.at (Web2c Actions): Adjust.
18112
23c5a174
AD
181132002-04-22 Akim Demaille <akim@epita.fr>
18114
18115 * src/reader.c (token_translations_init): 256 is now the default
18116 value for the error token, i.e., it will be assigned another
18117 number if the user assigned 256 to one of her tokens.
18118 (reader): Don't force 256 to error.
18119 * doc/bison.texinfo (Symbols): Adjust.
18120 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
18121 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
18122 etc. instead of 10, 20, 30 (which was used to `jump' over error
18123 (256) and undefined (2)).
18124
5fbb0954
AD
181252002-04-22 Akim Demaille <akim@epita.fr>
18126
18127 Propagate more token_number_t.
18128
18129 * src/gram.h (token_number_as_item_number)
18130 (item_number_as_token_number): New.
18131 * src/output.c (GENERATE_OUTPUT_TABLE): New.
18132 Use it to create output_item_number_table and
18133 output_token_number_table.
18134 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18135 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
18136 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
18137 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
18138
4f940944
AD
181392002-04-22 Akim Demaille <akim@epita.fr>
18140
18141 * src/output.h, src/output.c (get_lines_number): Remove.
18142
3ded9a63
AD
181432002-04-19 Akim Demaille <akim@epita.fr>
18144
18145 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
18146 as Lex/Flex'.
18147 (Debugging): More details about enabling the debugging features.
18148 (Table of Symbols): Describe $$, $n, @$, and @n.
18149 Suggested by Tim Josling.
18150
e0c471a9
AD
181512002-04-19 Akim Demaille <akim@epita.fr>
18152
18153 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
18154
fecc10cd
AD
181552002-04-10 Akim Demaille <akim@epita.fr>
18156
18157 * src/system.h: Rely on HAVE_LIMITS_H.
18158 Suggested by Paul Eggert.
18159
51dec47b
AD
181602002-04-09 Akim Demaille <akim@epita.fr>
18161
18162 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
18163 full stderr, and strip it according to the bison options, instead
18164 of composing the error message from different bits.
18165 This makes it easier to check for several error messages.
18166 Adjust all the invocations.
18167 Add an invocation exercising the error token.
18168 Add an invocation demonstrating a stupid error message.
18169 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
18170 Adjust the tests.
18171 Error message are for stderr, not stdout.
18172
007a50a4
AD
181732002-04-09 Akim Demaille <akim@epita.fr>
18174
18175 * src/gram.h, src/gram.c (error_token_number): Remove, use
18176 errtoken->number.
18177 * src/reader.c (reader): Don't specify the user token number (2)
18178 for $undefined, as it uselessly prevents using it.
18179 * src/gram.h (token_number_t): Move to...
18180 * src/symtab.h: here.
18181 (state_t.number): Is a token_number_t.
18182 * src/print.c, src/reader.c: Use undeftoken->number instead of
18183 hard coded 2.
18184 (Even though this 2 is not the same as above: the number of the
18185 undeftoken remains being 2, it is its user token number which
18186 might not be 2).
18187 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
18188 `user_token_number_max'.
18189 Output `undef_token_number'.
18190 * data/bison.simple, data/bison.c++: Use them.
18191 Be sure to map invalid yylex return values to
18192 `undef_token_number'. This saves us from gratuitous SEGV.
18193
18194 * tests/conflicts.at (Solved SR Conflicts)
18195 (Unresolved SR Conflicts): Adjust.
18196 * tests/regression.at (Web2c Actions): Adjust.
18197
06446ccf
AD
181982002-04-08 Akim Demaille <akim@epita.fr>
18199
18200 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
18201 Adding #line.
18202 Remove the duplicate `typedefs'.
18203 (RhsNumberType): Fix the declaration and various other typos.
18204 Use __ofile__.
18205 * data/bison.simple: Use __ofile__.
18206 * src/scan-skel.l: Handle __ofile__.
18207
62a3e4f0
AD
182082002-04-08 Akim Demaille <akim@epita.fr>
18209
18210 * src/gram.h (item_number_t): New, the type of item numbers in
18211 RITEM. Note that it must be able to code symbol numbers as
18212 positive number, and the negation of rule numbers as negative
18213 numbers.
18214 Adjust all dependencies (pretty many).
18215 * src/reduce.c (rule): Remove this `short *' pointer: use
18216 item_number_t.
18217 * src/system.h (MINSHORT, MAXSHORT): Remove.
18218 Include `limits.h'.
18219 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
18220 (shortcpy): Remove.
18221 (MAXTABLE): Move to...
18222 * src/output.c (MAXTABLE): here.
18223 (prepare_rules): Use output_int_table to output rhs.
18224 * data/bison.simple, data/bison.c++: Adjust.
18225 * tests/torture.at (Big triangle): Move the limit from 254 to
18226 500.
18227 * tests/regression.at (Web2c Actions): Ajust.
18228
18229 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
18230 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18231 passes, but produces negative #line number, once fixed, GCC is
18232 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18233 C), it passes.
18234 * src/state.h (state_h): Code input lines on ints, not shorts.
18235
bb88b0fc
AD
182362002-04-08 Akim Demaille <akim@epita.fr>
18237
18238 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18239 and then the grammar.
18240
9a636f47
AD
182412002-04-08 Akim Demaille <akim@epita.fr>
18242
18243 * src/system.h: No longer using strndup.
18244
680e8701
AD
182452002-04-07 Akim Demaille <akim@epita.fr>
18246
18247 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18248 * src/output.c (output_table_data): Return the longest number.
18249 (prepare_tokens): Output `token_number_max').
18250 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18251 New.
18252 Use them to define yy_token_number_type/TokenNumberType.
18253 Use this type for yytranslate.
18254 * tests/torture.at (Big triangle): Push the limit from 124 to
18255 253.
18256 * tests/regression.at (Web2c Actions): Adjust.
18257
817e9f41
AD
182582002-04-07 Akim Demaille <akim@epita.fr>
18259
18260 * tests/torture.at (Big triangle): New.
18261 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18262 * tests/existing.at: here.
18263
5123689b
AD
182642002-04-07 Akim Demaille <akim@epita.fr>
18265
18266 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18267 nritems.
18268 Adjust dependencies.
18269
f3849179
AD
182702002-04-07 Akim Demaille <akim@epita.fr>
18271
18272 * src/reader.c: Normalize increments to prefix form.
18273
bd02036a
AD
182742002-04-07 Akim Demaille <akim@epita.fr>
18275
18276 * src/reader.c, symtab.c: Remove debugging code.
18277
db8837cb
AD
182782002-04-07 Akim Demaille <akim@epita.fr>
18279
18280 Rename all the `bucket's as `symbol_t'.
18281
18282 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18283 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18284 * src/symtab.c, src/symtab.h (bucket): Rename as...
18285 (symbol_t): this.
18286 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18287 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18288 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18289 (buckets_new, buckets_free, buckets_do): Rename as...
18290 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18291 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18292 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18293 (symbols_new, symbols_free, symbols_do): these.
18294
72a23c97
AD
182952002-04-07 Akim Demaille <akim@epita.fr>
18296
18297 Use lib/hash for the symbol table.
18298
18299 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18300 EOF.
18301 * src/lex.c (lex): Set the `number' member of new terminals.
18302 * src/reader.c (bucket_check_defined, bucket_make_alias)
18303 (bucket_check_alias_consistence, bucket_translation): New.
18304 (reader, grammar_free, readgram, token_translations_init)
18305 (packsymbols): Adjust.
18306 (reader): Number the predefined tokens.
18307 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18308 for predefined tokens.
18309 * src/symtab.h (bucket): Remove all the hash table related
18310 members.
18311 * src/symtab.c (symtab): Replace by...
18312 (bucket_table): this.
18313 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18314 (buckets_new, buckets_do): New.
18315
280a38c3
AD
183162002-04-07 Akim Demaille <akim@epita.fr>
18317
18318 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
18319 (start_symbol, max_user_token_number, semantic_parser)
18320 (error_token_number): Initialize.
18321 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
18322 Initialize.
18323 (reader): Don't.
18324 (errtoken, eoftoken, undeftoken, axiom): Extern.
18325
03b31c0c
AD
183262002-04-07 Akim Demaille <akim@epita.fr>
18327
18328 * src/gram.h (rule_s): prec and precsym are now pointers
18329 to the bucket giving the priority/associativity.
18330 Member `associativity' removed: useless.
18331 * src/reduce.c, src/conflicts.c: Adjust.
18332
8b3df748
AD
183332002-04-07 Akim Demaille <akim@epita.fr>
18334
18335 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
18336 Properly escape the symbols' TAG when outputting them.
18337
e601aa1d
AD
183382002-04-07 Akim Demaille <akim@epita.fr>
18339
18340 * src/lalr.h (LA): Is a bitsetv, not bitset*.
18341
b0299a2e
AD
183422002-04-07 Akim Demaille <akim@epita.fr>
18343
18344 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
18345 (LArule): this, which is an array to rule_t*.
18346 * src/print.c, src/conflicts.c: Adjust.
18347
d7e1f00c
AD
183482002-04-07 Akim Demaille <akim@epita.fr>
18349
18350 * src/gram.h (rule_t): Rename `number' as `user_number'.
18351 `number' is a new member.
18352 Adjust dependencies.
18353 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
18354
cc9305dd
AD
183552002-04-07 Akim Demaille <akim@epita.fr>
18356
18357 As a result of the previous patch, it is no longer needed
18358 to reorder ritem itself.
18359
18360 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
18361
b0940840
AD
183622002-04-07 Akim Demaille <akim@epita.fr>
18363
18364 Be sure never to walk through RITEMS, but use only data related to
18365 the rules themselves. RITEMS should be banished.
18366
18367 * src/output.c (output_token_translations): Rename as...
18368 (prepare_tokens): this.
18369 In addition to `translate', prepare the muscles `tname' and
18370 `toknum', which were handled by...
18371 (output_rule_data): this.
18372 Remove, and move the remainder of its outputs into...
18373 (prepare_rules): this new routines, which also merges content from
18374 (output_gram): this.
18375 (prepare_rules): Be sure never to walk through RITEMS.
18376 (output_stos): Rename as...
18377 (prepare_stos): this.
18378 (output): Always invoke prepare_states, after all, just don't use it
18379 in the output if you don't need it.
18380
643a5994
AD
183812002-04-07 Akim Demaille <akim@epita.fr>
18382
18383 * src/LR0.c (new_state): Display `nstates' as the name of the
18384 newly created state.
18385 Adjust to initialize first_state and last_state if needed.
18386 Be sure to distinguish the initial from the final state.
18387 (new_states): Create the itemset of the initial state, and use
18388 new_state.
18389 * src/closure.c (closure): Now that the initial state has its
18390 items properly set, there is no need for a special case when
18391 creating `ruleset'.
18392
18393 As a result, now the rule 0, reducing to $axiom, is visible in the
18394 outputs. Adjust the test suite.
18395
18396 * tests/conflicts.at (Solved SR Conflicts)
18397 (Unresolved SR Conflicts): Adjust.
18398 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
18399 * tests/conflicts.at (S/R in initial): New.
18400
b4c4ccc2
AD
184012002-04-07 Akim Demaille <akim@epita.fr>
18402
18403 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
18404 the RHS of the rules.
18405 * src/output.c (output_gram): Likewise.
18406
bba97eb2
AD
184072002-04-07 Akim Demaille <akim@epita.fr>
18408
18409 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
18410 bucket.
18411 Adjust all dependencies.
18412 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
18413 `number' of the buckets too.
18414 * src/gram.h: Include `symtab.h'.
18415 (associativity): Move to...
18416 * src/symtab.h: here.
18417 No longer include `gram.h'.
18418
c3b407f4
AD
184192002-04-07 Akim Demaille <akim@epita.fr>
18420
18421 * src/gram.h, src/gram.c (rules_rhs_length): New.
18422 (ritem_longest_rhs): Use it.
18423 * src/gram.h (rule_t): `number' is a new member.
18424 * src/reader.c (packgram): Set it.
18425 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
18426 the end of `rules', and count them out of `nrules'.
18427 (reduce_output, dump_grammar): Adjust.
18428 * src/print.c (print_grammar): It is no longer needed to check for
18429 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
18430 * tests/reduce.at (Reduced Automaton): New test.
18431
11652ab3
AD
184322002-04-07 Akim Demaille <akim@epita.fr>
18433
18434 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
18435 lacking `+ 1' to nrules, Bison reported as useless a token if it
18436 was used solely to set the precedence of the last rule...
18437
26b23c1a
AD
184382002-04-07 Akim Demaille <akim@epita.fr>
18439
18440 * data/bison.c++, data/bison.simple: Don't output the current file
18441 name in #line, to avoid useless diffs between two identical
18442 outputs under different names.
18443
18bcecb0
AD
184442002-04-07 Akim Demaille <akim@epita.fr>
18445
18446 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
18447 Normalize loops to using `< nrules + 1', not `<= nrules'.
18448
fa770c86
AD
184492002-04-07 Akim Demaille <akim@epita.fr>
18450
18451 * TODO: Update.
18452
d9b739c3
AD
184532002-04-07 Akim Demaille <akim@epita.fr>
18454
18455 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
18456 bucket.value as bucket.number.
18457
99013900
AD
184582002-04-07 Akim Demaille <akim@epita.fr>
18459
18460 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
18461 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18462 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
18463 RHS, instead of being an index in RITEMS.
18464
e966383b
PE
184652002-04-04 Paul Eggert <eggert@twinsun.com>
18466
18467 * doc/bison.texinfo: Update copyright date.
18468 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18469 (Symbols): Warn about running Bison in one character set,
18470 but compiling and/or running in an incompatible one.
18471 Warn about character code 256, too.
18472
184732002-04-03 Paul Eggert <eggert@twinsun.com>
18474
18475 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18476 YYERROR_VERBOSE is nonzero, not whether it is defined.
18477
18478 Merge changes from bison-1_29-branch.
c307773e 18479
8d6c48b9
PE
184802002-03-20 Paul Eggert <eggert@twinsun.com>
18481
18482 Merge fixes from Debian bison_1.34-1.diff.
18483
18484 * configure.in (AC_PREREQ): 2.53.
18485
e53c6322
AD
184862002-03-20 Akim Demaille <akim@epita.fr>
18487
18488 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18489
9ffbeca7
PE
184902002-03-19 Paul Eggert <eggert@twinsun.com>
18491
21db0b2a
PE
18492 * src/bison.simple (YYCOPY): New macro.
18493 (YYSTACK_RELOCATE): Use it.
18494 Remove Type arg; no longer needed. All callers changed.
18495 (yymemcpy): Remove; no longer needed.
18496
9ffbeca7
PE
18497 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18498 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18499
642cb8f8
AD
185002002-03-19 Akim Demaille <akim@epita.fr>
18501
18502 Test and fix the #line outputs.
18503
18504 * tests/atlocal.at (GCC): New.
18505 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 18506 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
18507 (Action synch line, Epilogue synch line): New tests.
18508 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18509 * data/bison.simple, data/bison.c++: Use it.
18510
3c31a486
AD
185112002-03-19 Akim Demaille <akim@epita.fr>
18512
18513 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18514 (Solved SR Conflicts, %expect not enough, %expect right)
18515 (%expect too much): Move to...
18516 * tests/conflicts.at: this new file.
18517
0d8bed56
AD
185182002-03-19 Akim Demaille <akim@epita.fr>
18519
18520 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18521 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18522 that we can move to enums for instance.
18523 * src/output.c (token_definitions_output): Output a list of
18524 `token-name, token-number' instead of the #define.
18525 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18526
9208d17f
AD
185272002-03-14 Akim Demaille <akim@epita.fr>
18528
18529 Use Gettext 0.11.1.
18530
af27eacb
RA
185312002-03-09 Robert Anisko <robert@lrde.epita.fr>
18532
18533 * data/bison.c++: Make the user able to add members to the generated
18534 parser by subclassing.
18535
9101a310
RA
185362002-03-05 Robert Anisko <robert@lrde.epita.fr>
18537
18538 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18539 a character.
18540 Reported by Nicolas Tisserand and Nicolas Burrus.
18541
fff9bf0b
RA
185422002-03-04 Robert Anisko <robert@lrde.epita.fr>
18543
18544 * src/reader.c: Warn about lacking semi-colons, do not complain.
18545
64dba31e
RA
185462002-03-04 Robert Anisko <robert@lrde.epita.fr>
18547
18548 * data/bison.c++: Remove a debug line.
18549
374f5a14
RA
185502002-03-04 Robert Anisko <robert@lrde.epita.fr>
18551
18552 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18553 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18554 provide a default implementation.
18555
bfcf1f3a
AD
185562002-03-04 Akim Demaille <akim@epita.fr>
18557
18558 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18559 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18560 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18561 * tests/semantic.at (Parsing Guards): Similarly.
18562 * src/reader.at (readgram): Complain if the last rule is not ended
18563 with a semi-colon.
18564
65ccf9fc
AD
185652002-03-04 Akim Demaille <akim@epita.fr>
18566
18567 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18568 * src/closure.c: here.
18569 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18570 RTC.
18571 * src/warshall.h, src/warshall.c: Remove.
18572 * tests/sets.at (Broken Closure): Adjust.
18573
d0039cbc
AD
185742002-03-04 Akim Demaille <akim@epita.fr>
18575
18576 * src/output.c (output_skeleton): tempdir is const.
18577 bytes_read is unused.
18578
345cea78
AD
185792002-03-04 Akim Demaille <akim@epita.fr>
18580
18581 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18582 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18583 Update.
18584 From Michael Hayes.
18585
564801f7
AD
185862002-03-04 Akim Demaille <akim@epita.fr>
18587
18588 * src/closure.c (closure): `r' is unused.
18589
e5352bc7
AD
185902002-03-04 Akim Demaille <akim@epita.fr>
18591
18592 * tests/sets.at (Broken Closure): Add the ending `;'.
18593 * src/reader.at (readgram): Complain if a rule is not ended with a
18594 semi-colon.
18595
914feea9
AD
185962002-03-04 Akim Demaille <akim@epita.fr>
18597
18598 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18599 (count_sr_conflicts): Use bitset_count.
18600 * src/reduce.c (inaccessable_symbols): Ditto.
18601 (bits_size): Remove.
18602 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18603
f0250de6
AD
186042002-03-04 Akim Demaille <akim@epita.fr>
18605
18606 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18607 * src/reduce.c: Remove the `bitset_zero's following the
18608 `bitset_create's, as now it is performed by the latter.
18609
ef017502
AD
186102002-03-04 Akim Demaille <akim@epita.fr>
18611
18612 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18613 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18614 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18615 latest sources from Michael.
18616
76514394
AD
186172002-03-04 Akim Demaille <akim@epita.fr>
18618
18619 * src/output.c (output): Don't free the grammar.
18620 * src/reader.c (grammar_free): New.
18621 * src/main.c (main): Call it and don't free symtab here.
18622
55024580
AD
186232002-03-04 Akim Demaille <akim@epita.fr>
18624
18625 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18626 before returning.
18627 Reported by Benoit Perrot.
18628
f9abaa2c
AD
186292002-03-04 Akim Demaille <akim@epita.fr>
18630
18631 Use bitset operations when possible, not loops over bits.
18632
18633 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18634 bitset_or.
18635 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18636 * src/reduce.c (useless_nonterminals): Formatting changes.
18637 * src/warshall.c (TC): Use bitset_or.
18638
0e721e75
AD
186392002-03-04 Akim Demaille <akim@epita.fr>
18640
18641 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18642 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18643 Ditto.
18644
0fb1ffb1
AD
186452002-03-04 Akim Demaille <akim@epita.fr>
18646
18647 * src/lalr.c (F): Now a bitset*.
18648 Adjust all dependencies.
18649
b86796bf
AD
186502002-03-04 Akim Demaille <akim@epita.fr>
18651
18652 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18653 Adjust all dependencies.
18654
602bbf31
AD
186552002-03-04 Akim Demaille <akim@epita.fr>
18656
18657 * src/L0.c, src/LR0.h (nstates): Be size_t.
18658 Adjust comparisons (signed vs unsigned).
18659 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18660 bitset*.
18661 Adjust all dependencies.
18662
d8a0245c
AD
186632002-03-04 Akim Demaille <akim@epita.fr>
18664
18665 * src/closure.c (firsts): Now, also a bitset.
18666 Adjust all dependencies.
18667 (varsetsize): Remove, now unused.
18668 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18669
34ba9743
AD
186702002-03-04 Akim Demaille <akim@epita.fr>
18671
18672 * src/print.c: Convert to use bitset.h, not hand coded iterations
18673 over ints.
18674
ed86e78c
AD
186752002-03-04 Akim Demaille <akim@epita.fr>
18676
18677 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18678
dfdb1797
AD
186792002-03-04 Akim Demaille <akim@epita.fr>
18680
18681 * src/closure.c (ruleset): Be a bitset.
18682 (rulesetsize): Remove.
18683
7086e707
AD
186842002-03-04 Akim Demaille <akim@epita.fr>
18685
18686 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18687 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18688 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18689 * src/closure.c (fderives): Be an array of bitsets.
18690
98254360
RA
186912002-02-28 Robert Anisko <robert@lrde.epita.fr>
18692
18693 * data/bison.c++: Merge the two generated headers. Insert a copyright
18694 notice in each output file.
18695
a75c057f
AD
186962002-02-28 Akim Demaille <akim@epita.fr>
18697
18698 * data/bison.c++: Copy the prologue of bison.simple to fetch
18699 useful M4 definitions, such as b4_header_guard.
18700
06b00abc
AD
187012002-02-25 Akim Demaille <akim@epita.fr>
18702
18703 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
18704 translator friendly scheme for the bgr
18705 copyright notice.
06b00abc 18706
70e7d534
AD
187072002-02-25 Akim Demaille <akim@epita.fr>
18708
18709 * src/output.c (header_output): Remove, now handled completely via
18710 M4.
18711
abe017f6
AD
187122002-02-25 Akim Demaille <akim@epita.fr>
18713
18714 * m4/m4.m4: New, from CVS Autoconf.
18715 * configure.in: Invoke it.
18716 * src/output.c (output_skeleton): Use its result instead of the
18717 hard coded name.
18718
381fb12e
AD
187192002-02-25 Akim Demaille <akim@epita.fr>
18720
18721 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18722 Fileutils 4.1.5.
18723 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18724 * src/output.c (output_skeleton): Use mkstemp to create a real
18725 temporary file.
18726 Move the filling of `skeleton' and its muscle to...
18727 (prepare): here.
18728 (output): Move the definition of the prologue muscle to...
18729 (prepare): here.
18730 * src/system.h (DEFAULT_TMPDIR): New.
18731
6f38107f
PE
187322002-02-14 Paul Eggert <eggert@twinsun.com>
18733
18734 Remove the support for C++ namespace cleanliness; it was
18735 causing more problems than it was curing, since it didn't work
18736 properly on some nonstandard C++ compilers. This can wait
18737 for a proper C++ parser.
18738
18739 * NEWS: Document this.
18740 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18741 of C++, as it's treated like C now.
18742 * src/bison.simple (YYSTD): Remove.
18743 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18744 Treat C++ just like Standard C instead of trying to support
18745 namespace cleanliness.
18746
80cce3da
AD
187472002-02-14 Akim Demaille <akim@epita.fr>
18748
18749 * tests/regression.at (else): Adjust to Andreas' change.
18750
842e8679
AD
187512002-02-14 Akim Demaille <akim@epita.fr>
18752
18753 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18754
4bda3f10
AD
187552002-02-13 Andreas Schwab <schwab@suse.de>
18756
18757 * src/output.c (output_rule_data): Don't output NULL, it might
18758 not be defined yet.
18759
4162fa07 187602002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 18761
4162fa07
RA
18762 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18763 (Copyright notice): Update.
b418ecd8 18764
bd16a5dc
AD
187652002-02-11 Akim Demaille <akim@epita.fr>
18766
18767 * tests/regression.at (%nonassoc and eof): Don't include
18768 nonportable headers.
18769
8d69a1a3
RA
187702002-02-08 Robert Anisko <robert@lrde.epita.fr>
18771
18772 * data/bison.c++: Correct error recovery. Make the user able to
18773 initialize the starting location.
18774
9b2d0677
AD
187752002-02-07 Akim Demaille <akim@epita.fr>
18776
18777 * tests/input.at: New.
18778
69e2658b
RA
187792002-02-07 Robert Anisko <robert@lrde.epita.fr>
18780
18781 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 18782 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
18783 directives around tables only needed for debugging.
18784
4aacc3a7
RA
187852002-02-07 Robert Anisko <robert@lrde.epita.fr>
18786
18787 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18788 C++ parsers.
18789 (yy::b4_name::parse): Use print_.
18790
762a801e
RA
187912002-02-07 Robert Anisko <robert@lrde.epita.fr>
18792
18793 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18794
4bb2bc3f
RA
187952002-02-07 Robert Anisko <robert@lrde.epita.fr>
18796
18797 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18798 C++ parsers.
18799 (yy::b4_name::parse): Build verbose error messages, and use error_.
18800
6b45a3ca
RA
188012002-02-06 Robert Anisko <robert@lrde.epita.fr>
18802
18803 * data/bison.c++: Fix m4 quoting in comments.
18804
50997c6e
RA
188052002-02-06 Robert Anisko <robert@lrde.epita.fr>
18806
18807 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18808 not expanded by m4.
18809
3f3eed27
AD
188102002-02-05 Akim Demaille <akim@epita.fr>
18811
18812 * data/bison.c++: Adjust to the M4 back end.
18813 More is certainly needed.
18814
be2a1a68
AD
188152002-02-05 Akim Demaille <akim@epita.fr>
18816
18817 Give a try to M4 as a back end.
18818
18819 * lib/readpipe.c: New, from wdiff.
18820 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18821 BISON_HAIRY.
18822 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18823 specific values. Now it is m4 that performs the lookup.
18824 * src/parse-skel.y: Remove.
18825 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18826 * src/output.c (actions_output, guards_output)
18827 (token_definitions_output): No longer keeps track of the output
18828 line number, hence remove the second argument.
18829 (guards_output): Check against the guard member of a rule, not the
18830 action member.
18831 Adjust callers.
18832 (output_skeleton): Don't look for the skeleton location, let m4 do
18833 that.
18834 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18835 file will be used.
18836 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18837 (prepare): Given that for the time being changesyntax is not
18838 usable in M4, rename the muscles using `-' to `_'.
18839 Define `defines_flag', `output_parser_name' and `output_header_name'.
18840 * src/output.h (actions_output, guards_output)
18841 (token_definitions_output): Adjust prototypes.
18842 * src/scan-skel.l: Instead of scanning the skeletons, it now
18843 processes the output of m4: `__oline__' and `#output'.
18844 * data/bison.simple: Adjust to be used by M4(sugar).
18845 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18846 to date.
18847 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18848 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18849 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18850 shamelessly stolen from CVS Autoconf.
18851
beda758b
AD
188522002-02-05 Akim Demaille <akim@epita.fr>
18853
18854 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18855 * configure.in: Check for the declarations of free and malloc.
18856 * src/muscle_tab.c: Adjust.
18857
5ece6d43
AD
188582002-02-05 Akim Demaille <akim@epita.fr>
18859
18860 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18861 which have no values.
18862
5bb18f9a
AD
188632002-02-05 Akim Demaille <akim@epita.fr>
18864
18865 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18866 * data/: here.
18867
894dd62e
PE
188682002-01-29 Paul Eggert <eggert@twinsun.com>
18869
18870 * src/bison.simple (YYSIZE_T): Do not define merely because
18871 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18872 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18873
82841af7
AD
188742002-01-27 Akim Demaille <akim@epita.fr>
18875
18876 Fix `%nonassoc and eof'.
18877
18878 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18879 which were not properly copied! Replace
18880 memcpy (res->errs, src->errs, src->nerrs);
18881 with
18882 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18883 !!!
18884 * tests/regression.at (%nonassoc and eof): Adjust to newest
18885 Autotest: `.' is not in the PATH.
18886
318b76e9
AD
188872002-01-27 Akim Demaille <akim@epita.fr>
18888
18889 * tests/sets.at (AT_EXTRACT_SETS): New.
18890 (Nullable): Use it.
18891 (Firsts): New.
18892
30d2f3d5
AD
188932002-01-26 Akim Demaille <akim@epita.fr>
18894
18895 * tests/actions.at, tests/calc.at, tests/headers.at,
18896 * tests/torture.at: Adjust to the newest Autotest which no longer
18897 forces `.' in the PATH.
18898
30f8c395
AD
188992002-01-25 Akim Demaille <akim@epita.fr>
18900
18901 * tests/regression.at (%nonassoc and eof): New.
18902 Suggested by Robert Anisko.
18903
29ae55f1
AD
189042002-01-24 Akim Demaille <akim@epita.fr>
18905
18906 Bison dumps core when trying to complain about broken input files.
18907 Reported by Cris van Pelt.
18908
18909 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18910 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18911 into...
18912 (Invalid inputs): Strengthen: exercise parse_percent_token.
18913
2b548aa6
RA
189142002-01-24 Robert Anisko <robert.anisko@epita.fr>
18915
18916 * src/Makefile.am: Add bison.c++.
18917 * src/bison.c++: New skeleton.
18918
bb0146c2
AD
189192002-01-21 Paolo Bonzini <bonzini@gnu.org>
18920
18921 * po/it.po: New.
18922
bec30531
AD
189232002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
18924
18925 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
18926
fc6edc45
MA
189272002-01-20 Marc Autret <marc@gnu.org>
18928
18929 * src/files.c (compute_output_file_names): Fix
18930
5e5d5415
MA
189312002-01-20 Marc Autret <marc@gnu.org>
18932
18933 * tests/output.at: New test.
18934 * src/files.c (compute_base_names): Don't map extensions when
18935 the YACC flag is set, use defaults.
18936 Reported by Evgeny Stambulchik.
18937
44ea3fbd
MA
189382002-01-20 Marc Autret <marc@gnu.org>
18939
ba0fe3c7
PE
18940 * src/system.h: Need to define __attribute__ away for non-GCC
18941 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
18942 Suggested by Albert Chin-A-Young.
18943
338963d1
TVH
189442002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
18945
18946 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
18947 canonical definition.
18948 * src/system.h: Use the canonical definition for PARAMS (avoids
18949 a conflict with the macro from lib/hash.h).
18950
c57b2479
AD
189512002-01-11 Akim Demaille <akim@epita.fr>
18952
18953 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 18954 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 18955
b85810ae
AD
189562002-01-09 Akim Demaille <akim@epita.fr>
18957
18958 * src/files.c, src/files.h (output_infix): New.
18959 (tab_extension): Remove.
18960 (compute_base_names): Compute the former, drop the latter.
18961 * src/output.c (prepare): Insert the muscles `output-infix', and
18962 `output-suffix'.
18963 * src/parse-skel.y (string, string.1): New.
18964 (section.header): Use it.
18965 (section.yacc): Remove.
18966 (prefix): Remove too.
18967 * src/scan-skel.l: Adjust.
18968 * src/bison.simple, src/bison.hairy: Adjust.
18969
cae60122
AD
189702002-01-09 Akim Demaille <akim@epita.fr>
18971
18972 * configure.in (WERROR_CFLAGS): Compute it.
18973 * src/Makefile.am (CFLAGS): Pass it.
18974 * tests/atlocal.in (CFLAGS): Idem.
18975 * src/files.c: Fix a few warnings.
18976 (get_extension_index): Remove, unused.
18977
ae404801
AD
189782002-01-08 Akim Demaille <akim@epita.fr>
18979
18980 * src/getargs.c (AS_FILE_NAME): New.
18981 (getargs): Use it to convert DOSish file names.
18982 * src/files.c (base_name): Rename as full_base_name to avoid
18983 clashes with `base_name ()'.
18984 (filename_split): New.
18985 (compute_base_names): N-th rewrite, using filename_split.
18986
22312b71
AD
189872002-01-08 Akim Demaille <akim@epita.fr>
18988
18989 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
18990 New, stolen from the Fileutils 4.1.
18991 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
18992 * configure.in: Check for the presence of memrchr, and of its
18993 prototype.
18994
a67cef01
TVH
189952002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
18996
18997 * lib/hash.h (__P): Added definition for this macro.
18998 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
18999 BUILT_SOURCES, to ensure they are generated first.
19000 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
19001 %error-verbose to allow bootstrapping with bison 1.30x.
19002
2b25d624
AD
190032002-01-06 Akim Demaille <akim@epita.fr>
19004
19005 * src/reader.c (parse_braces): Don't fetch the next char, the
19006 convention is to fetch on entry.
19007 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
19008 'switch' without a following semicolon.
19009 * tests/regression.at (braces parsing): New.
19010
3460813b
AD
190112002-01-06 Akim Demaille <akim@epita.fr>
19012
19013 Bison is dead wrong in its RR conflict reports.
19014
19015 * tests/torture.at (GNU Cim Grammar): New.
19016 * src/conflicts.c (count_rr_conflicts): Fix.
19017
73784c64
AD
190182002-01-06 Akim Demaille <akim@epita.fr>
19019
19020 Creating package.m4 from configure.ac causes too many problems.
19021
19022 * tests/Makefile.am (package.m4): Create it by hand,
19023 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
19024
25d81090
AD
190252002-01-06 Akim Demaille <akim@epita.fr>
19026
19027 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
19028 skeleton.h.
19029
a9b8959e
PE
190302002-01-04 Paul Eggert <eggert@twinsun.com>
19031
19032 * doc/bison.texinfo (Debugging):
19033 Remove YYSTDERR; it's no longer defined or used.
19034 Also, s/cstdio.h/cstdio/.
19035
25d81090
AD
190362002-01-03 Akim Demaille <akim@epita.fr>
19037
19038 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
19039
1109455c
AD
190402002-01-03 Akim Demaille <akim@epita.fr>
19041
19042 * src/parse-skel.y (process_skeleton): Don't bind the parser's
19043 tracing code to --trace, wait for a better --trace option, with
19044 args.
19045
7ea5e977
AD
190462002-01-03 Akim Demaille <akim@epita.fr>
19047
19048 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
19049 The ISO C++ standard is extremely clear about it: stderr is
19050 considered a macro, not a regular symbol (see table 94 `Header
19051 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
19052 Therefore std:: does not apply to it. It still does with fprintf.
19053 Also, s/cstdio.h/cstdio/.
19054
fab5b110
AD
190552002-01-03 Akim Demaille <akim@epita.fr>
19056
19057 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
19058 for non system headers.
19059
aed7fd9b
AD
190602002-01-02 Akim Demaille <akim@epita.fr>
19061
19062 Equip the skeleton chain with location tracking, runtime trace,
19063 pure parser and scanner.
19064
19065 * src/parse-skel.y: Request a pure parser, locations, and prefix
19066 renaming.
19067 (%union): Having several members with the same type does not help
19068 type mismatches, simplify.
19069 (YYPRINT, yyprint): New.
19070 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
19071 (skel_error): this.
19072 Handle locations.
19073 * src/scan-skel.l: Adjust to these changes.
19074 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
19075 (LOCATION_PRINT, skel_control_t): New.
19076
24fad99e
AD
190772001-12-30 Akim Demaille <akim@epita.fr>
19078
19079 * src/parse-skel.y: Get rid of the shift/reduce conflict:
19080 replace `gb' with BLANKS.
19081 * src/scan-skel.l: Adjust.
19082
a4b36db4
AD
190832001-12-30 Akim Demaille <akim@epita.fr>
19084
19085 * src/system.h: We don't need nor want bcopy.
19086 Throw away MS-DOS crap: we don't need getpid.
19087 * configure.in: We don't need strndup. It was even causing
19088 problems: because Flex includes the headers *before* us,
19089 _GNU_SOURCE is not defined by config.h, and therefore strndup was
19090 not visible.
19091 * lib/xstrndup.c: New.
19092 * src/scan-skel.l: Use it.
19093 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
19094 * src/parse-skel.y: Use %directives instead of #defines.
19095
1239777d
AD
190962001-12-30 Akim Demaille <akim@epita.fr>
19097
19098 * src/skeleton.h: New.
19099 * src/output.c (output_parser, output_master_parser): Remove, dead
19100 code.
19101 * src/output.h (get_lines_number, actions_output, guards_output)
19102 (token_definitions_output): Prototype them.
19103 * src/parse-skel.y: Add the license notice.
19104 Include output.h and skeleton.h.
19105 (process_skeleton): Returns void, and takes a single parameter.
19106 * src/scan-skel.l: Add the license notice.
19107 Include skeleton.h.
19108 Don't use %option yylineno: it seems that then Flex imagines
19109 REJECT has been used, and therefore it won't reallocate its
19110 buffers (which makes no other sense to me than a bug). It results
19111 in warnings for `unused: yy_flex_realloc'.
19112
9b3add5b
RA
191132001-12-30 Robert Anisko <robert.anisko@epita.fr>
19114
19115 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19116 (MUSCLE_INSERT_PREFIX): ...to there.
19117 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19118 (MUSCLE_INSERT_PREFIX): Move from here...
19119
19120 * src/bison.hairy: Add a section directive. Put braces around muscle
19121 names. This parser skeleton is still broken, but Bison should not
19122 choke on a bad muscle 'syntax'.
19123 * src/bison.simple: Add a section directive. Put braces around muscle
19124 names.
19125
19126 * src/files.h (strsuffix, stringappend): Add declarations.
19127 (tab_extension): Add declaration.
19128 (short_base_name): Add declaration.
19129
19130 * src/files.c (strsuffix, stringappend): No longer static. These
19131 functions are used in the skeleton parser.
19132 (tab_extension): New.
19133 (compute_base_names): Use the computations done in this function
fab5b110 19134 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
19135 names.
19136 (short_base_name): No longer static.
19137
19138 * src/output.c (output_skeleton): New.
19139 (output): Disable call to output_master_parser, and give a try to
19140 a new skeleton handling system.
19141 (guards_output, actions_output): No longer static.
19142 (token_definitions_output, get_lines_number): No longer static.
19143
19144 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
19145
fab5b110 19146 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
19147 parse-skel.y.
19148
19149 * src/parse-skel.y: New file.
19150 * src/scan-skel.l: New file.
19151
b5b61c61
AD
191522001-12-29 Akim Demaille <akim@epita.fr>
19153
19154 %name-prefix is broken.
19155
19156 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
19157 Adjust all dependencies.
19158 * tests/headers.at (export YYLTYPE): Strengthen this test: use
19159 %name-prefix.
19160
19161 Renaming yylval but not yylloc is not consistent. Now we do.
19162
19163 * src/bison.simple: Prefix yylloc if used.
19164 * doc/bison.texinfo (Decl Summary): Document that.
19165
8c9a50be
AD
191662001-12-29 Akim Demaille <akim@epita.fr>
19167
19168 * doc/bison.texinfo: Promote `%long-directive' over
19169 `%long_directive'.
19170 Remove all references to fixed-output-files, yacc is enough.
19171
d99361e6
AD
191722001-12-29 Akim Demaille <akim@epita.fr>
19173
19174 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
19175 user prologue. These are defaults.
19176 * tests/actions.at (Mid-rule actions): Make sure the user can
19177 define YYDEBUG and YYERROR_VERBOSE.
19178
b9cecb91
AD
191792001-12-29 Akim Demaille <akim@epita.fr>
19180
19181 * src/output.c (header_output): Don't forget to export YYLTYPE and
19182 yylloc.
19183 * tests/headers.at (export YYLTYPE): New, make sure it does.
19184 * tests/regression.at (%union and --defines, Invalid CPP headers):
19185 Move to...
19186 * tests/headers.at: here.
19187
aea13e97
AD
191882001-12-29 Akim Demaille <akim@epita.fr>
19189
19190 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
19191
931394cb
AD
191922001-12-29 Akim Demaille <akim@epita.fr>
19193
19194 * tests/actions.at (Mid-rule actions): Output on a single line
19195 instead of several.
19196
704a47c4
AD
191972001-12-29 Akim Demaille <akim@epita.fr>
19198
19199 * doc/bison.texinfo: Formatting changes.
19200
091e20bb
AD
192012001-12-29 Akim Demaille <akim@epita.fr>
19202
19203 Don't store the token defs in a muscle, just be ready to output it
19204 on command. Now possible via `symbols'. Fixes a memory leak.
19205
19206 * src/output.c (token_definitions_output): New.
19207 (output_parser, header_output): Use it.
19208 * src/reader.c (symbols_save): Remove.
19209
cce71710
AD
192102001-12-29 Akim Demaille <akim@epita.fr>
19211
19212 * src/bison.simple: Do not provide a default for YYSTYPE and
19213 YYLTYPE before the user's prologue. Otherwise it's hardly... a
19214 default.
19215
82c035a8
AD
192162001-12-29 Akim Demaille <akim@epita.fr>
19217
19218 Mid-rule actions are simply... ignored!
19219
19220 * src/reader.c (readgram): Be sure to attach mid-rule actions to
19221 the empty-rule associated to the dummy symbol, not to the host
19222 rule.
19223 * tests/actions.at (Mid-rule actions): New.
19224
8419d367
AD
192252001-12-29 Akim Demaille <akim@epita.fr>
19226
19227 Memory leak.
19228
19229 * src/reader.c (reader): Free grammar.
19230
375d5806
AD
192312001-12-29 Akim Demaille <akim@epita.fr>
19232
19233 Memory leak.
19234
19235 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19236 since it allocates it for each state, although only one is needed.
19237 (allocate_storage): Do it here.
19238
f51cb8ff
AD
192392001-12-29 Akim Demaille <akim@epita.fr>
19240
19241 * src/options.h, src/options.c (create_long_option_table): Rename
19242 as...
19243 (long_option_table_new): this, with a clearer prototype.
19244 (percent_table): Remove, unused,
19245 * src/getargs.c (getargs): Adjust.
19246
29e88316
AD
192472001-12-29 Akim Demaille <akim@epita.fr>
19248
19249 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19250 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19251 as states.
19252
b9f71f19
AD
192532001-12-29 Akim Demaille <akim@epita.fr>
19254
19255 * src/lalr.c (build_relations): Rename `states' as `states1'.
19256 Sorry, I don't understand exactly what it is, no better name...
19257
1a2b5d37
AD
192582001-12-29 Akim Demaille <akim@epita.fr>
19259
19260 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19261 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19262 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19263 as rules.
19264
1cca533e
AD
192652001-12-29 Akim Demaille <akim@epita.fr>
19266
19267 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19268 ago.
19269
c03ae966
AD
192702001-12-29 Akim Demaille <akim@epita.fr>
19271
19272 * src/reader.c, src/reader.h (user_toknums): Remove.
19273 Adjust all users to use symbols[i]->user_token_number.
19274
5a670b1e
AD
192752001-12-29 Akim Demaille <akim@epita.fr>
19276
19277 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19278 Adjust all users to use symbols[i]->prec or ->assoc.
19279
ad949da9
AD
192802001-12-29 Akim Demaille <akim@epita.fr>
19281
19282 * src/reader.c, src/reader.h (tags): Remove.
19283 Adjust all users to use symbols[i]->tag.
19284
0e78e603
AD
192852001-12-29 Akim Demaille <akim@epita.fr>
19286
19287 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19288 and rule_table.
19289 * src/reader.c (packsymbols): Fill this table.
19290 Drop sprec.
19291 * src/conflicts.c (resolve_sr_conflict): Adjust.
19292 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19293 single table.
19294 Use symbols[i]->tag instead of tags[i].
19295
213e640e
AD
192962001-12-29 Akim Demaille <akim@epita.fr>
19297
19298 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19299 In addition, put a comment in there, to replace...
19300 * tests/regression.at (%union and C comments): Remove.
19301
e7b8bef1
AD
193022001-12-29 Akim Demaille <akim@epita.fr>
19303
19304 * tests/regression.at (Web2c Actions): Blindly move the actual
19305 output as expected output. The contents *seem* right to me, but I
19306 can't pretend reading perfectly parser tables... Nonetheless, all
19307 the other tests pass correctly, the table look OK, even though the
19308 presence of `$axiom' is to be noted: AFAICS it is useless (but
19309 harmless).
19310
b68e7744
AD
193112001-12-29 Akim Demaille <akim@epita.fr>
19312
19313 * src/reader.c (readgram): Don't add the rule 0 if there were no
19314 rules read. In other words, add it _after_ having performed
19315 grammar sanity checks.
19316 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
19317
78d5bae9
AD
193182001-12-29 Akim Demaille <akim@epita.fr>
19319
19320 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
19321 visible, and some states have now a different number.
19322
ff442794
AD
193232001-12-29 Akim Demaille <akim@epita.fr>
19324
19325 * src/reader.c (readgram): Bind the initial rule's lineno to that
19326 of the first rule.
19327 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
19328 (Solved SR Conflicts): Adjust rule 0's line number.
19329
610ab194
AD
193302001-12-29 Akim Demaille <akim@epita.fr>
19331
19332 Fix the `GAWK Grammar' failure.
19333
19334 * src/LR0.c (final_state): Initialize to -1 so that we do compute
19335 the reductions of the first state which was mistakenly confused
19336 with the final state because precisely final_state was initialized
19337 to 0.
19338 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
19339 now noticed by Bison.
19340 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
19341 have a reduction on $default.
19342
29d29c8f
AD
193432001-12-29 Akim Demaille <akim@epita.fr>
19344
19345 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
19346 rule line numbers.
19347 * src/closure.c (print_closure): Likewise.
19348 * src/derives.c (print_derives): Likewise.
19349 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
19350 now.
19351
7c6b64d0
AD
193522001-12-29 Akim Demaille <akim@epita.fr>
19353
19354 * src/lalr.c (lookaheads_print): New.
19355 (lalr): Call it when --trace-flag.
19356 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
19357 are dumped.
19358
3d4daee3
AD
193592001-12-29 Akim Demaille <akim@epita.fr>
19360
19361 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
19362 when walking through ritem, even via rule->rhs.
19363 * src/reduce.c (dump_grammar, useful_production, reduce_output)
19364 (useful_production, useless_nonterminals): Likewise.
19365 (reduce_grammar_tables): Likewise, plus update nritems.
19366 * src/nullable.c (set_nullable): Likewise.
19367 * src/lalr.c (build_relations): Likewise.
19368 * tests/sets.at (Nullable): Adjust.
19369 Fortunately, now, the $axiom is no longer nullable.
19370
9e7f6bbd
AD
193712001-12-29 Akim Demaille <akim@epita.fr>
19372
19373 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
19374 the 0-sentinel.
19375 * src/gram.c (ritem_longest_rhs): Likewise.
19376 * src/reduce.c (nonterminals_reduce): Likewise.
19377 * src/print_graph.c (print_graph): Likewise.
19378 * src/output.c (output_rule_data): Likewise.
19379 * src/nullable.c (set_nullable): Likewise.
19380
255ef638
AD
193812001-12-29 Akim Demaille <akim@epita.fr>
19382
19383 * src/output.c: Comment changes.
19384
0d8a7363
AD
193852001-12-27 Paul Eggert <eggert@twinsun.com>
19386
19387 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
19388 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
19389 Sparc, as they were causing more porting problems than the
19390 (minor) performance improvement was worth.
19391
19392 Also, catch up with 1.31's YYSTD.
19393
3db472b9
AD
193942001-12-27 Akim Demaille <akim@epita.fr>
19395
19396 * src/output.c (output_gram): Rely on nritems, not the
19397 0-sentinel. See below.
19398 Use -1 as separator, not 0.
19399 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
19400 Rely on -1 as separator in yyrhs, instead of 0.
19401 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
19402 twice `Now at end of input', therefore there are two lines less to
19403 expect.
19404
b365aa05
AD
194052001-12-27 Akim Demaille <akim@epita.fr>
19406
19407 * tests/regression.at (Unresolved SR Conflicts):
19408 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
19409 below.
19410
30171f79
AD
194112001-12-27 Akim Demaille <akim@epita.fr>
19412
19413 * src/LR0.c (new_state): Recognize the final state by the fact it
19414 is reached by eoftoken.
19415 (insert_start_shifting_state, insert_eof_shifting_state)
19416 (insert_accepting_state, augment_automaton): Remove, since now
19417 these states are automatically computed from the initial state.
19418 (generate_states): Adjust.
19419 * src/print.c: When reporting a rule number to the user, substract
19420 1, so that the axiom rule is rule 0, and the first user rule is 1.
19421 * src/reduce.c: Likewise.
19422 * src/print_graph.c (print_core): For the time being, just as for
19423 the report, depend upon --trace-flags to dump the full set of
19424 items.
19425 * src/reader.c (readgram): Once the grammar read, insert the rule
19426 0: `$axiom: START-SYMBOL $'.
19427 * tests/set.at: Adjust: rule 0 is now displayed, and since the
19428 number of the states has changed (the final state is no longer
19429 necessarily the last), catch up.
19430
75142d45
AD
194312001-12-27 Akim Demaille <akim@epita.fr>
19432
19433 Try to make the use of the eoftoken valid. Given that its value
19434 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
19435 is used instead of > 0 where appropriate, (ii), depend upon nritems
19436 instead of the 0-sentinel.
19437
19438 * src/gram.h, src/gram.c (nritems): New.
19439 Expected to be duplication of nitems, but for the time being...
19440 * src/reader.c (packgram): Assert nritems and nitems are equal.
19441 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
19442 * src/closure.c (print_closure, print_fderives): Likewise.
19443 * src/gram.c (ritem_print): Likewise.
19444 * src/print.c (print_core, print_grammar): Likewise.
19445 * src/print_graph.c: Likewise.
19446
b7c49edf
AD
194472001-12-27 Akim Demaille <akim@epita.fr>
19448
19449 * src/main.c (main): If there are complains after grammar
19450 reductions, then output the report anyway if requested, then die.
19451 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
19452 * src/reader.c (eoftoken): New.
19453 (parse_token_decl): If the token being defined has value `0', it
19454 is the eoftoken.
19455 (packsymbols): No longer hack `tags' to insert `$' by hand.
19456 Be sure to preserve the value of the eoftoken.
19457 (reader): Make sure eoftoken is defined.
19458 Initialize nsyms to 0: now eoftoken is created just like the others.
19459 * src/print.c (print_grammar): Don't special case the eof token.
19460 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
19461 lie anyway, albeit pleasant.
19462 * tests/calc.at: Exercise error messages with eoftoken.
19463 Change the grammar so that empty input is invalid.
19464 Adjust expectations.
19465 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19466
ec2da99f
AD
194672001-12-27 Akim Demaille <akim@epita.fr>
19468
19469 * configure.in: Check the protos of strchr ans strspn.
19470 Replace strchr if needed.
19471 * src/system.h: Provide the protos of strchr, strspn and memchr if
19472 missing.
19473 * lib/strchr.c: New.
19474 * src/reader.c (symbols_save): Use strchr.
19475
8adfa272
AD
194762001-12-27 Akim Demaille <akim@epita.fr>
19477
19478 * src/print.c, src/print_graph.c (escape): New.
19479 Use it to quote the TAGS outputs.
19480 * src/print_graph.c (print_state): Now errors are in red, and
19481 reductions in green.
19482 Prefer high to wide: output the state number on a line of its own.
19483
80dac38c
AD
194842001-12-27 Akim Demaille <akim@epita.fr>
19485
19486 * src/state.h, src/state.c (reductions_new): New.
19487 * src/LR0.c (set_state_table): Let all the states have a
19488 `reductions', even if reduced to 0.
19489 (save_reductions): Adjust.
19490 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19491 * src/print.c (print_reductions, print_actions): Adjust.
19492 * src/output.c (action_row): Adjust.
19493
2cec70b9
AD
194942001-12-27 Akim Demaille <akim@epita.fr>
19495
19496 * src/state.h, src/state.c (errs_new, errs_dup): New.
19497 * src/LR0.c (set_state_table): Let all the states have an errs,
19498 even if reduced to 0.
19499 * src/print.c (print_errs, print_reductions): Adjust.
19500 * src/output.c (output_actions, action_row): Adjust.
19501 * src/conflicts.c (resolve_sr_conflict): Adjust.
19502
13ca549a
AD
195032001-12-27 Akim Demaille <akim@epita.fr>
19504
19505 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19506
5092aba5
AD
195072001-12-27 Akim Demaille <akim@epita.fr>
19508
19509 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19510 * src/print.c: here.
19511 (lookaheadset, shiftset): New, used as additional storage by
19512 print_reductions.
19513 (print_results): Adjust.
19514 (print_shifts, print_gotos, print_errs): New, extracted from...
19515 (print_actions): here.
19516 * src/print_graph.c (print_actions): Remove dead code.
19517
11e2beca
AD
195182001-12-27 Akim Demaille <akim@epita.fr>
19519
19520 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19521 `$n' and `@n'.
19522
dac3c910
AD
195232001-12-27 Akim Demaille <akim@epita.fr>
19524
19525 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19526 (build_relations): Adjust.
19527
d0b0fefa
AD
195282001-12-27 Akim Demaille <akim@epita.fr>
19529
19530 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19531 duplication.
19532
adc8c848
AD
195332001-12-27 Akim Demaille <akim@epita.fr>
19534
19535 * src/reader.c (packgram): Catch nitems overflows.
19536
14d293ac
AD
195372001-12-27 Akim Demaille <akim@epita.fr>
19538
19539 * src/files.c, src/files.h (guard_obstack): Remove.
19540 * src/output.c (output): Adjust.
19541 * src/reader.c (parse_braces): New, factoring...
19542 (copy_action, copy_guard): these two which are renamed as...
19543 (parse_action, parse_guard): these.
19544 As a voluntary consequence, using braces around guards is now
19545 mandatory.
19546
f499b062
AD
195472001-12-27 Akim Demaille <akim@epita.fr>
19548
19549 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19550 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19551 members.
19552 (symbol_list_new): Adjust.
19553 (copy_action): action_line is the first line, not the last.
19554 (copy_guard): Just as for actions, store the `action' only, not
19555 the switch/case/break flesh.
19556 Don't parse the user action that might follow the guard, let...
19557 (readgram): do it, i.e., now, there can be an action after a
19558 guard.
19559 In other words the guard is just explicitly optional.
19560 (packgram): Adjust.
19561 * src/output.c (guards_output): New.
19562 (output_parser): Call it when needed.
19563 (output): Also free the guard and attrs obstacks.
19564 * src/files.c, src/files.h (obstack_save): Remove.
19565 (output_files): Remove.
19566 As a result, if one needs the former `.act' file, using an
19567 appropriate skeleton which requires actions and guards is now
19568 required.
19569 * src/main.c (main): Adjust.
19570 * tests/semantic.at: New.
19571 * tests/regression.at: Use `input.y' as input file name.
19572 Avoid 8+3 problems by requiring input.c when the test needs the
19573 parser.
19574
d945f5cd
AD
195752001-12-27 Akim Demaille <akim@epita.fr>
19576
19577 * src/reader.c (symbol_list_new): Be sure to initialize all the
19578 fields.
19579
d200e455
AD
195802001-12-27 Akim Demaille <akim@epita.fr>
19581
19582 All the hacks using a final pseudo state are now useless.
19583
19584 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19585 * src/lalr.c (nLA): New.
19586 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19587 instead of lookaheadsp from the pseudo state (nstate + 1).
19588
f9507c28
AD
195892001-12-27 Akim Demaille <akim@epita.fr>
19590
19591 * src/output.c (action_row, token_actions): Use a state_t instead
19592 of a integer, and nlookaheads instead of the following state's
19593 lookaheadsp.
19594
065fbd27
AD
195952001-12-27 Akim Demaille <akim@epita.fr>
19596
19597 * src/conflicts.c (log_resolution, flush_shift)
19598 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19599 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19600 (conflicts_print, print_reductions): Use a state_t instead of an
19601 integer when referring to a state.
19602 As much as possible, depend upon nlookaheads, instead of the
19603 `lookaheadsp' member of the following state (since lookaheads of
19604 successive states are successive, the difference between state n + 1
19605 and n served as the number of lookaheads for state n).
19606 * src/lalr.c (add_lookback_edge): Likewise.
19607 * src/print.c (print_core, print_actions, print_state)
19608 (print_results): Likewise.
19609 * src/print_graph.c (print_core, print_actions, print_state)
19610 (print_graph): Likewise.
19611 * src/conflicts.h: Adjust.
19612
1b177bd7
AD
196132001-12-27 Akim Demaille <akim@epita.fr>
19614
19615 * src/bison.hairy: Formatting/comment changes.
19616 ANSIfy.
19617 Remove `register' indications.
19618 Add plenty of `static'.
19619
7742ddeb
AD
196202001-12-27 Akim Demaille <akim@epita.fr>
19621
19622 * src/output.c (prepare): Drop the muscle `ntbase' which
19623 duplicates ntokens.
19624 * src/bison.simple: Formatting/comment changes.
19625 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19626 is an undocumented synonym.
19627
1fa14068
AD
196282001-12-22 Akim Demaille <akim@epita.fr>
19629
19630 * src/output.c (output_table_data): Change the prototype to use
19631 `int' for array ranges: some invocations do pass an int, not a
19632 short.
19633 Reported by Wayne Green.
19634
b9752825
AD
196352001-12-22 Akim Demaille <akim@epita.fr>
19636
19637 Some actions of web2c.y are improperly triggered.
19638 Reported by Mike Castle.
19639
19640 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19641 * tests/regression.at (Web2c): Rename as...
19642 (Web2c Report): this.
19643 (Web2c Actions): New.
19644
776209d6
AD
196452001-12-22 Akim Demaille <akim@epita.fr>
19646
19647 Reductions in web2c.y are improperly reported.
19648 Reported by Mike Castle.
19649
19650 * src/conflicts.c (print_reductions): Fix.
19651 * tests/regression.at (Web2c): New.
19652
275fc3ad
AD
196532001-12-18 Akim Demaille <akim@epita.fr>
19654
19655 Some host fail on `assert (!"foo")', which expands to
19656 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19657 Reported by Nelson Beebee.
19658
19659 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19660 `#define it_succeeded 0' and `assert (it_succeeded)'.
19661
897668ee
MA
196622001-12-17 Marc Autret <autret_m@epita.fr>
19663
19664 * src/bison.simple: Don't hard code the skeleton line and filename.
19665 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19666 New line counter 'skeleton_line' (skeleton-line muscle).
19667
ab3399e0
PE
196682001-12-17 Paul Eggert <eggert@twinsun.com>
19669
19670 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19671 YYDEBUG must be defined to a nonzero value.
19672
19673 * src/bison.simple (yytname): Do not assume that the user defines
19674 YYDEBUG to a properly parenthesized expression.
19675
3877f72b
AD
196762001-12-17 Akim Demaille <akim@epita.fr>
19677
19678 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19679 nlookaheads is a new member.
19680 Adjust all users.
19681 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19682 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19683 state.
776209d6 19684
331dbc1b
AD
196852001-12-17 Akim Demaille <akim@epita.fr>
19686
19687 * src/files.h, src/files.c (open_files, close_files): Remove.
19688 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19689 let...
19690 * src/reader.c (reader): Do it.
776209d6 19691
be750e4c
AD
196922001-12-17 Akim Demaille <akim@epita.fr>
19693
19694 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 19695
709ae8c6
AD
196962001-12-17 Akim Demaille <akim@epita.fr>
19697
19698 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19699 (flush_reduce): New.
19700 (resolve_sr_conflict): Adjust.
776209d6 19701
f87685c3
AD
197022001-12-17 Akim Demaille <akim@epita.fr>
19703
19704 * src/output.c (output_obstack): Be static and rename as...
19705 (format_obstack): this, to avoid any confusion with files.c's
19706 output_obstack.
19707 * src/reader.h (muscle_obstack): Move to...
19708 * src/output.h: here, since it's defined in output.c.
19709
837491d8
AD
197102001-12-17 Akim Demaille <akim@epita.fr>
19711
19712 * src/output.c (action_row, save_column, default_goto)
19713 (sort_actions, matching_state, pack_vector): Better variable
19714 locality.
19715
796d61fb
AD
197162001-12-17 Akim Demaille <akim@epita.fr>
19717
19718 * src/output.c: Various formatting changes.
776209d6 19719
64d15509
AD
197202001-12-17 Akim Demaille <akim@epita.fr>
19721
19722 * src/files.c (output_files): Free the output_obstack.
19723 * src/main.c (main): Call print and print_graph conditionally.
19724 * src/print.c (print): Work unconditionally.
19725 * src/print_graph.c (print_graph): Work unconditionally.
19726 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19727
fbc8ecb7
MA
197282001-12-16 Marc Autret <autret_m@epita.fr>
19729
19730 * src/output.c (actions_output): Fix. When we use %no-lines,
19731 there is one less line per action.
19732
f0440388
MA
197332001-12-16 Marc Autret <autret_m@epita.fr>
19734
19735 * src/bison.simple: Remove a useless #line directive.
19736 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19737 * src/output.c (get_lines_number): New.
776209d6 19738 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
19739 output muscles.
19740 Fix line numbering.
19741 (actions_output): Computes the number of lines taken by actions.
19742 (output_master_parser): Insert new skeleton which is the name of
19743 the output parser file name.
19744
a79986b8
MA
197452001-12-15 Marc Autret <autret_m@epita.fr>
19746
19747 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19748
4ec8e00f
MA
197492001-12-15 Marc Autret <autret_m@epita.fr>
19750
19751 * src/output.c (output_gram): Keep track of the hairy one.
19752
1a4648ff
AD
197532001-12-15 Akim Demaille <akim@epita.fr>
19754
19755 Make `make distcheck' work.
19756
19757 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19758 system.h which uses libgettext.h.
19759
9c2c67e6
AD
197602001-12-15 Akim Demaille <akim@epita.fr>
19761
19762 * src/nullable.c (set_nullable): Useless rules must be skipped,
19763 otherwise, since we range over their symbols, we might look at a
19764 nonterminal which no longer ``exists'', i.e., it is not counted in
19765 `nvars', hence we overflow our arrays.
19766
93ede233
AD
197672001-12-15 Akim Demaille <akim@epita.fr>
19768
19769 The header can also be produced directly, without any obstack!
19770 Yahoo!
19771
19772 * src/files.c, src/files.h (defines_obstack): Remove.
19773 (compute_header_macro): Global.
19774 (defines_obstack_save): Remove.
19775 * src/reader.c (parse_union_decl): No longer output to
19776 defines_obstack: its content can be found in the `stype' muscle
19777 anyway.
19778 (output_token_translations): Merge into...
19779 (symbols_output): this.
19780 Rename as...
19781 (symbols_save): this.
19782 (reader): Adjust.
19783 * src/output.c (header_output): New.
19784 (output): Call it.
19785
2666f928
AD
197862001-12-15 Akim Demaille <akim@epita.fr>
19787
19788 * src/reader.c (parse_union_decl): Instead of handling two obstack
19789 simultaneously, use one to define the `stype' muscle, and use the
19790 value of the latter to fill defines_obstack.
19791 (copy_comment): Remove.
19792 (copy_comment2): Work for a single obstack.
19793 Rename as...
19794 (copy_comment): this.
19795
428046f8
AD
197962001-12-15 Akim Demaille <akim@epita.fr>
19797
19798 * src/lex.c, src/lex.h (xgetc): No longer static.
19799 * src/reader.c (parse_union_decl): Revamp.
19800
ea52d706
AD
198012001-12-15 Akim Demaille <akim@epita.fr>
19802
19803 Still making progress in separating Bison into (i) input, (ii)
19804 process, (iii) output: now we can directly output the parser file
19805 without using table_obstack at all.
19806
19807 * src/files.c, src/files.h (table_obstack): Bye bye.
19808 (parser_file_name): New.
19809 * src/files.c (compute_output_file_names): Compute it.
19810 * src/output.c (actions_output, output_parser)
19811 (output_master_parser): To a file instead of an obstack.
19812
3f96f4dc
AD
198132001-12-15 Akim Demaille <akim@epita.fr>
19814
19815 Attach actions to rules, instead of pre-outputting them to
19816 actions_obstack.
19817
19818 * src/gram.h (rule_t): action and action_line are new members.
19819 * src/reader.c (symbol_list): Likewise.
19820 (copy_action): Save the actions within the rule.
19821 (packgram): Save them in rule_table.
19822 * src/output.c (actions_output): New.
19823 (output_parser): Use it on `%%actions'.
19824 (output_rule_data): Don't free rule_table.
19825 (output): Do it.
19826 (prepare): Don't save the `action' muscle.
19827 * src/bison.simple: s/%%action/%%actions/.
19828
51576fb3
AD
198292001-12-15 Akim Demaille <akim@epita.fr>
19830
19831 * src/reader.c (copy_action): When --yacc, don't append a `;'
19832 to the user action: let it fail if lacking.
dee049eb 19833 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 19834
2648a72d
AD
198352001-12-14 Akim Demaille <akim@epita.fr>
19836
19837 * src/lex.c (literalchar): Simply return the char you decoded, non
19838 longer mess around with obstacks and int pointers.
19839 Adjust all callers.
19840
92790e5b
AD
198412001-12-14 Akim Demaille <akim@epita.fr>
19842
19843 * src/lex.c (literalchar): Don't escape the special characters,
19844 just decode them, and keep them as char (before, eol was output as
19845 the 2 char string `\n' etc.).
19846 * src/output.c (output_rule_data): Use quotearg to output the
19847 token strings.
19848
927c1557
PE
198492001-12-13 Paul Eggert <eggert@twinsun.com>
19850
19851 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19852 Do not infringe on the global user namespace when using C++.
19853 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19854 All uses of `fprintf' and `stderr' changed.
19855
19856 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19857
ed8e1f68
AD
198582001-12-13 Akim Demaille <akim@epita.fr>
19859
19860 The computation of nullable is broken: it doesn't handle empty
19861 RHS's properly.
19862
19863 * tests/torture.at (GNU AWK Grammar): New.
19864 * tests/sets.at (Nullable): New.
19865 * src/nullable.c (set_nullable): Instead of blindly looping over
19866 `ritems', loop over the rules, and then over their rhs's.
19867
19868 Work around Autotest bugs.
19869
19870 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19871 frame, because Autotest understand lines starting with a `+' as
19872 traces from the shell. Then, they are not processed properly.
19873 Admittedly an Autotest bug, but we don't have time to wait for
19874 Autotest to catch up.
19875 * tests/regression.at (Broken Closure): Adjust to the new table
19876 frames.
19877 Move to...
19878 * tests/sets.at: here.
19879
cb581495
AD
198802001-12-13 Akim Demaille <akim@epita.fr>
19881
19882 * src/closure.c (closure): Use nrules instead of playing tricks
19883 with BITS_PER_WORD.
19884
2e729273
AD
198852001-12-13 Akim Demaille <akim@epita.fr>
19886
19887 * src/print.c (print_actions): Output the handling of `$' as the
19888 traces do: shifting the token EOF. Before EOF was treated as a
19889 nonterminal.
19890 * tests/regression.at: Adjust some tests.
19891 * src/print_graph.c (print_core): Complete the set of items via
19892 closure. The next-to-final and final states are still unsatisfying,
19893 but that's to be addressed elsewhere.
19894 No longer output the rule numbers, but do output the state number.
19895 A single loop for the shifts + gotos is enough, but picked a
19896 distinct color for each.
19897 (print_graph): Initialize and finalize closure.
19898
107f7dfb
AD
198992001-12-13 Akim Demaille <akim@epita.fr>
19900
19901 * src/reader.c (readgram): Remove dead code, an strip useless
19902 braces.
19903 (get_type): Remove, unused.
19904
9b53a24f
AD
199052001-12-12 Akim Demaille <akim@epita.fr>
19906
19907 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19908 on that of lib/error.c.
19909
dbfb6dcd
AD
199102001-12-12 Akim Demaille <akim@epita.fr>
19911
19912 Some hosts don't like `/' in includes.
19913
19914 * src/system.h: Include libgettext.h without qualifying the path.
19915 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
19916 $(top_srcdir).
19917
c25fb648
MA
199182001-12-11 Marc Autret <autret_m@epita.fr>
19919
19920 * src/output.c (output_parser): Remove useless muscle.
19921
710ddc4f
MA
199222001-12-11 Marc Autret <autret_m@epita.fr>
19923
19924 * src/bison.simple: Remove #line just before %%epilogue. It
19925 is now handled in ...
19926 * src/reader.c (read_additionnal_code): Add the output of a
19927 #line for the epilogue.
19928
e83d80b8
MA
199292001-12-10 Marc Autret <autret_m@epita.fr>
19930
927c1557 19931 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
19932 replace precedent remove.
19933 * src/bison.simple: Remove #line before %%prologue because
19934 %%input-line is wrong at this time.
19935
971d5158
MA
199362001-12-10 Marc Autret <autret_m@epita.fr>
19937
19938 * src/reader.c (symbols_output): Clean up.
927c1557 19939 * src/output.c (output_gram, output): Clean up.
971d5158 19940
5edafffd
AD
199412001-12-10 Akim Demaille <akim@epita.fr>
19942
19943 * src/lalr.c (initialize_lookaheads): New. Extracted from...
19944 * src/LR0.c (set_state_table): here.
19945 * src/lalr.c (lalr): Call it.
19946
0279f8e9
AD
199472001-12-10 Akim Demaille <akim@epita.fr>
19948
19949 * src/state.h (shifts): Remove the `number' member: shifts are
19950 attached to state, hence no longer need to be labelled with a
19951 state number.
19952
190c4f5f
AD
199532001-12-10 Akim Demaille <akim@epita.fr>
19954
19955 Now that states have a complete set of members, the linked list of
19956 shifts is useless: just fill directly the state's shifts member.
19957
19958 * src/state.h (shifts): Remove the `next' member.
19959 * src/LR0.c (first_state, last_state): Remove.
19960 Adjust the callers.
19961 (augment_automaton): Don't look for the shifts that must be added
19962 a shift on EOF: it is those of the state we looked for! But now,
19963 since shifts are attached, it is no longer needed to looking
19964 merely by its id: its number.
19965
2a73b93d
AD
199662001-12-10 Akim Demaille <akim@epita.fr>
19967
19968 * src/LR0.c (augment_automaton): Better variable locality.
19969 Remove an impossible branch: if there is a state corresponding to
19970 the start symbol being shifted, then there is shift for the start
19971 symbol from the initial state.
19972
74392f6a
AD
199732001-12-10 Akim Demaille <akim@epita.fr>
19974
19975 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
19976 only when appropriate: when insert_start_shifting_state' is not
19977 invoked.
19978 * tests/regression.at (Rule Line Numbers): Adjust.
19979
37c82725
AD
199802001-12-10 Akim Demaille <akim@epita.fr>
19981
19982 * src/LR0.c (augment_automaton): Now that all states have shifts,
19983 merge the two cases addition shifts to the initial state.
19984
6a164e0c
AD
199852001-12-10 Akim Demaille <akim@epita.fr>
19986
19987 * src/lalr.c (set_state_table): Move to...
19988 * src/LR0.c: here.
19989 * src/lalr.c (lalr): Don't call it...
19990 * src/LR0.c (generate_states): do it.
19991 * src/LR0.h (first_state): Remove, only the table is used.
19992
7215de24
AD
199932001-12-10 Akim Demaille <akim@epita.fr>
19994
19995 * src/LR0.h (first_shift, first_reduction): Remove.
19996 * src/lalr.c: Don't use first_shift: find shifts through the
19997 states.
19998
80e25d4d
AD
199992001-12-10 Akim Demaille <akim@epita.fr>
20000
20001 * src/LR0.c: Attach shifts to states as soon as they are
20002 computed.
20003 * src/lalr.c (set_state_table): Instead of assigning shifts to
20004 state, just assert that the mapping was properly done.
20005
0ab3728b
AD
200062001-12-10 Akim Demaille <akim@epita.fr>
20007
20008 * src/LR0.c (insert_start_shift): Rename as...
20009 (insert_start_shifting_state): this.
20010 (insert_eof_shifting_state, insert_accepting_state): New.
20011 (augment_automaton): Adjust.
20012 Better locality of the variables.
20013 When looking if the start_symbol is shifted from the initial
20014 state, using `while (... symbol != start_symbol ...)' sounds
20015 better than `while (... symbol < start_symbol ...)': If fail
20016 to see how the order between symbols could be relevant!
20017
78af9bbc
AD
200182001-12-10 Akim Demaille <akim@epita.fr>
20019
20020 * src/getargs.h: Don't declare `spec_name_prefix' and
20021 `spec_file_prefix', declared by src/files.h.
20022 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
20023 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
20024 * src/output.c (prepare): Adjust.
20025 * src/reader.c (symbols_output): Likewise.
20026 * src/vmsgetargs.c: Vaguely adjust, but who cares?
20027
bdef2a41
AD
200282001-12-10 Akim Demaille <akim@epita.fr>
20029
20030 * src/muscle_tab.c (muscle_init): NULL is a better default than
20031 `"0"'.
20032
3735969c
AD
200332001-12-10 Akim Demaille <akim@epita.fr>
20034
20035 * src/reader.c (reader): Calling symbols_output once is enough.
20036
49701457
AD
200372001-12-10 Akim Demaille <akim@epita.fr>
20038
20039 Now that states have a complete set of members, the linked list of
20040 reductions is useless: just fill directly the state's reductions
20041 member.
20042
20043 * src/state.h (struct reductions): Remove member `number' and
20044 `next'.
20045 * src/LR0.c (first_reduction, last_reduction): Remove.
20046 (save_reductions): Don't link the new reductions, store them in
20047 this_state.
20048 * src/lalr.c (set_state_table): No need to attach reductions to
20049 states, it's already done.
20050 * src/output.c (output_actions): No longer free the shifts, then
20051 the reductions, then the states: free all the states and their
20052 members.
20053
0edad749
AD
200542001-12-10 Akim Demaille <akim@epita.fr>
20055
20056 * src/options.c (OPTN, DRTV, BOTH): New.
20057 (option_table): Use them.
20058
0edad749
AD
20059 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
20060 the job of system.h.
20061 * src/options.c: Don't include stdio.h and xalloc.h for the same
20062 reasons.
20063
5449dd0f
AD
200642001-12-10 Akim Demaille <akim@epita.fr>
20065
20066 * src/output.c (output, prepare): Make sure the values of the
20067 muscles `action' and `prologue' are 0-terminated.
20068
a870c567
AD
200692001-12-10 Akim Demaille <akim@epita.fr>
20070
20071 Clean up GCC warnings.
20072
20073 * src/reader.c (copy_action): `buf' is not used.
20074 (parse_skel_decl): Be static.
20075 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
20076 * src/options.h (create_long_option_table): Have a real prototype.
20077 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
20078 (hash_delete_at): Return const void *.
20079 Adjust casts to preserve the const.
20080
80df8768
AD
200812001-12-10 Akim Demaille <akim@epita.fr>
20082
20083 * configure.in: Require 2.52g.
20084 M4 is not needed, but AUTOM4TE is.
20085 * m4/m4.m4: Remove.
20086 * tests/Makefile.am: Adjust.
20087
f693ad14
AD
200882001-12-10 Akim Demaille <akim@epita.fr>
20089
20090 One structure for states is enough, even though theoretically
20091 there are LR(0) states and LALR(1) states.
20092
20093 * src/lalr.h (state_t): Remove.
20094 (state_table): Be state_t **, not state_t *.
20095 * src/state.h (core, CORE_ALLOC): Rename as...
20096 (state_t, STATE_ALLOC): this.
20097 Add the LALR(1) members: shifts, reductions, errs.
20098 * src/LR0.c (state_table): Rename as...
20099 (state_hash): this, to avoid name clashes with the global
20100 `state_table'.
20101 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
20102 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
20103
74ffbcb6
AD
201042001-12-10 Akim Demaille <akim@epita.fr>
20105
20106 Bison dumps core on bash.y.
20107 Reported by Pascal Bart.
20108
20109 * src/warshall.c (bitmatrix_print): New.
20110 (TC): Use it.
ba0fe3c7 20111 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
20112 j must be the outer loop.
20113 * tests/regression.at (Broken Closure): New.
20114
07708e19
AD
201152001-12-05 Akim Demaille <akim@epita.fr>
20116
20117 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
20118 its argument.
ba1ecc07 20119 Reported by Peter Hamorsky.
07708e19 20120
92b16366
AD
201212001-12-05 Akim Demaille <akim@epita.fr>
20122
20123 * src/conflicts.c (err_table): Remove.
20124 (resolve_sr_conflict): Adjust.
20125 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
20126 Rename as...
20127 (state_t.reductions, state_t.shifts): this.
20128
076ab033
AD
201292001-12-05 Akim Demaille <akim@epita.fr>
20130
20131 * src/reduce.c (reduce_grammar_tables): No longer disable the
20132 removal of useless rules via CPP but via `if (0)', so that the
20133 compiler still check the code is valid.
20134 For instance, it should have noticed `rline' no longer exists: use
20135 the `line' member of rule_t.
20136 * src/gram.c (dummy, rline): Remove, unused.
20137
3843c413
AD
201382001-12-05 Akim Demaille <akim@epita.fr>
20139
20140 * src/output.c (pack_vector): Use assert, not berror.
20141 * src/main.c (berror): Remove, unused.
20142
43168960
AD
201432001-12-05 Akim Demaille <akim@epita.fr>
20144
20145 New experimental feature: if --verbose --trace output all the
20146 items of a state, not only its kernel.
20147
20148 * src/print.c (print_core): If `trace_flag', then invoke closure
20149 before outputting the items of the state (print_core is no longer
20150 a correct name them).
20151 (print_results): Invoke new_closure/free_closure if needed.
20152
b2872512
AD
201532001-12-05 Akim Demaille <akim@epita.fr>
20154
20155 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
20156 * src/closure.c, src/closure.h (itemsetsize): Rename as...
20157 (nitemset): for consistency with the rest of the project.
20158
23cbcc6c
AD
201592001-12-05 Akim Demaille <akim@epita.fr>
20160
20161 * src/closure.c (print_closure): Improve.
20162 (closure): Use it for printing input and output.
20163
03ec521c
AD
201642001-12-05 Akim Demaille <akim@epita.fr>
20165
20166 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
20167 indexed by nonterminals.
20168
3a7456dd
AD
201692001-12-05 Akim Demaille <akim@epita.fr>
20170
20171 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
20172 what it was!).
20173 * src/warshall.h: Remove accidental duplication of the content.
20174
1cbcf2e7
AD
201752001-12-05 Akim Demaille <akim@epita.fr>
20176
20177 * src/closure.c (set_fderives): De-obfuscate.
20178
84182270
AD
201792001-12-05 Akim Demaille <akim@epita.fr>
20180
20181 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
20182
3f6f053c
AD
201832001-12-05 Akim Demaille <akim@epita.fr>
20184
20185 * src/closure.c (set_firsts): De-obfuscate.
20186
7a5350ba
AD
201872001-12-05 Akim Demaille <akim@epita.fr>
20188
20189 * src/output.c (action_row): De-obfuscate
20190 using the good o' techniques: arrays not pointers, variable
20191 locality, BITISSET, RESETBIT etc.
20192
d954473d
AD
201932001-12-05 Akim Demaille <akim@epita.fr>
20194
20195 Pessimize the code to simplify it: from now on, all the states
20196 have a valid SHIFTS, which NSHIFTS is possibly 0.
20197
20198 * src/LR0.c (shifts_new): Be global and move to..
20199 * src/state.c, src/state.h: here.
20200 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
20201 * src/print_graph: Adjust.
20202
9839bbe5
AD
202032001-12-05 Akim Demaille <akim@epita.fr>
20204
20205 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
20206 * src/conflicts.c: Use it.
20207 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
20208 incorrectly ``simplified''.
20209
9f136c07
AD
202102001-12-05 Akim Demaille <akim@epita.fr>
20211
20212 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
20213 using the good o' techniques: arrays not pointers, variable
20214 locality, BITISSET, RESETBIT etc.
20215
b608206e
AD
202162001-12-05 Akim Demaille <akim@epita.fr>
20217
20218 * src/state.h (SHIFT_SYMBOL): New.
20219 * src/conflicts.c: Use it to deobfuscate.
20220
52afa962
AD
202212001-12-05 Akim Demaille <akim@epita.fr>
20222
20223 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
20224 (print_reductions): De-obfuscate using the good o' techniques:
20225 arrays not pointers, variable locality, BITISSET.
20226
e74dc321
AD
202272001-12-05 Akim Demaille <akim@epita.fr>
20228
20229 * src/conflicts.c (print_reductions): Arrays, not pointers.
20230 Use BITISSET.
20231
768fca83
AD
202322001-12-05 Akim Demaille <akim@epita.fr>
20233
20234 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20235
a17e599f
AD
202362001-12-05 Akim Demaille <akim@epita.fr>
20237
20238 * src/conflicts.c (print_reductions): Improve variable locality.
20239
a04bc341
AD
202402001-12-05 Akim Demaille <akim@epita.fr>
20241
20242 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20243
c8ea038e
AD
202442001-12-05 Akim Demaille <akim@epita.fr>
20245
20246 * src/conflicts.c (print_reductions): Improve variable locality.
20247
aa2aab3c
AD
202482001-12-05 Akim Demaille <akim@epita.fr>
20249
20250 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20251 * src/lalr.c: Use them.
20252
b178c8cc
AD
202532001-12-05 Akim Demaille <akim@epita.fr>
20254
20255 * src/LR0.c (augment_automaton): Formatting changes.
20256 Better variable locality.
20257
f67d13aa
AD
202582001-12-05 Akim Demaille <akim@epita.fr>
20259
20260 * src/lalr.c (matrix_print): New.
20261 (transpose): Use it.
20262 Use arrays instead of pointers.
20263
c2713865
AD
202642001-12-05 Akim Demaille <akim@epita.fr>
20265
20266 * src/lalr.c (maxrhs): Move to...
20267 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20268 * src/lalr.c (build_relations): Adjust.
20269
9887c18a
AD
202702001-12-05 Akim Demaille <akim@epita.fr>
20271
20272 * src/lalr.c (transpose): Free the memory allocated to the
20273 argument, as it is replaced by the results by the unique caller.
20274 (build_relations): Merely invoke transpose: it handles the memory
20275 deallocation.
20276 Improve variable locality.
20277 Avoid variables used as mere abbreviations.
20278 (compute_lookaheads): Use arrays instead of pointers.
20279
4d4f699c
AD
202802001-12-05 Akim Demaille <akim@epita.fr>
20281
20282 * src/lalr.c (initialize_F): Improve variable locality.
20283 Avoid variables used as mere abbreviations.
20284
80a69750
AD
202852001-12-05 Akim Demaille <akim@epita.fr>
20286
20287 * src/derives.c (print_derives): Display the ruleno.
20288 * src/lalr.c (initialize_F, transpose): Better variable locality
20289 to improve readability.
20290 Avoid variables used as mere abbreviations.
20291
fe961097
AD
202922001-12-05 Akim Demaille <akim@epita.fr>
20293
20294 * src/lalr.c (traverse): Use arrays instead of pointers.
20295
e3e4e814
AD
202962001-12-05 Akim Demaille <akim@epita.fr>
20297
20298 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20299 the handling of squeue.
20300 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20301
630e182b
AD
203022001-12-05 Akim Demaille <akim@epita.fr>
20303
20304 Because useless nonterminals are now kept alive (instead of being
20305 `destroyed'), we now sometimes examine them, and store information
20306 related to them. Hence we need to know their number, and adjust
20307 memory allocations.
20308
20309 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20310 static.
20311 * src/LR0.c (allocate_itemsets): The memory allocated to
20312 `symbol_count' was used for two different purpose: once to count
20313 the number of occurrences of each symbol, and later reassigned to
20314 `shift_symbol', containing the symbol that can be shifted from a
20315 given state.
20316 Deobfuscate, i.e., allocate, use and free `symbol_count' here
20317 only, and...
20318 (new_itemsets): Allocate `shift_symbol' here.
20319 (allocate_itemsets): symbol_count includes useless nonterminals.
20320 Make room for them.
20321 (free_storage): Use `free', not `XFREE', for pointers that cannot
20322 be null.
20323
81b51460
AD
203242001-12-05 Akim Demaille <akim@epita.fr>
20325
20326 * src/nullable.c (set_nullable): Deobfuscate the handling of
20327 ritem.
20328 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20329
3067fbef
AD
203302001-12-05 Akim Demaille <akim@epita.fr>
20331
20332 * src/gram.c, src/gram.h (ritem_print): New.
20333 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
20334 (This useless function was defined only to work around VMS linkers
20335 that can't handle compilation units with variables only).
20336 * src/reduce.c (dump_grammar): Use it to trace the construction of
20337 ritem.
20338
c2bea5f9
PE
203392001-12-04 Paul Eggert <eggert@twinsun.com>
20340
7d27c823
PE
20341 * src/bison.simple (union yyalloc): Change member names
20342 to be the same as the stack names.
20343 (yyparse): yyptr is now union yyalloc *, not char *.
20344 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
20345 and may generate better code on some machines.
c2bea5f9
PE
20346 (yystpcpy): Use prototype if __STDC__ is defined, not just
20347 if __cplusplus is defined.
35687a9d 20348
2c8a9dfa
AD
203492001-11-30 Akim Demaille <akim@epita.fr>
20350
20351 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
20352 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
20353 Gettext doesn't compile cleanly, and dies with -Werror.
20354 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
20355 Include WARNING_CFLAGS here.
20356 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
20357 before being defined.
20358
f4e421e6
AD
203592001-11-27 Paul Eggert <eggert@twinsun.com>
20360
20361 * lib/quotearg.h (quotearg_n, quotearg_n_style):
20362 First arg is int, not unsigned.
20363 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
20364 (SIZE_MAX, UINT_MAX): New macros.
20365 (quotearg_n_options): Abort if N is negative.
20366 Avoid overflow check on hosts where size_t is 64 bits and int
20367 is 32 bits, as overflow is impossible there.
20368 Fix off-by-one typo that caused unnecessary reallocation.
20369
7093d0f5
AD
203702001-11-29 Paul Eggert <eggert@twinsun.com>
20371
20372 Name space cleanup in generated parser.
20373
20374 * doc/bison.texinfo (Bison Parser): Discuss system headers
20375 and their effect on the user name space.
20376
20377 * src/bison.simple:
20378 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
20379 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
20380 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
20381
20382 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
20383 on user names when possible.
20384
20385 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
20386 Simplify test for whather <alloca.h> exists.
20387
20388 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
20389
20390 (<stdio.h>): Include if YYDEBUG.
20391
20392 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
20393 ! defined (yyoverflow) && ! defined (yymemcpy).
20394
20395 (yymemcpy, yyparse): Rename local variables as needed so that
20396 they all begin with 'yy'.
20397
20398 (yystrlen, yystpcpy): New functions.
20399
20400 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
20401 All uses changed.
20402
20403 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
20404 instead of relying on string.h functions. Use YYSTACK_ALLOC
20405 and YYSTACK_FREE instead of malloc and free.
20406
fd51e5ff
AD
204072001-11-30 Akim Demaille <akim@epita.fr>
20408
20409 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
20410 before their first uses.
20411 (YYBISON, YYPURE): Move to the top of the output.
20412
7d13ff5f
AD
204132001-11-30 Akim Demaille <akim@epita.fr>
20414
20415 * tests/reduce.at (Useless Nonterminals): Fix.
20416
892a3995
AD
204172001-11-30 Akim Demaille <akim@epita.fr>
20418
20419 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
20420 if body instead of `;' to pacify GCC's warnings.
20421
68f1e3ed
AD
204222001-11-30 Akim Demaille <akim@epita.fr>
20423
20424 Instead of mapping the LHS of unused rules to -1, keep the LHS
20425 valid, but flag the rules as invalid.
20426
20427 * src/gram.h (rule_t): `useful' is a new member.
20428 * src/print.c (print_grammar): Adjust.
20429 * src/derives.c (set_derives): Likewise.
20430 * src/reader.c (packgram, reduce_output): Likewise.
20431 * src/reduce.c (reduce_grammar_tables): Likewise.
20432 * tests/reduce.at (Underivable Rules, Useless Rules): New.
20433
d2d1b42b
AD
204342001-11-30 Akim Demaille <akim@epita.fr>
20435
20436 * src/reduce.c (reduce_output): Formatting changes.
20437 * src/print.c (print_results, print_grammar): Likewise.
20438 * tests/regression.at (Rule Line Numbers)
20439 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
20440
760b53a8
AD
204412001-11-30 Akim Demaille <akim@epita.fr>
20442
20443 * src/reduce.c (nonterminals_reduce): Instead of throwing away
20444 useless nonterminals, move them at the end of the symbol arrays.
20445 (reduce_output): Adjust.
20446 * tests/reduce.at (Useless Nonterminals): Adjust.
20447
00238958
AD
204482001-11-30 Akim Demaille <akim@epita.fr>
20449
20450 * src/reduce.c: Various comment/formatting changes.
20451 (nonterminals_reduce): New, extracted from...
20452 (reduce_grammar_tables): here.
20453 (reduce_grammar): Call nonterminals_reduce.
20454
396452de
PE
204552001-11-29 Paul Eggert <eggert@twinsun.com>
20456
20457 * src/bison.simple (YYSTACK_REALLOC): Remove.
20458 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
20459 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
20460 New macros.
20461 (union yyalloc): New type.
20462 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
20463 an arbitrary restriction on hosts where size_t is wider than int.
20464
20465 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20466 a parser stack overflow. Allocate just one block of memory for all
20467 three stacks, instead of allocating three blocks; this typically is
20468 faster and reduces fragmentation.
20469
20470 Do not limit the number of items in the stack to a value that fits
20471 in 'int', as this is an arbitrary limit on hosts with 64-bit
20472 size_t and 32-bit int.
20473
147e184c
MA
204742001-11-29 Marc Autret <autret_m@epita.fr>
20475
20476 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20477 of defining YYERROR_VERBOSE.
20478 [AT_DATA]: $4 is now out of C declarations in the prologue.
20479
426cf563
MA
204802001-11-28 Marc Autret <autret_m@epita.fr>
20481
20482 * src/reader.c (parse_dquoted_param): New.
20483 (parse_skel_decl): Use it.
20484 * src/lex.h: Add its prototype.
20485 * src/lex.c (literalchar): Become not static.
20486
c7925b99
MA
204872001-11-28 Marc Autret <autret_m@epita.fr>
20488
20489 * src/output.h: And put its extern declaration here.
20490 * src/output.c (error_verbose): Define here.
20491 (prepare): Echo name modification.
20492 * src/getargs.h: Clean its extern declaration.
20493 * src/getargs.c (error_verbose_flag): Remove.
20494 (getargs): Remove case 'e'.
20495 * src/options.c (option_table): 'error-verbose' is now seen as simple
20496 percent option.
20497 Include output.h.
20498
20499 * src/reader.c (read_declarations): Remove case tok_include.
20500 (parse_include_decl): Remove.
20501 * src/lex.h (token_t): Remove tok_include.
20502 * src/options.c (option_table): 'include' is now a simple command line
20503 option.
20504
5b5d1929
MA
205052001-11-28 Marc Autret <autret_m@epita.fr>
20506
20507 * src/bison.simple: Adjust muscle names.
20508 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20509 * src/output.c (prepare): s/_/-/ for the muscles names.
20510 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20511
8850be4b
MA
205122001-11-28 Marc Autret <autret_m@epita.fr>
20513
20514 * src/bison.simple: Fix debug.
20515 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20516
4a38e613
AD
205172001-11-28 Akim Demaille <akim@epita.fr>
20518
20519 * src/LR0.c (shifts_new): New.
20520 (save_shifts, insert_start_shift, augment_automaton): Use it.
20521
4b35e1c1
AD
205222001-11-28 Akim Demaille <akim@epita.fr>
20523
20524 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20525 keep ruleno only.
20526
d2b04478
AD
205272001-11-28 Akim Demaille <akim@epita.fr>
20528
20529 * src/closure.c (closure): Instead of looping over word in array
20530 then bits in words, loop over bits in array.
20531
2c4c30aa
AD
205322001-11-28 Akim Demaille <akim@epita.fr>
20533
20534 * src/closure.c (closure): No longer optimize the special case
20535 where all the bits of `ruleset[r]' are set to 0, to make the code
20536 clearer.
20537
576890b7
AD
205382001-11-28 Akim Demaille <akim@epita.fr>
20539
20540 * src/closure.c (closure): `r' and `c' are new variables, used to
20541 de-obfuscate accesses to RULESET and CORE.
20542
cb487d7d
AD
205432001-11-28 Akim Demaille <akim@epita.fr>
20544
20545 * src/reduce.c (reduce_print): Use ngettext.
20546 (dump_grammar): Improve the trace accuracy.
20547
6013d43f
AD
205482001-11-28 Akim Demaille <akim@epita.fr>
20549
20550 * src/reduce.c (dump_grammar): Don't translate trace messages.
20551
cb4956ee
AD
205522001-11-28 Akim Demaille <akim@epita.fr>
20553
20554 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20555 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20556 as all tags are free'ed afterwards.
20557 From Enrico Scholz.
20558
648185ab
PE
205592001-11-27 Paul Eggert <eggert@twinsun.com>
20560
20561 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20562 use alloca when we didn't want to, and vice versa.
20563
68254a03
MA
205642001-11-27 Marc Autret <autret_m@epita.fr>
20565
9113b58f
AD
20566 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20567 initialization.
68254a03
MA
20568 * src/output.c (prepare): Remove its update.
20569
04d843a2
MA
205702001-11-27 Marc Autret <autret_m@epita.fr>
20571
20572 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20573 Use %error-verbose.
20574
d2079671 205752001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
20576
20577 * src/bison.simple: Remove YYERROR_VERBOSE using.
20578 Use %%error_verbose.
20579 (yyparse): Likewise.
20580 * src/output.c (prepare): Give its final value.
20581 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20582 * src/getargs.h: Add its extern declaration.
20583 * src/getargs.c (error_verbose_flag): New int.
20584 (getargs): Update to catch new case.
20585 * src/options.c (option_table): 'error-verbose' is a new option.
20586 (shortopts): Update.
20587
e0327bc8
AD
205882001-11-27 Akim Demaille <akim@epita.fr>
20589
20590 * src/system.h: Use intl/libgettext.h.
20591 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20592
000f1a3c
AD
205932001-11-27 Akim Demaille <akim@epita.fr>
20594
20595 * tests/torture.at (Exploding the Stack Size with Malloc):
20596 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20597
26cfe0be
AD
205982001-11-27 Akim Demaille <akim@epita.fr>
20599
20600 * src/files.c: Include error.h.
20601 Reported by Hans Aberg.
20602
f6bd5427
MA
206032001-11-26 Marc Autret <autret_m@epita.fr>
20604
d2079671 20605 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
20606 (read_declarations): Add case tok_include.
20607 * src/getargs.h (include): Add its extern definition.
20608 * src/getargs.c (include): New const char *.
20609 (getargs): Add case '-I'.
20610 * src/options.c (option_table): Add include as command line and
20611 percent option.
20612 * src/lex.h (token_t): Add tok_include.
20613
2ca209c1
AD
206142001-11-26 Akim Demaille <akim@epita.fr>
20615
20616 * src/reader.c (readgram): Make sure rules for mid-rule actions
20617 have a lineno equal to that of their host rule.
20618 Reported by Hans Aberg.
20619 * tests/regression.at (Rule Line Numbers): New.
20620
0e41b407
AD
206212001-11-26 Akim Demaille <akim@epita.fr>
20622
20623 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20624 size_ts.
20625
206262001-11-26 Akim Demaille <akim@epita.fr>
20627
20628 * src/complain.c, src/complain.h (error): Remove, provided by
20629 lib/error.[ch].
20630
e0c40012
AD
206312001-11-26 Akim Demaille <akim@epita.fr>
20632
20633 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20634 issue an error message.
20635 * tests/regression.at (Invalid %directive): New.
20636 Reported by Hans Aberg.
20637
5e147124
AD
206382001-11-26 Akim Demaille <akim@epita.fr>
20639
20640 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20641 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20642
a034c8b8
AD
206432001-11-26 Akim Demaille <akim@epita.fr>
20644
20645 * src/conflicts.c (conflicts_print): Don't complain at all when
20646 there are no reduce/reduce conflicts, and as many shift/reduce
20647 conflicts as expected.
20648 * tests/regression.at (%expect right): Adjust.
20649
c64a20f3
AD
206502001-11-23 Akim Demaille <akim@epita.fr>
20651
20652 * lib/alloca.c: Update, from fileutils.
20653
5b0d29bb
AD
206542001-11-23 Akim Demaille <akim@epita.fr>
20655
20656 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20657
722c4bfe
AD
206582001-11-23 Akim Demaille <akim@epita.fr>
20659
20660 * src/system.h: Include alloca.h.
20661 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20662
6255b435
AD
206632001-11-23 Akim Demaille <akim@epita.fr>
20664
20665 * src/print_graph.c (print_actions): Remove `rule', unused.
20666 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20667 pacify GCC's signed < unsigned warnings.
20668 * src/closure.c (itemsetsize): Likewise.
20669 * src/reader.c (symbol_list_new): Static.
20670
b29b2ed5
AD
206712001-11-23 Akim Demaille <akim@epita.fr>
20672
20673 Attaching lineno to buckets is stupid, since only one copy of each
20674 symbol is kept, only the line of the first occurrence is kept too.
20675
20676 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20677 * src/reader.c (rline_allocated): Remove, unused.
20678 (symbol_list): Have a `line' member.
20679 (symbol_list_new): New.
20680 (readgram): Use it.
20681 * src/print.c (print_grammar): Output the rule line numbers.
20682 * tests/regression.at (Solved SR Conflicts)
20683 (Unresolved SR Conflicts): Adjust.
20684 Reported by Hans Aberg.
20685
a81b1d4a
MA
206862001-11-22 Marc Autret <autret_m@epita.fr>
20687
20688 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20689
c1ecb3c1
MA
206902001-11-22 Marc Autret <autret_m@epita.fr>
20691
20692 * src/muscle_tab.c (muscle_init): Remove initialization of
20693 skeleton muscle.
20694 * src/output.c (output_master_parser): Do it here.
20695
fbe01355
AD
206962001-11-20 Akim Demaille <akim@epita.fr>
20697
20698 * po/sv.po: New.
20699 * configure.in (ALL_LINGUAS): Adjust.
20700 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20701 longer contains strings to translate.
20702
81e895c0
AD
207032001-11-19 Akim Demaille <akim@epita.fr>
20704
20705 * src/conflicts.c (conflicts_print): Add a missing \n.
20706
6bb1878b
AD
207072001-11-19 Akim Demaille <akim@epita.fr>
20708
20709 * src/nullable.c (nullable_print): New.
20710 (set_nullable): Call it when tracing.
20711 Better locality of variables.
20712
d9ec2d07
AD
207132001-11-19 Akim Demaille <akim@epita.fr>
20714
20715 * src/print.c (print_actions): Better locality of variables.
20716
720e5c1b
AD
207172001-11-19 Akim Demaille <akim@epita.fr>
20718
20719 * src/derives.c (print_derives): Fix and enrich.
20720 * src/closure.c (print_fderives): Likewise.
20721
fb908786
AD
207222001-11-19 Akim Demaille <akim@epita.fr>
20723
20724 * src/closure.c (itemsetend): Remove, replaced with...
20725 (itemsetsize): new.
20726
125ecb56
AD
207272001-11-19 Akim Demaille <akim@epita.fr>
20728
20729 * src/LR0.c (kernel_end): Remove, replaced with...
20730 (kernel_size): new.
20731
d8cf039f
AD
207322001-11-19 Akim Demaille <akim@epita.fr>
20733
20734 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20735 to clarify.
20736
7bec0760
AD
207372001-11-19 Akim Demaille <akim@epita.fr>
20738
20739 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20740
c87d4863
AD
207412001-11-19 Akim Demaille <akim@epita.fr>
20742
20743 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20744 trace messages.
20745 * src/LR0.c: Likewise.
20746 (allocate_itemsets): Use arrays instead of pointers to clarify.
20747
9bfe901c
AD
207482001-11-19 Akim Demaille <akim@epita.fr>
20749
20750 * src/getargs.c (statistics_flag): Replace with...
20751 (trace_flag): New.
20752 (longopts): Accept --trace instead of --statistics.
20753 * src/getargs.h, src/options.c: Adjust.
20754 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20755 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20756
97db7bd4
AD
207572001-11-19 Akim Demaille <akim@epita.fr>
20758
cc72668c 20759 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
20760 pointers to clarify the code.
20761 (save_reductions, save_shifts): Factor common parts of alternatives.
20762
2c5f66ed
AD
207632001-11-19 Akim Demaille <akim@epita.fr>
20764
20765 * src/LR0.c (new_state, get_state): Complete TRACE code.
20766 * src/closure.c: Include `reader.h' to get `tags', needed by the
20767 trace code.
20768 Rename the conditional DEBUG as TRACE.
20769 Output consistently TRACEs to stderr, not stdout.
20770 * src/derives.c: Likewise.
20771 * src/reduce.c: (inaccessable_symbols): Using if is better style
20772 than goto.
20773 Use `#if TRACE' instead of `#if 0' for tracing code.
20774
300f275f
AD
207752001-11-19 Akim Demaille <akim@epita.fr>
20776
20777 * src/system.h (LIST_FREE, shortcpy): New.
20778 * src/LR0.c: Use them.
20779 * src/output.c (free_itemsets, free_reductions, free_shifts):
20780 Remove, replaced by LIST_FREE.
20781
f59c437a
AD
207822001-11-19 Akim Demaille <akim@epita.fr>
20783
20784 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20785 (REDUCTIONS_ALLOC): New.
20786 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20787 allocation.
20788
6986fd9e
AD
207892001-11-19 Akim Demaille <akim@epita.fr>
20790
20791 * src/LR0.c (new_state): Complete trace code.
20792 * src/nullable.c (set_nullable): Don't translate traces.
20793
4bc30f78
AD
207942001-11-19 Akim Demaille <akim@epita.fr>
20795
20796 * src/print_graph.c (print_core): Better locality of variables.
20797 * src/print.c (print_core): Likewise.
20798
08a946e0
AD
207992001-11-19 Akim Demaille <akim@epita.fr>
20800
20801 * src/vcg.c: You do the output, so you are responsible of the
20802 handling of VCG syntax, in particular: use quotearg.
20803 * src/print_graph.c: Don't.
20804 (print_actions): Don't output the actions as part of the nodes,
20805 since that's the job of the edges.
20806 (print_state): Don't output by hand: fill the node description,
9bfe901c 20807 and ask for its output.
08a946e0 20808
f0473484
AD
208092001-11-19 Akim Demaille <akim@epita.fr>
20810
cc72668c
AD
20811 * src/bison.simple (yyparse): When verbosely reporting an error,
20812 no longer put additional quotes around token names.
f0473484
AD
20813 * tests/calc.at: Adjust.
20814
e41dc700
AD
208152001-11-19 Akim Demaille <akim@epita.fr>
20816
20817 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20818 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20819 * src/output.c: Adjust.
20820
652a871c
AD
208212001-11-19 Akim Demaille <akim@epita.fr>
20822
20823 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20824 (rule_t): this.
20825 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20826
b2ed6e58
AD
208272001-11-19 Akim Demaille <akim@epita.fr>
20828
20829 * src/gram.h (rule_t): New.
20830 (rule_table): New.
20831 (rrhs, rlhs): Remove, part of state_t.
20832 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20833 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20834 * src/reader.c, src/reduce.c: Adjust.
20835
edad7067
AD
208362001-11-19 Akim Demaille <akim@epita.fr>
20837
20838 * src/reader.c (symbols_output): New, extracted from...
20839 (packsymbols): Here.
20840 (reader): Call it.
20841
3feec034
AD
208422001-11-19 Akim Demaille <akim@epita.fr>
20843
20844 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20845 (maxrhs): this new function.
20846
ddcd5fdf
AD
208472001-11-19 Akim Demaille <akim@epita.fr>
20848
cc72668c 20849 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
20850 Adjust.
20851
bb527fc2
AD
208522001-11-19 Akim Demaille <akim@epita.fr>
20853
cc72668c 20854 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
20855 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20856 * src/lalr.c: Adjust.
20857
a845a697
AD
208582001-11-19 Akim Demaille <akim@epita.fr>
20859
20860 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20861 (set_state_table): handle the `lookaheads' members.
20862
f004bf6a
AD
208632001-11-19 Akim Demaille <akim@epita.fr>
20864
cc72668c
AD
20865 * src/lalr.h (lookaheads): Removed array, whose contents is now
20866 a member of...
f004bf6a
AD
20867 (state_t): this structure.
20868 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20869 Adjust.
20870
de326cc0
AD
208712001-11-19 Akim Demaille <akim@epita.fr>
20872
cc72668c
AD
20873 * src/lalr.h (consistent): Removed array, whose contents is now
20874 a member of...
de326cc0
AD
20875 (state_t): this structure.
20876 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20877 Adjust.
20878
90b4416b
AD
208792001-11-19 Akim Demaille <akim@epita.fr>
20880
cc72668c
AD
20881 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20882 contents are now members of...
90b4416b
AD
20883 (state_t): this structure.
20884 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20885 Adjust.
20886
9703cc49
AD
208872001-11-19 Akim Demaille <akim@epita.fr>
20888
20889 * src/lalr.h (state_t): New.
20890 (state_table): Be a state_t * instead of a core **.
20891 (accessing_symbol): Remove, part of state_t.
20892 * src/lalr.c: Adjust.
20893 (set_accessing_symbol): Merge into...
20894 (set_state_table): this.
20895 * src/print_graph.c, src/conflicts.c: Adjust.
20896
d803322e
AD
208972001-11-14 Akim Demaille <akim@epita.fr>
20898
20899 * tests/calc.at, tests/output.at, tests/regression.at,
20900 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20901 now the tests are run in private dirs, therefore AC_CLEANUP and
20902 family can be simplified to 0-ary.
20903 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20904 use abs. path to find config.h.
20905 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20906 stderr, there can be way too much random noise.
20907 Instead pass -Werror to GCC and rely on the exit status.
20908 Reported by Wolfram Wagner.
20909
3d76b07d
AD
209102001-11-14 Akim Demaille <akim@epita.fr>
20911
20912 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
20913 defined only if yyoverflow is defined, to avoid `warning: unused
20914 variable `yyvs1''.
20915 Reported by The Test Suite.
20916
09b503c8
AD
209172001-11-14 Akim Demaille <akim@epita.fr>
20918
20919 * src/print.c: Include reduce.h.
20920 Reported by Hans Aberg.
20921
209222001-11-14 Akim Demaille <akim@epita.fr>
20923
20924 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
20925 Revert a previous patch: these are really const.
20926 * src/conflicts.c (conflict_report): Additional useless pair of
20927 braces to pacify GCC's warnings for `if () if () {} else {}'.
20928 * src/lex.c (parse_percent_token): Replace equal_offset with
20929 arg_offset.
20930 arg is const.
20931 Be sure to strdup `arg' when used, since there is no reason for
20932 token_buffer not to change.
20933
0f37a994
AD
209342001-11-14 Akim Demaille <akim@epita.fr>
20935
20936 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
20937 definition.
20938 * src/main.c (main): Use them.
20939 Suggested by Hans Aberg.
20940
d39d93b8
AD
209412001-11-12 Akim Demaille <akim@epita.fr>
20942
20943 * src/system.h (ngettext): Now that we use ngettext, be sure to
20944 provide a default definition when NLS are not used.
20945
9edcd895
AD
209462001-11-12 Akim Demaille <akim@epita.fr>
20947
20948 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
20949 Use @kbd to denote user input.
20950 (Language and Grammar): ANSIfy the example.
20951 Adjust its layout for info/notinfo.
20952 (Location Tracking Calc): Output error messages to stderr.
20953 Output locations in a more GNUtically correct way.
20954 Fix a couple of Englishos.
20955 Adjust @group/@end group pairs.
20956
7da99ede
AD
209572001-11-12 Akim Demaille <akim@epita.fr>
20958
e3aa65c5 20959 %expect was not functioning at all.
7da99ede
AD
20960
20961 * src/conflicts.c (expected_conflicts): Set to -1.
20962 (conflict_report): Use ngettext.
20963 (conflicts_print): Check %expect and make its violation an error.
20964 * doc/bison.texinfo (Expect Decl): Adjust.
20965 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
20966 * tests/regression.at (%expect not enough, %expect right)
20967 (%expect too much): New.
20968
ba9dda1a
AD
209692001-11-12 Akim Demaille <akim@epita.fr>
20970
20971 * tests/regression.at (Conflicts): Rename as...
20972 (Unresolved SR Conflicts): this.
20973 (Solved SR Conflicts): New.
20974
337c5bd1
AD
209752001-11-12 Akim Demaille <akim@epita.fr>
20976
20977 * src/reduce.c (print_results): Rename as...
20978 (reduce_output): This.
20979 Output to OUT, passed as argument, instead of output_obstack.
20980 (dump_grammar): Likewise.
20981 (reduce_free): New.
20982 Also free V1.
20983 (reduce_grammar): No longer call reduce_output, since...
20984 * src/print.c (print_results): do it.
20985 * src/main.c (main): Call reduce_free;
20986
c73a41af
AD
209872001-11-12 Akim Demaille <akim@epita.fr>
20988
20989 * src/conflicts.c (print_reductions): Accept OUT as argument.
20990 Output to it, not to output_obstack.
20991 * src/print.c (print_actions): Adjust.
20992
0df87bb6
AD
209932001-11-12 Akim Demaille <akim@epita.fr>
20994
20995 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
20996 the result instead of using...
20997 (src_total, rrc_total, src_count, rrc_count): Remove.
20998 (any_conflicts): Remove.
20999 (print_conflicts): Split into...
21000 (conflicts_print, conflicts_output): New.
21001 * src/conflicts.h: Adjust.
21002 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 21003 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
21004 * tests/regression.at (Conflicts): New.
21005 Reported by Tom Lane.
21006
e4d3d4de
AD
210072001-11-12 Akim Demaille <akim@epita.fr>
21008
21009 * tests/regression.at (Invalid input): Remove, duplicate with
21010 ``Invalid input: 1''.
21011
6d7d248e
AD
210122001-11-12 Akim Demaille <akim@epita.fr>
21013
21014 * tests/torture.at (AT_DATA_STACK_TORTURE)
21015 (Exploding the Stack Size with Alloca)
21016 (Exploding the Stack Size with Malloc): New.
21017
e9e4c321
AD
210182001-11-12 Akim Demaille <akim@epita.fr>
21019
21020 * src/bison.simple (YYSTACK_REALLOC): New.
21021 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 21022 Reported by Per Allansson.
e9e4c321 21023
5f7e0832
AD
210242001-11-12 Pascal Bart <pascal.bart@epita.fr>
21025
21026 * src/bison.simple: Define type yystype instead of YYSTYPE, and
21027 define CPP macro, which substitute YYSTYPE by yystype.
21028 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
21029 with yyltype/YYLTYPE. This allows inclusion of the generated
21030 header within the parser if the compiler, such as GGC, accepts
21031 multiple equivalent #defines.
21032 From Akim.
21033
e3f1699f
AD
210342001-11-05 Akim Demaille <akim@epita.fr>
21035
21036 * src/reader.c (symbols_output): New, extracted from...
21037 (packsymbols): here.
21038 (reader): Adjust.
21039
65be0866
AD
210402001-11-05 Akim Demaille <akim@epita.fr>
21041
21042 * src/lex.c (parse_percent_token): s/quotearg/quote/.
21043
e4d910bf
AD
210442001-11-05 Akim Demaille <akim@epita.fr>
21045
21046 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
21047 pattern.
21048
951366c1
AD
210492001-11-05 Akim Demaille <akim@epita.fr>
21050
21051 * src/options.h (struct option_table_struct): set_flags is void*.
21052 * src/options.c (longopts): Support `--output' and `%output'.
21053 (usage): Adjust.
21054 * src/lex.h (tok_setopt): Remove, replaced with...
21055 (tok_intopt, tok_stropt): these new guys.
21056 * src/lex.c (getopt.h): Not needed.
21057 (token_buffer, unlexed_token_buffer): Not const.
21058 (percent_table): Promote `-' over `_' in directive names.
21059 Active `%name-prefix', `file-prefix', and `output'.
21060 (parse_percent_token): Accept possible arguments to directives.
21061 Promote `-' over `_' in directive names.
21062
d8988b2f
AD
210632001-11-04 Akim Demaille <akim@epita.fr>
21064
21065 * doc/bison.texinfo (Decl Summary): Split the list into
21066 `directives for grammars' and `directives for bison'.
21067 Sort'em.
21068 Add description of `%name-prefix', `file-prefix', and `output'.
21069 Promote `-' over `_' in directive names.
21070 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
21071 Simplify the description of `--name-prefix'.
21072 Promote `-' over `_' in directive names.
21073 Promote `--output' over `--output-file'.
21074 Fix the description of `--defines'.
21075 * tests/output.at: Exercise %file-prefix and %output.
21076
6468d18e
AD
210772001-11-02 Akim Demaille <akim@epita.fr>
21078
21079 * doc/refcard.tex: Update.
21080
6b7e85b9
AD
210812001-11-02 Akim Demaille <akim@epita.fr>
21082
21083 * src/symtab.h (SUNDEF): New.
21084 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
21085 stand for `uninitialized', instead of 0.
21086 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
21087 * src/lex.c (lex): Adjust.
21088
21089 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
21090 Number it 0.
21091 Let yylex return it instead of a plain 0.
21092 Reported by Dick Streefland.
21093
cd5aafcf
AD
210942001-11-02 Akim Demaille <akim@epita.fr>
21095
21096 * tests/regression.at (Mixing %token styles): New test.
21097
037ca2f1
AD
210982001-11-02 Akim Demaille <akim@epita.fr>
21099
21100 * src/reader.c (parse_thong_decl): Formatting changes.
21101 (token_translations_init): New, extracted from...
21102 (packsymbols): Here.
21103 Adjust.
21104
270a173c
AD
211052001-11-01 Akim Demaille <akim@epita.fr>
21106
21107 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
21108 Check that `9foo.y' produces correct cpp guards.
21109 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
21110 guards.
21111 Reported by Wwp.
21112
561f9a30
AD
211132001-11-01 Akim Demaille <akim@epita.fr>
21114
21115 * tests/regression.at (Invalid input: 2): New.
21116 * src/lex.c (unlexed_token_buffer): New.
21117 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
21118 too.
21119 Reported by Wwp.
21120
f987e9d2
AD
211212001-11-01 Akim Demaille <akim@epita.fr>
21122
21123 * tests/calc.at: Catch up with 1.30.
21124 * configure.in: Bump to 1.49a.
21125 Adjust to newer Autotest.
21126
0846f581
PB
211272001-10-19 Pascal Bart <pascal.bart@epita.fr>
21128
21129 * src/conflicts.c: Move global variables rrc_total and src_total ...
21130 (print_conflicts): here.
21131 * src/output.c (output): Free global variable user_toknums.
21132 * src/lex.c (token_obstack): Become static.
21133
3c1a79b3
AD
211342001-10-18 Akim Demaille <akim@epita.fr>
21135
21136 * tests/atlocal.in (GCC): Add.
21137 * tests/calc.at: s/m4_match/m4_bmatch/.
21138 s/m4_patsubst/m4_bpatsubst/.
21139 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
21140 * configure.in: AC_SUBST(GCC).
21141
5d52e7d0
MA
211422001-10-14 Marc Autret <autret_m@epita.fr>
21143
21144 * src/options.c (create_long_option_table): Fix.
21145
631aa1d3
AD
211462001-10-10 Akim Demaille <akim@epita.fr>
21147
21148 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
21149
f6ec6d13
AD
211502001-10-04 Akim Demaille <akim@epita.fr>
21151
21152 * src/reader.c (parse_union_decl): Push the caracters in
21153 union_obstack, not attrs_obstack.
21154
342b8b6e
AD
211552001-10-04 Akim Demaille <akim@epita.fr>
21156
21157 Merge in the branch 1.29.
21158
21159 * src/reader.c (packsymbols): Use a temporary obstack for
21160 `%%tokendef', since output_stack is already used elsewhere.
21161
21162 2001-10-02 Akim Demaille <akim@epita.fr>
21163
21164 Bump 1.29d.
21165
21166 2001-10-02 Akim Demaille <akim@epita.fr>
21167
21168 Version 1.29c.
21169
21170 2001-10-02 Akim Demaille <akim@epita.fr>
21171
21172 * tests/regression.at (Invalid CPP headers): New.
21173 From Alexander Belopolsky.
21174 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
21175
21176 2001-10-02 Akim Demaille <akim@epita.fr>
21177
21178 * tests/regression.at (Invalid input): New.
21179 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
21180 Reported by Shura.
21181
21182 2001-10-02 Akim Demaille <akim@epita.fr>
21183
21184 * tests/calc.at: Now that --debug works, the tests must be adjusted.
21185
21186 2001-10-02 Akim Demaille <akim@epita.fr>
21187
21188 * src/output.c (output_parser): Assert `skeleton'.
21189 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
21190 systems.
21191 From Shura.
21192
21193 2001-10-01 Marc Autret <autret_m@epita.fr>
21194
21195 * src/lex.h: Echo modifications.
21196 * src/lex.c (unlex): Parameter is now token_t.
21197 From Hans Aberg.
21198
21199 2001-10-01 Marc Autret <autret_m@epita.fr>
21200
21201 * src/main.c: Include lex.h.
21202 From Hans Aberg.
21203
21204 2001-09-29 Akim Demaille <akim@epita.fr>
21205
21206 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
21207
21208 2001-09-28 Akim Demaille <akim@epita.fr>
21209
21210 * tests/testsuite.at: Update to newer Autotest.
21211 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
21212
21213 2001-09-27 Akim Demaille <akim@epita.fr>
21214
21215 Position independent wrapper.
21216
21217 * tests/bison: Remove.
21218 * tests/bison.in: New.
21219 * configure.in: Adjust.
21220
21221 2001-09-27 Paul Eggert <eggert@twinsun.com>
21222
21223 Port quotearg fixes from tar 1.13.24.
21224
21225 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
21226 tm to be declared.
21227 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
21228 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
21229
21230 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21231 * m4/mbrtowc.m4: New file.
21232 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21233 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21234
21235 2001-09-27 Akim Demaille <akim@epita.fr>
21236
21237 Bump to 1.29c.
21238
21239 2001-09-27 Akim Demaille <akim@epita.fr>
21240
21241 Version 1.29b.
21242
21243 2001-09-25 Akim Demaille <akim@epita.fr>
21244
21245 * src/system.h: Include `xalloc.h'.
21246 Remove it from the C files.
21247 * src/files.c (output_files): Free the obstacks.
21248 * src/lex.c (init_lex): Rename as...
21249 (lex_init): this.
21250 (lex_free): New.
21251 * src/main.c (main): Use it.
21252
21253 2001-09-24 Marc Autret <autret_m@epita.fr>
21254
21255 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21256 to output informations in fout (FILE*).
21257 (open_graph, close_graph): Likewise.
21258 (output_graph, output_edge, output_node): Likewise.
21259 * src/vcg.h: Update function prototypes.
21260 * src/print_graph.c (print_graph): Open output graph file.
21261 (print_actions): Adjust.
21262 * src/files.h: Remove extern declaration.
21263 * src/files.c: Remove graph_obstack declaration.
21264 (open_files): Remove graph_obstack initialization.
21265 (output_files): Remove graph_obstack saving.
21266
21267 2001-09-24 Marc Autret <autret_m@epita.fr>
21268
21269 * src/files.c (compute_output_file_names): Fix.
21270
21271 2001-09-24 Marc Autret <autret_m@epita.fr>,
21272 Akim Demaille <akim@epita.fr>
21273
21274 * src/reader.c (reader): Remove call to free_symtab ().
21275 * src/main.c (main): Call it here.
21276 Include symtab.h.
21277 * src/conflicts.c (initialize_conflicts): Rename as...
21278 (solve_conflicts): this.
21279 * src/print.c (print_core, print_actions, print_state)
21280 (print_grammar): Dump to a file instead a `output_obstack'.
21281 (print_results): Dump `output_obstack', and then proceed with the
21282 FILE *.
21283 * src/files.c (compute_output_file_names, close_files): New.
21284 (output_files): Adjust.
21285 * src/main.c (main): Adjust.
21286
21287 2001-09-23 Marc Autret <autret_m@epita.fr>
21288
21289 * src/files.c (compute_header_macro): Computes header macro name
21290 from spec_defines_file when given.
21291
21292 2001-09-23 Marc Autret <autret_m@epita.fr>
21293
21294 * src/files.c (output_files): Add default extensions.
21295
21296 2001-09-22 Akim Demaille <akim@epita.fr>
21297
21298 * src/conflicts.c (finalize_conflicts): Rename as...
21299 (free_conflicts): this.
21300
21301 2001-09-22 Akim Demaille <akim@epita.fr>
21302
21303 * src/gram.c (gram_free): Rename back as...
21304 (dummy): this.
21305 (output_token_translations): Free `token_translations'.
21306 * src/symtab.c (free_symtab): Free the tag field.
21307
21308 2001-09-22 Akim Demaille <akim@epita.fr>
21309
21310 Remove `translations' as it is always set to true.
21311
21312 * src/gram.h: Adjust.
21313 * src/reader.c (packsymbols, parse_token_decl): Adjust
21314 * src/print.c (print_grammar): Adjust.
21315 * src/output.c (output_token_translations): Adjust.
21316 * src/lex.c (lex): Adjust.
21317 * src/gram.c: Be sure the set pointers to NULL.
21318 (dummy): Rename as...
21319 (gram_free): this.
21320
21321 2001-09-22 Akim Demaille <akim@epita.fr>
21322
21323 * configure.in: Invoke AM_LIB_DMALLOC.
21324 * src/system.h: Use dmalloc.
21325 * src/LR0.c: Be sure to have pointers initialized to NULL.
21326 (allocate_itemsets): Allocate kernel_items only if needed.
21327
21328 2001-09-22 Akim Demaille <akim@epita.fr>
21329
21330 * configure.in: Bump to 1.29b.
21331 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
21332 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
21333 need xmalloc.c in calc.y.
21334 From Pascal Bart.
21335
21336 2001-09-21 Akim Demaille <akim@epita.fr>
21337
21338 Version 1.29a.
21339 * Makefile.maint, config/config.guess, config/config.sub,
21340 * config/missing: Update from masters.
21341 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
21342 upon package.m4.
21343 * configure.in (ALL_LINGUAS): Add `tr'.
21344
21345 2001-09-21 Akim Demaille <akim@epita.fr>
21346
21347 * tests/Makefile.am (package.m4): Move to...
21348 ($(srcdir)/$(TESTSUITE)): here.
21349
21350 2001-09-20 Akim Demaille <akim@epita.fr>
21351
21352 * src/complain.c: No longer try to be standalone: use system.h.
21353 Don't assume __STDC__ is defined to 1. Just test if it is defined.
21354 * src/complain.h: Likewise.
21355 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
21356 Remove the unused variable `n'.
21357 From Albert Chin-A-Young.
21358
21359 2001-09-18 Marc Autret <autret_m@epita.fr>
21360
21361 * doc/bison.1: Update.
21362 * doc/bison.texinfo (Bison Options): Update --defines and --graph
21363 descriptions.
21364 (Option Cross Key): Update.
21365 Add --graph.
21366
21367 2001-09-18 Marc Autret <autret_m@epita.fr>
21368
21369 * tests/regression.at: New test (comment in %union).
21370
21371 2001-09-18 Marc Autret <autret_m@epita.fr>
21372
21373 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
21374 do that.
21375 Reported by Keith Browne.
21376
21377 2001-09-18 Marc Autret <autret_m@epita.fr>
21378
21379 * tests/output.at: Add tests for --defines and --graph.
21380
21381 2001-09-18 Marc Autret <autret_m@epita.fr>
21382
21383 * tests/output.at: Removes tests of %{header,src}_extension features.
21384
21385 2001-09-18 Akim Demaille <akim@epita.fr>
21386
21387 * tests/Makefile.am (package.m4): New.
21388 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
21389 (_AT_CHECK_CALC_ERROR): Likewise.
21390 Factor the `, ' part of verbose error messages.
21391
21392 2001-09-18 Marc Autret <autret_m@epita.fr>
21393
21394 * src/getargs.c (longopts): Declare --defines and --graph as options
21395 with optional arguments.
21396 * src/files.h: Add extern declarations.
21397 * src/files.c (spec_graph_file, spec_defines_file): New.
21398 (output_files): Update.
21399 Remove CPP-outed code.
21400
21401 2001-09-18 Marc Autret <autret_m@epita.fr>
21402
21403 Turn off %{source,header}_extension feature.
21404
21405 * src/files.c (compute_exts_from_gf): Update.
21406 (compute_exts_from_src): Update.
21407 (output_files): CPP-out useless code.
21408 * src/files.h: Remove {header,source}_extension extern declarations.
21409 * src/reader.c (parse_dquoted_param): CPP-out.
21410 (parse_header_extension_decl): Remove.
21411 (parse_source_extension_decl): Remove.
21412 (read_declarations): Remove cases tok_{hdrext,srcext}.
21413 * src/lex.c (percent_table): Remove {header,source}_extension entries.
21414 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
21415
21416 2001-09-10 Akim Demaille <akim@epita.fr>
21417
21418 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
21419 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
21420 (AT_CHECK_OUTPUT): this.
21421 Merely check ls' exit status, its output is useless.
21422
21423 2001-09-10 Akim Demaille <akim@epita.fr>
21424
21425 * tests/calc.at: Use m4_match.
21426 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
21427
21428 2001-09-10 Marc Autret <autret_m@epita.fr>,
21429 Akim Demaille <akim@epita.fr>
21430
21431 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
21432 enum color_e.
21433 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
21434 to `normal'.
21435 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
21436 * src/lex.h: Adjust prototype.
21437 (token_t): Add `tok_undef'.
21438 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
21439 (parse_percent_token): Now returns token_t.
21440 Add default statement in switch.
21441 (lex): Separate `c' as an input variable, from the token_t result
21442 part.
21443 (unlexed): Is a token_t.
21444
21445 2001-09-10 Akim Demaille <akim@epita.fr>
21446
21447 * configure.in: Bump to 1.29a.
21448
21449 2001-09-07 Akim Demaille <akim@epita.fr>
21450
21451 Version 1.29.
21452
21453 2001-08-30 Akim Demaille <akim@epita.fr>
21454
21455 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
21456 * m4/atconfig.m4: Remove.
21457 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
21458 * tests/bison: New.
21459 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
21460 m4_if, m4_patsubst, and m4_regexp.
21461 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
21462 `input' file instead of echo.
21463
21464 2001-08-29 Akim Demaille <akim@epita.fr>
21465
21466 Bump to 1.28e.
21467
21468 2001-08-29 Akim Demaille <akim@epita.fr>
21469
21470 Version 1.28d.
21471
21472 2001-08-29 Paul Eggert <eggert@twinsun.com>
21473
21474 * src/bison.simple (yyparse): Don't take the address of an
21475 item before the start of an array, as that doesn't conform to
21476 the C Standard.
21477
21478 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21479
21480 * doc/bison.texinfo (Location Tracking Calc): New node.
21481
21482 2001-08-29 Paul Eggert <eggert@twinsun.com>
21483
21484 * src/output.c (output): Do not define const, as this now
21485 causes more problems than it cures.
21486
21487 2001-08-29 Akim Demaille <akim@epita.fr>
21488
21489 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21490 the nodes.
21491 Be sure to tag the `detailmenu'.
21492
21493 2001-08-29 Akim Demaille <akim@epita.fr>
21494
21495 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21496 download in a tmp dir.
21497
21498 2001-08-28 Marc Autret <autret_m@epita.fr>
21499
21500 * config/depcomp: New file.
21501
21502 2001-08-28 Marc Autret <autret_m@epita.fr>
21503
21504 * doc/bison.1 (mandoc): Adjust.
21505 From Juan Manuel Guerrero.
21506
21507 2001-08-28 Marc Autret <autret_m@epita.fr>
21508
21509 * src/print_graph.c (print_state): Fix.
21510
21511 2001-08-27 Marc Autret <autret_m@epita.fr>
21512
21513 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21514 char * members.
21515 Echo modifications to the functions prototypes.
21516 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21517
21518 2001-08-27 Marc Autret <autret_m@epita.fr>
21519
21520 * src/vcg.c: Include `xalloc.h'.
21521 (add_colorentry): New.
21522 (add_classname): New.
21523 (add_infoname): New.
21524 * src/vcg.h: Add new prototypes.
21525
21526 2001-08-27 Akim Demaille <akim@epita.fr>
21527
21528 * Makefile.maint: Sync. again with CVS Autoconf.
21529
21530 2001-08-27 Akim Demaille <akim@epita.fr>
21531
21532 * Makefile.maint: Formatting changes.
21533 (po-update, cvs-update, update): New targets.
21534 (AMTAR): Remove.
21535
21536 2001-08-27 Akim Demaille <akim@epita.fr>
21537
21538 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21539 * Makefile.maint: Sync. with CVS Autoconf.
21540
21541 2001-08-27 Marc Autret <autret_m@epita.fr>
21542
21543 * src/vcg.h (struct infoname_s): New.
21544 (struct colorentry_s): New.
21545 (graph_s): New fields {vertical,horizontal}_order in structure.
21546 Add `infoname' field.
21547 Add `colorentry' field;
21548 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21549 (G_HORIZONTAL_ORDER): New.
21550 (G_INFONAME): New.
21551 (G_COLORENTRY): New.
21552 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21553 Add output of `infoname'.
21554 Add output of `colorentry'.
21555
21556 2001-08-27 Marc Autret <autret_m@epita.fr>
21557
21558 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21559 This one shadowed a global parameter.
21560
21561 2001-08-24 Marc Autret <autret_m@epita.fr>
21562
21563 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21564 instead of `unsigned'.
21565 (print_state): Do not call obstack_object_size () in obstack_grow ()
21566 to avoid macro variables shadowing.
21567
21568 2001-08-23 Marc Autret <autret_m@epita.fr>
21569
21570 * src/lex.c (percent_table): Typo: s/naem/name/.
21571 Add graph option.
21572 Normalize new options declarations.
21573
21574 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21575
21576 * tests/suite.at: Exercise %header_extension and %source_extension.
21577
21578 2001-08-16 Marc Autret <autret_m@epita.fr>
21579
21580 * src/reader.c (parse_dquoted_param): New.
21581 (parse_header_extension_decl): Use it.
21582 (parse_source_extension_decl): Likewise.
21583
21584 2001-08-16 Marc Autret <autret_m@epita.fr>
21585
21586 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21587 (get_xxxx_str): Use assert () instead of complain ().
21588 Remove return invokations in default cases.
21589 (get_decision_str): Modify default behaviour. Remove second argument.
21590 Echo modifications on calls.
21591 (output_graph): Fix.
21592
21593 2001-08-16 Marc Autret <autret_m@epita.fr>
21594
21595 * src/getargs.c (usage): Update with ``-g, --graph''.
21596
21597 2001-08-16 Marc Autret <autret_m@epita.fr>
21598
21599 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21600 (Option Cross Key): Likewise.
21601 * doc/bison.1: Update.
21602
1c8c2190
PB
216032001-09-25 Pascal Bart <pascal.bart@epita.fr>
21604
21605 * src/output.c (output_master_parser): Don't finish action_obstack.
21606 (output_parser): Don't care about the muscle action, here.
21607 (prepare): Copy the action_obstack in the action muscle.
21608 (output): Free action_obstack.
21609
180d45ba
PB
216102001-09-23 Pascal Bart <pascal.bart@epita.fr>
21611
21612 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21613 will contain `%union' declaration.
21614 (parse_union_decl): Delete #line directive output.
21615 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21616 informations about %union.
21617 (parse_union_decl): Copy the union_obstack in the muscle stype.
21618 * src/bison.simple: Add new #line directive.
21619 Add typdef %%stype YYSTYPE.
21620
c51d1a19
PB
216212001-09-23 Pascal Bart <pascal.bart@epita.fr>
21622
21623 * src/bison.simple: Add new `#line' directive.
21624
6f9344da
PB
216252001-09-22 Pascal Bart <pascal.bart@epita.fr>
21626
21627 * src/bison.simple: New `#line' directive.
21628 * src/output.c (output_parser): Support new dynamic muscle input_line.
21629
652def80
MA
216302001-09-22 Marc Autret <autret_m@epita.fr>
21631
21632 * src/output.c (output_master_parser): New.
21633 (output_parser): Be more re-entrant.
21634
25b222fa
MA
216352001-09-21 Marc Autret <autret_m@epita.fr>
21636
21637 * src/reader.c (copy_definition, parse_union_decl): Update and use
21638 `linef' muscle.
21639 (copy_action): Likewise.
21640 Use obstack_1grow ().
21641 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21642
6bc35ae5
MA
216432001-09-21 Marc Autret <autret_m@epita.fr>
21644
21645 * src/options.c (option_table): Adjust.
21646 * src/lex.c (parse_percent_token): Fix.
21647
c0629aa1
PB
216482001-09-20 Pascal Bart <pascal.bart@epita.fr>
21649
21650 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 21651
82b6d266
PB
216522001-09-20 Pascal Bart <pascal.bart@epita.fr>
21653
21654 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21655 is now an option_table_struct*.
21656 (option_strcmp): New function option_strcmp.
21657 (parse_percent_token): Call option_strcmp.
21658 * src/getargs.c (xalloc.h, options.h): Include it.
21659 (getargs): Call create_long_option_table.
21660 (getargs): Free longopts at the end of the function.
21661 (shortopts): Move in options.c.
21662 * src/options.c (create_long_option_table): New function. Convert
21663 information from option_table to option structure.
21664 * src/reader.c (options.h): Include it.
21665
21666 * src/Makefile.am: Adjust.
21667 * src/options.c (option_table): Create from longopts and percent_table.
21668 * src/getargs.c (longopts): Delete.
21669 * src/lex.c (struct percent_table_struct): Delete.
21670 (percent_table): Delete.
21671 (options.h): Include it.
21672 * src/options.c: Create.
21673 * src/options.h: Create.
21674 Declare enum opt_access_e.
21675 Define struct option_table_struct.
21676
75f5aaea
MA
216772001-09-20 Marc Autret <autret_m@epita.fr>
21678
21679 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21680 sections of Bison.
21681
f508cb0a
PB
216822001-09-19 Pascal Bart <pascal.bart@epita.fr>
21683
21684 * src/bison.simple: s/%%filename/%%skeleton.
21685 * src/muscle_tab.c (getargs.h): Include it.
21686 (muscle_init): Insert new muscle skeleton.
21687
13105fc1
PB
216882001-09-18 Pascal Bart <pascal.bart@epita.fr>
21689
21690 * src/output.c (output_parser): Delete unused variable actions_dumped.
21691
b0c4483e
PB
216922001-09-07 Pascal Bart <pascal.bart@epita.fr>
21693
21694 * src/output.c (output): Delete call to reader_output_yylsp.
21695 * src/reader.c (reader): Likewise.
ba0fe3c7 21696 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 21697
11d82f03
MA
216982001-09-02 Marc Autret <autret_m@epita.fr>
21699
21700 * src/reader.c: Include muscle_tab.h.
21701 (parse_union_decl): Update.
21702 (parse_macro_decl): Rename parse_muscle_decl.
21703 Update to use renamed functions and variable.
21704 (read_declarations, copy_action, read_additionnal_code, : Updated
21705 with correct variables and functions names.
21706 (packsymbols, reader): Likewise.
342b8b6e 21707
11d82f03 21708 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 21709
11d82f03
MA
21710 * src/output.c: Include muscle_tab.h
21711 In all functions using macro_insert, change by using muscle_insert ().
21712 (macro_obstack): Rename muscle_obstack.
21713 Echo modifications in the whole file.
21714 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21715 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21716 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21717
21718 * src/muscle_tab.h: Update double inclusion macros.
21719 (macro_entry_s): Rename muscle_entry_s.
21720 Update prototypes.
342b8b6e 21721
11d82f03
MA
21722 * src/muscle_tab.c: Include muscle_tab.h.
21723 Rename macro_tabble to muscle_table.
21724 (mhash1, mhash2, mcmp): Use muscle_entry.
21725 (macro_init): Rename muscle_init. Update.
21726 (macro_insert): Rename muscle_insert. Update.
21727 (macro_find): Rename muscle_find. Update.
21728
21729 * src/main.c: Include muscle_tab.h.
21730 (main): Call muscle_init ().
21731 * src/Makefile.am (bison_SOURCES): Echo modifications.
21732
93a37297
MA
217332001-09-02 Marc Autret <autret_m@epita.fr>
21734
f753cd62 21735 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 21736
f753cd62
MA
21737 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21738
217392001-09-02 Marc Autret <autret_m@epita.fr>
21740
21741 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 21742
682d48cd
PB
217432001-09-01 Pascal Bart <pascal.bart@epita.fr>
21744
342b8b6e 21745 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
21746 filename.
21747
087c8fda
MA
217482001-09-01 Marc Autret <autret_m@epita.fr>
21749
21750 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21751 to an explicit value to activate the feature. We do it here.
21752
dda680cb
PB
217532001-08-31 Pascal Bart <pascal.bart@epita.fr>
21754
21755 * src/output.c (prepare): Delete the `filename' muscule insertion.
21756 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21757 (parse_union_decl): Likewise.
21758 * src/macrotab.c (macro_init): Initialize filename by infile.
21759
9e644e64
MA
217602001-08-31 Marc Autret <autret_m@epita.fr>
21761
21762 * src/bison.simple (YYLSP_NEEDED): New definition.
21763 * src/output.c (prepare): Add macro insertion of `locations_flag'
21764
17da6427
PB
217652001-08-31 Pascal Bart <pascal.bart@epita.fr>
21766
21767 * src/output.c (prepare): Delete insertion of previous muscles,
21768 and insert the `prefix' muscles.
21769 * src/macrotab.c (macro_init): Likewise.
21770 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 21771 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
21772 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21773 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 21774 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
21775 name_prefix.
21776
e8cb70b9
PB
217772001-08-31 Pascal Bart <pascal.bart@epita.fr>
21778
21779 * src/main.c (main): Standardize.
21780 * src/output.c (output_table_data, output_parser): Likewise.
21781 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21782
63c2d5de
MA
217832001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21784
342b8b6e 21785 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
21786 %%epilogue.
21787 * src/output.c (output): Rename %%declarations to %%prologue.
21788 * src/bison.simple: Echo modifications.
342b8b6e 21789
d8cb5183
MA
217902001-08-31 Marc Autret <autret_m@epita.fr>
21791
21792 * src/reader.c (readgram): CleanUp.
21793 (output_token_defines): Likewise.
21794 (packsymbols): Likewise.
21795 (reader): Likewise.
21796 * src/output.c (output): CPP-out useless code.
21797
6c686258
PB
217982001-08-31 Pascal Bart <pascal.bart@epita.fr>
21799
342b8b6e 21800 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
21801 output_trailers and output_headers.
21802 * src/output.h: Remove obsolete functions prototypes of output_headers
21803 and output_trailers.
21804
8f451ef7
PB
218052001-08-30 Pascal Bart <pascal.bart@epita.fr>
21806
21807 * src/main.c: Include macrotab.h.
342b8b6e 21808 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
21809 Adjust functions prototypes.
21810 * src/macrotab.c (macro_insert): Constify key and value.
21811 (macro_find): Constify key.
21812 (macro_insert): Include 'xalloc.h'
21813 (macro_insert): Use XMALLOC.
21814 (macro_find): Constify return value.
21815 * src/output.c (output_table_data): Rename table to table_data.
21816 (output_parser): Constify macro_key, macro_value.
21817
997b6fd0 218182001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
21819
21820 * src/reader.c (parse_skel_decl): New.
342b8b6e 21821 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
21822 * src/lex.h (token_t): New token `tok_skel'.
21823 * src/lex.c (percent_table): Add skeleton option entry.
21824 Standardize.
21825
ff48177d
MA
218262001-08-29 Marc Autret <autret_m@epita.fr>
21827
21828 * src/bison.simple: Add %%user_code directive at the end.
21829 * src/reader.c (read_additionnal_code): New.
21830 (reader): Use it.
21831 * src/output.c (output_program): Remove.
21832 (output): Update.
21833
b33160bf
MA
218342001-08-28 Marc Autret <autret_m@epita.fr>
21835
21836 * src/output.c (output_actions): Clean up.
4e5caae2 21837 (output_gram): CPP-out useless code.
b33160bf
MA
21838 * src/reader.c (reader): Clean up, CPP-out useless code.
21839
d1a2daf7
PB
218402001-08-28 Pascal Bart <pascal.bart@epita.fr>
21841
342b8b6e 21842 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 21843 directive.
d1a2daf7
PB
21844 * src/bison.simple: Add `%%definitions'.
21845
2b763dfe
MA
218462001-08-28 Marc Autret <autret_m@epita.fr>
21847
21848 * config/depcomp: New file.
21849
f1a87ef6
PE
218502001-08-27 Paul Eggert <eggert@twinsun.com>
21851
21852 * src/bison.simple (yyparse): Don't take the address of an
21853 item before the start of an array, as that doesn't conform to
21854 the C Standard.
21855
82e236e2
RA
218562001-08-27 Robert Anisko <robert.anisko@epita.fr>
21857
f1a87ef6 21858 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
21859 obstack. It was done too late here.
21860
21861 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21862 completely wrong.
21863 (reader): Initialize the macro obstack here, since we need it to grow
21864 '%define' directives.
21865
21866 * src/reader.h: Declare the macro obstack as extern.
21867
b0cfa28a
RA
218682001-08-27 Robert Anisko <robert.anisko@epita.fr>
21869
21870 * src/output.c (output_parser): Fix. Store single '%' characters in
21871 the output obstack instead of throwing them away.
21872
6fc74234
AD
218732001-08-27 Akim Demaille <akim@epita.fr>
21874
21875 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21876
9c76d118
RA
218772001-08-25 Robert Anisko <robert.anisko@epita.fr>
21878
21879 * lib/Makefile.am: Adjust.
21880
a8289c62
RA
218812001-08-25 Robert Anisko <robert.anisko@epita.fr>
21882
21883 * src/bison.simple: Update and add '%%' directives.
21884
b6610515
RA
218852001-08-25 Robert Anisko <robert.anisko@epita.fr>
21886
21887 * src/reader.c (reader): Remove calls to 'output_headers' and
21888 'output_trailers'. Remove some C output.
21889 (readgram): Disable a piece of code that was writing a default
21890 definition for 'YYSTYPE'.
21891 (reader_output_yylsp): Remove.
21892 (packsymbols): Output token defintions to a macro.
21893 (copy_definition): Disable C output.
6fc74234 21894
b6610515
RA
21895 * src/reader.c (parse_macro_decl): New function used to parse macro
21896 declarations.
21897 (copy_string2): Put the body of copy_string into this new function.
21898 Add a parameter to let the caller choose whether he wants to copy the
21899 string delimiters or not.
21900 (copy_string): Be a simple call to copy_string2 with the last argument
21901 bound to true.
21902 (read_declarations): Add case for macro definition.
21903 (copy_identifier): New.
6fc74234 21904 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
21905 rather than lex.
21906
26f609ff
RA
219072001-08-25 Robert Anisko <robert.anisko@epita.fr>
21908
21909 * src/output.c (prepare): Add prefixed names.
21910 (output_parser): Output semantic actions.
21911 (output_parser): Fix bug on '%%line' directives.
6fc74234 21912
26f609ff
RA
21913 * src/output.c (output_headers): Remove. The C code printed by this
21914 function should now be in the skeletons.
21915 (output_trailers): Remove.
21916 (output): Disable call to 'reader_output_yylsp'.
21917 (output_rule_data): Do not output tables to the table obstack.
21918
21919 * src/output.c: Remove some C dedicated output.
21920 Improve the use of macro and output obstacks.
21921 (output_defines): Remove.
6fc74234 21922
26f609ff
RA
21923 * src/output.c (output_token_translations): Associate 'translate'
21924 table with a macro. No output to the table obstack.
21925 (output_gram): Same for 'rhs' and 'prhs'.
21926 (output_stos): Same for 'stos'.
21927 (output_rule_data): Same for 'r1' and 'r2'.
21928 (token_actions): Same for 'defact'.
21929 (goto_actions): Same for 'defgoto'.
21930 (output_base): Same for 'pact' and 'pgoto'.
21931 (output_table): Same for 'table'.
21932 (output_check): Same for 'check'.
6fc74234 21933
26f609ff
RA
21934 * src/output.c (output_table_data): New function.
21935 (output_short_table): Remove.
21936 (output_short_or_char_table): Remove.
6fc74234 21937
26f609ff
RA
21938 * src/output.c (output_parser): Replace most of the skeleton copy code
21939 with something new. Skeletons are now processed character by character
21940 rather than line by line, and Bison looks for '%%' macros. This is the
21941 first step in making Bison's output process (a lot) more flexible.
21942 (output_parser): Use the macro table.
21943
6f43b113
RA
219442001-08-25 Robert Anisko <robert.anisko@epita.fr>
21945
21946 * src/main.c (main): Initialize the macro table.
21947
dd3127cf
RA
219482001-08-25 Robert Anisko <robert.anisko@epita.fr>
21949
21950 * src/lex.c (percent_table): Add tok_define.
21951 * src/lex.h: Add tok_define.
21952
aa321494
RA
219532001-08-25 Robert Anisko <robert.anisko@epita.fr>
21954
21955 * src/macrotab.c: New file.
21956 * src/macrotab.h: New file.
21957 * src/Makefile.am: Update.
21958
68bd3b6b
RA
219592001-08-25 Robert Anisko <robert.anisko@epita.fr>
21960
21961 * lib/hash.c: New file.
21962 * lib/hash.h: New file.
21963 * lib/Makefile.am: Update.
21964
45f8dd1e
AD
219652001-08-15 Akim Demaille <akim@epita.fr>
21966
21967 Version 1.28c.
21968
40a64a7a 219692001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
21970
21971 * src/reader.c (readgram): Indent output macro YYSTYPE.
21972 (packsymbols): Likewise.
21973 (output_token_defines): Likewise.
21974 * src/files.c: Standardize.
21975 (compute_header_macro): New.
21976 (defines_obstack_save): New. Use compute_header_macro.
21977 (output_files): Update. Use defines_obstack_save.
21978
f9a8293a
AD
219792001-08-15 Akim Demaille <akim@epita.fr>
21980
21981 * doc/bison.texinfo (Table of Symbols): Document
21982 YYSTACK_USE_ALLOCA.
21983
150ca7a7
AD
219842001-08-15 Akim Demaille <akim@epita.fr>
21985
21986 * missing: Update from CVS Automake.
21987 * config/config.guess, config/config.sub, config/texinfo.tex:
21988 Update from gnu.org.
21989
69b5cec4
AD
219902001-08-15 Akim Demaille <akim@epita.fr>
21991
21992 * Makefile.maint: Sync with CVS Autoconf.
21993
f2b5126e
PB
219942001-08-14 Pascal Bart <pascal.bart@epita.fr>
21995
69b5cec4 21996 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
21997 `fdl.texi'.
21998 * doc/fdl.texi: Add to package.
21999
4ecbf796
MA
220002001-08-14 Marc Autret <autret_m@epita.fr>
22001
22002 Turn on %{source,header}_extension features.
22003
69b5cec4 22004 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
22005 source_extension.
22006 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 22007 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
22008 between options.
22009
95fb5662
MA
220102001-08-14 Marc Autret <autret_m@epita.fr>
22011
22012 * src/files.c (compute_base_names): Add extensions computing when
22013 `--file-prefix' used.
22014 Standardize function calls.
22015
78d09da9
MA
220162001-08-13 Marc Autret <autret_m@epita.fr>
22017
69b5cec4 22018 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
22019 defining it (defined but null disables alloca).
22020
5a009f2c
MA
220212001-08-13 Marc Autret <autret_m@epita.fr>
22022
22023 * src/bison.simple (_yy_memcpy): CPP reformat.
22024
1e41465a
PB
220252001-08-13 Pascal Bart <pascal.bart@epita.fr>
22026
22027 * tests/atconfig.in (CPPFLAGS): Fix.
22028
c67a198d
PB
220292001-08-10 Pascal Bart <pascal.bart@epita.fr>
22030
79282c6c 22031 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
22032 `gpl.texi'.
22033 * doc/gpl.texi: Add to package.
22034
09a6de7e
MA
220352001-08-10 Marc Autret <autret_m@epita.fr>
22036
22037 * src/print_graph.h: Fix.
22038 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
22039
b77b9ee0
AD
220402001-08-10 Akim Demaille <akim@epita.fr>
22041
22042 * src/system.h: Provide default declarations for stpcpy, strndup,
22043 and strnlen.
22044
3e259915
MA
220452001-08-10 Robert Anisko <anisko_r@epita.fr>
22046
22047 * doc/bison.texinfo (Locations): Update @$ stuff.
22048
ca96bc2d
MA
220492001-08-09 Robert Anisko <anisko_r@epita.fr>
22050
22051 * src/bison.simple (YYLLOC_DEFAULT): Update.
22052 (yyparse): Adjust.
22053
fdc6758b
MA
220542001-08-08 Marc Autret <autret_m@epita.fr>
22055
b77b9ee0 22056 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
22057 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
22058 Reported by Fabrice Bauzac.
957d4dbf 22059
600cad3b
MA
220602001-08-08 Marc Autret <autret_m@epita.fr>
22061
22062 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
22063 * src/vcg.c (output_node): Fix.
22064 * src/vcg.h: Cleanup.
22065 * src/print_graph.c: Add comments.
b77b9ee0 22066 (node_output_size): New global variable. Simplify the formatting of
600cad3b 22067 the VCG graph output.
b77b9ee0 22068 (print_actions): Unused code is now used. It notifies the final state
600cad3b 22069 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 22070 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
22071 blue.
22072 Get the current node name and node_obstack by argument.
22073 (node_obstack): New variable.
22074 (print_state): Manage node_obstack.
22075 (print_core): Use node_obstack given by argument.
22076 A node is not only computed here but in print_actions also.
22077 (print_graph): CPP out useless code instead of commenting it.
22078
976e528f
AD
220792001-08-07 Pascal Bart <pascal.bart@epita.fr>
22080
22081 * tests/atconfig.in (CPPFLAGS): Fix.
22082
20e8e5ca
AD
220832001-08-07 Akim Demaille <akim@epita.fr>
22084
22085 * src/print_graph.c (quote): New.
22086 (print_core): Use it.
22087
957d4dbf 220882001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 22089
3e3da797
AD
22090 * src/vcg.c (complain.h): Include it.
22091 Unepitaize `return' invocations.
c4b66126 22092 [NDEBUG] (main): Remove.
79282c6c 22093 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
22094 * src/files.c (open_files): Initialize graph_obstack.
22095 * src/print_graph.c (print_actions): CPP out useless code.
22096 (print_core): Don't output the last `\n' in labels.
22097 Use `quote'.
22098 * src/files.c (output_files): Output the VCG file.
22099 * src/main.c (main): Invoke print_graph ();
3e3da797 22100
957d4dbf 221012001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
22102
22103 Automaton VCG graph output.
22104 Using option ``-g'' or long option ``--graph'', you can generate
22105 a gram_filename.vcg file containing a VCG description of the LALR (1)
22106 automaton of your grammar.
22107
22108 * src/main.c: Call to print_graph() function.
22109 * src/getargs.h: Update.
22110 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
22111 (graph_flag): New flag.
22112 (longopts): Update.
22113 (getargs): Add case `g'.
22114 * src/files.c (graph_obstack): New obstack struct.
22115 (open_files): Initialize new obstack.
22116 (output_files): Saves graph_obstack if required.
22117 * src/files.h (graph_obstack): New extern declaration.
22118 * src/Makefile.am: Add new source files.
22119
927c1557 221202001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
22121
22122 * src/print_graph.c, src/print_graph.h (graph): New.
22123 * src/vcg.h: New file.
22124 * src/vcg.c: New file, VCG graph handling.
22125
7333d403
AD
221262001-08-06 Marc Autret <autret_m@epita.fr>
22127
22128 Add of %source_extension and %header_extension which specify
22129 the source or/and the header output file extension.
22130
22131 * src/files.c (compute_base_names): Remove initialisation of
22132 src_extension and header_extension.
22133 (compute_exts_from_gf): Update.
22134 (compute_exts_from_src): Update.
22135 (output_files): Update.
22136 * src/reader.c (parse_header_extension_decl): New.
22137 (parse_source_extension_decl): New.
22138 (read_declarations): New case statements for the new tokens.
22139 * src/lex.c (percent_table): Add entries for %source_extension
22140 and %header_extension.
22141 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
22142
84163231
AD
221432001-08-06 Marc Autret <autret_m@epita.fr>
22144
22145 * configure.in: Bump to 1.28c.
22146 * doc/bison.texinfo: Texinfo thingies.
22147
8303fc42
AD
221482001-08-04 Pascal Bart <pascal.bart@epita.fr>
22149
22150 * tests/atconfig.in (CPPFLAGS): Add.
22151 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
22152
70a84437
AD
221532001-08-03 Akim Demaille <akim@epita.fr>
22154
22155 Version 1.28b.
22156
2ce10144
AD
221572001-08-03 Akim Demaille <akim@epita.fr>
22158
22159 * tests/Makefile.am (check-local): Ship testsuite.
22160 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
22161 Include `string.h'.
22162
1e3e4bc1
AD
221632001-08-03 Akim Demaille <akim@epita.fr>
22164
22165 * configure.in: Try using -Wformat when compiling.
22166
42b45b7f
AD
221672001-08-03 Akim Demaille <akim@epita.fr>
22168
22169 * configure.in: Bump to 1.28b.
22170
8f13fe33
AD
221712001-08-03 Akim Demaille <akim@epita.fr>
22172
22173 * src/complain.c: Adjust strerror_r portability issues.
22174
b37ba92c
AD
221752001-08-03 Akim Demaille <akim@epita.fr>
22176
22177 Version 1.28a.
22178
b0ce6046
AD
221792001-08-03 Akim Demaille <akim@epita.fr>
22180
22181 * src/getargs.c, src/getarg.h (skeleton)): Constify.
22182 * src/lex.c (literalchar): Avoid name clashes on `buf'.
22183 * src/getargs.c: Include complain.h.
22184 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
22185 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
22186
d01c415b
AD
221872001-08-03 Akim Demaille <akim@epita.fr>
22188
22189 * src/reader.c (readgram): Display hidden chars in error messages.
22190
459dd1a6
AD
221912001-08-03 Akim Demaille <akim@epita.fr>
22192
22193 Update to gettext 0.10.39.
22194
53b74c0c
AD
221952001-08-03 Akim Demaille <akim@epita.fr>
22196
22197 * lib/strspn.c: New.
22198
234a3be3
AD
221992001-08-01 Marc Autret <autret_m@epita.fr>
22200
22201 * doc/bison.texinfo: Update.
22202 * doc/bison.1 (mandoc): Update.
22203 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
22204 * src/files.c: Support output files extensions computing.
22205 (src_extension): New static variable.
22206 (header_extension): New static variable.
22207 (tr): New function.
22208 (get_extension_index): New function, gets the index of an extension
22209 filename in a string.
22210 (compute_exts_from_gf): New function, computes extensions from the
22211 grammar file extension.
22212 (compute_exts_from_src): New functions, computes extensions from the
22213 C source file extension, file given by ``-o'' option.
22214 (compute_base_names): Update.
22215 (output_files): Update.
22216
847bf1f5
AD
222172001-08-01 Robert Anisko <anisko_r@epita.fr>
22218
d995fee7 22219 * doc/bison.texi: Document @$.
847bf1f5
AD
22220 (Locations): New section.
22221
d074a105
AD
222222001-07-18 Akim Demaille <akim@epita.fr>
22223
22224 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
22225 * config/prev-version.txt, config/move-if-change: New.
22226 * Makefile.am: Adjust.
22227
3419715d
AD
222282001-07-08 Pascal Bart <pascal.bart@epita.fr>
22229
22230 * src/bison.simple (yyparse): Suppress warning `comparaison
22231 between signed and unsigned'.
22232
62ab6972
AD
222332001-07-05 Pascal Bart <pascal.bart@epita.fr>
22234
22235 * src/getargs.h (raw_flag): Remove.
22236 * src/getargs.c: Die on `-r'/`--raw'.
22237 * src/lex.c (parse_percent_token): Die on `%raw'.
22238 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22239 * tests/calc.at: Suppress test with option `--raw'.
22240
1e24cc5b
AD
222412001-07-14 Akim Demaille <akim@epita.fr>
22242
22243 * config/: New.
22244 * configure.in: Require Autoconf 2.50.
22245 Update to gettext 0.10.38.
22246
32dfccf8
AD
222472001-03-16 Akim Demaille <akim@epita.fr>
22248
22249 * doc/bison.texinfo: ANSIfy the examples.
22250
cd5bd6ac
AD
222512001-03-16 Akim Demaille <akim@epita.fr>
22252
22253 * getargs.c (skeleton): New variable.
22254 (longopts): --skeleton is a new option.
22255 (shortopts, getargs): -S is a new option.
22256 * getargs.h: Declare skeleton.
22257 * output.c (output_parser): Use it.
22258
5141b016
AD
222592001-03-16 Akim Demaille <akim@epita.fr>
22260
22261 * m4/strerror_r.m4: New.
22262 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22263 * lib/error.h, lib/error.c: Update.
22264
447992b9
AD
222652001-03-16 Akim Demaille <akim@epita.fr>
22266
22267 * src/getargs.c (longopts): Clean up.
22268
274d42ce
AD
222692001-02-21 Akim Demaille <akim@epita.fr>
22270
22271 * src/reader.c (gensym): `gensym_count' is your own.
22272 Use a static buf to create the symbol name, as token_buffer is no
22273 longer a buffer.
22274
22c821f3
AD
222752001-02-08 Akim Demaille <akim@epita.fr>
22276
22277 * src/conflicts.c (conflict_report): Be sure not to append to res
22278 between two calls, which could happen if both first sprintf were
22279 skipped, but not the first cp += strlen.
22280
18569462
AD
222812001-02-08 Akim Demaille <akim@epita.fr>
22282
22283 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22284 New, from fileutils 4.0.37.
22285 * configure.in: Require Autoconf 2.49c. I took some time before
22286 making this decision. This is the only way out for portability
22287 issues in Bison, it would mean way too much duplicate effort to
22288 import in Bison features implemented in 2.49c since 2.13.
22289 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22290
0d8f3c8a
AD
222912001-02-02 Akim Demaille <akim@epita.fr>
22292
22293 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 22294 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 22295
f17bcd1f
AD
222962001-01-19 Akim Demaille <akim@epita.fr>
22297
22298 Get rid of the ad hoc handling of token_buffer in the scanner: use
22299 the obstacks.
22300
22301 * src/lex.c (token_obstack): New.
22302 (init_lex): Initialize it. No longer call...
22303 (grow_token_buffer): this. Remove it.
22304 Adjust all the places which used it to use the obstack.
22305
511e79b3
AD
223062001-01-19 Akim Demaille <akim@epita.fr>
22307
22308 * src/lex.h: Rename all the tokens:
22309 s/\bENDFILE\b/tok_eof/g;
22310 s/\bIDENTIFIER\b/tok_identifier/g;
22311 etc.
22312 Let them be enums, not #define, to ease debugging.
22313 Adjust all the code.
22314
0d6508ef
AD
223152001-01-18 Akim Demaille <akim@epita.fr>
22316
22317 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
22318 * src/lex.c (maxtoken, grow_token_buffer): Static.
22319
6deb4447
AD
223202001-01-18 Akim Demaille <akim@epita.fr>
22321
22322 Since we now use obstacks, more % directives can be enabled.
22323
22324 * src/lex.c (percent_table): Also accept `%yacc',
22325 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
22326 `%debug'.
22327 Handle the actions for `%semantic_parser' and `%pure_parser' here,
22328 instead of returning a token.
22329 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
22330 * src/reader.c (read_declarations): Adjust.
22331 * src/files.c (open_files): Don't call `compute_base_names', don't
22332 compute `attrsfile' since they depend upon data which might be
22333 *in* the input file now.
22334 (output_files): Do it here.
22335 * src/output.c (output_headers): Document the fact that this patch
22336 introduces a guaranteed SEGV for semantic parsers.
22337 * doc/bison.texinfo: Document them.
22338 * tests/suite.at: Exercise these %options.
22339
ff4423cc
AD
223402000-12-20 Akim Demaille <akim@epita.fr>
22341
22342 Also handle the output file (--verbose) with obstacks.
22343
22344 * files.c (foutput): Remove.
22345 (output_obstack): New.
22346 Adjust all dependencies.
22347 * src/conflicts.c: Return a string.
22348 * src/system.h (obstack_grow_string): Rename as...
22349 (obstack_sgrow): this. Be ready to work with non literals.
22350 (obstack_fgrow4): New.
22351
956dba3a
AD
223522000-12-20 Akim Demaille <akim@epita.fr>
22353
22354 * src/files.c (open_files): Fix the computation of short_base_name
22355 in the case of `-o foo.tab.c'.
22356
337bab46
AD
223572000-12-20 Akim Demaille <akim@epita.fr>
22358
22359 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
22360 (copy_dollar): Now that everything uses obstacks, get rid of the
22361 FILE * parameters.
22362
5d3214b8
AD
223632000-12-20 Akim Demaille <akim@epita.fr>
22364
22365 * src/files.c (open_files): Actually the `.output' file is based
22366 on the short_base_name, not base_name.
22367 * tests/suite.at (Checking output file names): Adjust.
22368
29092a57
AD
223692000-12-20 Akim Demaille <akim@epita.fr>
22370
22371 * src/bison.s1: Remove, we now use directly...
22372 * src/bison.simple: this.
22373 * src/Makefile.am: Use pkgdata instead of data.
22374
ea5607fd
AD
223752000-12-20 Akim Demaille <akim@epita.fr>
22376
22377 * src/files.c (guard_obstack): New.
22378 (open_files): Initialize it.
22379 (output_files): Dump it...
22380 * src/files.h: Export it.
22381 * src/reader.c (copy_guard): Use it.
22382
27110317
AD
223832000-12-19 Akim Demaille <akim@epita.fr>
22384
22385 * src/files.c (outfile, defsfile, actfile): Removed as global
22386 vars.
22387 (open_files): Don't compute them.
22388 (output_files): Adjust.
22389 (base_name, short_base_name): Be global.
22390 Adjust dependencies.
22391
19c50364
AD
223922000-12-19 Akim Demaille <akim@epita.fr>
22393
22394 * src/files.c (strsuffix): New.
22395 (stringappend): Be just like strcat but allocate.
22396 (base_names): Eve out from open_files.
22397 Try to simplify the rather hairy computation of base_name and
22398 short_base_name.
22399 (open_files): Use it.
22400 * tests/suite.at (Checking output file names): New test.
22401
573c1d9f
AD
224022000-12-19 Akim Demaille <akim@epita.fr>
22403
22404 * src/system.h (obstack_grow_literal_string): Rename as...
22405 (obstack_grow_string): this.
22406 * src/output.c (output_parser): Recognize `%% actions' instead of
22407 `$'.
22408 * src/bison.s1: s/$/%% actions/.
22409 * src/bison.hairy: Likewise.
22410
ef7ddedd
AD
224112000-12-19 Akim Demaille <akim@epita.fr>
22412
22413 * src/output.c (output_parser): Compute the `#line' lines when
22414 there are.
22415 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
22416 Suggested by Hans Aberg.
22417
ff61dabd
AD
224182000-12-19 Akim Demaille <akim@epita.fr>
22419
22420 Let the handling of the skeleton files be local to the procedures
22421 that use it.
22422
22423 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
22424 longer static.
22425 (fparser, open_extra_files): Remove.
22426 (open_files, output_files): Don't take care of fparser.
22427 * src/files.h: Adjust.
22428 * src/output.c (output_parser): Open and close the file to the
22429 skeleton.
22430 * src/reader.c (read_declarations): When %semantic_parser, open
22431 fguard.
22432
55b96341
AD
224332000-12-19 Akim Demaille <akim@epita.fr>
22434
22435 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
22436 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
22437
358c15b7
AD
224382000-12-19 Akim Demaille <akim@epita.fr>
22439
22440 * src/files.c (open_files): Yipee! We no longer need all the code
22441 looking for `/tmp' since we have no tmp file.
22442
7de3329e
AD
224432000-12-19 Akim Demaille <akim@epita.fr>
22444
22445 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
22446 New macros.
22447 * src/files.c (open_files): Less dependency on MSDOS etc.
22448
3abcd459
AD
224492000-12-14 Akim Demaille <akim@epita.fr>
22450
22451 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
22452 Provide a default definition.
22453 Use it when executing the default @ action.
22454 * src/reader.c (reader_output_yylsp): No longer include
22455 `timestamp' and `text' in the default YYLTYPE.
22456
2a91a95e
AD
224572000-12-12 Akim Demaille <akim@epita.fr>
22458
22459 * src/reader.c (copy_definition, parse_union_decl, copy_action)
22460 (copy_guard): Quote the file names.
22461 Reported by Laurent Mascherpa.
22462
14d3eb9b
AD
224632000-12-12 Akim Demaille <akim@epita.fr>
22464
22465 * src/output.c (output_headers, output_program, output): Be sure
22466 to escape special characters when outputting filenames.
22467 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22468 (output_headers): Don't depend on them, Use ACTSTR.
22469
d7045ec6
AD
224702000-11-17 Akim Demaille <akim@epita.fr>
22471
22472 * lib/obstack.h: Formatting changes.
22473 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22474 prevents type checking.
22475 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22476 cast the value to (void *): assigning a `foo *' to a `void *'
22477 variable is valid.
22478 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22479 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22480 append characters.
22481
6fd54b73
AD
224822000-11-17 Akim Demaille <akim@epita.fr>
22483
22484 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22485 as...
22486 (suite.m4, regression.m4, calc.m4): these.
22487 * tests/atgeneral.m4: Update from CVS Autoconf.
22488
4c50eae6
AD
224892000-11-17 Akim Demaille <akim@epita.fr>
22490
22491 * tests/regression.m4 (%union and --defines): New test,
22492 demonstrating a current bug in the obstack implementation.
22493
a35f64ea
AD
224942000-11-17 Akim Demaille <akim@epita.fr>
22495
22496 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22497 macros.
22498 Use them to declare the variables which are global or local to
22499 `yyparse'.
22500
7de23534
AD
225012000-11-17 Akim Demaille <akim@epita.fr>
22502
22503 * acconfig.h: Remove, no longer used.
22504
aa7815f5
AD
225052000-11-07 Akim Demaille <akim@epita.fr>
22506
22507 * src: s/Copyright (C)/Copyright/g.
22508
5af1f549
AD
225092000-11-07 Akim Demaille <akim@epita.fr>
22510
22511 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22512 defining.
22513 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22514
553e2b22
AD
225152000-11-07 Akim Demaille <akim@epita.fr>
22516
22517 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22518 Merge in a single CPP if/else.
22519
8a4f41d6
AD
225202000-11-07 Akim Demaille <akim@epita.fr>
22521
22522 * src/output.c (output): Remove useless variables.
22523 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22524 argument `data' for consistency with the prototypes.
22525 Qualify it `const'.
22526 (obstack_copy, obstack_copy0): Rename the second argument as
22527 `address' for consistency. Qualify it `const'.
22528 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22529 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22530 `const' their input argument (`data' or `address').
22531 Adjust the corresponding macros to include `const' in casts.
22532
095a3fb5
AD
225332000-11-03 Akim Demaille <akim@epita.fr>
22534
22535 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22536 s/PFILE1/BISON_HAIRY/.
22537 Adjust dependencies.
22538
d1cdce7c
AD
225392000-11-03 Akim Demaille <akim@epita.fr>
22540
090c5ebf 22541 For some reason, this was not applied.
d1cdce7c
AD
22542
22543 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22544 `unlink': it's no longer used.
22545
9311529b
AD
225462000-11-03 Akim Demaille <akim@epita.fr>
22547
22548 * src/files.c (skeleton_find): New function, eved out of...
22549 (open_files, open_extra_files): here.
22550
d8880f69
AD
225512000-11-03 Akim Demaille <akim@epita.fr>
22552
22553 Don't use `atexit'.
22554
22555 * src/files.c (obstack_save): New function.
22556 (done): Rename as...
22557 (output_files): this.
22558 Use `obstack_save'.
22559 * src/main.c (main): Don't use `atexit' to register `done', since
22560 it no longer has to remove tmp files, just call `output_files'
22561 when there are no errors.
22562
0dbb648e
AD
225632000-11-02 Akim Demaille <akim@epita.fr>
22564
22565 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22566 `unlink': it's no longer used.
22567 * src/files.h: Formatting changes.
22568
896fe5c1
AD
225692000-11-02 Akim Demaille <akim@epita.fr>
22570
22571 Remove the last uses of mktemp and unlink/delete.
22572
22573 * src/files.c (fdefines, ftable): Removed.
22574 (defines_ostack, table_obstack): New.
22575 Adjust dependencies of the former into uses of the latter.
22576 * src/output.c (output_short_or_char_table, output_short_table):
22577 Convert to using obstacks.
22578 * src/reader.c (copy_comment2): Accept one FILE * and two
22579 obstacks.
22580 (output_token_defines, reader_output_yylsp): Use obstacks.
22581 * src/system.h (obstack_fgrow3): New.
1f65350a 22582 * po/POTFILES.in: Adjust.
896fe5c1 22583
dd60faec
AD
225842000-11-01 Akim Demaille <akim@epita.fr>
22585
22586 Change each use of `fattrs' into a use of `attrs_obstack'.
22587
22588 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22589 * src/files.c (fattrs): Remove.
22590 (attrs_obstack): New.
22591 Adjust all dependencies.
22592 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22593
8c7ebe49
AD
225942000-11-01 Akim Demaille <akim@epita.fr>
22595
22596 Introduce obstacks.
22597 Change each use of `faction' into a use of `action_obstack'.
22598
22599 * lib/obstack.h, lib/obstack.c: New files.
22600 * src/files.c (faction): Remove.
22601 (action_obstack): New.
22602 Adjust all dependencies.
22603
77aee789
AD
226042000-10-20 Akim Demaille <akim@epita.fr>
22605
22606 * lib/quote.h (PARAMS): New macro. Use it.
22607
43591cec
AD
226082000-10-16 Akim Demaille <akim@epita.fr>
22609
22610 * src/output.c (output_short_or_char_table): New function.
22611 (output_short_table, output_token_translations): Use it.
22612 (goto_actions): Use output_short_table.
22613
1e9798d5
AD
226142000-10-16 Akim Demaille <akim@epita.fr>
22615
22616 * src/symtab.c (bucket_new): New function.
22617 (getsym): Use it.
22618
22619 * src/output.c (output_short_table): New argument to display the
22620 comment associated with the table.
22621 Adjust dependencies.
22622 (output_gram): Use it.
22623 (output_rule_data): Nicer output layout for YYTNAME.
22624
f282676b
AD
226252000-10-16 Akim Demaille <akim@epita.fr>
22626
22627 * src/lex.c (read_typename): New function.
22628 (lex): Use it.
22629 * src/reader.c (copy_dollar): Likewise.
22630
550a72a3
AD
226312000-10-16 Akim Demaille <akim@epita.fr>
22632
22633 * src/reader.c (copy_comment2): Expect the input stream to be on
22634 the `/' which is suspected to open a comment, instead of being
22635 called after `//' or `/*' was read.
22636 (copy_comment, copy_definition, parse_union_decl, copy_action)
22637 (copy_guard): Adjust.
22638
131e2fef
AD
226392000-10-16 Akim Demaille <akim@epita.fr>
22640
22641 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22642 `read_signed_integer'.
22643
79282c5a
AD
226442000-10-16 Akim Demaille <akim@epita.fr>
22645
22646 * src/reader.c (copy_dollar): New function.
22647 (copy_guard, copy_action): Use it.
22648
ff4a34be
AD
226492000-10-16 Akim Demaille <akim@epita.fr>
22650
22651 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22652 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22653 New files, from Fileutils 4.0.27.
22654 * src/main.c (printable_version): Remove.
22655 * src/lex.c, src/reader.c: Use `quote'.
22656
226572000-10-04 Akim Demaille <akim@epita.fr>
22658
22659 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22660
14ded682
AD
226612000-10-04 Akim Demaille <akim@epita.fr>
22662
22663 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22664
8e03724b
AD
226652000-10-04 Akim Demaille <akim@epita.fr>
22666
22667 When a literal string is used to define two different tokens,
22668 `bison -v' segfaults.
22669 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22670
22671 * tests/regression.m4: New file.
22672 Include the core of the sample provided by Piotr Gackiewicz.
22673 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22674 properly.
22675
a9e64249
AD
226762000-10-04 Akim Demaille <akim@epita.fr>
22677
22678 * src/reader.c (parse_expect_decl): Keep `count' within the size
22679 of `buffer'.
22680 From Neil Booth.
22681
da9abf43
AD
226822000-10-02 Paul Eggert <eggert@twinsun.com>
22683
22684 * bison.s1 (yyparse): Assign the default value
22685 unconditionally, to avoid a GCC warning and make the parser a
22686 tad smaller.
22687
c33638bb
AD
226882000-10-02 Akim Demaille <akim@epita.fr>
22689
22690 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22691 options.
22692
444c570a
AD
226932000-10-02 Akim Demaille <akim@epita.fr>
22694
22695 * src/derives.c, src/print.c, src/reduce.c: To ease the
22696 translation, move some `\n' out of the translated strings.
22697
89cab50d
AD
226982000-10-02 Akim Demaille <akim@epita.fr>
22699
22700 The location tracking mechanism is precious for parse error
22701 messages. Nevertheless, it is enabled only when `@n' is used in
22702 the grammar, which is a different issue (you can use it in error
22703 message, but not in the grammar per se). Therefore, there should
22704 be another means to enable it.
22705
22706 * src/getargs.c (getargs): Support `--locations'.
22707 (usage): Report it.
22708 * src/getargs.h (locationsflag): Export it.
22709 * src/lex.c (percent_table): Support `%locations'.
22710 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22711 with `locationsflag'.
22712 * doc/bison.texinfo: Document `--locations' and `%locations'.
22713 Sort the options.
22714 * tests/calc.m4: Test it.
22715
22716 For regularity of the names, replace each
22717 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22718 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22719 In addition replace each `flag' with `_flag'.
22720
d6c2cba0
AD
227212000-10-02 Akim Demaille <akim@epita.fr>
22722
22723 Also test parse error messages, including with YYERROR_VERBOSE.
22724
22725 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22726 associative).
22727 Use it to check the computations.
22728 Use it to check `nonassoc' is honored.
22729 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22730 `--yyerror-verbose'.
22731 (_AT_CHECK_CALC): Adjust to this option.
22732 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22733
5a35a6cb
AD
227342000-10-02 Akim Demaille <akim@epita.fr>
22735
22736 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22737 the latter demonstrates a flaw in the handling of non debugging
22738 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22739 was used in order to simplify:
22740
22741 #if YYDEBUG
22742 if (yydebug)
22743 {
22744 ...
22745 }
22746 #endif
22747
22748 into
22749
22750 if (yydebug)
22751 {
22752 ...
22753 }
22754
22755 unfortunately this leads to a CPP conflict when
22756 `--name-prefix=foo' is used since it produces `#define yydebug
22757 foodebug'.
22758
22759 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22760 (YYDPRINTF): New macro.
22761 Spread its use.
22762 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22763 the bison options.
22764 Also test `--verbose', `--defines' and `--name-prefix'.
22765
71da9eea
AD
227662000-10-02 Akim Demaille <akim@epita.fr>
22767
22768 Improve the readability of the produced parsers.
22769
22770 * src/bison.s1: Formatting changes.
22771 Improve the comment related to the `$' mark.
22772 (yydefault): Don't fall through to `yyresume': `goto' there.
22773 * src/output.c (output_parser): When the `$' is met, skip the end
22774 of its line.
22775 New variable, `number_of_dollar_signs', to check there's exactly
22776 one `$' in the parser skeleton.
22777
95e36146
AD
227782000-10-02 Akim Demaille <akim@epita.fr>
22779
22780 * lib/xstrdup.c: New file, from the fileutils.
22781 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22782 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22783 instead of strlen + xmalloc + strcpy.
22784 * src/symtab.c (copys): Remove, use xstrdup instead.
22785
d7020c20
AD
227862000-10-02 Akim Demaille <akim@epita.fr>
22787
22788 * src/gram.h (associativity): New enum type which replaces the
22789 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22790 `right_assoc', `left_assoc' and `non_assoc'.
22791 Adjust all dependencies.
22792 * src/reader.c: Formatting changes.
22793 (LTYPESTR): Don't define it, use it as a literal in
22794 `reader_output_yylsp'.
22795 * src/symtab.h (symbol_class): New enum type which replaces the
22796 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22797 `sunknown', `stoken and `snterm'.
22798
1916f98e
AD
227992000-10-02 Akim Demaille <akim@epita.fr>
22800
22801 * src/getargs.c (fixed_outfiles): Rename as...
22802 (yaccflag): for consistency and accuracy.
22803 Adjust dependencies.
22804
d7913476
AD
228052000-10-02 Akim Demaille <akim@epita.fr>
22806
22807 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22808 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22809 difficult and introduced a lot of core dump. It turns out that
22810 Bison used an implementation of `xmalloc' based on `calloc', and
22811 at various places it does depend upon the initialization to 0. I
22812 have not tried to isolate the pertinent places, and all the former
22813 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22814 someone should address this issue.
22815
22816 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22817 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22818 files.
22819 Adjust dependencies.
22820 * src/warshall.h: New file.
22821 Propagate.
22822
340ef489
AD
228232000-10-02 Akim Demaille <akim@epita.fr>
22824
22825 Various anti-`extern in *.c' changes.
22826
22827 * src/system.h: Include `assert.h'.
22828
b2ca4022
AD
228292000-10-02 Akim Demaille <akim@epita.fr>
22830
22831 * src/state.h (nstates, final_state, first_state, first_shift)
22832 (first_reduction): Move their exportation from here...
22833 * src/LR0.h: to here.
22834 Adjust dependencies.
22835 * src/getargs.c (statisticsflag): New variable.
22836 Add support for `--statistics'.
22837 Adjust dependencies.
22838
22839 Remove a lot of now useless `extern' statements in most files.
22840
403b315b
AD
228412000-10-02 Akim Demaille <akim@epita.fr>
22842
22843 * src/LR0.h: New file.
22844 Propagate its use.
22845
07a58c13
AD
228462000-10-02 Akim Demaille <akim@epita.fr>
22847
22848 * src/print.h: New file.
22849 Propagate its use.
22850 * src/print.c: Formatting and ordering changes.
22851 (verbose, terse): Replace with...
22852 (print_results): this new function.
22853 Adjust dependencies.
22854
0619caf0
AD
228552000-10-02 Akim Demaille <akim@epita.fr>
22856
22857 * src/conflicts.c (conflict_report): New function.
22858 (conflict_log, verbose_conflict_log): Replace with...
22859 (print_conflicts): this function.
22860 Adjust dependencies.
22861 * src/conflicts.h: New file.
22862 Propagate its inclusion.
22863
3519ec76
AD
228642000-10-02 Akim Demaille <akim@epita.fr>
22865
22866 * src/nullable.h: New file.
22867 Propagate its inclusion.
22868 * src/nullable.c: Formatting changes.
22869
015acc48
AD
228702000-10-02 Akim Demaille <akim@epita.fr>
22871
22872 * src/reduce.h: New file.
22873 Propagate its inclusion.
22874 * src/reduce.c: Topological sort and other formatting changes.
22875 (bool, TRUE, FALSE): Move their definition to...
22876 * src/system.h: here.
22877
8963a27b
AD
228782000-10-02 Akim Demaille <akim@epita.fr>
22879
22880 * src/files.c: Formatting changes.
22881 (tryopen, tryclose, openfiles): Rename as...
22882 (xfopen, xfclose, open_files): this.
22883 (stringappend): static.
22884 * src/files.h: Complete the list of exported symbols.
22885 Propagate its use.
22886
a70083a3
AD
228872000-10-02 Akim Demaille <akim@epita.fr>
22888
22889 * src/reader.h: New file.
22890 Propagate its use instead of tedious list of `extern' and
22891 prototypes.
22892 * src/reader.c: Formatting changes, topological sort,
22893 s/register//.
22894
abadc117
AD
228952000-10-02 Akim Demaille <akim@epita.fr>
22896
22897 * src/lex.h: Prototype `lex.c' exported functions.
22898 * src/reader.c: Adjust.
22899 * src/lex.c: Formatting changes.
22900 (safegetc): Rename as...
22901 (xgetc): this.
22902
720d742f
AD
229032000-10-02 Akim Demaille <akim@epita.fr>
22904
22905 * src/lalr.h: New file.
22906 Propagate its inclusion instead of prototypes and `extern'.
22907 * src/lalr.c: Formatting changes, topological sorting etc.
22908
f2acea59
AD
229092000-10-02 Akim Demaille <akim@epita.fr>
22910
22911 * src/output.c (token_actions): Introduce a temporary array,
22912 YYDEFACT, that makes it possible for this function to use
22913 output_short_table.
22914
d019d655
AD
229152000-10-02 Akim Demaille <akim@epita.fr>
22916
22917 `user_toknums' is output as a `short[]' in `output.c', while it is
22918 defined as a `int[]' in `reader.c'. For consistency with the
22919 other output tables, `user_toknums' is now defined as a table of
22920 shorts.
22921
22922 * src/reader.c (user_toknums): Be a short table instead of an int
22923 table.
22924 Adjust dependencies.
22925
22926 Factor the short table outputs.
22927
22928 * src/output.c (output_short_table): New function.
22929 * src/output.c (output_gram, output_stos, output_rule_data)
22930 (output_base, output_table, output_check): Use it.
22931
6c89f1c1
AD
229322000-10-02 Akim Demaille <akim@epita.fr>
22933
22934 * src/output.c (output): Topological sort of the functions, in
22935 order to get rid of the `static' prototypes.
22936 No longer use `register'.
22937 * src/output.h: New file.
22938 Propagate its inclusion in files explicitly prototyping functions
22939 from output.c.
22940
d9efd181
AD
229412000-09-21 Akim Demaille <akim@epita.fr>
22942
22943 * src/atgeneral.m4: Update from Autoconf.
22944
c29240e7 229452000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
22946
22947 * src/closure.h: New file.
22948 * src/closure.c: Formatting changes, topological sort over the
22949 functions, use of closure.h.
22950 (initialize_closure, finalize_closure): Rename as...
22951 (new_closure, free_closure): these. Adjust dependencies.
22952 * src/LR0.c: Formatting changes, topological sort, use of
22953 cloture.h.
22954 (initialize_states): Rename as...
22955 (new_states): this.
22956 * src/Makefile.am (noinst_HEADERS): Adjust.
22957
499daa50
AD
229582000-09-20 Akim Demaille <akim@epita.fr>
22959
22960 * src/acconfig.h: Don't protect config.h against multiple
22961 inclusion.
22962 Don't define PARAMS.
22963 * src/system.h: Define PARAMS.
22964 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
22965 purpose of config.h. system.h must not try to fix wrong
22966 definitions in config.h.
22967
cc84fd5d
AD
229682000-09-20 Akim Demaille <akim@epita.fr>
22969
22970 * src/derives.h: New file.
22971 * src/main.c, src/derives.h: Use it.
22972 Formatting changes.
22973 * src/Makefile.am (noinst_HEADERS): Adjust.
22974
db5b3a89
AD
229752000-09-20 Akim Demaille <akim@epita.fr>
22976
22977 * tests/atgeneral.m4: Update from Autoconf.
22978 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
22979 (AT_CHECK_CALC): New macros.
22980 Use these macros to test bison with options `', `--raw',
22981 `--debug', `--yacc', `--yacc --debug'.
22982
ceed8467
AD
229832000-09-19 Akim Demaille <akim@epita.fr>
22984
22985 * src/output.c: Formatting changes.
22986 * src/machine.h: Remove, leaving its contents in...
22987 * src/system.h: here.
22988 Include stdio.h.
22989 Adjust all dependencies on stdio.h and machine.h.
22990 * src/getargs.h: New file.
22991 Let all `extern' declarations about getargs.c be replaced with
22992 inclusion of `getargs.h'.
22993 * src/Makefile.am (noinst_HEADERS): Adjust.
22994
22995 * tests/calc.m4 (yyin): Be initialized in main, not on the global
22996 scope.
22997 (yyerror): Returns void, not int.
22998 * doc/bison.texinfo: Formatting changes.
22999
05a1d24b
AD
230002000-09-19 Akim Demaille <akim@epita.fr>
23001
23002 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
23003 portable.
23004
cbd25751
AD
230052000-09-18 Akim Demaille <akim@epita.fr>
23006
23007 * configure.in: Append WARNING_CFLAGS to CFLAGS.
23008 * src/Makefile.am (INCLUDES): Don't.
23009 Be ready to fetch headers in lib/.
23010
13863333
AD
230112000-09-18 Akim Demaille <akim@epita.fr>
23012
23013 * doc/bison.texinfo: Update the copyright.
23014 ANSIfy and GNUify the examples.
23015 Remove the old menu.
23016
0d533154
AD
230172000-09-18 Akim Demaille <akim@epita.fr>
23018
23019 First set of tests: use the `calc' example from the documentation.
23020
23021 * src/bison.s1 (yyparse): Condition the code using `yytname' which
23022 is defined only when YYDEBUG is.
23023 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
23024 * src/files.c (tryopen, tryclose): Formatting changes.
23025 Move to the top and be static.
23026 * src/reader.c (read_signed_integer): Likewise.
23027 * tests/calc.m4: New file.
23028 * Makefile.am, suite.m4: Adjust.
23029 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
23030
e79137ac
AD
230312000-09-18 Akim Demaille <akim@epita.fr>
23032
23033 Add support for an Autotest test suite for Bison.
23034
23035 * m4/m4.m4, m4/atconfig.m4: New files.
23036 * m4/Makefile.am (EXTRA_DIST): Adjust.
23037 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
23038 files.
23039 * src/getargs.c: Display a more standard --version message.
23040 * src/reader.c (reader): Formatting changes.
23041 No longer depend upon VERSION_STRING.
23042 * configure.in: No longer use `dnl'.
23043 Set up the test suite and the new directory `tests/.
23044 (VERSION_STRING): Remove.
23045
27821bff
AD
230462000-04-14 Akim Demaille <akim@epita.fr>
23047
23048 * src/reader.c (copy_comment2): New function, same as former
23049 `copy_comment', but outputs into two FILE *.
23050 (copy_comment): Use it.
23051 (parse_union_decl): Use it.
23052 (get_type, parse_start_decl): Use the same `invalid' message.
23053 (parse_start_decl, parse_union_decl): Use the same `multiple'
23054 message.
23055 (parse_union_decl, copy_guard, copy_action): Use the same
23056 `unmatched' message.
23057 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
23058
cfe5fbc0
AD
230592000-03-31 Akim Demaille <akim@epita.fr>
23060
23061 * src/files.c (tryopen, tryclose): Move to the top.
23062 Be static.
23063
cb7db13e
AD
230642000-03-31 Akim Demaille <akim@epita.fr>
23065
23066 * src/main.c (main): Don't call `done', exit does it.
23067
a0f6b076
AD
230682000-03-31 Akim Demaille <akim@epita.fr>
23069
36281465
AD
23070 * allocate.c: s/return (foo)/return foo/.
23071 * lalr.c: Likewise.
23072 * LR0.c: Likewise.
23073 * output.c: Likewise.
23074 * reader.c: Likewise.
23075 * symtab.c: Likewise.
23076 * vmsgetargs.c: Likewise.
23077
230782000-03-31 Akim Demaille <akim@epita.fr>
23079
23080 Clean up the error reporting functions.
a0f6b076
AD
23081
23082 * src/report.c: New file.
23083 * src/report.h: Likewise.
23084 * src/Makefile.am: Adjust.
23085 * m4/error.m4: New file.
23086 * m4/Makefile.am: Adjust.
23087 * configure.in (jm_PREREQ_ERROR): Call it.
23088 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
23089 Remove.
23090 (fatal, fatals): Remove. All callers use complain.c::fatal.
23091 (warn, warni, warns, warnss, warnss): Remove. All callers use
23092 complain.c::complain.
23093 (toomany): Remove, use fatal instead.
23094 * src/files.c (done): No argument, use complain_message_count.
23095 * src/main.c (main): Register `done' to `atexit'.
23096
23097 * src/getargs.c (usage): More `fputs', less `fprintf'.
23098
18539825
AD
230992000-03-28 Akim Demaille <akim@epita.fr>
23100
23101 * lib/: New directory.
23102 * Makefile.am (SUBDIRS): Adjust.
23103 * configure.in: Adjust.
23104 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
23105 useless.
23106 * src/alloca.c: Moved to lib/.
23107 * src/getopt.c: Likewise.
23108 * src/getopt1.c: Likewise.
23109 * src/getopt.h: Likewise.
23110 * src/ansi2knr.c: Likewise.
23111 * src/ansi2knr.1: Likewise.
23112 * src/Makefile.am: Adjust.
23113 * lib/Makefile.am: New file.
23114
9f306f2a
AD
231152000-03-28 Akim Demaille <akim@epita.fr>
23116
23117 * src/getargs.c (usage): Refresh the help message.
23118
0ba347b6
AD
231192000-03-17 Akim Demaille <akim@epita.fr>
23120
23121 * src/getopt1.c: Updated from textutils 2.0e
23122 * src/getopt.c: Likewise.
23123 * src/getopt.h: Likewise.
23124
dbe7f271
AD
231252000-03-17 Akim Demaille <akim@epita.fr>
23126
23127 * src/Makefile.am (bison.simple): Fix the awk program: quote only
23128 the file name, not the whole `#line LINE FILE'.
23129
75bbe78d
AD
231302000-03-17 Akim Demaille <akim@epita.fr>
23131
23132 On syntax errors, report the token on which we choked.
23133
aa5fd0ee
AD
23134 * src/bison.s1 (yyparse): In the label yyerrlab, when
23135 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 23136
7b306f52
AD
231372000-03-17 Akim Demaille <akim@epita.fr>
23138
aa5fd0ee 23139 * src/reader.c (copy_at): New function.
7b306f52
AD
23140 (copy_guard): Use it.
23141 (copy_action): Use it.
23142
e87b5700
AD
231432000-03-17 Akim Demaille <akim@epita.fr>
23144
23145 Be kind to translators, save some useless translations.
23146
aa5fd0ee 23147 * src/main.c (banner): New function.
e87b5700
AD
23148 (fatal_banner): Use it.
23149 (warn_banner): Use it.
23150
ae3c3164
AD
231512000-03-17 Akim Demaille <akim@epita.fr>
23152
aa5fd0ee
AD
23153 * src/reader.c (copy_definition): Use copy_string and
23154 copy_comment. Removed now unused `match', `ended',
23155 `cplus_comment'.
ae3c3164
AD
23156 (copy_comment, copy_string): Moved, to be visible from
23157 copy_definition.
23158
4dc58e7c
AD
231592000-03-17 Akim Demaille <akim@epita.fr>
23160
aa5fd0ee
AD
23161 * src/reader.c (copy_string): Declare `static inline'. No
23162 problems with inline, since it is checked by configure.
4dc58e7c
AD
23163 (copy_comment): Likewise.
23164
0a6384c4
AD
231652000-03-17 Akim Demaille <akim@epita.fr>
23166
aa5fd0ee 23167 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 23168
3cef001a
AD
231692000-03-17 Akim Demaille <akim@epita.fr>
23170
aa5fd0ee 23171 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
23172 (copy_action): Use it. Removed now unused `match', `ended',
23173 `cplus_comment'.
23174 (copy_guard): Likewise.
23175
ca36d2ef
AD
231762000-03-17 Akim Demaille <akim@epita.fr>
23177
aa5fd0ee 23178 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
23179 (copy_action): Use it.
23180 (copy_guard): Likewise.
23181
6666f98f
AD
231822000-03-17 Akim Demaille <akim@epita.fr>
23183
23184 Change the handling of @s so that they behave exactly like $s.
23185 There is now a pseudo variable @$ (readble and writable), location
23186 of the lhs of the rule (by default ranging from the location of
23187 the first symbol of the rhs, to the location of the last symbol,
23188 or, if the rhs is empty, YYLLOC).
23189
23190 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
23191 yyval.
23192 (yyparse): When providing a default semantic action, provide a
23193 default location action.
23194 (after the $): No longer change `*YYLSP', just stack YYLOC the
23195 same way you stack YYVAL.
23196 * src/reader.c (read_declarations): Use warns.
23197 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
23198 (copy_action, case '@'): Likewise.
23199 Use a standard error message, to save useless work from
23200 translators.
23201
41aca2e0
AD
232022000-03-17 Akim Demaille <akim@epita.fr>
23203
aa5fd0ee
AD
23204 * src/bison.s1: Formatting and cosmetics changes.
23205 * src/reader.c: Likewise.
41aca2e0
AD
23206 Update the Copyright notice.
23207
dc08c1d5
AD
232082000-03-17 Akim Demaille <akim@epita.fr>
23209
aa5fd0ee
AD
23210 * src/bison.s1 (#line): All set to `#line' only, since the
23211 Makefile now handles them.
dc08c1d5 23212
9ee3c97b
AD
232132000-03-16 Akim Demaille <akim@epita.fr>
23214
23215 * src/output.c (output_rule_data): Output the documentation of
23216 some of the tables.
23217 (Copyright notice): Update.
23218 Formatting changes.
23219
0de741ca
AD
232202000-03-16 Akim Demaille <akim@epita.fr>
23221
23222 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
23223 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
23224 One `#if YYDEBUG' remains, since it uses variables which are
23225 defined only if `YYDEBUG != 0'.
23226
bb10be54
AD
232272000-03-16 Akim Demaille <akim@epita.fr>
23228
23229 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
23230 and related variables so that the similarities are highlighted.
23231
b07b484a
AD
232322000-03-16 Akim Demaille <akim@epita.fr>
23233
23234 * src/bison.s1: Properly indent CPP directives.
23235
361f60b3
AD
232362000-03-16 Akim Demaille <akim@epita.fr>
23237
23238 * src/bison.s1: Properly indent the `alloca' CPP section.
23239
8c44d3ec
AD
232402000-03-16 Akim Demaille <akim@epita.fr>
23241
23242 Do not hard code values of directories in `configure.in'.
23243 Update the `configure' tool chain.
23244
23245 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23246 src/makefile.am.
23247 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23248 (AC_OUTPUT): Add m4/Makefile.
23249 Bump to bison 1.28a, 1.29 has never been released.
23250 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23251 handled via src/Makefile.am.
23252 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23253 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23254 autoheader.
23255 * Makefile.am (SUBDIRS): Add m4.
23256 (ACLOCAL_AM_FLAGS): New variable.
23257 (AUTOMAKE_OPTIONS): Add check-news.
23258 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23259 the proper line number and file name.
23260 (DEFS): Propagate the location of bison library files and of the
23261 locale files.
23262 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23263 builddir.
23264 * acinclude.m4: Remove, replaced by the directory m4.
23265 * m4/Makefile.am (EXTRA_DIST): New variable.
23266 * m4/gettext.m4: New file, from the fileutils.
23267 * m4/lcmessage.m4: Likewise
23268 * m4/progtest.m4: Likewise.
23269 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23270
f95997e7
AD
232712000-03-10 Akim Demaille <akim@epita.fr>
23272
23273 * src/closure.c:
23274 Formatting changes of various comments.
23275 Respect the GNU coding standards at various places.
23276 Don't use `_()' when no translation is needed.
23277
232781999-12-13 Jesse Thilo <jthilo@gnu.org>
23279
23280 * src/files.c:
23281 OS/2 honors TMPDIR environment variable.
23282
232831999-12-13 Jesse Thilo <jthilo@gnu.org>
23284
23285 * doc/bison.texinfo: Tweaked spelling and grammar.
23286 Updated ISBN.
23287 Removed reference to price of printed copy.
23288 Mention BISON_SIMPLE and BISON_HAIRY.
23289
232901999-12-13 Jesse Thilo <jthilo@gnu.org>
23291
23292 * configure.in, NEWS:
23293 Bison 1.29 released.
23294
232951999-10-27 Jesse Thilo <jthilo@gnu.org>
23296
23297 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23298 Added reference card.
23299
233001999-07-26 Jesse Thilo <jthilo@gnu.org>
23301
23302 * po/ru.po: Added Russian translation.
23303
233041999-07-26 Jesse Thilo <jthilo@gnu.org>
23305
23306 * configure.in: Added Russian translation.
23307
233081999-07-06 Jesse Thilo <jthilo@gnu.org>
23309
23310 * configure.in, NEWS, README:
23311 Released version 1.28.
23312
233131999-06-14 Jesse Thilo <jthilo@gnu.org>
23314
23315 * src/system.h:
23316 Squashed redefinition warning on some systems.
23317
23318 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
23319 Have configure build version string instead of relying on ANSI string
23320 concatentation.
23321
233221999-06-14 Jesse Thilo <jthilo@gnu.org>
23323
23324 * po/POTFILES.in: Got rid of version.c.
23325
233261999-06-14 Jesse Thilo <jthilo@gnu.org>
23327
23328 * acconfig.h, configure.in:
23329 Have configure build version string instead of relying on ANSI string
23330 concatentation.
23331
233321999-06-08 Jesse Thilo <jthilo@gnu.org>
23333
23334 * doc/bison.1:
23335 Dropped mention of `+' for long-named options.
23336
233371999-05-30 Jesse Thilo <jthilo@gnu.org>
23338
23339 * src/files.c: Added <unistd.h> for unlink().
23340
23341 * src/Makefile.am, src/system.h:
23342 I18n fixes.
23343
233441999-05-30 Jesse Thilo <jthilo@gnu.org>
23345
23346 * README: Added a FAQ list.
23347
23348 * configure.in, acconfig.h:
23349 I18n fixes.
23350
233511999-05-30 Jesse Thilo <jthilo@gnu.org>
23352
23353 * doc/FAQ, doc/Makefile.am:
23354 Added a FAQ list.
23355
233561999-05-19 Jesse Thilo <jthilo@gnu.org>
23357
23358 * src/alloc.h, src/symtab.h, src/version.c:
23359 Protected inclusion of "config.h" with HAVE_CONFIG_H.
23360
233611999-04-18 Jesse Thilo <jthilo@gnu.org>
23362
23363 * src/.cvsignore, src/Makefile.am:
23364 Reorganized: sources in `src', documentation in `doc'.
23365
23366 * src/lex.c (literalchar):
23367 fixed the code for escaping double quotes (thanks
23368 Jonathan Czisny.)
23369
233701999-04-18 Jesse Thilo <jthilo@gnu.org>
23371
23372 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
23373 Adjusted paths to reflect directory reorganization.
23374
233751999-04-18 Jesse Thilo <jthilo@gnu.org>
23376
23377 * doc/.cvsignore, doc/Makefile.am:
23378 Reorganized: sources in `src', documentation in `doc'.
23379
233801999-04-18 Jesse Thilo <jthilo@gnu.org>
23381
23382 * configure.in:
23383 Updated AC_INIT file to reflect directory reorganization.
23384
23385 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
23386 Reorganized: sources in `src', documentation in `doc'.
23387
233881999-04-13 Jesse Thilo <jthilo@gnu.org>
23389
23390 * src/allocate.c:
23391 Don't declare calloc() and realloc() if not necessary.
23392
233931999-04-13 Jesse Thilo <jthilo@gnu.org>
23394
23395 * configure.in, acconfig.h, acinclude.m4:
23396 Don't declare calloc() and realloc() if not necessary.
23397
233981999-03-23 Jesse Thilo <jthilo@gnu.org>
23399
23400 * po/.cvsignore: Added i18n support.
23401
234021999-03-23 Jesse Thilo <jthilo@gnu.org>
23403
23404 * acconfig.h, configure.in, Makefile.am:
23405 Added i18n support.
23406
234071999-03-22 Jesse Thilo <jthilo@gnu.org>
23408
23409 * src/bison.s1: Fixed #line numbers.
23410
234111999-03-15 Jesse Thilo <jthilo@gnu.org>
23412
23413 * po/es.po, po/fr.po, po/nl.po, po/de.po:
23414 Added PO files from Translation Project.
23415
234161999-03-03 Jesse Thilo <jthilo@gnu.org>
23417
23418 * Makefile.am:
23419 Added support for non-ANSI compilers (ansi2knr).
23420
234211999-02-16 Jesse Thilo <jthilo@gnu.org>
23422
23423 * configure.in: Bumped version number to 1.27.
23424
23425 * Makefile.am:
23426 Added `bison.simple' to list of files removed by `make distclean'.
23427
234281999-02-12 Jesse Thilo <jthilo@gnu.org>
23429
23430 * src/files.c, src/files.h:
23431 Defined locations of parser files in config.h instead of Makefile.
23432
234331999-02-12 Jesse Thilo <jthilo@gnu.org>
23434
23435 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
23436 Defined locations of parser files in config.h instead of Makefile.
23437
234381999-02-09 Jesse Thilo <jthilo@gnu.org>
23439
23440 * Makefile.am:
23441 Removed inappropriate use of $< macro.
23442
234431999-02-05 Jesse Thilo <jthilo@gnu.org>
23444
23445 * po/Makefile.in.in, po/POTFILES.in:
23446 Add `po' directory skeleton.
23447
234481999-01-27 Jesse Thilo <jthilo@gnu.org>
23449
23450 * README: Document help-bison list.
23451
23452 * configure.in: Add check for mkstemp().
23453
234541999-01-20 Jesse Thilo <jthilo@gnu.org>
23455
23456 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
23457 Hush a few compiler warnings.
23458
23459 * src/files.c:
23460 Add tryclose(), which verifies that fclose was successful.
23461 Hush a couple of compiler warnings.
23462
234631999-01-20 Jesse Thilo <jthilo@gnu.org>
23464
23465 * Makefile.am, OChangeLog:
23466 ChangeLog is now automatically generated. Include the old version as
23467 OChangeLog.
23468
234691999-01-14 Jesse Thilo <jthilo@gnu.org>
23470
23471 * 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:
23472 Update FSF address.
23473
234741999-01-14 Jesse Thilo <jthilo@gnu.org>
23475
23476 * doc/bison.texinfo: Fix formatting glitch.
23477
23478 * doc/bison.texinfo: Update FSF address.
23479
234801999-01-14 Jesse Thilo <jthilo@gnu.org>
23481
23482 * acconfig.h: Update FSF address.
23483
234841999-01-08 Jesse Thilo <jthilo@gnu.org>
23485
23486 * src/system.h:
23487 Don't define PACKAGE here, since config.h defines it.
23488
234891998-12-30 Jesse Thilo <jthilo@gnu.org>
23490
23491 * src/reader.c: Update copyright date.
23492
23493 * src/main.c:
23494 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23495 favor of output directly to stderr (avoids buffer overruns).
23496
23497 * src/reader.c: Some checks for premature EOF.
23498
23499 * 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:
23500 Use prototypes if the compiler understands them.
23501
23502 * src/files.c: Honor TMPDIR on Unix hosts.
23503 Use prototypes if the compiler understands them.
23504
23505 * src/reader.c:
23506 Fix a couple of buffer overrun bugs.
23507 Use prototypes if the compiler understands them.
23508
23509 * src/system.h: Include unistd.h and ctype.h.
23510 Use #ifdef instead of #if for NLS symbols.
23511
235121998-12-30 Jesse Thilo <jthilo@gnu.org>
23513
23514 * doc/bison.texinfo:
23515 Delete comment "consider using @set for edition number, etc..." since
23516 we now are doing so.
23517
235181998-12-30 Jesse Thilo <jthilo@gnu.org>
23519
23520 * configure.in:
23521 Use prototypes if the compiler understands them.
23522
23523 * NEWS: Document 1.26 highlights.
23524
23525 * Makefile.am: Require Automake 1.3 or later.
23526
23527 * acconfig.h:
23528 Use prototypes if the compiler understands them.
23529
235301998-12-29 Jesse Thilo <jthilo@gnu.org>
23531
23532 * src/version.c:
23533 Use VERSION symbol from automake for version number.
23534
235351998-12-29 Jesse Thilo <jthilo@gnu.org>
23536
23537 * acconfig.h, configure.in, version.cin:
23538 Use VERSION symbol from automake for version number.
23539
235401998-11-28 Jesse Thilo <jthilo@gnu.org>
23541
23542 * Makefile.am:
23543 Distribute original version of simple parser (bison.s1), not built
23544 version (bison.simple).
23545
235461998-11-28 Jesse Thilo <jthilo@gnu.org>
23547
23548 * doc/bison.texinfo: Add info dir entry.
23549
23550 * doc/bison.texinfo:
23551 Let automake put version number into documentation.
23552
235531998-11-26 Jesse Thilo <jthilo@gnu.org>
23554
23555 * src/bison.cld, src/build.com, src/vmshlp.mar:
23556 Add non-RCS files from /gd/gnu/bison.
23557
235581998-11-26 Jesse Thilo <jthilo@gnu.org>
23559
23560 * doc/bison.1:
23561 Document the BISON_HAIRY and BISON_SIMPLE variables.
23562
235631998-11-25 Jesse Thilo <jthilo@gnu.org>
23564
23565 * src/version.c: Build version.c automatically.
23566
23567 * src/reader.c:
23568 Fix token numbering (used to start at 258, not 257).
23569
23570 * src/system.h: Include config.h.
23571
23572 * src/getargs.c: Update bug report address.
23573
23574 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23575 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23576
235771998-11-25 Jesse Thilo <jthilo@gnu.org>
23578
23579 * Makefile.am:
23580 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23581
23582 * configure.in, version.cin:
23583 Build version.c automatically.
23584
23585 * AUTHORS: Add AUTHORS file.
23586
23587 * README: Update bug report address.
23588
23589 * bison.simple:
23590 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23591
23592 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23593 Add automake stuff.
23594
235951998-11-25 Jesse Thilo <jthilo@gnu.org>
23596
23597 * doc/bison.texinfo: Clean up some formatting.
23598
235991998-05-05 Richard Stallman <rms@gnu.org>
23600
23601 * doc/bison.texinfo:
23602 Explain better why to make a pure parser.
23603
236041998-01-05 Richard Stallman <rms@gnu.org>
23605
23606 * src/files.c (openfiles):
23607 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23608 find a temporary directory, if possible. Do not unlink files while
23609 they are open.
23610
236111997-08-25 Richard Stallman <rms@gnu.org>
23612
23613 * src/reader.c (stack_offset;):
23614 Change some warni to warns.
23615
23616 * src/lex.c (literalchar): Use warns, not warni.
23617
236181997-06-28 Richard Stallman <rms@gnu.org>
23619
23620 * src/bison.s1: Add a Bison version comment.
23621
23622 * src/main.c (fatal, warn, berror):
23623 Use program_name.
23624
236251997-06-28 Richard Stallman <rms@gnu.org>
23626
23627 * Makefile.in (bison_version): New variable.
23628 (dist): Use that variable.
23629 (bison.s1): Substitute the Bison version into bison.simple.
23630
23631 * bison.simple: Add a Bison version comment.
23632
236331997-06-18 Richard Stallman <rms@gnu.org>
23634
23635 * src/main.c (fatal, warn, berror):
23636 Make error messages standard.
23637 (toomany): Improve error message text.
23638
23639 * 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:
23640 new.h renamed to alloc.h.
23641
236421997-06-18 Richard Stallman <rms@gnu.org>
23643
23644 * Makefile.in: new.h renamed to alloc.h.
23645
236461997-05-24 Richard Stallman <rms@gnu.org>
23647
23648 * src/lex.c (literalchar):
23649 Fix the code for escaping \, " and '.
23650
23651 (lex): Avoid trouble when there are many chars
23652 to discard in a char literal with just several chars in it.
23653
236541997-05-17 Richard Stallman <rms@gnu.org>
23655
23656 * src/bison.s1:
23657 Use malloc, if using alloca is troublesome.
23658 (YYSTACK_USE_ALLOCA): New flag macro.
23659 Define it for some systems and compilers.
23660 (YYSTACK_ALLOC): New macro.
23661 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23662 If it was malloc'd, free it.
23663
236641997-05-17 Richard Stallman <rms@gnu.org>
23665
23666 * bison.simple:
23667 Use malloc, if using alloca is troublesome.
23668 (YYSTACK_USE_ALLOCA): New flag macro.
23669 Define it for some systems and compilers.
23670 (YYSTACK_ALLOC): New macro.
23671 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23672 If it was malloc'd, free it.
23673
236741997-04-23 Richard Stallman <rms@gnu.org>
23675
23676 * src/bison.s1:
23677 (alloca) [__hpux]: Always define as __builtin_alloca.
23678
236791997-04-23 Richard Stallman <rms@gnu.org>
23680
23681 * bison.simple:
23682 (alloca) [__hpux]: Always define as __builtin_alloca.
23683
236841997-04-22 Richard Stallman <rms@gnu.org>
23685
23686 * src/bison.s1:
23687 [__hpux]: Include alloca.h (right for HPUX 10)
23688 instead of declaring alloca (right for HPUX 9).
23689
23690 * src/bison.s1 (__yy_memcpy):
23691 Declare arg `count' as unsigned int.
23692 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23693
236941997-04-22 Richard Stallman <rms@gnu.org>
23695
23696 * bison.simple:
23697 [__hpux]: Include alloca.h (right for HPUX 10)
23698 instead of declaring alloca (right for HPUX 9).
23699
23700 * bison.simple (__yy_memcpy):
23701 Declare arg `count' as unsigned int.
23702 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23703
237041997-01-03 Richard Stallman <rms@gnu.org>
23705
23706 * src/allocate.c: [__STDC__ or _MSC_VER]:
23707 Declare calloc and realloc to return void *.
23708
237091997-01-02 Richard Stallman <rms@gnu.org>
23710
23711 * src/system.h:
23712 [_MSC_VER]: Include stdlib.h and process.h.
23713 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23714
23715 * src/main.c (main): Return FAILURE as a value.
23716 (printable_version): Declare arg as int, not char.
23717
237181997-01-02 Richard Stallman <rms@gnu.org>
23719
23720 * Makefile.in (dist):
23721 Explicitly check for symlinks, and copy them.
23722
237231996-12-19 Richard Stallman <rms@gnu.org>
23724
23725 * src/files.c:
23726 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23727
237281996-12-18 Paul Eggert <eggert@gnu.org>
23729
23730 * src/bison.s1 (yyparse):
23731 If __GNUC__ and YYPARSE_PARAM are both defined,
23732 declare yyparse to have a void * argument.
23733
237341996-12-18 Paul Eggert <eggert@gnu.org>
23735
23736 * bison.simple (yyparse):
23737 If __GNUC__ and YYPARSE_PARAM are both defined,
23738 declare yyparse to have a void * argument.
23739
237401996-12-17 Richard Stallman <rms@gnu.org>
23741
23742 * src/reduce.c (nbits): Add some casts.
23743
237441996-08-12 Richard Stallman <rms@gnu.org>
23745
23746 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23747
237481996-08-12 Richard Stallman <rms@gnu.org>
23749
23750 * bison.simple: Test _MSDOS as well as _MSDOS_.
23751
237521996-07-31 Richard Stallman <rms@gnu.org>
23753
23754 * src/bison.s1:
23755 [__sun && __i386]: Include alloca.h.
23756
237571996-07-31 Richard Stallman <rms@gnu.org>
23758
23759 * bison.simple:
23760 [__sun && __i386]: Include alloca.h.
23761
237621996-07-30 Richard Stallman <rms@gnu.org>
23763
23764 * src/bison.s1: Comment change.
23765
23766 * src/bison.s1: Test _MSDOS_, not MSDOS.
23767
237681996-07-30 Richard Stallman <rms@gnu.org>
23769
23770 * bison.simple: Comment change.
23771
23772 * bison.simple: Test _MSDOS_, not MSDOS.
23773
237741996-06-01 Richard Stallman <rms@gnu.org>
23775
23776 * 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:
23777 Insert `_' macro around many string constants.
23778
23779 * src/main.c:
23780 Insert `_' macro around many string constants.
23781
23782 (main): Call setlocale, bindtextdomain and textdomain.
23783
23784 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23785 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23786 [ENABLE_NLS]: Include libintl.h.
23787 [ENABLE_NLS] (gettext): Define.
23788 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23789 (N_, PACKAGE, LOCALEDIR): New macros.
23790
237911996-06-01 Richard Stallman <rms@gnu.org>
23792
23793 * POTFILES.in: New file.
23794
23795 * Makefile.in (allocate.o):
23796 Define target explicitly.
23797
23798 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23799 (LDFLAGS): Set to @LDFLAGS@.
23800 (configure): Run autoconf only if preceding `cd' succeeds.
23801 (bison.s1): Redirect output to temporary file then move the
23802 temporary to the target, rather than redirecting directly to bison.s1.
23803 (clean): Remove config.status and config.log.
23804 (distclean): Don't remove config.status here.
23805
238061996-05-12 Richard Stallman <rms@gnu.org>
23807
23808 * src/bison.s1:
23809 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23810
238111996-05-12 Richard Stallman <rms@gnu.org>
23812
23813 * bison.simple:
23814 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23815
238161996-05-11 Richard Stallman <rms@gnu.org>
23817
23818 * src/bison.s1 (__yy_memcpy):
23819 Really reorder the args, as was supposedly done on Feb 14 1995.
23820 (yyparse): Calls changed accordingly.
23821
238221996-05-11 Richard Stallman <rms@gnu.org>
23823
23824 * Makefile.in (dist): Don't use $(srcdir).
23825
23826 * bison.simple (__yy_memcpy):
23827 Really reorder the args, as was supposedly done on Feb 14 1995.
23828 (yyparse): Calls changed accordingly.
23829
238301996-01-27 Richard Stallman <rms@gnu.org>
23831
23832 * src/output.c (output_rule_data):
23833 Test YYERROR_VERBOSE in the conditional
23834 around the definition of ttyname.
23835
238361995-12-29 Richard Stallman <rms@gnu.org>
23837
23838 * src/bison.s1:
23839 Fix line numbers in #line commands.
23840
238411995-12-29 Richard Stallman <rms@gnu.org>
23842
23843 * bison.simple:
23844 Fix line numbers in #line commands.
23845
238461995-12-27 Richard Stallman <rms@gnu.org>
23847
23848 * src/bison.s1 (YYPARSE_PARAM_DECL):
23849 In C++, make it always null.
23850 (YYPARSE_PARAM_ARG): New macro.
23851 (yyparse): Use YYPARSE_PARAM_ARG.
23852
238531995-12-27 Richard Stallman <rms@gnu.org>
23854
23855 * bison.simple (YYPARSE_PARAM_DECL):
23856 In C++, make it always null.
23857 (YYPARSE_PARAM_ARG): New macro.
23858 (yyparse): Use YYPARSE_PARAM_ARG.
23859
238601995-11-29 Richard Stallman <rms@gnu.org>
23861
23862 * doc/bison.texinfo:
23863 Describe literal string tokens, %raw, %no_lines, %token_table.
23864
238651995-11-29 Daniel Hagerty <hag@gnu.org>
23866
23867 * doc/bison.texinfo: Fixed update date
23868
238691995-10-16 Richard Stallman <rms@gnu.org>
23870
23871 * src/version.c: Version 1.25.
23872
238731995-10-16 Richard Stallman <rms@gnu.org>
23874
23875 * NEWS: *** empty log message ***
23876
238771995-10-16 Richard Stallman <rms@gnu.org>
23878
23879 * doc/bison.1, doc/bison.rnh:
23880 Add new options.
23881
238821995-10-15 Richard Stallman <rms@gnu.org>
23883
23884 * src/vmsgetargs.c, src/getargs.c:
23885 Added -n, -k, and -raw switches.
23886 (noparserflag, toknumflag, rawtoknumflag): New variables.
23887
23888 * src/symtab.h (SALIAS):
23889 New #define for adding aliases to %token.
23890 (struct bucket): Added `alias' field.
23891
23892 * src/reduce.c (reduce_grammar):
23893 Revise error message.
23894 (print_notices): Remove final `.' from error message.
23895
23896 * src/reader.c (reader_output_yylsp):
23897 New function.
23898 (readgram): Use `#if 0' around code that accepted %command
23899 inside grammar rules: The documentation doesn't allow it,
23900 and it will fail since the %command processors scan for the next %.
23901 (parse_token_decl): Extended the %token
23902 declaration to allow a multi-character symbol as an alias.
23903 (parse_thong_decl): New function.
23904 (read_declarations): Added %thong declarations.
23905 (read_declarations): Handle NOOP to deal with allowing
23906 % declarations as another means to specify the flags.
23907 (readgram): Allow %prec prior to semantics embedded in a rule.
23908 (skip_to_char, read_declarations, copy_definition)
23909 (parse_token_decl, parse_start_decl, parse_type_decl)
23910 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23911 (get_type_name, copy_guard, copy_action, readgram)
23912 (get_type, packsymbols): Revised most error messages.
23913 Changed `fatal' to `warnxxx' to avoid aborting for error.
23914 Revised and use multiple warnxxx functions to avoid using VARARGS1.
23915 (read_declarations): Improve the error message for
23916 an invalid character. Do not abort.
23917 (read_declarations, copy_guard, copy_action): Use
23918 printable_version to avoid unprintable characters in printed output.
23919 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
23920 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
23921 Allow the type of a non-terminal can be given
23922 more than once, as long as all specifications give the same type.
23923
23924 * src/output.c:
23925 (output_headers, output_trailers, output, output_gram)
23926 (output_rule_data): Implement noparserflag variable.
23927 Implement toknumflag variable.
23928 (output): Call reader_output_yylsp to output LTYPESTR.
23929
23930 * src/main.c (main):
23931 If reader sees an error, don't process the grammar.
23932 (fatals): Updated to not use VARARGS1.
23933 (printable_version, int_to_string, warn, warni, warns, warnss)
23934 (warnsss): New error reporting functions. Avoid abort for error.
23935
23936 * src/lex.h:
23937 Added THONG and NOOP for alias processing.
23938 Added SETOPT for the new code that allows setting options with %flags.
23939
23940 * src/lex.c:
23941 Include getopt.h. Add some extern decls.
23942 (safegetc): New function to deal with EOF gracefully.
23943 (literalchar); new function to deal with reading \ escapes.
23944 (lex): Use literalchar.
23945 (lex): Implemented "..." tokens.
23946 (literalchar, lex, parse_percent_token): Made tokenbuffer
23947 always contain the token. This includes growing the token
23948 buffer while reading an integer.
23949 (parse_percent_token): Replaced if-else statement with percent_table.
23950 (parse_percent_token): Added % declarations as another
23951 way to specify the flags -n, -l, and -r. Also added hooks for
23952 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
23953 major changes to files.c.
23954 (lex) Retain in the incoming stream a character following
23955 an incorrect '/'.
23956 (skip_white_space, lex): Revised most error messages
23957 and changed fatal to warn to avoid aborting.
23958 (percent_table): Added %thong declarations.
23959
23960 * src/gram.h: Comment changes.
23961
23962 * src/files.c (openfiles, open_extra_files, done):
23963 Add faction flag
23964 and actfile file. Handle noparserflag. Both for -n switch.
23965
23966 * src/conflicts.c (resolve_sr_conflict):
23967 Remove use of alloca.
23968
239691995-06-01 Jim Meyering <meyering@gnu.org>
23970
23971 * doc/bison.texinfo: *** empty log message ***
23972
239731995-05-06 Richard Stallman <rms@gnu.org>
23974
23975 * src/bison.s1: Comment change.
23976
239771995-05-06 Richard Stallman <rms@gnu.org>
23978
23979 * bison.simple: Comment change.
23980
239811995-05-03 Richard Stallman <rms@gnu.org>
23982
23983 * src/version.c: Version now 1.24.
23984
23985 * src/bison.s1: Change distribution terms.
23986
23987 * src/version.c: Version now 1.23.
23988
239891995-05-03 Richard Stallman <rms@gnu.org>
23990
23991 * doc/bison.texinfo:
23992 Rewrite "Conditions for Using Bison".
23993 Update version to 1.24.
23994
239951995-05-03 Richard Stallman <rms@gnu.org>
23996
23997 * bison.simple: Change distribution terms.
23998
239991995-02-23 Richard Stallman <rms@gnu.org>
24000
24001 * src/files.c: Test __VMS_POSIX as well as VMS.
24002
240031995-02-14 Jim Meyering <meyering@gnu.org>
24004
24005 * src/bison.s1 (__yy_memcpy):
24006 Renamed from __yy_bcopy to avoid
24007 confusion. Reverse FROM and TO arguments to be consistent with
24008 those of memcpy.
24009
240101995-02-14 Jim Meyering <meyering@gnu.org>
24011
24012 * bison.simple (__yy_memcpy):
24013 Renamed from __yy_bcopy to avoid
24014 confusion. Reverse FROM and TO arguments to be consistent with
24015 those of memcpy.
24016
240171994-11-10 David J. MacKenzie <djm@gnu.org>
24018
24019 * NEWS: reformat
24020
24021 * NEWS: New file.
24022
24023 * Makefile.in (DISTFILES): Include NEWS.
24024
24025 * Makefile.in (DISTFILES):
24026 Include install-sh, not install.sh.
24027
24028 * configure.in: Update to Autoconf v2 macro names.
24029
240301994-10-05 David J. MacKenzie <djm@gnu.org>
24031
24032 * Makefile.in: fix typo
24033
24034 * Makefile.in (prefix, exec_prefix):
24035 Let configure set them.
24036
240371994-09-28 David J. MacKenzie <djm@gnu.org>
24038
24039 * Makefile.in: Set datadir to $(prefix)/share.
24040
240411994-09-15 Richard Stallman <rms@gnu.org>
24042
24043 * src/bison.s1:
24044 Update copyright notice and GPL version.
24045
240461994-09-15 Richard Stallman <rms@gnu.org>
24047
24048 * bison.simple:
24049 Update copyright notice and GPL version.
24050
240511994-07-12 Richard Stallman <rms@gnu.org>
24052
24053 * src/reduce.c, src/reader.c:
24054 entered into RCS
24055
240561994-05-05 David J. MacKenzie <djm@gnu.org>
24057
24058 * Makefile.in: entered into RCS
24059
240601994-03-26 Richard Stallman <rms@gnu.org>
24061
24062 * src/bison.s1: entered into RCS
24063
240641994-03-26 Richard Stallman <rms@gnu.org>
24065
24066 * bison.simple: entered into RCS
24067
240681994-03-25 Richard Stallman <rms@gnu.org>
24069
24070 * src/main.c: entered into RCS
24071
240721994-03-24 Richard Stallman <rms@gnu.org>
24073
24074 * src/conflicts.c: entered into RCS
24075
240761994-01-02 Richard Stallman <rms@gnu.org>
24077
24078 * Makefile.in: *** empty log message ***
24079
240801993-11-21 Richard Stallman <rms@gnu.org>
24081
24082 * src/bison.s1: *** empty log message ***
24083
240841993-11-21 Richard Stallman <rms@gnu.org>
24085
24086 * doc/bison.texinfo: entered into RCS
24087
24088 * doc/bison.texinfo: *** empty log message ***
24089
240901993-11-21 Richard Stallman <rms@gnu.org>
24091
24092 * bison.simple: *** empty log message ***
24093
240941993-10-25 David J. MacKenzie <djm@gnu.org>
24095
24096 * doc/bison.texinfo: *** empty log message ***
24097
240981993-10-19 Richard Stallman <rms@gnu.org>
24099
24100 * src/bison.s1: *** empty log message ***
24101
241021993-10-19 Richard Stallman <rms@gnu.org>
24103
24104 * bison.simple: *** empty log message ***
24105
241061993-10-14 Richard Stallman <rms@gnu.org>
24107
24108 * src/bison.s1: *** empty log message ***
24109
241101993-10-14 Richard Stallman <rms@gnu.org>
24111
24112 * bison.simple: *** empty log message ***
24113
241141993-09-14 David J. MacKenzie <djm@gnu.org>
24115
24116 * doc/bison.texinfo: *** empty log message ***
24117
241181993-09-13 Noah Friedman <friedman@gnu.org>
24119
24120 * Makefile.in: *** empty log message ***
24121
241221993-09-10 Richard Stallman <rms@gnu.org>
24123
24124 * src/conflicts.c: *** empty log message ***
24125
24126 * src/system.h: entered into RCS
24127
241281993-09-10 Richard Stallman <rms@gnu.org>
24129
24130 * doc/bison.1: entered into RCS
24131
241321993-09-06 Noah Friedman <friedman@gnu.org>
24133
24134 * src/version.c: entered into RCS
24135
241361993-09-06 Noah Friedman <friedman@gnu.org>
24137
24138 * Makefile.in: *** empty log message ***
24139
241401993-07-30 David J. MacKenzie <djm@gnu.org>
24141
24142 * Makefile.in: *** empty log message ***
24143
241441993-07-24 Richard Stallman <rms@gnu.org>
24145
24146 * src/bison.s1: *** empty log message ***
24147
241481993-07-24 Richard Stallman <rms@gnu.org>
24149
24150 * bison.simple: *** empty log message ***
24151
241521993-07-08 David J. MacKenzie <djm@gnu.org>
24153
24154 * Makefile.in: *** empty log message ***
24155
241561993-07-04 Richard Stallman <rms@gnu.org>
24157
24158 * src/bison.s1: *** empty log message ***
24159
241601993-07-04 Richard Stallman <rms@gnu.org>
24161
24162 * bison.simple: *** empty log message ***
24163
241641993-06-26 David J. MacKenzie <djm@gnu.org>
24165
24166 * src/getargs.c: entered into RCS
24167
241681993-06-26 David J. MacKenzie <djm@gnu.org>
24169
24170 * doc/bison.texinfo: *** empty log message ***
24171
24172 * doc/bison.1: New file.
24173
241741993-06-25 Richard Stallman <rms@gnu.org>
24175
24176 * src/getargs.c: New file.
24177
241781993-06-16 Richard Stallman <rms@gnu.org>
24179
24180 * src/bison.s1: *** empty log message ***
24181
241821993-06-16 Richard Stallman <rms@gnu.org>
24183
24184 * bison.simple: *** empty log message ***
24185
241861993-06-03 Richard Stallman <rms@gnu.org>
24187
24188 * src/bison.s1: New file.
24189
241901993-06-03 Richard Stallman <rms@gnu.org>
24191
24192 * doc/bison.texinfo: *** empty log message ***
24193
241941993-06-03 Richard Stallman <rms@gnu.org>
24195
24196 * bison.simple: New file.
24197
241981993-05-19 Richard Stallman <rms@gnu.org>
24199
24200 * doc/bison.texinfo: New file.
24201
242021993-05-07 Noah Friedman <friedman@gnu.org>
24203
24204 * Makefile.in: *** empty log message ***
24205
242061993-04-28 Noah Friedman <friedman@gnu.org>
24207
24208 * src/reader.c: *** empty log message ***
24209
242101993-04-23 Noah Friedman <friedman@gnu.org>
24211
24212 * src/alloc.h: entered into RCS
24213
242141993-04-20 David J. MacKenzie <djm@gnu.org>
24215
24216 * src/version.c: *** empty log message ***
24217
24218 * src/files.c, src/allocate.c:
24219 entered into RCS
24220
24221 * src/reader.c: *** empty log message ***
24222
24223 * src/lex.c: entered into RCS
24224
24225 * src/conflicts.c: New file.
24226
24227 * src/symtab.c: entered into RCS
24228
24229 * src/alloc.h: New file.
24230
24231 * src/LR0.c: entered into RCS
24232
242331993-04-18 Noah Friedman <friedman@gnu.org>
24234
24235 * src/reader.c: New file.
24236
24237 * src/version.c: *** empty log message ***
24238
242391993-04-18 Noah Friedman <friedman@gnu.org>
24240
24241 * Makefile.in: *** empty log message ***
24242
242431993-04-17 Noah Friedman <friedman@gnu.org>
24244
24245 * Makefile.in: *** empty log message ***
24246
242471993-04-15 Richard Stallman <rms@gnu.org>
24248
24249 * src/main.c, src/files.c:
24250 New file.
24251
242521993-04-15 Noah Friedman <friedman@gnu.org>
24253
24254 * configure.in: entered into RCS
24255
24256 * configure.in: *** empty log message ***
24257
24258 * configure.in: New file.
24259
242601993-04-14 Richard Stallman <rms@gnu.org>
24261
24262 * Makefile.in: New file.
24263
242641993-04-13 Richard Stallman <rms@gnu.org>
24265
24266 * src/version.c: New file.
24267
242681993-03-25 Richard Stallman <rms@gnu.org>
24269
24270 * src/output.c: entered into RCS
24271
242721992-09-25 Richard Stallman <rms@gnu.org>
24273
24274 * configure.bat: entered into RCS
24275
242761992-06-22 Richard Stallman <rms@gnu.org>
24277
24278 * src/vmsgetargs.c: entered into RCS
24279
242801992-06-22 Richard Stallman <rms@gnu.org>
24281
24282 * doc/bison.rnh: entered into RCS
24283
242841992-04-20 David J. MacKenzie <djm@gnu.org>
24285
24286 * README: entered into RCS
24287
242881992-01-22 Richard Stallman <rms@gnu.org>
24289
24290 * src/machine.h: entered into RCS
24291
242921991-12-21 Richard Stallman <rms@gnu.org>
24293
24294 * src/lalr.c, src/closure.c:
24295 entered into RCS
24296
242971991-12-20 Richard Stallman <rms@gnu.org>
24298
24299 * src/state.h: entered into RCS
24300
243011991-12-18 Richard Stallman <rms@gnu.org>
24302
24303 * src/print.c, src/nullable.c, src/derives.c:
24304 entered into RCS
24305
243061991-11-03 David J. MacKenzie <djm@gnu.org>
24307
24308 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24309 entered into RCS
24310
243111988-09-09 Richard Stallman <rms@gnu.org>
24312
24313 * src/bison.hairy: entered into RCS
24314
243151987-12-16 Richard Stallman <rms@gnu.org>
24316
24317 * REFERENCES: entered into RCS
dc546b0f 24318
f294a2c2 24319
04098407 24320 -----
f294a2c2 24321
04098407 24322 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e021191b
JD
24323 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
24324 2008, 2009 Free Software Foundation, Inc.
f294a2c2 24325
04098407
PE
24326 Copying and distribution of this file, with or without
24327 modification, are permitted provided the copyright notice and this
24328 notice are preserved.