]> git.saurik.com Git - bison.git/blame - ChangeLog
Import latest m4/m4.m4.
[bison.git] / ChangeLog
CommitLineData
d8911864
EB
12009-08-20 Eric Blake <ebb9@byu.net>
2
3 Import latest m4/m4.m4.
4 * submodules/autoconf: Update to autoconf 2.64.
5 * configure.ac (M4_GNU_OPTION): New define.
6 * src/output.c (output_skeleton): Use it to resolve FIXME.
7 * NEWS: Mention this.
8
c2724603
JD
92009-08-19 Joel E. Denny <jdenny@clemson.edu>
10
11 Fix complaints about escape sequences.
12 Discussed starting at
13 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
14 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
15 For a \0 and similar escape sequences meaning the null
16 character, report an invalid escape sequence instead of an
17 invalid null character because the latter does not actually
18 appear in the user's input.
19 In all escape sequence complaints, don't escape the initial
20 backslash, and don't quote when the sequence appears at the end
21 of the complaint line unless there's whitespace that quotearg
22 won't escape.
23 Consistently say "invalid" not "unrecognized".
24 Consistently prefer "empty character literal" over "extra
25 characters in character literal" warning for invalid escape
26 sequences; that is, consistently discard those sequences.
27 * tests/input.at (Bad escapes in literals): New.
28
17aed602
AD
292009-08-19 Akim Demaille <demaille@gostai.com>
30
31 doc: fixes.
32 * doc/bison.texinfo: Fix minor Texinfo errors.
33
9142239a
AD
342009-08-19 Akim Demaille <demaille@gostai.com>
35
36 tests: distcc compliance.
37 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
38 error messages from the output.
39
171ad99d
AD
402009-08-19 Akim Demaille <demaille@gostai.com>
41
42 variables: simplify the upgrade of namespace into api.namespace.
43
44 This patch simplifies "variables: rename namespace as
45 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
46 Suggested by Joel E. Denny in
47 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
48
49 * src/muscle-tab.c (muscle_percent_variable_update): New.
50 (muscle_percent_define_insert): Use it in replacement of the
51 previous tr invocation.
52 Remove variable_tr, no longer needed.
53 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
54 Remove.
55 * data/c++.m4: No longer handle namespace -> api.namespace.
56 * tests/input.at (%define backward compatibility): Check that
57 namespace is treated as api.namespace.
58
d59e456d
AD
592009-08-19 Akim Demaille <demaille@gostai.com>
60
61 doc: %initial-action to initialize yylloc.
62 Reported by Bill Allombert.
63 * doc/bison.texinfo: Set fill-column to 76.
64 (Location Type): Document the use of %initial-action to initialize
65 yylloc.
66
ceb8b8e6
AD
672009-08-19 Akim Demaille <demaille@gostai.com>
68
69 lalr1.cc: use state_type.
70 * data/lalr1.cc (yysyntax_error_): Use state_type.
71 Move argument names into yy*.
72
7580c379
AD
732009-08-19 Akim Demaille <demaille@gostai.com>
74
75 lalr1.cc: get rid of yyparse's yystate.
76 yystate and yystack_[0].state are equal, keep only the latter.
77 The former was also used as a temporary variable to compute the
78 post-reduction state. Move this computation into an auxiliary
79 function.
80
81 * data/glr.c (yyLRgotoState): Fuse variable definition and first
82 assignment.
83 * data/lalr1.cc (yy_lr_goto_state_): New.
84 (yyparse): Use it.
85 Replace remaining uses of yystate by yystate_[0].state.
86 Remove the former.
87
c4dc4c46
AD
882009-08-19 Akim Demaille <demaille@gostai.com>
89
90 lalr1.cc: destroy $$ when YYERROR is called.
91 * data/lalr1.cc (yyreduce): Compute the resulting state before
92 running the user action so that yylhs is a valid symbol.
93 (yyerrorlab): Since yylhs is complete (it knows its type), we can
94 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
95 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
96
c67e466f
JD
972009-08-18 Joel E. Denny <jdenny@clemson.edu>
98
99 maint: update for gnulib's recent update-copyright changes
100 * gnulib: Update.
101 * .x-update-copyright (COPYING): Add as it's no longer implied
102 when .x-update-copyright is present.
103 * cfg.mk (update-copyright-local): Remove, now ignored.
104 (update-copyright): Declare update-b4-copyright as a dependency.
105
af6d2358
AD
1062009-08-17 Akim Demaille <demaille@gostai.com>
107
108 build: require gettext 0.17.
109
110 Suggested by Bruno Haible.
111 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
112 * configure.ac: require gettext 0.17 to ensure compatibility with
113 gnulib.
114
91a2b9b1
AD
1152009-08-17 Akim Demaille <demaille@gostai.com>
116
117 build: lower gettext requirements.
118
119 Bison was uselessly requiring the formatstring macros from
120 gettext, which resulted in mo files not being installed on systems
121 that perfectly supported Bison mo files. Lower the requirement.
122 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
123
124 * configure.ac: Require need-ngettext instead of
125 need-formatstring-macros.
126 Reported by Martin Jabocs.
127 Suggested by Bruno Haible.
128 * INSTALL: Restructure.
129 (Internationalization): New.
130
585935e8
JD
1312009-08-14 Joel E. Denny <jdenny@clemson.edu>
132
133 maint: fix use of copyright year intervals.
134 * gnulib: Update.
135 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
136 as now recommended in gnulib/NEWS.
137 * build-aux/update-b4-copyright: Fix.
138 * cfg.mk (update-copyright-env): Configure update-copyright.
139
83b60c97
JD
1402009-08-13 Joel E. Denny <jdenny@clemson.edu>
141
142 Make it easier to write deterministic tests.
143 Continues Akim's work from his 2009-06-10 commits.
144 * src/reader.c (check_and_convert_grammar): Don't add any
145 symbols after the first symbols_do invocation.
146 * src/symtab.c (symbols_sorted): New static global.
147 (user_token_number_redeclaration): Update comments.
148 (symbol_from_uniqstr): If a new symbol is being created, assert
149 that symbols_sorted hasn't been allocated yet.
150 (symbols_free): Free symbols_sorted.
151 (symbols_cmp, symbols_cmp_qsort): New functions.
152 (symbols_do): Sort symbol_table into symbols_sorted on first
153 invocation.
154 * tests/input.at (Numbered tokens): Recombine tests now that the
155 output should be deterministic across multiple numbers.
156
28169bab
AD
1572009-08-12 Akim Demaille <demaille@gostai.com>
158
159 tests: GCC 4.5 compliance.
160 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
161 messages about #error.
162
9f14e187
AD
1632009-08-12 Akim Demaille <demaille@gostai.com>
164
165 build: fix the generation of the documentation.
166 Some of our targets use "bison --help", but they can't depend on
167 "bison" itself (to avoid additional requirements on the user), so
168 they used to call "make src/bison" in the commands. Then
169 concurrent builds may fail: one make might be aiming one of its
170 jobs at compiling src/bison, and another job at generating the man
171 page. If the latter is faster than the former, then we have two
172 makes that concurrently try to compile src/bison.
173
174 This might also be a more convincing explanation for the failure
175 described in the patch "build: fix paths".
176
177 * Makefile.am (SUFFIXES): Initialize.
178 * build-aux/move-if-change: New, symlink to gnulib's.
179 * build-aux/local.mk: Ship it.
180 * doc/common.x: Remove, merged into...
181 * doc/bison.x: here.
182 * doc/local.mk (doc/bison.help): New.
183 ($(CROSS_OPTIONS_TEXI)): Depend on it.
184 Use src/bison.
185 (.x.1): Replace with...
186 (doc/bison.1): this explicit, simpler, target.
187 (common_dep): Remove, inlined where appropriate.
188 (SUFFIXES, PREPATH): Remove, unused.
189
d1b55e81
AD
1902009-08-12 Akim Demaille <demaille@gostai.com>
191
192 gnulib: improve prefixing.
193 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
194 change the value of...
195 (gl_LIBOBJS): this.
196 Adjust more variables.
197 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
198 gl_LIBOBJS.
199 (prefix): Also transform rules whose targets have slashes.
200 Use $prefix liberally.
201 Map @MKDIR_P@ to $(MKDIR_P).
202 Prefix directories that are mkdir'd.
203
838205d5
AD
2042009-08-12 Akim Demaille <demaille@gostai.com>
205
206 build: fix paths.
207 When using $(top_builddir) inconsistently, Make (including GNU
208 Make) is sometimes confused. As a result it may want to build
209 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
210 file, different names) concurrently, which, amusingly enough,
211 might end with:
212
213 ranlib lib/libbison.a
214 ranlib lib/libbison.a
215 make[2]: *** [lib/libbison.a] Segmentation fault
216
217 on OS X.
218
219 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
220 needed.
221
67af7198
AD
2222009-08-12 Akim Demaille <demaille@gostai.com>
223
224 distcheck: fix.
225
226 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
227
c467dc42
JD
2282009-08-10 Joel E. Denny <jdenny@clemson.edu>
229
230 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
231
dfaa4860
JD
2322009-08-10 Joel E. Denny <jdenny@clemson.edu>
233
234 Miscellaneous code readability improvements.
235
236 * src/reader.c (reader): Move %define front-end variable
237 defaults and checking into...
238 (prepare_percent_define_front_end_variables): ... this new
239 function.
240
241 * src/scan-gram.l (INITIAL): For consistency with string
242 literals, don't store open quote on character literal. It's
243 discarded before returning anyway.
244 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
245 Make length test more readable, and make the character stored
246 for an empty literal more obvious while consistent with the
247 previous behavior.
248
249 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
250 USER_NUMBER_HAS_STRING_ALIAS throughout.
251 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
252 that is repeated in symtab.h. Improve argument names to make it
253 clear which side of the symbol-string alias pair is which.
254 (symbol_check_alias_consistency): Improve local variable names
255 for the same purpose.
256 * src/symtab.h (struct symbol): Make comments about aliases
257 clearer.
258 (symbol_make_alias): Improve comments and argument name.
259 * src/output.c (token_definitions_output): Update for rename to
260 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
261
ce268795
AR
2622009-08-08 Alex Rozenman <rozenman@gmail.com>
263
264 Convert "misleading reference" messages to warnings.
265 * src/scan-code.l: New function 'show_sub_messages', more
266 factoring.
267 * tests/named-ref.at: Adjust tests.
268
401b73af
JD
2692009-08-06 Joel E. Denny <jdenny@clemson.edu>
270
271 maint: run "make update-copyright"
272
a1a9422d
JD
2732009-08-06 Joel E. Denny <jdenny@clemson.edu>
274
275 maint: make update-b4-copyright easier to use
276 * build-aux/update-b4-copyright: In warnings, report line
277 numbers rather than character positions.
278 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
279 that update-copyright runs it.
280 * gnulib: Update.
281
0b61a8ec
JD
2822009-08-05 Joel E. Denny <jdenny@clemson.edu>
283
284 maint: clean up update-b4-copyright code
285 * build-aux/update-b4-copyright: Do not accept 2-digit
286 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
287 Don't accept a `[' in a b4_copyright argument.
288 Format code more consistently.
289 Don't assume b4*copyright never occurs.
290
269e222e
JD
2912009-08-04 Joel E. Denny <jdenny@clemson.edu>
292
293 maint: automate b4_copyright updates.
294 * Makefile.am (update-b4-copyright): New target rule.
295 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
296 * build-aux/update-b4-copyright: New.
297 * data/yacc.c: Remove stray characters around b4_copyright
298 invocations.
299
35905f2b
JD
3002009-08-04 Joel E. Denny <jdenny@clemson.edu>
301
302 maint: automate annual package-wide copyright-year update.
303 * .x-update-copyright: New.
304 * Makefile.am (EXTRA_DIST): Remove maint.mk.
305 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
306 update-copyright. Remove gnumakefile, which is implied by
307 maintainer-makefile.
308 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
309 * gnulib: Update.
310 * maint.mk: Remove, now copied from gnulib.
311 * examples/extexi: Add missing "(C)" in copyright statement so
312 update-copyright can recognize it.
313 * src/LR0.h: Likewise.
314 * src/print.h: Likewise.
315 * src/print_graph.h: Likewise.
316 * src/gram.c: Add missing comma in copyright statement.
317 * src/gram.h: Likewise.
318
b30e18dc
JD
3192009-08-04 Joel E. Denny <jdenny@clemson.edu>
320
321 Fix "make distcheck".
322 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
323 of just calc.stamp.
324
8d90395d
JD
3252009-08-01 Joel E. Denny <jdenny@clemson.edu>
326
327 Pacify "gcc -Wunused" for the input function from Flex.
328 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
329 and later.
330 * src/scan-code.l: Add "%option noinput", which I cannot find in
331 the Flex manual, but which Flex has supported since at least as
332 far back as 2.5.4. However, if any of our developers still use
333 Flex 2.5.4, they'll need to stop configuring with
334 --enable-gcc-warnings because "%option noinput" didn't work
335 correctly until Flex 2.5.6.
336 * src/scan-gram.l: Likewise.
337 * src/scan-skel.l: Likewise.
338
ba4184ec
AR
3392009-07-31 Alex Rozenman <rozenman@gmail.com>
340
341 Fix --enable-gcc-warnings problems.
342 * src/reader.c: Adjust variable names.
343 * src/scan-code.l: Fix prototypes and adjust names.
344 * src/named-ref.c: Remove redundant "if".
345
91a2af97
JD
3462009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
347
348 Fix a --enable-gcc-warnings problem.
349 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
350 variable.
351
3208e3f4
JD
3522009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
353
354 Warn about character literals not of length one.
355 * NEWS (2.5): Document.
356 * src/scan-gram.l (INITIAL): Remove comment that we don't check
357 the length.
358 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
359 * tests/input.at (Bad character literals): New test group.
360
5add20ab 3612009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
362
363 Fix some memory leaks.
364 * src/named-ref.c: Add a pointer check (named_ref_free).
365 * src/scan-code.l: New function (variant_table_free). Called in
366 code_scanner_free.
367 * src/symlist.c: Call to named_ref_free (symbol_list_free).
368
e459fb0e
JD
3692009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
370
371 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
372
c4be5517
JD
3732009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
374
375 Some M4 cleanup in the testsuite.
376 Suggested by Eric Blake at
377 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
378 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
379 complicate the code by distinguishing between a missing value
380 and an empty string value for an optional argument. This fix is
381 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
382 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
383 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
384 arguments are not needed because of the following changes.
385 Fix stale comments.
386 Bison developers should use GNU M4 and should not use
387 POSIXLY_CORRECT when building the test suite, so do not
388 complicate the code by avoiding $10 and above.
389 Do not quote an empty string value for an optional argument, and
390 do not distinguish between a missing value and an empty string
391 value.
392
feeb56cd
JD
3932009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
394
395 Revert unnecessary column realignment in --help output.
396 Reported by Akim Demaille at
397 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
398 * src/getargs.c (usage): Here.
399
5add20ab 4002009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
401
402 Alphabetical order in src/local.mk.
403 * src/local.mk: Adjust.
404
5add20ab 4052009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
406
407 Style changes and factoring.
408 * src/named-ref.h: Add comments.
409 * src/parse-gram.y: Readability and style changes.
410 * src/reader.c: Factoring: assign_named_ref function.
411 * src/scan-code.l: Factoring and style changes. Rename
412 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
413 Use "unsigned" type for variant index. Improve readablity.
414 * src/scan-gram.l: Change error messages and add comments.
415 * src/symlist.h: symbol_list_null: New function decl.
416 * src/symlist.c: symbol_list_null: Implement here.
417 * tests/named-refs.at: Adjust for new error messages.
418
83ea2423
EB
4192009-06-29 Eric Blake <ebb9@byu.net>
420
421 scan-code: avoid compiler warnings
422 * src/scan-code.l (parse_named_ref): Use correct specifiers.
423
5ece73ea
AD
4242009-06-29 Akim Demaille <demaille@gostai.com>
425
426 build: avoid concurrent extraction of calc++.
427 * examples/calc++/Makefile.am (calc.stamp): New.
428 Depend on it to create the sources of calc++ so that concurrent
429 builds don't launch several "extexi" in parallel.
430 Not only this is inefficient, this also builds incorrect sources
431 with several extractions mixed together.
432
ad597a78
AD
4332009-06-29 Akim Demaille <demaille@gostai.com>
434
435 parse.error: fix.
436 * data/bison.m4: Move code related to specific variables after the
437 definition of the variable-maintaining macros so that we don't
438 "invoke" b4_percent_define_check_values before it is defined.
439
31b850d2
AD
4402009-06-29 Akim Demaille <demaille@gostai.com>
441
442 variables: parse.error
443
444 Implement, document, and test the replacement of %error-verbose
445 by %define parse.error "verbose".
446 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
447 values of the parse.error variable.
448 Make "simple" its default value.
449 Check the valid values.
450 * src/parse-gram.y: Use %define parse.error.
451 (PERCENT_ERROR_VERBOSE): New token.
452 Support it.
453 * src/scan-gram.l: Support %error-verbose.
454
455 * doc/bison.texinfo (Decl Summary): Replace the documentation of
456 %define error-verbose by that of %define parse.error.
457 * NEWS: Document it.
458
459 * tests/actions.at, tests/calc.at: Use parse.error instead of
460 %error-verbose.
461
b9f1d9a4
AR
4622009-06-27 Alex Rozenman <rozenman@gmail.com>
463
464 Implement support for named symbol references.
465 * src/parse-gram.y: Add new syntax (named_ref.opt).
466 * src/reader.c: Store named refs in symbol lists.
467 * src/reader.h: New argument for symbol_append and
468 action_append functions.
469 * src/scan-code.h: Add new field (named_ref) into
470 code_props data structure. Keeps named ref of midrule
471 actions.
472 * src/scan-code.l: Support for named refs in semantic
473 action code. New function 'parse_named_ref'.
474 * src/scan-gram.l: Support bracketed id.
475 * src/symlist.c: Store named refs in symbol lists.
476 * src/symlist.h: New field in symbol list: named_ref.
477 * src/named-ref.h: New file, a struct for named_ref.
478 * src/named-ref.cp: New file, named_ref_new function.
479 * src/local.mk: Add two new files.
480 * tests/testsuite.at: Include new test group:
481 * tests/named-refs.at: this new file.
482
b5c212b6
AD
4832009-06-25 Akim Demaille <demaille@gostai.com>
484
485 hash: check insertion for memory exhaustion.
486 * src/uniqstr.c (uniqstr_new): New.
487
67501061
AD
4882009-06-24 Akim Demaille <demaille@gostai.com>
489
490 variables: rename namespace as api.namespace.
491 Discussed in
492 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
493
494 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
495 New.
496 (b4_percent_define_use): New.
497 Use it where applicable.
498 * data/c++.m4: Replace uses of the variable "namespace" by
499 "api.namespace".
500 Default the latter to the former.
501 * doc/bison.texinfo (Decl Summary): Document "namespace" as
502 obsolete.
503 Document api.namespace.
504 Use @samp to document %define uses, keep @code for identifiers.
505 * NEWS: Likewise.
506 * tests/c++.at, tests/input.at: Test api.namespace instead of
507 namespace. (The tests passed with namespace.)
508
41976786
AD
5092009-06-11 Akim Demaille <demaille@gostai.com>
510
511 style changes.
512 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
513 * src/print-xml.c: Style changes.
514 * tests/conflicts.at: Comment changes.
515
44bb9084
AD
5162009-06-11 Akim Demaille <demaille@gostai.com>
517
518 xml: beware of user strings used to give a %prec to rules.
519 * tests/conflicts.at (%prec with user strings): New.
520 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
521 XML output.
522
04d1e39d
AD
5232009-06-11 Akim Demaille <demaille@gostai.com>
524
525 hash: check insertion for memory exhaustion.
526 * src/muscle-tab.c (muscle_insert, muscle_grow)
527 * src/state.c (state_hash_insert): Check the return value of
528 hash_insert.
529
a8873669
AD
5302009-06-11 Akim Demaille <demaille@gostai.com>
531
532 tests: honor TESTSUITEFLAGS in every check target.
533 * tests/local.mk (RUN_TESTSUITE): New.
534 (check-local, installcheck-local, maintainer-check-g++)
535 (maintainer-check-posix, maintainer-check-valgrind): Use it.
536
8893145a
AD
5372009-06-10 Akim Demaille <demaille@gostai.com>
538
539 deterministic test suite.
540 Some consistency checks on symbols are performed after all the
541 symbols were read, by an iteration over the symbol table. This
542 traversal is nondeterministic, which can be a problem for test
543 cases.
544 Avoid this.
545 Addresses another form of nondeterminism reported by Joel E. Denny.
546 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
547
548 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
549 test in two.
550 Use different file names for the three tests to make the
551 maintenance easier.
552
92d7a23a
AD
5532009-06-10 Akim Demaille <demaille@gostai.com>
554
555 gnulib: update.
556 * gnulib: Update to latest.
557 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
558 * m4/.gitignore: Regen.
559 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
560 Call xalloc_die on hash_insert failures.
561 Requested by the new __warn_unused_result__ attribute of
562 hash_insert.
563
12cf133f
AD
5642009-06-10 Akim Demaille <demaille@gostai.com>
565
566 deterministic user-token-number redeclaration errors.
567 Address nondeterminism reported by Joel E. Denny.
568 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
569
570 * src/uniqstr.h: Comment changes.
571 * src/location.h (boundary_cmp, location_cmp): New.
572 * src/symtab.c (user_token_number_redeclaration): New.
573 (symbol_translation): Use it.
574 * tests/input.at (Numbered tokens): Adjust the expected output.
575
796a2b0a
AD
5762009-05-25 Akim Demaille <demaille@gostai.com>
577
578 build: avoid ignored errors.
579 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
580 errors, they pollute the output.
581
0b6d43c5
JD
5822009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
583
584 Convert multiple variable definition warnings to complaints.
585 * NEWS (2.5): Add a new entry for that change.
586 * doc/bison.texinfo (Decl Summary): Update %define entry.
587 (Bison Options): Update -D/--define/-F/--force-define entry.
588 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
589 * src/muscle-tab.h (muscle_percent_define_insert): Update
590 comments.
591 * tests/input.at (`%define errors'): Update.
592 (`%define, --define, --force-define'): Update.
593
de5ab940
JD
5942009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
595
596 -F/--force-define and relative %define/-D/--define priorities.
597 * NEWS (2.5): Add documentation to -D/--define entry.
598 * build-aux/cross-options.pl: Hard-code association of
599 --force-define with %define.
600 * doc/bison.texinfo (Decl Summary): In %define entry,
601 cross-reference command-line options.
602 (Bison Options): Add documentation to -D/--define entry.
603 (Option Cross Key): Widen column for --force-define row.
604 * src/getargs.c (usage): Document -F/--force-define. Realign
605 options in output.
606 (short_options, long_options, getargs): Parse -F/--force-define,
607 and update muscle_percent_define_insert invocations.
608 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
609 (muscle_percent_define_insert): Add argument with that type.
610 * src/muscle-tab.c (muscle_percent_define_insert): Implement
611 -F/--force-define behavior and priorities.
612 (muscle_percent_define_ensure): Update
613 muscle_percent_define_insert invocation.
614 * src/parse-gram.y (prologue_declaration): Update
615 muscle_percent_define_insert invocations.
616 * tests/input.at (`%define, --define'): Rename to...
617 (`%define, --define, --force-define'): ... this and extend.
618
f8e7258f
JD
6192009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
620
621 Update some comments to make sense for -D.
622 * data/bison.m4 (b4_check_user_names): In header comments, say
623 "user occurrence" instead of "grammar occurrence".
624 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
625 (muscle_percent_code_grow): Likewise just for consistency.
626
b987342b
JD
6272009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
628
629 * data/c++.m4 (b4_namespace_close): Simplify slightly.
630
4977e0a7
JD
6312009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
632
633 Handle a trailing `:' in a user-supplied C++ namespace better.
634 * data/c++.m4 (b4_namespace_close): Don't let it be printed
635 among the closing braces here. This fix might make the
636 generated code easier to debug, but otherwise it should be
637 insignificant because a trailing `:' is a C++ error already.
638
9b04dad7
AD
6392009-05-19 Akim Demaille <demaille@gostai.com>
640
641 remove useless variable.
642 * src/getargs.c (skeleton_arg): Remove now useless variable.
643 Should help the compiler see that this printf-like call is sane.
644
4c6622c2
AD
6452009-05-15 Akim Demaille <demaille@gostai.com>
646
647 Rename token.prefix as api.tokens.prefix.
648 Discussed here.
649 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
650
651 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
652 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
653 (token.prefix): Rename as...
654 (api.tokens.prefix): this.
655
3c248d70
AD
6562009-05-11 Akim Demaille <demaille@gostai.com>
657
658 doc: use C++ headers.
659 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
660 headers.
661
99c08fb6
AD
6622009-05-11 Akim Demaille <demaille@gostai.com>
663
664 doc: token.prefix
665 * doc/bison.simple (Decl Summary): Document token.prefix.
666 (Calc++ Parser): Various fixes.
667 Formatting changes.
668 Use token.prefix.
669 Introduce a macro TOKEN to shorten the code and make it more
670 readable.
671 (Calc++ Scanner): Adjust.
672 * NEWS (Variable token.prefix): New.
673
84a1cb5a
AD
6742009-05-04 Akim Demaille <demaille@gostai.com>
675
676 bison: catch bad symbol names.
677 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
678 * tests/input.at: Adjust.
679
cdf3f113
AD
6802009-05-04 Akim Demaille <demaille@gostai.com>
681
682 identifiers: dashes are letters.
683 Dashes can now start identifiers (symbols and directives).
84a1cb5a 684
cdf3f113
AD
685 * src/scan-gram.l ({letter}): Add dash.
686 ({id}): Remove it.
687 * tests/input.at (Symbols): Adjust.
688 Remove stray comment.
689 * tests/regression.at (Invalid inputs): Adjust error message.
690 * doc/bison.texinfo (Symbols): Update.
691
98a345a2
JD
6922009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
693
694 Declare %code to be a permanent feature.
695 * NEWS (2.4.2): Here.
696 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
697 experimental.
698 (Decl Summary): Likewise.
699
67212941
JD
7002009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
701
702 Convert underscores to dashes in some %define variable names.
703 For now, just api.push-pull and lr.keep-unreachable-states.
704 Maintain old names for backward compatibility.
705 * NEWS (2.5): Document.
706 * data/c.m4 (b4_identification): Update comment.
707 * data/yacc.c: Update access.
708 * doc/bison.texinfo: Update.
709 * etc/bench.pl.in (bench_push_parser): Update use.
710 * src/files.c (tr): Move to...
711 * src/getargs.c, src/getargs.h (tr): ... here because I can't
712 think of a better place to expose it. My logic is that, for all
713 uses of tr so far, command-line arguments can be involved, and
714 getargs.h is already included.
715 * src/main.c (main): Update access.
716 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
717 variable names to new variable names before assigning value.
718 * src/reader.c (reader): Update setting default.
719 * tests/calc.at: Update uses.
720 * tests/conflicts.at (Unreachable States After Conflict
721 Resolution): Update use.
722 * tests/input.at (%define enum variables): Update use.
723 (%define backward compatibility): New test group.
724 * tests/push.at: Update uses.
725 * tests/reduce.at: Update uses.
726 * tests/torture.at: Update uses.
727
ba5c6d94
JD
7282009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
729
730 Set all front-end %define defaults in one place.
731 * src/main.c (main): Move lr.keep_unreachable_states default...
732 * src/reader.c (reader): ... to here.
733
5bab9d08
JD
7342009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
735
736 Rename lr.default_reductions to lr.default-reductions.
737 * NEWS (2.5): Here.
738 * doc/bison.texinfo: Here.
739 * src/lalr.c (initialize_LA): Here.
740 * src/print.c (print_reductions): Here.
741 * src/reader.c (reader): Here.
742 * src/tables.c (action_row): Here.
743 * tests/input.at (%define enum variables): Here.
744 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
745
d521ee19
JD
7462009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
747
748 Pacify ./configure --enable-gcc-warnings.
749 * tests/input.at (Symbols): Prototype yyerror and yylex.
750
7512009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
752
753 Document how `%define "var" "value"' is not M4-friendly.
754 * src/parse-gram.y (variable): In comments here.
755
8f0d265e
JD
7562009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
757
758 Clean up recent patches a little.
759 Reported by Akim Demaille.
760 * doc/bison.texinfo (Understanding): Fix typos.
761 * src/print.c (print_reductions): Don't use negated variable.
762
f4909773
JD
7632009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
764
765 List accepted values for a %define enum variable with an invalid value.
766 Suggested by Akim Demaille at
767 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
768 * data/bison.m4 (_b4_percent_define_check_values): Implement.
769 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
770 * tests/input.at (%define lr.default_reductions invalid values): Merge
771 into...
772 (%define enum variables): ... here, and update output.
773
110ef36a
JD
7742009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
775
776 Rename "default rule" to "default reduction".
777 This includes changing variable names in code, changing
778 comments, and renaming %define lr.default_rules to %define
779 lr.default_reductions.
780 * NEWS (2.5): Update IELR documentation.
781 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
782 documentation.
783 * data/glr.c, data/lalr1.java: Sync copyright dates.
784 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
785 and lr.type documentation. Make some other wording
786 improvements.
787 (Glossary): Adjust cross-references and Default Reduction
788 definition.
789 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
790 Remove a confusing comment pointed out by Akim Demaille.
791 (initialize_LA): Adjust code.
792 * src/print-xml.c (print_reductions): Adjust code.
793 * src/print.c (print_reductions): Adjust code.
794 * src/reader.c (reader): Adjust code.
795 * src/tables.c (action_row): Adjust code.
796 (token_actions): Adjust code.
797 * src/tables.h: Adjust YYDEFACT documentation.
798 * tests/input.at (%define lr.default_rules invalid values):
799 Rename test group to...
800 (%define lr.default_reductions invalid values): ... this, and
801 update grammar file and expected output.
802 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
803 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
804
746ee38c
AD
8052009-04-21 Akim Demaille <demaille@gostai.com>
806
807 tests: check the use of dashes and periods in symbols.
808 * tests/input.at (Symbol): New test group.
809
eb45ef3b
JD
8102009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
811
812 Document %define lr.type and lr.default_rules.
813 * NEWS (2.5): Add an entry.
814 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
815 besides just LALR(1) and GLR(1).
816 * doc/bison.texinfo (Introduction): Likewise.
817 (Language and Grammar): Bison is no longer limited to LALR(1)
818 restrictions.
819 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
820 when trying to distinguish from GLR. Talk about LR(1) grammars
821 rather than LALR(1) grammars.
822 (Decl Summary): In %define api.push_pull entry, say it applies
823 to deterministic parsers in C rather than LALR(1) parsers in C.
824 Add lr.default_rules entry.
825 Add lr.type entry.
826 (Mystery Conflicts): Bison is no longer limited to LALR(1)
827 restrictions.
828 (Generalized LR Parsing): Same changes as for the previous GLR
829 section.
830 (Memory Management): Say deterministic rather than LALR(1).
831 (Understanding): Correct some bison output.
832 Index discussion of "accepting state".
833 Say deterministic rather than LALR(1).
834 (Bison Options): In --yacc entry, say deterministic rather than
835 LALR(1).
836 In --report, --graph, and --xml entries, just don't mention
837 LALR(1).
838 (C++ Parsers): Say deterministic rather than LALR(1).
839 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
840 (Glossary): Add Accepting State, Consistent State, Default Rule,
841 and IELR(1) definitions.
842 In Generalized LR (GLR) definition, make same changes as in
843 previous GLR sections.
844 In LALR(1) definition, say Bison uses LALR(1) by default rather
845 than implying Bison is limited to LALR(1).
846 (LocalWords): Add IELR.
847
db34f798
JD
8482009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
849
850 Finish implementing %define lr.type.
851 Its value can be "LALR", "IELR", or "canonical LR".
852 * lib/timevar.def (TV_IELR_PHASE1): New var.
853 (TV_IELR_PHASE2): New var.
854 (TV_IELR_PHASE3): New var.
855 (TV_IELR_PHASE4): New var.
856 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
857 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
858 Sbitset.h, ielr.h, and ielr.c.
859 * src/getargs.h, src/getargs.c (enum trace, trace_args,
860 trace_types): Add trace_ielr.
861 * src/lalr.h, src/lalr.c (ngotos): Export it.
862 (F): Rename to...
863 (goto_follows): ... this, update all uses, and export it.
864 (set_goto_map): Export it.
865 (map_goto): Export it.
866 (compute_lookahead_tokens): Don't free goto_follows yet. Now
867 handled in ielr.
868 (initialize_LA): Export it. Move lookback allocation to...
869 (lalr): ... here because, for canonical LR, initialize_LA must
870 be invoked but lookback and much of the rest of LALR isn't
871 needed.
872 * main.c (main): Instead of lalr, invoke ielr, which invokes
873 lalr.
874 * src/reader.c (reader): Default lr.type to "LALR".
875 Default lr.default_rules to "accepting" if lr.type is "canonical
876 LR". Leave the default as "all" otherwise.
877 Check for a valid lr.type value.
878 * src/state.h, src/state.c (struct state_list): Add state_list
879 member.
880 (state_new): Initialize state_list member to NULL.
881 (state_new_isocore): New function, exported.
882 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
883 exercises all values of lr.type.
884 (GNU AWK Grammar): Rename test group to...
885 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
886 AT_TEST_EXISTING_GRAMMAR.
887 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
888 (GNU pic Grammar): Rename test group to...
889 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
890 AT_TEST_EXISTING_GRAMMAR.
891 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
892 all values of lr.type.
893 (Single State Split): New test groups using AT_TEST_LR_TYPE.
894 (Lane Split): Likewise.
895 (Complex Lane Split): Likewise.
896 (Split During Added Lookahead Propagation): Likewise.
897
7fe11bb5
JD
8982009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
899
900 Add new files for IELR and canonical LR implementation.
901 * src/AnnotationList.c: New.
902 * src/AnnotationList.h: New.
903 * src/InadequacyList.c: New.
904 * src/InadequacyList.h: New.
905 * src/Sbitset.c: New.
906 * src/Sbitset.h: New.
907 * src/ielr.c: New.
908 * src/ielr.h: New.
909
7254f6a8
JD
9102009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
911
912 Implement %define lr.default_rules.
913 Its value describes the states that are permitted to contain
914 default rules: "all", "consistent", or "accepting".
915 * src/reader.c (reader): Default lr.default_rules to "all".
916 Check for a valid lr.default_rules value.
917 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
918 is "accepting", then only mark the accepting state as
919 consistent.
920 (initialize_LA): Tell state_lookahead_tokens_count whether
921 lr.default_rules is "accepting".
922 * src/tables.c (action_row): If lr.default_rules is not "all",
923 then disable default rules in inconsistent states.
924 * src/print.c (print_reductions): Use this opportunity to
925 perform some assertions about whether lr.default_rules was
926 obeyed correctly.
927 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
928 helps with checking the parser tables for a grammar.
929 * tests/input.at (%define lr.default_rules invalid values): New
930 test group.
931 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
932 AT_TEST_TABLES_AND_PARSE.
933 (`no %define lr.default_rules'): New test group generated by
934 AT_TEST_LR_DEFAULT_RULES.
935 (`%define lr.default_rules "all"'): Likewise.
936 (`%define lr.default_rules "consistent"'): Likewise.
937 (`%define lr.default_rules "accepting"'): Likewise.
938
72e727f2
AD
9392009-04-20 Akim Demaille <demaille@gostai.com>
940
941 Formatting change.
942
90462b8d
AD
9432009-04-20 Akim Demaille <demaille@gostai.com>
944
945 bison: factoring.
946 * src/output.c (token_definitions_output): Use symbol_id_get
947 instead of duplicating its logic.
948 * TODO (YYERRCODE): Extend.
949
4f646c37
AD
9502009-04-20 Akim Demaille <demaille@gostai.com>
951
71b00ed8
AD
952 variables: prefer error-verbose to error_verbose.
953 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
954 instead of error_verbose.
955 * src/scan-gram.l (%error-verbose): Map to the error-verbose
956 variable.
957 * doc/bison.texinfo: Promote %define error-verbose instead of
958 %error-verbose.
959 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
960
9612009-04-15 Akim Demaille <demaille@gostai.com>
962
4f646c37
AD
963 variables: accept dashes.
964 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
965 underscores.
966 * src/scan-gram.l ({id}): Also accept dashes after the initial
967 letter.
968 ({directive}): Use {id}.
969 * src/parse-gram.y: Comment and formatting changes.
970 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
971 symbols.
972 * src/complain.h, src/complain.c (yacc_at): New.
973 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
974 symbol names.
975 * src/output.c (token_definitions_output): Do not #define token
976 names with dashes.
977
184e3179
AD
9782009-04-20 Akim Demaille <demaille@gostai.com>
979
980 Consistently refer to Yacc, not YACC.
981 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
982
41253c3a
JD
9832009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
984
985 Pacify make maintainer-check-posix.
986 * tests/input.at (%define, --define): Move bison command-line
987 options before grammar file name.
988
197b82ba
JD
9892009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
990
991 Document semicolon warnings.
992 * NEWS (2.5): Here.
993
0c90a1f5
AD
9942009-04-14 Akim Demaille <demaille@gostai.com>
995
996 variables: use `parse.assert' instead of `assert'.
997 * TODO (assert): Remove.
998 * data/bison.m4 (b4_assert_if): Replace with...
999 (b4_parse_assert_if): this.
1000 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1001 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1002
fa819509
AD
10032009-04-14 Akim Demaille <demaille@gostai.com>
1004
16dc0d90 1005 variables: use `parse.trace' instead of `debug'.
fa819509
AD
1006 * src/getargs.c (getargs): Map -t to %define trace.parse.
1007 * src/scan-gram.l (%debug): Map to %define trace.parse.
1008 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1009 names to `_' in macro names.
1010 (b4_debug_if): Replace with...
1011 (b4_parse_trace_if): this.
1012 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1013 * data/yacc.c: Adjust.
1014 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1015 Use @code to label the variable list.
1016 Document the variable parse.trace.
1017 (Tracing): Promote the parse.trace variable.
1018 * TODO: %printer is not documented.
1019
f7dae1ea
AD
10202009-04-14 Akim Demaille <demaille@gostai.com>
1021
1022 doc: minor fixes.
1023 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1024 (Table of Symbols): Remove duplicate entry for %debug.
1025
3535c071
EB
10262009-04-10 Eric Blake <ebb9@byu.net>
1027
1028 submodules: update to latest
1029 * submodules/autoconf: Use latest upstream Autoconf.
1030
cf48f675
EB
10312009-04-06 Eric Blake <ebb9@byu.net>
1032
1033 Work around autoconf 2.63b bug in testsuite.
1034 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1035 autoconf bug related to # in test.
1036
50cca368
JD
10372009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1038
1039 * NEWS (2.5): New section. Describe new -D/--define feature.
1040
3583d96b
AD
10412009-04-06 Akim Demaille <demaille@gostai.com>
1042
1043 Regen.
1044 * src/parse-gram.h, src/parse-gram.c: Regen.
1045
00f5d575
AD
10462009-04-06 Akim Demaille <demaille@gostai.com>
1047
1048 rename muscle_tab.* as muscle-tab.* for consistency.
1049 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
1050 * src/muscle-tab.h, src/muscle-tab.c: these.
1051 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
1052 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
1053
76bf5102
AD
10542009-04-06 Akim Demaille <demaille@gostai.com>
1055
1056 Makefile: introduce $(BISON).
1057 * src/local.mk (BISON): New.
1058 (YACC): Use it.
1059
bc0f5737
AD
10602009-04-06 Akim Demaille <demaille@gostai.com>
1061
1062 parser: handle %locations as %define locations.
1063 * src/getargs.h, src/getargs.c (locations_flag): Remove.
1064 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
1065 to set "locations" to true.
1066 * src/output.c (prepare): Don't output "locations".
1067 * src/scan-gram.l (%locations): Handle it as a %<flag>.
1068 * src/parse-gram.y: It's no longer a token.
1069 Don't handle it.
1070 * data/bison.m4 (b4_locations_if): Define it with
1071 b4_percent_define_if_define.
1072 * data/c.m4, data/glr.cc: Adjust.
1073
697c912f
AD
10742009-04-06 Akim Demaille <demaille@gostai.com>
1075
1076 Regen.
1077 * src/parse-gram.c: Regen.
1078
4920ae8b
AD
10792009-04-06 Akim Demaille <demaille@gostai.com>
1080
1081 muscle: factor the handling of obsolete of obsolete directives.
1082 Suggested by Joel E. Denny.
50cca368 1083
4920ae8b
AD
1084 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
1085 New, extracted from...
1086 * src/parse-gram.y (prologue_declaration: pure-parser): here.
1087 Remove it.
1088 (prologue_declaration: "%<flag>"): Use
1089 muscle_percent_define_ensure.
1090 (%error-verbose, %pure-parser): No longer tokens.
1091 * src/scan-gram.l (pure-parser): Return as a %<flag>.
1092
1d5b3c08
JD
10932009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1094
1095 Fix options documentation.
1096 * build-aux/cross-options.pl: As in --help output, write optional
1097 arguments as [=ARG] not =[ARG].
1098 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1099
62c99cf4
JD
11002009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1101
1102 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1103 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1104 requirements for a correct m4 are stricter.
1105 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
1106 * configure.ac: Update to use AC_PROG_GNU_M4.
1107 Reported by Eric Blake.
1108
1c93f35b
JD
11092009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1110
1111 Help with updating web manual.
1112 * HACKING: Incorporate instructions from gnulib/doc/README.
1113 * bootstrap.conf (gnulib_modules): Add gendocs.
1114
86cfae0a
AD
11152009-04-03 Akim Demaille <demaille@gostai.com>
1116
1117 Regen.
1118 * src/parse-gram.h, src/parse-gram.c: Regen.
1119
ba061fa6
AD
11202009-04-03 Akim Demaille <demaille@gostai.com>
1121
1122 Factor %FLAG at scan level.
1123 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
1124 definitions and associated rules, replaced by....
1125 (PERCENT_FLAG): this new token type, and rule.
1126 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
1127 Use it for %debug and %error-verbose.
1128
b19ebeb3
AD
11292009-04-03 Akim Demaille <demaille@gostai.com>
1130
1131 Regen.
1132 * src/parse-gram.h, src/parse-gram.c: Regen.
1133
001a16a9
AD
11342009-04-03 Akim Demaille <demaille@gostai.com>
1135
1136 Treat %debug as %define debug.
1137 * data/bison.m4 (b4_debug_if): New.
1138 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
1139 * data/lalr1.java: Use it instead of b4_debug_flag.
1140 * src/getargs.h, src/getargs.c (debug_flag): Remove.
1141 * src/output.c (prepare): Don't output it.
1142 * src/parse-gram.y: Treat %debug as %define debug.
1143
11442009-04-03 Akim Demaille <demaille@gostai.com>
1145
1146 Treat %error-verbose as %define error_verbose.
1147 This allows to pass -Derror_verbose on the command line. Better
1148 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
1149 ERROR_VERBOSE being defined as false or true.
1150 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
1151 on b4_percent_define_ifdef, for does not check the defined value,
1152 but only whether the symbol is defined, rely on
1153 b4_percent_define_flag_if, so that a value of "false" is processed
1154 as a false.
1155 If not defined, define the flag to "false".
1156 (b4_error_verbose_if): New.
1157 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
1158 b4_error_verbose_flag.
1159 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
1160 * src/output.c (prepare): Don't output it.
1161 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
1162
92822aff
JD
11632009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1164
1165 Fix strange %define locations for default values.
1166 Reported by Akim Demaille at
1167 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1168 and discussed again starting at
1169 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1170 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1171 because location information is bogus.
1172 Use angle brackets to delimit fake file name because square brackets
1173 look like underexpanded m4. Choose a better fake file name.
1174 Use negative line numbers.
1175 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1176 * src/location.c (location_print): If line for a boundary is negative,
1177 only print that boundary's file name.
1178 * src/location.h: Document that.
1179 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1180 defaults): Update output.
1181
e021191b
JD
11822009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1183
1184 Pacify ./configure --enable-gcc-warnings.
1185 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
1186 in lib won't compile with it.
1187 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
1188
78f65418
AD
11892009-03-31 Akim Demaille <demaille@gostai.com>
1190
1191 bootstrap: --help to stdout.
1192 * bootstrap (usage): Don't send --help to stderr.
1193 Use a here doc instead of a long string.
1194
f7e241f4
AD
11952009-03-31 Akim Demaille <demaille@gostai.com>
1196
1197 bootstrap: README-hacking no longer exists
1198 * bootstrap (checkout_only_file): Set to HACKING.
1199
31d3e510
AD
12002009-03-26 Akim Demaille <demaille@gostai.com>
1201
1202 doc: merge HACKING and README-hacking.
1203 Two files is confusing.
1204 Reported by Alexandre Duret-Lutz.
1f9d8248 1205
31d3e510
AD
1206 * README-hacking: Merge into...
1207 * HACKING (Working from the repository): here.
1208
81535bfa
AD
12092009-03-26 Akim Demaille <demaille@gostai.com>
1210
1211 doc: update README-hacking.
1212 * README-hacking: We now use git and git submodules.
1213 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1214
56f772e9
AD
12152009-03-26 Akim Demaille <demaille@gostai.com>
1216
1217 lalr1.cc: avoid GCC 4.3 warnings.
1218 GCC 4.3 now warns about "a || b && c" and asks for explicit
1219 parentheses.
1220 Reported by Alexandre Duret-Lutz.
1221 * data/location.cc: Update copyright years.
1222 (Position::operator==): Use parens to make precedence explicit.
1223 Compare lines and columns first, as they are more likely to be
1224 different, and they are faster to compare.
1225
11c073b7
AD
12262009-03-26 Akim Demaille <demaille@gostai.com>
1227
1228 gnulib: update.
1229 * gnulib: Update to latest.
1230 * src/local.mk (AM_CFLAGS): Move to...
1231 * Makefile.am: here.
1232 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
1233 AM_CFLAGS.
1234
91be6b28
AD
12352009-03-02 Akim Demaille <demaille@gostai.com>
1236
1237 Comment changes.
1238
cbf25ce7
AD
12392009-03-02 Akim Demaille <demaille@gostai.com>
1240
1241 Share b4_yytranslate_define.
1242 * data/lalr1.cc (b4_yytranslate_define): Move to...
1243 * data/c++.m4: here.
1244
882f02ed
AD
12452009-03-02 Akim Demaille <demaille@gostai.com>
1246
1247 Use locations in the variant example.
1f9d8248
AD
1248 Yes, this obfuscates the point of this example, variants only.
1249 But glr.cc cannot work (yet?) without locations. This change
1250 makes it easier to use this example with glr.cc.
11c073b7 1251
882f02ed
AD
1252 * examples/variant.yy (assert): %define it.
1253 (locations): Request them.
1254 (yylex): Bind the location to the stage.
1255
0623bacc
AD
12562009-03-02 Akim Demaille <demaille@gostai.com>
1257
1258 Dub make_TOKEN as a public type interface.
1259 * data/c++.m4 (b4_symbol_constructor_declare)
1260 (b4_symbol_constructor_define): New empty stubs.
1261 (b4_public_types_declare, b4_public_types_define): Use them.
1262 * data/lalr1.cc (b4_symbol_constructor_declare)
1263 (b4_symbol_constructor_declare_)
1264 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
1265 Move to...
1266 * data/variant.hh: here.
1267 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
1268 needed.
1269 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
1270 b4_symbol_constructor_declare, as it is now done by
1271 b4_public_types_define and b4_public_types_declare.
1272
5f5a90df
AD
12732009-03-02 Akim Demaille <demaille@gostai.com>
1274
1275 Coding style changes.
1276 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1277 (b4_symbol_constructor_declarations)
1278 (b4_symbol_constructor_definition_)
1279 (b4_symbol_constructor_definitions)
1280 (b4_yytranslate_definition): Rename as...
1281 (b4_symbol_constructor_declare_)
1282 (b4_symbol_constructor_declare)
1283 (b4_symbol_constructor_define_)
1284 (b4_symbol_constructor_define)
1285 (b4_yytranslate_define): these.
1286 * data/variant.hh (b4_variant_definition): Rename as...
1287 (b4_variant_define): this.
1288
b47b6ff7
AD
12892009-03-02 Akim Demaille <demaille@gostai.com>
1290
1291 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
1292 * data/bison.m4 (b4_percent_define_if_define): New.
1293 * data/c++.m4 (b4_variant_if): Move to...
1294 * data/bison.m4: Here, using b4_percent_define_if_define.
1295 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
1296 * data/bison.m4: Here, using b4_percent_define_if_define.
1297
1d6b689b
AD
12982009-03-02 Akim Demaille <demaille@gostai.com>
1299
1300 Dub symbol_type_base as a public type.
1301 * data/c++.m4 (b4_public_types_declare): Now define
1302 symbol_type_base and symbol_type.
1303 (b4_public_types_define): New.
1304 In both cases, the definitions are taken verbatim from lalr1.cc.
1305 * data/lalr1.cc: Adjust.
1306
4f84717d
AD
13072009-03-02 Akim Demaille <demaille@gostai.com>
1308
1309 b4_public_types_declare.
1310 * data/c++.m4 (b4_public_types_declare): New.
1311 * data/glr.cc, data/lalr1.cc: Use it.
1312
b9e4eb5b
AD
13132009-03-02 Akim Demaille <demaille@gostai.com>
1314
1315 b4_semantic_type_declare.
1316 * data/c++.m4 (b4_semantic_type_declare): New.
1317 Factors and generalizes what was in glr.cc and lalr1.cc.
1318 * data/variant.hh (b4_semantic_type_declare): Redefine it for
1319 variants.
1320 * data/lalr1.cc, data/glr.cc: Use it.
1321
6a6e7f0c
AD
13222009-02-26 Akim Demaille <demaille@gostai.com>
1323
1324 Upgrade gnulib.
1325 * gnulib: Upgrade from master.
1326 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
1327 Regen.
1328
e9e61b00
AD
13292009-02-25 Akim Demaille <demaille@gostai.com>
1330
1331 Remove useless arguments.
1332 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
1333 relevant.
1334
3eead995
AD
13352009-02-25 Akim Demaille <demaille@gostai.com>
1336
1337 Comment changes.
1338 * data/lalr1.cc: here.
1339
87f28efe
AD
13402009-02-25 Akim Demaille <demaille@gostai.com>
1341
1342 Fix glr.cc's debug level handling.
1343 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
1344 glr.c which is used.
1345 (debug_level, set_debug_level): Adjust.
1346
9be2a009
AD
13472009-02-25 Akim Demaille <demaille@gostai.com>
1348
1349 Copyright years.
1350 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1351
07a6e87d
AD
13522009-02-25 Akim Demaille <demaille@gostai.com>
1353
1354 Style changes.
1355 * etc/bench.pl.in (generate_grammar_list): Consitently use
1356 location_type, not yy::location.
1357
33c78bd2
AD
13582009-02-25 Akim Demaille <demaille@gostai.com>
1359
1360 Comment change.
1361 * data/lalr1.cc: here.
1362
49572920
AD
13632009-02-19 Akim Demaille <demaille@gostai.com>
1364
1365 Make yyparser::error public.
1366 * data/lalr1.cc: here.
1367 There is no good reason to keep it private (and it is convenient
1368 to use it from the scanner for instance). It is already public in
1369 glr.cc.
1370
88654b47
AD
13712009-02-19 Akim Demaille <demaille@gostai.com>
1372
1373 Comment changes.
1374 * data/glr.cc: here.
1375
4524c55b
AD
13762009-02-19 Akim Demaille <demaille@gostai.com>
1377
1378 Remove trailing blanks.
6a6e7f0c
AD
1379 The epilogue has its own ending \n, no need to add another.
1380
4524c55b
AD
1381 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
1382 epilogue.
1383 * data/glr.cc: dnl when extending the epilogue.
1384 Remove stray "private:".
1385
6ceccee8
AD
13862009-02-19 Akim Demaille <demaille@gostai.com>
1387
1388 Use b4_c_modern.
1389 * data/c.m4 (b4_c_function_decl): Here.
1390
9c6a8966
AD
13912009-02-19 Akim Demaille <demaille@gostai.com>
1392
1393 Comment changes.
1394 * data/lalr1.cc: here.
1395
507aa0e2
AD
13962009-02-19 Akim Demaille <demaille@gostai.com>
1397
1398 Extract variant.hh
1399 * data/variant.hh: New, extracted from...
1400 * data/lalr1.cc: here.
1401 Adjust.
1402 * data/local.mk: Adjust.
1403
51bacae6
AD
14042009-02-19 Akim Demaille <demaille@gostai.com>
1405
1406 Extract stack.hh from lalr1.cc.
1407 * data/stack.hh: New.
1408 * data/lalr1.cc: Extract from here.
1409 * data/local.mk: Adjust.
1410
06c3084f
JD
14112009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1412
1413 Add reminder about uploading public key to keys.gnupg.net.
1414 * HACKING (Release Procedure): Here.
1415
0ea583d2
AD
14162009-01-28 Akim Demaille <demaille@gostai.com>
1417
1418 * NEWS: Update information about 2.4.1 and 2.4.2.
1419
402b123d
AD
14202008-11-04 Akim Demaille <demaille@gostai.com>
1421
1422 Reformat NEWS.
1423 * NEWS: Use more outline-mode markup.
1424 Suggested by Jim Meyering.
1425
74553c98
AD
14262009-01-08 Akim Demaille <demaille@gostai.com>
1427
1428 Fix grep portability issues.
1429 Grep on Solaris does not support -q.
1430 Reported by Summum Bonum.
1431
1432 * NEWS: Add a stub for 2.4.2.
1433 * THANKS: Add Summum Bonum.
1434 * tests/atlocal.in (EGREP): New.
1435 (CC, CXX, XSLTPROC): Make it possible to override them via
1436 envvars.
1437 * tests/java.at: Use $EGREP instead of egrep.
1438 Use AT_CHECK's ignore instead of grep's -q.
1439
84eedf86
AD
14402008-12-11 Akim Demaille <demaille@gostai.com>
1441
1442 Pass the token type to yysyntax_error.
1443 * data/yacc.c (yysyntax_error): Take the transated token instead
1444 of the raw number.
1445 Adjust callers.
1446 * TODO: Update.
1447
5860cc8c
AD
14482008-12-11 Akim Demaille <demaille@gostai.com>
1449
1450 Formatting changes.
1451 * data/glr.c: Formatting changes.
1452
2b008529
AD
14532008-12-11 Akim Demaille <demaille@gostai.com>
1454
1455 Propagate i18n changes into glr.c.
1456 * TODO: Update.
1457 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
1458 building the error message format dynamically.
1459 * data/lalr1.java: Formatting changes.
1460
2cd1af95
AD
14612008-12-11 Akim Demaille <demaille@gostai.com>
1462
1463 Use testsuite -C.
1464 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
1465 Solves problems when top_srcdir is an absolute path.
1466 Suggested by Eric Blake.
1467 * configure.ac: Require Autoconf 2.62.
1468
eeb29422
AD
14692008-12-11 Akim Demaille <demaille@gostai.com>
1470
1471 Simplify the i18n of the error messages.
1472 * data/lalr1.cc: Comment changes.
1473 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
1474 lalr1.cc instead of building dynamically the format string.
1475
6617622c
AD
14762008-12-08 Akim Demaille <demaille@gostai.com>
1477
1478 Fix portability issue in the test suite.
1479 * tests/local.at (AT_MATCHES_CHECK): New.
1480 Based on Perl instead of Sed. Sed has too many portability
1481 pitfalls, not ever Sed is GNU Sed.
1482 * tests/actions.at (Fix user actions without a trailing semicolon):
1483 Use it.
1484
2ca1136c
AD
14852008-12-08 Akim Demaille <demaille@gostai.com>
1486
1487 Update data/README.
1488 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1489
6c63b895
AD
14902008-12-08 Akim Demaille <demaille@gostai.com>
1491
1492 Install autoconf as a submodule to get m4sugar.
1493 * .gitmodules: Add submodules/autoconf.
1494 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1495 submodules/autoconf.
1496
417e31d2
AD
14972008-12-08 Akim Demaille <demaille@gostai.com>
1498
1499 Test token.prefix in all the skeletons.
1500 * data/java.m4 (b4_token_enum): Use the token.prefix.
1501 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
1502 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
1503 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
1504 * tests/java.at: Comment changes.
1505 (AT_CHECK_JAVA_MINIMAL): Define the END token.
1506 (Java parser class and package names): Add token.prefix check.
1507
97abf544
AD
15082008-12-08 Akim Demaille <demaille@gostai.com>
1509
1510 Fix regeneration of atconfig.
1511 * tests/local.mk (tests/atconfig): The rule was incorrect, but
1512 remove it: now that there is no tests/Makefile.am, the top-level
1513 Makefile properly updates atconfig when needed.
1514
e8cd1ad6
DJ
15152008-12-07 Di-an Jan <dianj@freeshell.org>
1516
1517 Implement the FIXME that ends an user action with a semicolon
1518 if it seems necessary.
1519 * src/scan-code.l (flex rules section): Flag cpp directive from
1520 any `#' to the first unescaped end-of-line. Semicolon is not
1521 needed after `;', `{', '}', or cpp directives and is needed after
1522 any other token (whitespaces and comments have no effect).
1523 * tests/actions.at (Fix user actions without a trailing semicolon):
1524 New test.
1525 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1526 to make user actions complete statements.
1527 Adjust column numbers in error messages.
1528 * tests/regression.at (Fix user actions without a trailing semicolon):
1529 Remove. Covered by new test.
1530
ce9447fc
AD
15312008-12-07 Akim Demaille <demaille@gostai.com>
1532
1533 Update gnulib.
1534 * gnulib: Update from master.
1535
d333175f
EB
15362008-12-05 Eric Blake <ebb9@byu.net>
1537
1538 Avoid compiler warning.
1539 * src/output.c (muscle_insert_item_number_table): Delete unused
1540 function.
1541
215b40ac
EB
15422008-12-02 Eric Blake <ebb9@byu.net>
1543
1544 Build testsuite with newer autoconf.
1545 * tests/output.at (m4_expand): Don't override in newer autoconf,
1546 where the underlying implementation changed.
1547 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1548 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1549 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1550 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1551 since some of them contain unbalanced ')'.
1552
3bb21113
AD
15532008-12-01 Akim Demaille <demaille@gostai.com>
1554
1555 Use b4_symbol for printers and destructors everywhere.
1556 * data/bison.m4 (b4_symbol_action_location): New.
1557 * data/c.m4 (b4_symbol_actions): Remove.
1558 Adjust all callers to use by b4_symbol_foreach and the corresponding
1559 b4_symbol_printer/destructor macro.
1560 * data/glr.cc: Adjust.
1561 * data/lalr1.java: Adjust the %destructor sanity check.
1562 * src/output.c (symbol_code_props_output): Remove, we no longer
1563 need the b4_symbol_printers/destructors tables.
1564
fb7c5b1f
AD
15652008-12-01 Akim Demaille <demaille@gostai.com>
1566
1567 Use b4_symbol_case_.
1568 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
1569 b4_symbol_case_.
1570
cf6fb222
AD
15712008-12-01 Akim Demaille <demaille@gostai.com>
1572
1573 Move b4_symbol based macro to bison.m4.
1574 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
1575 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
1576 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
1577 (b4_type_foreach): Move to...
1578 * data/bison.m4: Here.
1579 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
1580 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 1581
e3c52a63
AD
15822008-12-01 Akim Demaille <demaille@gostai.com>
1583
1584 b4_symbol/type_foreach.
1585 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
1586 Use them.
1587
2bde9113
AD
15882008-12-01 Akim Demaille <demaille@gostai.com>
1589
1590 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
1591 Instead of defining complex list of tuples to define various
1592 properties of the symbols, we now prefer to define symbols as
1593 "structs" in m4: using the symbol key (its number), and the
1594 property name, b4_symbol gives it value. Use this to handle
1595 destructors and printers.
1596
2bde9113
AD
1597 * src/output.c (CODE_PROP): New.
1598 (prepare_symbol_definitions): Use it to define the printer and
1599 destructor related attributes of the symbols.
1600 * data/lalr1.cc (b4_symbol_actions): Rename as...
1601 (b4_symbol_action): this.
1602 Use b4_symbol instead of 6 arguments.
1603 (b4_symbol_printer, b4_symbol_destructor): New.
1604 Use them instead of b4_symbol_actions.
1605
44494bf6
AD
16062008-12-01 Akim Demaille <demaille@gostai.com>
1607
1608 Avoid capturing variables too easily.
1609 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
1610 v__ and p__ instead of v and p.
1611
fad814bd
AD
16122008-12-01 Akim Demaille <demaille@gostai.com>
1613
1614 Remove spurious empty line before syncline.
1615 * data/bison.m4 (b4_syncline): Don't output an empty line before
1616 the output.
1617
feda5527
AD
16182008-11-26 Akim Demaille <demaille@gostai.com>
1619
1620 Convert lib/Makefile.am into lib/local.mk.
1621 The real problem is rather gnulib.mk, which itself is extracted
1622 from a Makefile.am that gnulib expects to the "recursive". The
1623 tool prefix-gnulib-mk converts such a gnulib.mk to be
1624 non-recursive. Also, some AC_SUBST variables need to be adjusted.
1625
1626 * etc/prefix-gnulib-mk: New.
1627 * bootstrap (slurp): Use it to convert further gnulib.mk.
1628 No longer try to avoid re-creation of lib/gnulib.mk as the changes
1629 are deeper.
1630 * lib/Makefile.am: Rename as...
1631 * lib/local.mk: this.
1632 Adjust to be prefixed.
1633 * Makefile.am, configure.ac: Adjust.
1634 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
1635
56ddee7f
AD
16362008-11-26 Akim Demaille <demaille@gostai.com>
1637
1638 s/_FLAGS/FLAGS/.
1639 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
1640 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
1641 Reported by Eric Blake.
1642
728e89a0
AD
16432008-11-26 Akim Demaille <demaille@gostai.com>
1644
1645 Use b4_parser_tables_define in glr.cc.
1646 * data/glr.c: Use b4_parser_tables_define instead of defining the
1647 (deterministic integral) tables by hand.
1648
2c1bf9bd
AD
16492008-11-26 Akim Demaille <demaille@gostai.com>
1650
1651 Use b4_parser_tables_define in Java.
1652 * data/java.m4 (b4_typed_parser_table): Rename as...
1653 (b4_typed_parser_table_define): this, for consistency.
1654 Accept a comment as $4.
1655 Move $2 into yy*_.
1656 (b4_integral_parser_table): Rename as...
1657 (b4_integral_parser_table_define): this.
1658 * data/lalr1.java: Adjust all uses.
1659 Use b4_parser_tables_define instead of generation by hand.
1660
ba206cf4
AD
16612008-11-26 Akim Demaille <demaille@gostai.com>
1662
1663 Prepare the convergence bw C style and Java table generation.
1664 * data/bison.m4 (b4_tables_map, b4_tables_declare)
1665 (b4_tables_define): Rename as...
1666 (b4_integral_parser_tables_map, b4_parser_tables_declare)
1667 (b4_parser_tables_define): these.
1668 * data/c.m4 (b4_table_define): Rename as...
1669 (b4_integral_parser_table_define): this.
1670 * data/lalr1.cc: Adjust.
1671 (b4_table_define, b4_table_declare): Rename as...
1672 (b4_integral_parser_table_define)
1673 (b4_integral_parser_table_declare): these.
1674 (yyrline_): Move the comment where it is actually used.
1675 * data/yacc.c: Adjust.
1676 (yyrline): Use b4_integral_parser_table_define.
1677
d12f8e49
AD
16782008-11-26 Akim Demaille <demaille@gostai.com>
1679
1680 Regen.
1681 * src/parse-gram.h, src/parse-gram.c: Regen.
1682
0991e29b
AD
16832008-11-26 Akim Demaille <demaille@gostai.com>
1684
1685 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
1686 * data/lalr1.cc (b4_tables_map): Move to...
1687 * data/bison.m4: here.
1688 Update the comment for yytable during the flight.
1689 (b4_tables_declare, b4_tables_define): New.
1690 * data/lalr1.cc: Use them.
1691 * data/c.m4 (b4_table_define): New.
1692 * data/yacc.c: Use b4_tables_define instead of output the tables
1693 by hand.
1694 * tests/regression.at (Web2c Actions): Adjust the expected output,
1695 the order of the tables changed.
1696
3d3bc1fe
AD
16972008-11-26 Akim Demaille <demaille@gostai.com>
1698
1699 Get rid of (yy)rhs and (yy)prhs.
1700 These tables are no longer needed in the parsers, and they don't seem to
1701 be useful. They are not documented either.
feda5527 1702
3d3bc1fe
AD
1703 * src/output.c (prepare_rules): Get rid of rhs and prhs.
1704 Adjust the computation of (yy)r2.
1705
08c81469
AD
17062008-11-26 Akim Demaille <demaille@gostai.com>
1707
1708 Rule length is unsigned.
1709 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
1710
932b0c96
AD
17112008-11-26 Akim Demaille <demaille@gostai.com>
1712
1713 Get rid of lalr1-split.cc.
1714 It was no longer maintainer.
feda5527 1715
932b0c96
AD
1716 * data/lalr1-split.cc: Remove.
1717 * etc/bench.pl.in (bench_fusion_parser): Remove.
1718 Adjust.
1719
8452c667
AD
17202008-11-26 Akim Demaille <demaille@gostai.com>
1721
1722 Use yy* consistently.
1723 * data/glr.c: Now that yyrhs no longer exists as a global
1724 variable, rename local "rhs" variables into "yyrhs" for
1725 consistency.
1726
783aa653
AD
17272008-11-25 Akim Demaille <demaille@gostai.com>
1728
1729 Get rid of yyrhs and yyprhs in glr.c.
1730 * data/glr.c (yyrhs, yyprhs): Remove.
1731 Instead, use the state stack and yystos.
1732
6130b755
AD
17332008-11-25 Akim Demaille <demaille@gostai.com>
1734
1735 Flag glr tests.
1736 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
1737 as an Autotest keyword.
1738
95a7b1c9
AD
17392008-11-25 Akim Demaille <demaille@gostai.com>
1740
1741 Prefer TESTSUITE_FLAGS.
1742 TESTSUITEFLAGS is barely readable.
feda5527 1743
95a7b1c9
AD
1744 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
1745 for backward compatibility.
1746 Use the former instead of the latter.
1747
b4f18401
AD
17482008-11-25 Akim Demaille <demaille@gostai.com>
1749
1750 Get rid of yyrhs and yyprhs in larl1.java.
1751 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
1752 (yy_reduce_print): Rather, use yystos_ and the state stack.
1753
c265fd6b
AD
17542008-11-25 Akim Demaille <demaille@gostai.com>
1755
1756 Formatting changes.
1757
68dbdee8
AD
17582008-11-25 Akim Demaille <demaille@gostai.com>
1759
1760 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
1761 They were used to get the symbol types, given a rule number, when
1762 displaying the top of the stack before a reduction. But the
1763 symbol type is available from the state stack. This has two be
1764 benefits: two tables less in the parser (making it smaller), and a
1765 more consistent use of the three stacks which will help to fuse
1766 them.
feda5527 1767
68dbdee8
AD
1768 * data/yacc.c (yyprhs, yyrhs): Remove.
1769 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
1770 (yy_reduce_print): Take yyssp as argument.
1771 Use it, together with yystos, to get the symbol type.
1772 * tests/regression.at (Web2c Report): Remove these tables from the
1773 expected output.
1774
6ab1adbe
AD
17752008-11-25 Akim Demaille <demaille@gostai.com>
1776
1777 b4_tables_map.
1778 The point is to factor the generation of the tables across skeletons.
1779 This is language dependant.
feda5527 1780
6ab1adbe
AD
1781 * data/c.m4 (b4_comment_): New.
1782 Should be usable to define how to generate tables independently of
1783 the language.
1784 (b4_c_comment): New.
1785 (b4_comment): Bounce to b4_c_comment.
1786 Now support $2 = [PREFIX] for indentation.
1787 * data/lalr1.cc (b4_table_declare): Don't output a comment if
1788 there is no comment.
1789 Indent it properly when there is one.
1790 Output the ending semicolon.
1791 (b4_table_define): Space changes.
1792 Output the ending semicolon.
1793 (b4_tables_map): New.
1794 Use it twice instead of declaring and defining the (integral)
1795 tables by hand.
1796
0fddb3d5
AD
17972008-11-25 Akim Demaille <demaille@gostai.com>
1798
1799 b4_table_declare.
1800 * data/lalr1.cc (b4_table_declare): New.
1801 Use it to declare the tables defined with b4_table_define.
1802 (b4_table_define): Declare a third arg to match b4_table_declare
1803 signature.
1804 Move all the comments around invocations of b4_table_define into
1805 the invocations itselves.
1806 Move things around to have the order for declarations and
1807 definitions.
1808
c4ddc0fb
AD
18092008-11-25 Akim Demaille <demaille@gostai.com>
1810
1811 Formatting changes.
1812 * data/lalr1.java: here.
1813
e0c653e7
AD
18142008-11-25 Akim Demaille <demaille@gostai.com>
1815
1816 b4_args is more general than only C++.
1817 * data/lalr1.cc (b4_args, _b4_args): Move to...
1818 * data/bison.m4: here.
1819
4182a0a1
DJ
18202008-11-21 Di-an Jan <dianj@freeshell.org>
1821
1822 Implement no-XXX arguments for --warnings, --report, --trace.
1823 * src/getargs.c (flags_argmatch): Handles no-XXX.
1824 Fix typo in doxygen comment.
1825
01466c3e
AD
18262008-11-21 Akim Demaille <demaille@gostai.com>
1827
1828 Display the changes in cross-options.texi.
1829 * build-aux/cross-options.pl ($sep): New, to separate items.
1830 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
1831 changes.
1832
a7c09cba
DJ
18332008-11-20 Di-an Jan <dianj@freeshell.org>
1834
1835 Improves options in the manual.
1836 * doc/bison.texinfo (-g, -x): Add space before argument.
1837 (Option Cross Key): Implement FIXME: listing directives also.
1838 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1839 (Short Option): Special case -d. Put arguments inside @option.
feda5527 1840 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
1841 src/scan-gram.l (actual name passed as the first argument)
1842 with special case for %define.
1843 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
1844 to build-aux/cross-options.pl.
1845 * src/getargs.c (usage): Document limitations of cross-options.pl.
1846 * src/scan-gram.l: Likewise.
1847
6c88b51e
JD
18482008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1849
1850 Fix unexpanded macros in GLR defines file.
1851 Reported by Csaba Raduly at
1852 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1853 * THANKS (Csaba Raduly): Add.
1854 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1855 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1856 lexer in a separate module that includes the defines file.
1857 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
1858 source.
1859 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1860 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1861 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1862 (AT_DATA_SOURCE_PROLOGUE): New.
1863 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1864 (AT_DATA_SOURCE): New.
1865 (AT_FULL_COMPILE): Extend to support an additional source file.
1866
1e034807
AD
18672008-11-18 Akim Demaille <demaille@gostai.com>
1868
1869 More TODO.
1870 * TODO: More short term issues.
1871
e3dda35c
AD
18722008-11-18 Akim Demaille <demaille@gostai.com>
1873
1874 Regen.
1875 * src/parse-gram.h, src/parse-gram.c: Regen.
1876
bd187d7b
AD
18772008-11-18 Akim Demaille <demaille@gostai.com>
1878
1879 Use b4_subtract where possible.
1880 * data/lalr1.cc (b4_subtract): Move to...
1881 * data/bison.m4: here.
1882 * data/glr.c (b4_rhs_data): Use it.
1883 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
1884
6085ab0d
AD
18852008-11-18 Akim Demaille <demaille@gostai.com>
1886
1887 Remove incorrect mode specification.
1888 * data/glr.cc: Don't pretend it's C code.
1889
9ce405ce
JD
18902008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1891
1892 Simplify last patch slightly.
1893 * src/getargs.c (getargs): Here.
1894
a8beef7e
JD
18952008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1896
1897 Fix last warning from --enable-gcc-warnings.
1898 * src/getargs.c (getargs): Don't assign const address to non-const
1899 pointer.
1900
d50eea6d
JD
19012008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1902
1903 Don't let maintainer-*-check targets force a version update.
1904 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
1905 handled.
1906
f5f419de
DJ
19072008-11-17 Di-an Jan <dianj@freeshell.org>
1908
1909 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
1910 Align menus. Adjust word wrapping. Use node names for menu names.
1911 (Examples): Don't abbreviate node names.
1912 (LocalWords): Remove abbreviations.
1913 (Copying): Make description a sentence.
d50eea6d 1914 (Java Action Features): Remove period to match the rest of menu.
f5f419de 1915
d73e55e0
DJ
19162008-11-17 Di-an Jan <dianj@freeshell.org>
1917
1918 Handles several --enable-gcc-warnings.
1919 * src/getargs.c (command_line_location): Set parameters to void.
1920 * src/output.c (symbol_type_name_cmp): Make static.
1921 (symbols_by_type_name): Set parameters to void.
1922 (symbol_definitions_output): Remove unused parameter. Rename as...
1923 (prepare_symbol_definitions): this.
1924 (muscles_output): Move symbol_definitions_output to...
1925 (output): here as prepare_symbol_definitions.
1926 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 1927 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 1928
68c989de
DJ
19292008-11-17 Di-an Jan <dianj@freeshell.org>
1930
1931 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
1932 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
1933
23ce6f4c
AD
19342008-11-16 Akim Demaille <demaille@gostai.com>
1935
1936 Add missing $(EXEEXT).
1937 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
1938 "src/bison$(EXEEXT)".
1939 Reported by Di-an Jan.
1940
dd704c35
AD
19412008-11-15 Akim Demaille <demaille@gostai.com>
1942
1943 * TODO: Update.
1944
dab244d5
AD
19452008-11-15 Akim Demaille <demaille@gostai.com>
1946
1947 Formatting changes.
1948 * tests/input.at: here.
1949
4b4da9fb
AD
19502008-11-15 Akim Demaille <demaille@gostai.com>
1951
1952 Remove duplicate header inclusion.
1953 * src/LR0.c: here.
1954
4ea3f53d
AD
19552008-11-15 Akim Demaille <demaille@gostai.com>
1956
1957 * src/parse-gram.h, src/parse-gram.c: Regen.
1958
cb823b6f
AD
19592008-11-15 Akim Demaille <demaille@gostai.com>
1960
1961 Support parametric types.
b06df3c2
AD
1962
1963 There are two issues to handle: first scanning nested angle
1964 bracket pairs to support types such as std::pair< std::string,
1965 std::list<std::string> > >.
1966
1967 Another issue is to address idiosyncracies of C++: do not glue two
1968 closing angle brackets together (otherwise it's operator>>), and
1969 avoid sticking blindly a TYPE to the opening <, as it can result
1970 in '<:' which is a digraph for '['.
1971
cb823b6f
AD
1972 * src/scan-gram.l (brace_level): Rename as...
1973 (nesting): this.
1974 (SC_TAG): New.
1975 Implement support for complex tags.
b06df3c2 1976 (tag): Accept
cb823b6f
AD
1977 , but not <.
1978 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
1979 (b4_symbol_variant): Leave space around types as parameters.
1980 * examples/variant.yy: Use nested template types and leading ::.
1981 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
1982 Rename as...
1983 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
1984 * tests/c++.at: Test parametric types.
1985
7b6e6753
AD
19862008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1987
1988 Test token.prefix.
1989 This is not sufficient, but we test at least that the make_SYMBOL
1990 interface is not affected by token.prefix. A more general test
1991 will be implemented when the support of token.prefix is generalized
1992 to more skeletons.
b06df3c2 1993
7b6e6753
AD
1994 * tests/c++.at: One more variant test, using token.prefix.
1995
dddec537
AD
19962008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
1997
1998 Test the make_TOKEN interface.
1999 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2000 Factor the common code in yylex.
2001 Use it to test "%define lex_symbol".
2002
7d3e21ba
AD
20032008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2004
2005 Formatting change.
2006
4fc55348
AD
20072008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2008
2009 Simplify code for variants bench marks.
2010 * etc/bench.pl.in (&generate_grammar_list): Define and use
2011 location_type.
2012 Factor the common code in yylex.
2013
070e6509
AD
20142008-11-15 Akim Demaille <demaille@gostai.com>
2015
2016 Better error message.
2017 * bootstrap (find_tool): Fix the error message.
2018
0078681b
AD
20192008-11-15 Akim Demaille <demaille@gostai.com>
2020
2021 Update variant.yy to newest interface.
2022 * examples/variant.yy: Define lex_symbol.
2023 Adjust.
2024
ff084799
AD
20252008-11-15 Akim Demaille <demaille@gostai.com>
2026
2027 Don't use locations in variant.yy.
2028 * examples/variant.yy: Adjust to not using locations.
2029
b0d79ec6
AD
20302008-11-15 Akim Demaille <demaille@gostai.com>
2031
2032 Comment changes.
2033 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
2034 comments for the license.
2035
d4977ce3
AD
20362008-11-15 Akim Demaille <demaille@gostai.com>
2037
2038 Remove tests/Makefile.am.
2039 * tests/Makefile.am: Rename as...
2040 * tests/local.mk: this.
2041 * Makefile.am, configure.ac: Adjust.
2042 * Makefile.am (DISTCLEANFILES): Define.
2043 (maintainer-check, maintainer-xml-check, maintainer-push-check):
2044 Remove, we no longer need to bounce to the real targets.
2045
87f1149a
AD
20462008-11-15 Akim Demaille <demaille@gostai.com>
2047
2048 Comment changes.
2049
36415906
AD
20502008-11-15 Akim Demaille <demaille@gostai.com>
2051
2052 djgpp/local.mk.
2053 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
2054 * djgpp/local.mk: this new file.
2055
e2c2f696
AD
20562008-11-15 Akim Demaille <demaille@gostai.com>
2057
2058 Remove doc/Makefile.am.
2059 * doc/Makefile.am: Rename as...
2060 * doc/local.mk: this.
2061 Adjust paths
2062 * Makefile.am, configure.ac: Adjust.
2063 * Makefile.am (MOSTLYCLEANFILES): New.
2064 * src/local.mk: Adjust.
2065
2ead32e6
AD
20662008-11-15 Akim Demaille <demaille@gostai.com>
2067
2068 Move sc_tight_scope into maint.mk.
b06df3c2
AD
2069 It does not work, and I don't know how it was supposed to work: it
2070 seems to be looking for sources in the build tree. I just moved
2071 it at a better place, fixing it is still required.
2072
2ead32e6
AD
2073 * src/local.mk (echo): Remove.
2074 (sc_tight_scope): Move to...
2075 * maint.mk: here.
2076
2df9ec37
AD
20772008-11-15 Akim Demaille <demaille@gostai.com>
2078
2079 Regen.
2080 * src/parse-gram.h, src/parse-gram.h: Regen.
2081
0305d25e
AD
20822008-11-15 Akim Demaille <demaille@gostai.com>
2083
2084 Remove src/Makefile.am.
2085 * src/Makefile.am: Rename as...
2086 * src/local.mk: this.
2087 Prefix all the paths with src/.
2088 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
2089 (AM_CPPFLAGS): Find find in builddir/src.
2090 (YACC): Move the flags into...
2091 (AM_YFLAGS): here.
2092 * maint.mk (sc_tight_scope): Disable.
2093 It used to bounce to the version in src/Makefile.am which is now
2094 part of this very Makefile.
2095 * Makefile.am, configure.ac: Adjust.
2096 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
2097 include "..." to find files "here": we are no longer in src/, so
2098 qualify the includes with src/.
2099 * doc/Makefile.am (PREPATH): No longer include the top_builddir
2100 prefix.
2101 (.x.1): Adjust to be able to create src/foo from the top level
2102 Makefile, instead of going bounce to src/Makefile the creation of
2103 foo.
2104
5277c0a3
AD
21052008-11-15 Akim Demaille <demaille@gostai.com>
2106
2107 Remove useless variable.
2108 * doc/Makefile.am (srcsrcdir): Remove.
2109
6a5aa0cd
AD
21102008-11-15 Akim Demaille <demaille@gostai.com>
2111
2112 Remove data/Makefile.am.
2113 * data/Makefile.am: Rename as...
2114 * data/local.mk: this.
2115 Adjust paths.
2116 * Makefile.am, configure.ac: Adjust.
2117
7cb794dc
AD
21182008-11-15 Akim Demaille <demaille@gostai.com>
2119
2120 Remove etc/Makefile.am.
2121 * etc/Makefile.am: Rename as...
2122 * etc/local.mk: this.
2123 Adjust.
2124 * Makefile.am, configure.ac: Adjust.
2125
cd409e3b
AD
21262008-11-15 Akim Demaille <demaille@gostai.com>
2127
2128 Remove examples/local.mk.
2129 examples/calc++/Makefile.am might be interesting to keep as is, since
2130 it is an example in itself.
2df9ec37 2131
cd409e3b
AD
2132 * examples/Makefile.am: Rename as...
2133 * examples/local.mk: this.
2134 Adjust.
2135 * Makefile.am, configure.ac: Adjust.
2136
9a1e4214
AD
21372008-11-15 Akim Demaille <demaille@gostai.com>
2138
2139 Remove build-aux/Makefile.am.
2140 Recursive Makefiles are really way too slow, let's get rid of some of
2141 them.
2df9ec37 2142
9a1e4214
AD
2143 * build-aux/Makefile.am: Rename as...
2144 * build-aux/local.mk: this.
2145 Adjust paths.
2146 * Makefile.am, configure.ac: Adjust.
2147
0634493c
AD
21482008-11-15 Akim Demaille <demaille@gostai.com>
2149
2150 Provide convenience constructors for locations and positions.
2151 * data/location.cc (position::position): Accept file, line and
2152 column as arguments with default values.
2153 Always qualify initial line and column literals as unsigned.
2154 (location::location): Provide convenience constructors.
2155
fe1b448a
AD
21562008-11-15 Akim Demaille <demaille@gostai.com>
2157
b06df3c2
AD
2158 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
2159 token type.
fe1b448a
AD
2160 Using template buys us nothing, and makes it uselessly complex to
2161 construct a symbol. Besides, it could not be generalized to other
2162 languages, while make_FOO would work in C/Java etc.
2df9ec37 2163
fe1b448a
AD
2164 * data/lalr1.cc (b4_symbol_): New.
2165 (b4_symbol): Use it.
2166 (b4_symbol_constructor_declaration_)
2167 (b4_symbol_constructor_definition_): Instead of generating
2168 specializations of an overloaded template function, just generate
2169 several functions whose names are forged from the token names
2170 without the token.prefix.
2171 (b4_symbol_constructor_declarations): Generate them for all the
2172 symbols, not just by class of symbol type, now that instead of
2173 specializing a function template by the token, we generate a
2174 function named after the token.
2175 (b4_symbol_constructor_specialization_)
2176 (b4_symbol_constructor_specializations): Remove.
2177 * etc/bench.pl.in: Adjust to this new API.
2178
5679f311
AD
21792008-11-13 Akim Demaille <demaille@gostai.com>
2180
2181 %define token.prefix.
b06df3c2
AD
2182 Provide a means to add a prefix to the name of the tokens as
2183 output in the generated files. Because of name clashes, it is
2184 good to have such a prefix such as TOK_ that protects from names
2185 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 2186
5679f311
AD
2187 * data/bison.m4 (token.prefix): Empty by default.
2188 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
2189 * data/lalr1.cc (b4_symbol): Ditto.
2190
3204049e
AD
21912008-11-13 Akim Demaille <demaille@gostai.com>
2192
2193 Compute at M4 time some of the subtractions.
90290ce5 2194 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
2195 (b4_rhs_data): Use it.
2196
202598d3
AD
21972008-11-13 Akim Demaille <demaille@gostai.com>
2198
2199 symbol::token.
b06df3c2 2200 This allows the user to get the type of a token returned by yylex.
2df9ec37 2201
202598d3
AD
2202 * data/lalr1.cc (symbol::token): New.
2203 (yytoknum_): Define when %define lex_symbol, independently of
2204 %debug.
2205 (yytoken_number_): Move into...
2206 (symbol::token): here, since that's the only use.
2207 The other one is YYPRINT which was not officially supported
2208 by lalr1.cc, and anyway it did not work since YYPRINT uses this
2209 array under a different name (yytoknum).
2210
fc2476c7
AD
22112008-11-13 Akim Demaille <demaille@gostai.com>
2212
2213 YYERRCODE.
2214 * TODO (YYERRCODE): Mention the case of $undef.
2215
865f1e9f
AD
22162008-11-13 Akim Demaille <demaille@gostai.com>
2217
2218 TODO: YYPRINT.
2219 * TODO (YYPRINT): New.
2220
cb0b136a
AD
22212008-11-13 Akim Demaille <demaille@gostai.com>
2222
2223 Comment changes.
2224 * data/lalr1.cc, data/yacc.c: Fix the description of the
2225 yytranslate and yytoknum tables.
2226
2c086d29
AD
22272008-11-13 Akim Demaille <demaille@gostai.com>
2228
2229 Define make_symbol in the header.
b06df3c2
AD
2230 To reach good performances these functions should be inlined (yet
2231 this is to measure precisely). To this end they must be available
2232 to the caller.
2df9ec37 2233
2c086d29
AD
2234 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
2235 location_type with the class name.
2236 Since will now be output in the header, declare "inline".
2237 No longer use b4_symbol_constructor_specializations, but
2238 b4_symbol_constructor_definitions in the header.
2239 Don't call it in the *.cc file.
2240
1c4af381
AD
22412008-11-13 Akim Demaille <demaille@gostai.com>
2242
2243 Define yytranslate in the header for lex_symbol.
2244 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
2245 into the header file when using %define lex_symbol.
2246 (yytranslate_): Declare inline.
2247
e51b0a82
AD
22482008-11-13 Akim Demaille <demaille@gostai.com>
2249
b06df3c2
AD
2250 Define the constructors of symbol_type in
2251 b4_symbol_constructor_definitions.
e51b0a82 2252 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
2253 forthcoming patch will move elsewhere. Hence the interest of
2254 putting them together.
2df9ec37 2255
b06df3c2
AD
2256 The stack_symbol_type does not need to be moved, it is used only
2257 by the parser.
2df9ec37 2258
e51b0a82
AD
2259 * data/lalr1.cc: Move symbol_type and symbol_base_type
2260 constructors into...
2261 (b4_symbol_constructor_definitions): here.
2262 Adjust.
2263
78835571
AD
22642008-11-13 Akim Demaille <demaille@gostai.com>
2265
2266 Make it easier to move the definition of yytranslate_.
2267 Forthcoming changes will make it possible to use yytranslate_
2268 from outside the parser implementation file.
2df9ec37 2269
78835571
AD
2270 * data/lalr1.cc (b4_yytranslate_definition): New.
2271 Use it.
2272
c1e6c88c
AD
22732008-11-13 Akim Demaille <demaille@gostai.com>
2274
2275 Remove useless class specification.
2276 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
2277 to refer to the class name to use a type defined by the class for
2278 arguments of member functions.
2279
4654b0c0
AD
22802008-11-13 Akim Demaille <demaille@gostai.com>
2281
2282 Finer input type for yytranslate.
2283 This patch is debatable: the tradition expects yylex to return an int
2284 which happens to correspond to token_number (which is an enum). This
2285 allows for instance to return characters (such as '*' etc.). But this
2286 goes against the stronger typing I am trying to have with the new
2287 lex interface which return a symbol_type. So in this case, feed
2288 yytranslate_ with a token_type.
2df9ec37 2289
4654b0c0
AD
2290 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
2291 expect a token_type.
2292
dd735e4e
AD
22932008-11-13 Akim Demaille <demaille@gostai.com>
2294
2295 Honor lex-params in %define lex_symbol mode.
2296 * data/lalr1.cc: Use b4_lex_param.
2297
6659366c
AD
22982008-11-13 Akim Demaille <demaille@gostai.com>
2299
2300 Simplify names.
2301 * src/output.c (symbol_definitions_output): Rename symbol
2302 attributes type_name and has_type_name as type and has_type.
2303 * data/lalr1.cc: Adjust uses.
2304
e9805e57
AD
23052008-11-13 Akim Demaille <demaille@gostai.com>
2306
2307 Use b4_type_names for the union type.
b06df3c2
AD
2308 The union used to compute the size of the variant used to iterate
2309 over the type of all the symbols, with a lot of redundancy. Now
2310 iterate over the lists of symbols having the same type-name.
2df9ec37 2311
e9805e57
AD
2312 * data/lalr1.cc (b4_char_sizeof_): New.
2313 (b4_char_sizeof): Use it.
2314 Adjust to be called with a list of numbers instead of a single
2315 number.
2316 Adjust its caller for new-line issues.
2317
aea10ef4
AD
23182008-11-13 Akim Demaille <demaille@gostai.com>
2319
2320 Define the "identifier" of a symbol.
b06df3c2
AD
2321 Symbols may have several string representations, for instance if
2322 they have an alias. What I call its "id" is a string that can be
2323 used as an identifier. May not exist.
2df9ec37 2324
b06df3c2
AD
2325 Currently the symbols which have the "tag_is_id" flag set are
2326 those that don't have an alias. Look harder for the id.
2df9ec37 2327
aea10ef4
AD
2328 * src/output.c (is_identifier): Move to...
2329 * src/symtab.c (is_identifier): here.
2330 * src/symtab.h, src/symtab.c (symbol_id_get): New.
2331 * src/output.c (symbol_definitions_output): Use it to define "id"
2332 and "has_id".
2333 Remove the definition of "tag_is_id".
2334 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
2335 "tag_is_id" were used to produce code.
2336 We still use "tag" for documentation.
2337
2ea7730c
AD
23382008-11-11 Akim Demaille <demaille@gostai.com>
2339
2340 Locations are no longer required by lalr1.cc.
2341 * data/lalr1.cc (_b4_args, b4_args): New.
2342 Adjust all uses of locations to make them optional.
2343 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
2344 (AT_CHECK_NAMESPACE): Check the use of locations.
2345 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
2346 without locations with lalr1.cc.
2347 Test these cases.
2348 * tests/output.at: Check lalr1.cc with and without location
2349 support.
2350 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
2351 Don't use locations.
2352
7ca2266a
AD
23532008-11-11 Akim Demaille <demaille@gostai.com>
2354
2355 AT_FULL_COMPILE.
2356 * tests/local.at (AT_FULL_COMPILE): New.
2357 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
2358
1a7a65f9
AD
23592008-11-11 Akim Demaille <demaille@gostai.com>
2360
2361 Support parens in calc++.
2362 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
2363 * examples/calc++/test (run): Check the expected output.
2364 Adjust callers.
2365 Check parens too.
2366
c944f7f2
AD
23672008-11-11 Akim Demaille <demaille@gostai.com>
2368
2369 Simplify lalr1.cc since %defines is mandatory.
2370 * data/lalr1.cc: Remove useless calls to b4_defines_if.
2371
dada3cd1
AD
23722008-11-11 Akim Demaille <demaille@gostai.com>
2373
2374 TODO: yyfmt.
2375 * TODO (yysyntax_error): New item.
2376
422c18f4
AD
23772008-11-11 Akim Demaille <demaille@gostai.com>
2378
2379 Prefer M4 to CPP.
2380 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
2381 YYERROR_VERBOSE.
2382
a0ffc175
AD
23832008-11-11 Akim Demaille <demaille@gostai.com>
2384
2385 Support i18n of the parse error messages.
2386 * TODO (lalr1.cc/I18n): Remove.
2387 * data/lalr1.cc (yysyntax_error_): Support the translation of the
2388 error messages, as done in yacc.c.
2389 Stay within the yy* pseudo namespace.
2390
00a8a083
AD
23912008-11-11 Akim Demaille <demaille@gostai.com>
2392
2393 More TODO.
2394 * TODO (single stack, yysyntax_error): New.
2395
09277875
AD
23962008-11-11 Akim Demaille <demaille@gostai.com>
2397
2398 Make it possible to return a symbol_type from yylex.
2399 * data/lalr1.cc (b4_lex_symbol_if): New.
2400 (parse): When lex_symbol is defined, expected yylex to return the
2401 complete lookahead.
2402 * etc/bench.pl.in (generate_grammar_list): Extend to support this
2403 yylex interface.
2404 (bench_variant_parser): Exercise it.
2405
64c1b92a
AD
24062008-11-11 Akim Demaille <demaille@gostai.com>
2407
2408 Remove useless bench case.
2409 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
2410 no longer used.
2411
2722aa42
AD
24122008-11-11 Akim Demaille <demaille@gostai.com>
2413
2414 Improve display of directives.
2415 * etc/bench.pl.in (parse_term): Don't add useless eol.
2416
918eb7c5
AD
24172008-11-11 Akim Demaille <demaille@gostai.com>
2418
2419 Use string_cast in the bench.
2420 * etc/bench.pl.in (generate_grammar_list): Define and use
2421 string_cast.
2422
39be9022
AD
24232008-11-11 Akim Demaille <demaille@gostai.com>
2424
2425 Replace yychar with a Boolean.
2426 * data/lalr1.cc (parse::yychar): Replace by...
2427 (parse::yyempty): this.
2428
a2e3fa77
AD
24292008-11-11 Akim Demaille <demaille@gostai.com>
2430
2431 Factor the tables.
2432 * TODO: New item.
2433
aba12ad1
AD
24342008-11-11 Akim Demaille <demaille@gostai.com>
2435
2436 Let yytranslate handle the eof case.
2437 * data/lalr1.cc (yytranslate_): Handle the EOF case.
2438 Adjust callers.
2439 No longer expect yychar to be equal to yyeof_, rather, test the
2440 lookahead's (translated) kind.
2441
27cb5b59
AD
24422008-11-11 Akim Demaille <demaille@gostai.com>
2443
2444 yychar cannot be empty in yyerrlab.
2445 * TODO (yychar == yyempty_): New.
2446 * data/lalr1.cc: Remove the handling of this case.
2447 This eases forthcoming changes related to yychar and yytranslate.
2448
fce629c0
AD
24492008-11-11 Akim Demaille <demaille@gostai.com>
2450
2451 Bench: syntactic sugar for %define/#define.
2452 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
2453 (&bench_push_parser, bench_variant_parser): Use this feature.
2454 (&eat): New.
2455 Use it.
2456
ce671960
AD
24572008-11-11 Akim Demaille <demaille@gostai.com>
2458
2459 Less memory pressure on the "list" bench.
2460 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
2461 the values, to limit memory pressure.
2462
2873fdf8
AD
24632008-11-11 Akim Demaille <demaille@gostai.com>
2464
2465 Introduce make_symbol.
b06df3c2
AD
2466 make_symbol provides a means to construct a full symbol (kind,
2467 value, location) in a single shot. It is meant to be a Symbol
2468 constructor, parameterized by the symbol kind so that overloading
2469 would prevent incorrect kind/value pairs. Unfortunately
2470 parameterized constructors do not work well in C++ (unless the
2471 parameter also appears as an argument, which is not acceptable),
2472 hence the use of a function instead of a constructor.
2df9ec37 2473
2873fdf8
AD
2474 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2475 (b4_symbol_constructor_declarations)
2476 (b4_symbol_constructor_specialization_)
2477 (b4_symbol_constructor_specializations)
2478 (b4_symbol_constructor_definition_)
2479 (b4_symbol_constructor_definitions): New.
2480 Use them where appropriate to generate declaration, declaration of
2481 the specializations, and implementations of the templated
2482 overloaded function "make_symbol".
2483 (variant::variant): Always define a default ctor.
2484 Also provide a copy ctor.
2485 (symbol_base_type, symbol_type): New ctor overloads for value-less
2486 symbols.
2487 (symbol_type): Now public, so that functions such as yylex can use
2488 it.
2489
8be046d7
AD
24902008-11-11 Akim Demaille <demaille@gostai.com>
2491
2492 Inform m4 whether a tag is a valid id.
2493 * src/output.c (is_identifier): New.
2494 (symbol_definitions_output): Use it to define tag_is_id.
2495 But maybe this should be done at m4 level?
2496
de62edee
AD
24972008-11-11 Akim Demaille <demaille@gostai.com>
2498
2499 Test 214 was failing: it greps with a pattern containing [ ]*
2500 which obviously meant to catch spaces and tabs, but contained only
2501 spaces. Tabulations in sources are a nuisance, so to simplify the
2502 matter, get rid of all the tabulations in the Java sources. The
2503 other skeletons will be treated equally later.
2504
2505 * data/java.m4, data/lalr1.java: Untabify.
2506 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
2507 tabulations are no longer generated.
2508
905f0697
PB
25092008-11-11 Paolo Bonzini <bonzini@gnu.org>
2510
2511 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2512 * configure.ac: Adjust usage.
2513 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2514 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2515 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2516
09ccae9b
DJ
25172008-11-10 Di-an Jan <dianj@freeshell.org>
2518
2519 Workaround Java's ``code too large'' problem for parser tables
2520 in most cases, by using one function per initialization.
2521 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
2522 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
2523 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
2524 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
2525 (yytname_): Use b4_typed_parser_table.
2526 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
2527 ``code too large'' error.
2528
1979121c
DJ
25292008-11-10 Di-an Jan <dianj@freeshell.org>
2530
2531 * NEWS: Document them.
de62edee 2532
1979121c
DJ
2533 General Java skeleton improvements.
2534 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
2535 using gcj < 4.3 in the testsuite, according to comments in
2536 gnulib/m4/javacomp.m4.
2537 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
2538 location_type, position_type): Remove extraneous brackets from
2539 b4_percent_define_default.
2540 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
2541 m4_define and m4_define_default.
2542 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
2543 which marks the end of user code with appropriate syncline, like all
2544 the other skeletons.
2545 (b4_user_post_prologue): Add. Don't silently drop.
2546 (yylex): Remove.
2547 (parse): Inline yylex.
2548 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
2549 (%{...%}): Fix typo of %code imports.
2550 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
2551
2552 Support annotations on parser class with %define annotations.
2553 * data/lalr1.java (annotations): Add to parser class modifier.
2554 * doc/bison.texinfo (Java Parser Interface): Document
2555 %define annotations.
2556 (Java Declarations Summary): Document %define annotations.
2557 * tests/java.at (Java parser class modifiers): Test annotations.
2558
2559 Do not generate code for %error-verbose unless requested.
2560 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
2561 Make private. Make conditional on %error-verbose.
2562 (getErrorVerbose, setErrorVerbose): New.
2563 (yytnamerr_): Make conditional on %error-verbose.
2564 (yysyntax_error): Make some code conditional on %error-verbose.
2565 * doc/bison.texinfo (Java Bison Interface): Remove the parts
2566 about %error-verbose having no effect.
2567 (getErrorVerbose, setErrorVerbose): Document.
2568
2569 Move constants for token names to Lexer interface.
2570 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
2571 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
2572 (parse): Qualify EOF to Lexer.EOF.
2573 * doc/bison.texinfo (Java Parser Interface): Move documentation of
2574 EOF and token names to Java Lexer Interface.
2575 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
2576
2577 Make yyerror public.
2578 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
2579 (yyerror): Change to public. Add Javadoc comments. Use longer
2580 parameter names. Make the body rather than the declarator
2581 conditional on %locations.
2582 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
2583
2584 Allow user to add code to the constructor with %code init.
2585 * data/java.m4 (b4_init_throws): New, for %define init_throws.
2586 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
2587 Add %code init to the front of the constructor body.
2588 * doc/bison.texinfo (YYParser.YYParser): Document %code init
2589 and %define init_throws.
2590 (Java Declarations Summary): Document %code init and
2591 %define init_throws.
2592 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
2593 (Java constructor init and init_throws): Add tests.
de62edee 2594
42f832d6
AD
25952008-11-10 Akim Demaille <demaille@gostai.com>
2596
2597 Update TODO.
2598 * TODO (-D): is implemented.
2599 (associativity): Same precedence must have the same associativity.
2600 For instance, how can a * b / c be parsed if * is %left and / is
2601 %right?
2602 (YYERRORCODE, YYFAIL, YYBACKUP): New.
2603
247efe34
AD
26042008-11-10 Akim Demaille <demaille@gostai.com>
2605
2606 Formatting changes.
2607
5d731440
AD
26082008-11-10 Akim Demaille <demaille@gostai.com>
2609
2610 More information about the symbols.
2611 * src/output.c (type_names_output): Document all the symbols,
2612 including those that don't have a type-name.
2613 (symbol_definitions_output): Define "is_token" and
2614 "has_type_name".
2615 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
2616 type-name, now that they are defined too in b4_type_names.
2617
21db118b
AD
26182008-11-10 Akim Demaille <demaille@gostai.com>
2619
2620 Regen.
2621
6ed15cde
AD
26222008-11-10 Akim Demaille <demaille@gostai.com>
2623
2624 Make parser::yytranslate static.
b06df3c2
AD
2625 Small speedup (1%) on the list grammar. And makes yytranslate_
2626 available in non member functions.
de62edee 2627
6ed15cde
AD
2628 * data/lalr1.cc (yytranslate_): Does not need to be a instance
2629 function.
2630
30bb2edc
AD
26312008-11-10 Akim Demaille <demaille@gostai.com>
2632
2633 Avoid trailing spaces.
2634 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
2635 * data/lalr1.cc: Don't indent before rule and symbol actions, as
2636 they can be empty, and anyway this incorrectly indents the first
2637 action.
2638
b3a28fd4
AD
26392008-11-10 Akim Demaille <demaille@gostai.com>
2640
2641 Comment changes.
2642
914202bd
AD
26432008-11-10 Akim Demaille <demaille@gostai.com>
2644
2645 Use "enum" for integral constants.
2646 This is just nicer to read, I observed no speedup.
de62edee 2647
914202bd
AD
2648 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
2649 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
2650 (yyuser_token_number_max_, yyundef_token_): Move into...
2651 (yytranslate_): here.
2652
c17f9a4a
AD
26532008-11-10 Akim Demaille <demaille@gostai.com>
2654
2655 Shortcuts in bench directives.
2656 * etc/bench.pl.in (parse_dirs): New.
2657 Use it.
2658 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
2659 Create the benches in "benches/".
2660
b9855ea5
AD
26612008-11-10 Akim Demaille <demaille@gostai.com>
2662
2663 Formatting changes.
2664 * data/lalr1.cc: here.
2665
6e097787
AD
26662008-11-10 Akim Demaille <demaille@gostai.com>
2667
2668 Adjust verbose message to using emacs.
2669 * etc/bench.pl.in: Inform compilation-mode when we change the
2670 directory.
2671 (generate_grammar_list): Recognize %define "variant" in addition
2672 to %define variant.
2673
4c3cc7da
AD
26742008-11-10 Akim Demaille <demaille@gostai.com>
2675
2676 Classify symbols by type-name.
2677 * src/uniqstr.h (UNIQSTR_CMP): New.
2678 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
2679 (type_names_output): New.
2680 (muscles_output): Use it.
2681 * data/lalr1.cc (b4_symbol_action_): Remove.
2682 (b4_symbol_case_, b4_type_action_): New.
2683 Adjust uses of b4_symbol_action_ to use b4_type_action_.
2684
d69c9694
AD
26852008-11-10 Akim Demaille <demaille@gostai.com>
2686
2687 Change the handling of the symbols in the skeletons.
2688 Before we were using tables which lines were the symbols and which
2689 columns were things like number, tag, type-name etc. It is was
2690 difficult to extend: each time a column was added, all the numbers had
2691 to be updated (you asked for colon $2, not for "tag"). Also, it was
2692 hard to filter these tables when only a subset of the symbols (say the
2693 tokens, or the nterms, or the tokens that have and external number
2694 *and* a type-name) was of interest.
de62edee 2695
d69c9694
AD
2696 Now instead of monolithic tables, we define one macro per cell. For
2697 instance "b4_symbol(0, tag)" is a macro name which contents is
2698 self-decriptive. The macro "b4_symbol" provides easier access to
2699 these cells.
de62edee 2700
d69c9694
AD
2701 * src/output.c (type_names_output): Remove.
2702 (symbol_numbers_output, symbol_definitions_output): New.
2703 (muscles_output): Call them.
2704 (prepare_symbols): Define b4_symbols_number.
2705
5263bea9
AD
27062008-11-10 Akim Demaille <demaille@gostai.com>
2707
2708 --trace=muscles
2709 * src/getargs.h, src/getargs.c (trace_muscle): New.
2710 (trace_types, trace_args): Support it.
2711 * src/output.c (output_skeleton): Use it.
2712
4175f6bb
AD
27132008-11-10 Akim Demaille <demaille@gostai.com>
2714
2715 muscles_output.
2716 * src/output.c (muscles_output): New, extracted from...
2717 (output_skeleton): here.
2718 Adjust.
2719
1de69d6a
AD
27202008-11-10 Akim Demaille <demaille@gostai.com>
2721
2722 Formatting changes.
2723
36db78a7
AD
27242008-11-10 Akim Demaille <demaille@gostai.com>
2725
2726 Update the variant example.
2727 * examples/variant.yy: Formatting changes.
2728 One stage build.
2729
e5eb92e7
AD
27302008-11-10 Akim Demaille <demaille@gostai.com>
2731
2732 Support constructor with an argument.
2733 This improves the "list" bench by 2%.
de62edee 2734
e5eb92e7
AD
2735 * data/lalr1.cc (variant::build): Add an overloaded version with
2736 an argument.
2737 * tests/c++.at (AT_CHECK_VARIANT): Check it.
2738
76307410
AD
27392008-11-10 Akim Demaille <demaille@gostai.com>
2740
2741 Test variants.
2742 * tests/c++.at (AT_CHECK_VARIANTS): New.
2743 Use it with and without %define assert.
2744
d78f0ac9
AD
27452008-11-10 Akim Demaille <demaille@gostai.com>
2746
2747 Add %precedence support.
2748 Unfortunately it is not possible to reuse the %prec directive. This
2749 is because to please POSIX, we do not require to end the rules with a
2750 semicolon. As a result,
de62edee 2751
d78f0ac9 2752 foo: bar %prec baz
de62edee 2753
d78f0ac9
AD
2754 is ambiguous: either a rule which precedence is that of baz, or a rule,
2755 and then a declaration of the precedence of the token baz.
de62edee 2756
d78f0ac9
AD
2757 * doc/bison.texinfo: Document %precedence.
2758 (Precedence Only): New.
2759 * src/assoc.h, src/assoc.c (precedence_assoc): New.
2760 * src/conflicts.c (resolve_sr_conflict): Support it.
2761 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
2762 Parse it.
2763 * tests/calc.at: Use %precedence for NEG.
2764 * tests/conflicts.at (%precedence does not suffice)
2765 (%precedence suffices): New tests.
2766
c85be41a
AD
27672008-11-09 Akim Demaille <demaille@gostai.com>
2768
2769 Make benches in a sub dirs.
2770 * etc/bench.pl.in ($dir): New.
2771 Use it.
2772 Check the use of constructors with an argument.
2773 (bench_variant_parser): Fix.
2774
db65ca1f
AD
27752008-11-09 Akim Demaille <demaille@gostai.com>
2776
2777 fix eof condition
2778
9b0efa5b
AD
27792008-11-09 Akim Demaille <demaille@gostai.com>
2780
2781 Fix --help.
2782
432ac57a
AD
27832008-11-09 Akim Demaille <demaille@gostai.com>
2784
2785 Require the generation of parse-gram.output.
2786 * src/Makefile.am (YACC): Pass --report=all.
2787
deef2a0a
AD
27882008-11-09 Akim Demaille <demaille@gostai.com>
2789
2790 Formatting changes.
2791
df72984a
AD
27922008-11-09 Akim Demaille <demaille@gostai.com>
2793
2794 Update TODO.
2795 * TODO: Remove obsolete items.
2796 Update others.
2797
f10e19fd
AD
27982008-11-09 Akim Demaille <demaille@gostai.com>
2799
2800 Enhance bench.pl.
2801 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
2802 (@token, $grammar, $bench): New.
2803 (generate_grammar_variant): Rename as...
2804 (generate_grammar_list): this.
2805 (generate_grammar): Adjust.
2806 (bench_grammar): Rename as...
2807 (bench): this.
2808 Use it in the various bench-marking routines.
2809 (-b, -g): New options.
2810
5de9c593
AD
28112008-11-09 Akim Demaille <demaille@gostai.com>
2812
2813 Use a static hierarchy for symbols in the C++ parser.
2814 * data/lalr1.cc (symbol_base_type, symbol_type)
2815 (stack_symbol_type): Make it a static hierarchy.
2816 Adjust dependencies.
2817
757f8f98
AD
28182008-11-09 Akim Demaille <demaille@gostai.com>
2819
2820 bench.pl -d, --directive.
2821 * etc/bench.pl.in (@directive): New.
2822 (&bench_grammar): Use it.
2823 (&bench_list_grammar): New, to provide access to the "variant"
2824 grammar.
2825 Use it.
2826 (getopts): Support -d, --directive.
2827
d3be4f6d
AD
28282008-11-09 Akim Demaille <demaille@gostai.com>
2829
2830 Use inline for small operations.
2831 * data/lalr1.cc (symbol_base_type, symbol_type)
2832 (stack_symbol_type): Declare constructor and other operations as
2833 inline.
2834 (yy_destroy_): Inline.
2835
1f7d007b
AD
28362008-11-09 Akim Demaille <demaille@gostai.com>
2837
2838 Introduce a hierarchy for symbols.
2839 * data/lalr1.cc (symbol_base_type, symbol_type): New.
2840 (data_type): Rename as...
2841 (stack_symbol_type): this.
2842 Derive from symbol_base_type.
2843 (yy_symbol_value_print_): Merge into...
2844 (yy_symbol_print_): this.
2845 Rename as...
2846 (yy_print_): this.
2847 (yydestruct_): Rename as...
2848 (yy_destroy_): this.
2849 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
2850 (parser::parse): yyla is now of symbol_type.
2851 Use its type member instead of yytoken.
2852
bc0b0477
AD
28532008-11-09 Akim Demaille <demaille@gostai.com>
2854
2855 Rename data_type and stack_symbol_type.
2856 * data/lalr1.cc (data_type): Rename as...
2857 (stack_symbol_type): this.
2858
57295d14
AD
28592008-11-09 Akim Demaille <demaille@gostai.com>
2860
2861 Handle semantic value and location together.
2862 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
2863 yydata.value and yydata.location.
2864 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
2865 (YY_SYMBOL_PRINT): Now take semantic value and location as a
2866 single arg.
2867 Adjust all callers.
2868 (yydestruct_): New overload for a stack symbol.
2869
e9b0834e
AD
28702008-11-09 Akim Demaille <demaille@gostai.com>
2871
2872 Push a complete symbol, not connected parts.
2873 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
2874 state, value and location.
2875 Adjust callers.
2876
6082531a
AD
28772008-11-09 Akim Demaille <demaille@gostai.com>
2878
2879 Agregate yylval and yylloc.
2880 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
2881 (parser::yyla): this.
2882
33c195cc
AD
28832008-11-09 Akim Demaille <demaille@gostai.com>
2884
2885 Rely on the state stack to display reduction traces.
b06df3c2
AD
2886 To display rhs symbols before a reduction, we used information
2887 about the rule reduced, which required the tables yyrhs and
2888 yyprhs. Now use rely only on the state stack to get the same
2889 information.
de62edee 2890
33c195cc
AD
2891 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
2892 Use them.
2893 (parser::yyrhs_, parser::yyprhs_): Remove.
2894 (parser::yy_reduce_print_): Use the state stack.
2895
e1f93869
AD
28962008-11-09 Akim Demaille <demaille@gostai.com>
2897
2898 Fuse yyval and yyloc into yylhs.
2899 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
2900 yylhs.
2901 (parse): Replace yyval and yyloc with yylhs.value and
2902 yylhs.location.
2903 After a user action, compute yylhs.state earlier.
2904 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
2905 fresh error_token.
2906
2935744b
DJ
29072008-11-09 Di-an Jan <dianj@freeshell.org>
2908
2909 Remove unused variable.
2910 * src/output.c (type_names_output): Remove unused variable sep.
2911
bbf9ca37
PB
29122008-11-09 Paolo Bonzini <bonzini@gnu.org>
2913
2914 Change tests/output.at quoting.
2915 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
2916 expanding arguments.
2917
d9a9b96b
JD
29182008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2919
2920 Don't add a semicolon to actions for %skeleton or %language.
2921 It breaks Java test cases as reported by Akim Demaille.
2922 * src/scan-code.l: Implement.
2923
51365192
JD
29242008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
2925
2926 Clean up %skeleton and %language priority implementation.
2927 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
2928 remove static qualifier because others will soon need to see it.
2929 (language_prio): Likewise.
2930 (getargs): Use command_line_prio rather than 0.
2931 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
2932 enum fields.
2933 (skeleton_prio): Extern it.
2934 (language_prio): Extern it.
2935 * src/parse-gram.y: Use grammar_prio rather than 1.
2936
9380cfd0
AD
29372008-11-07 Akim Demaille <demaille@gostai.com>
2938
2939 Moving push traces into yypush_.
2940 * data/lalr1.cc (yypush_): Now takes a optional trace message.
2941 Adjust all uses.
2942
8901f32e
AD
29432008-11-07 Akim Demaille <demaille@gostai.com>
2944
2945 The single-stack C++ parser is now the standard one.
2946 * data/lalr1.cc: Rename as...
2947 * data/lalr1-split.cc: this.
2948 * data/lalr1-fusion.cc: Rename as...
2949 * data/lalr1.cc: this.
2950 * etc/bench.pl.in: Adjust.
2951
8cdabf02
AD
29522008-11-07 Akim Demaille <demaille@gostai.com>
2953
2954 Avoid empty-if warnings.
2955 Reported by Quentin Hocquet.
de62edee 2956
8cdabf02
AD
2957 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
2958 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
2959
5a893c2b
AD
29602008-11-07 Akim Demaille <demaille@gostai.com>
2961
2962 Pass command line location to skeleton_arg and language_argmatch.
2963 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
2964 The location argument is now mandatory.
2965 Adjust all dependencies.
2966 (getargs): Use command_line_location.
2967
58697c6d
AD
29682008-11-07 Akim Demaille <demaille@gostai.com>
2969
2970 -D, --define.
2971 * src/getargs.c (usage): Document -D.
2972 Fix help string for --locations.
2973 (command_line_location): New.
2974 (short_options, long_options, getargs): Support -D, --define.
2975 (getargs): Move -d support at the right place.
2976 * doc/bison.texinfo (Bison Options): Update.
2977 * tests/input.at (%define, --define): New.
2978
9fe5a457
AD
29792008-11-07 Akim Demaille <demaille@gostai.com>
2980
2981 Initialize the muscle table before parsing the command line.
2982 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
2983 (getargs): Define file_name.
2984 * src/main.c (main): Initialize muscle_tab before calling
2985 getargs.
2986 * src/muscle_tab.c (muscle_init): No longer define file_name, as
2987 its value is not available yet.
2988
56c5eca9
AD
29892008-11-07 Akim Demaille <demaille@gostai.com>
2990
2991 Locations without columns for command line arguments.
2992 * src/location.c (location_print): Don't display negative columns.
2993 * src/location.h: Document this.
2994
9b9e0a7d
AD
29952008-11-07 Akim Demaille <demaille@gostai.com>
2996
2997 Fix --help.
2998 * src/getargs.c (usage): Fix help string for -W.
2999
74eae918
AD
30002008-11-07 Akim Demaille <demaille@gostai.com>
3001
3002 Handle more general types of option arguments.
3003 * build-aux/cross-options.pl: The argument ends at the first
3004 space, not the first non-symbol character.
3005 Use @var for each word appearing the argument description.
3006
a3d4c6fb
AD
30072008-11-07 Akim Demaille <demaille@gostai.com>
3008
3009 Destroy the variants that remain on the stack in case of error.
3010 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3011 destructor.
3012 Display the value only if yymsg is nonnull.
3013 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3014
2d32fc9f
AD
30152008-11-07 Akim Demaille <demaille@gostai.com>
3016
3017 Add "%define assert" to variants.
3018 This is used to help the user catch cases where some value gets
3019 ovewritten by a new one. This should not happen, as this will
3020 probably leak.
de62edee 3021
2d32fc9f
AD
3022 Unfortunately this uncovered a bug in the C++ parser itself: the
3023 lookahead value was not destroyed between two calls to yylex. For
3024 instance if the previous lookahead was a std::string, and then an int,
3025 then the value of the std::string was correctly taken (i.e., the
3026 lookahead was now an empty string), but std::string structure itself
3027 was not reclaimed.
de62edee 3028
2d32fc9f
AD
3029 This is now done in variant::build(other&) (which is used to take the
3030 value of the lookahead): other is not only stolen from its value, it
3031 is also destroyed. This incurs a new performance penalty of a few
3032 percent, and union becomes faster again.
de62edee 3033
2d32fc9f
AD
3034 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
3035 (b4_variant_if): New.
3036 (variant::built): New.
3037 Use it whereever the status of the variant changes.
3038 * etc/bench.pl.in: Check the penalty of %define assert.
3039
f6038cb8
AD
30402008-11-07 Akim Demaille <demaille@gostai.com>
3041
3042 Use "%define variant" in bench.pl.
3043 * etc/bench.pl.in: No longer use the pseudo directive %variants,
3044 just use %define variants.
3045
ccde1f98
AD
30462008-11-07 Akim Demaille <demaille@gostai.com>
3047
3048 Regen.
3049 * src/parse-gram.h, src/parse-gram.c: Regen.
3050
58bd33b7
JD
30512008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3052
3053 Fix user actions without a trailing semicolon.
3054 Reported by Sergei Steshenko at
3055 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3056 * THANKS (Sergei Steshenko): Add.
3057 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3058 * tests/regression.at (Fix user actions without a trailing semicolon):
3059 New test case.
3060
639867b5
AD
30612008-11-04 Akim Demaille <demaille@gostai.com>
3062
3063 Use b4_copyright_years.
3064 * data/yacc.c (b4_copyright_years): New.
3065 Fix its value according to the comments in the file.
3066 Use it and undefine it.
3067
3c262606
AD
30682008-11-04 Akim Demaille <demaille@gostai.com>
3069
3070 Formatting changes.
3071 * data/lalr1-fusion.cc, src/parse-gram.y: here.
3072
a2b93d52
AD
30732008-11-04 Akim Demaille <demaille@gostai.com>
3074
3075 Formatting changes.
3076 * data/lalr1-fusion.cc: here.
3077
3a2803df
AD
30782008-11-04 Akim Demaille <demaille@gostai.com>
3079
3080 Use strict on bench.pl.
3081 * etc/bench.pl.in (&run, &generate_grammar): New.
3082 Rename the grammar generating functions for consistency.
3083 Change the interface so that the list of benches to run is passed
3084 as (optionless) arguments.
3085 (&compile): Use &run.
3086
a0d4650a
AD
30872008-11-04 Akim Demaille <demaille@gostai.com>
3088
3089 Remove spurious initial empty lines.
3090 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
3091 * data/yacc.c: End the @output lines with an @.
3092
cac9e09b
AD
30932008-11-04 Akim Demaille <demaille@gostai.com>
3094
3095 Improve the display of sizes.
3096 * etc/bench.p.in: Higher precision.
3097 Sort by decreasing size.
3098
4af4348a
AD
30992008-11-04 Akim Demaille <demaille@gostai.com>
3100
3101 Don't memcpy C++ structures.
3102 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
3103 arguments.
3104 (variant::build): New overload for
3105 copy-construction-that-destroys.
3106 (variant::swap): New.
3107 (parser::yypush_): Use it in variant mode.
3108
ef05c4d6
AD
31092008-11-04 Akim Demaille <demaille@gostai.com>
3110
3111 Better defaults for bench.pl.
3112 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
3113 default values.
3114 Adjust &verbose uses.
3115 (-q, --quiet): New.
3116
9718cfa9
AD
31172008-11-04 Akim Demaille <demaille@gostai.com>
3118
3119 Make variant.yy more complex.
3120 std::list cannot be copied via memcpy, they are more demanding than
3121 std::string. Use one std::list to strengthen the test.
de62edee 3122
9718cfa9
AD
3123 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
3124 Adjust.
3125 Create a list of strings, instead of a single large string.
3126
a6df593d
AD
31272008-11-04 Akim Demaille <demaille@gostai.com>
3128
3129 bench.pl --bench.
3130 * etc/bench.pl.in (--bench, $bench): New.
3131
006a0303
AD
31322008-11-04 Akim Demaille <demaille@gostai.com>
3133
3134 Sort methods.
3135 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
3136 Define it after as().
3137
faef3466
AD
31382008-11-04 Akim Demaille <demaille@gostai.com>
3139
3140 Useless parens.
3141 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
3142
2141aded
AD
31432008-11-04 Akim Demaille <demaille@gostai.com>
3144
3145 Issue missing synclines after user actions.
3146 * data/c.m4 (b4_case): Issue synclines on the output file.
3147
e426d17b
AD
31482008-11-04 Akim Demaille <demaille@gostai.com>
3149
3150 Remove trailing empty line.
3151 * data/lalr1-fusion.cc: Don't add an empty line after the user's
3152 epilogue.
3153
a9ce3f54
AD
31542008-11-04 Akim Demaille <demaille@gostai.com>
3155
3156 Fix output of copyright years.
3157 * data/bison.m4 (b4_copyright): Fix the indentation of the
3158 copyright year paragraph.
3159 Use b4_copyright_years when no years are given.
3160 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
3161 (b4_copyright_years): New.
3162 Use it.
3163
59c544c2
AD
31642008-11-04 Akim Demaille <demaille@gostai.com>
3165
3166 Avoid the spurious initial empty line.
3167 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
3168 the end of @output request to suppress the empty line that
3169 results.
3170
96b15448
AD
31712008-11-04 Akim Demaille <demaille@gostai.com>
3172
3173 Remove parser::rhs_number_type.
3174 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
3175 (yyrhs_): Use b4_table_define.
3176
f0633174
AD
31772008-11-04 Akim Demaille <demaille@gostai.com>
3178
3179 Fix iteration type.
3180 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
3181
417b8004
AD
31822008-11-04 Akim Demaille <demaille@gostai.com>
3183
3184 Factor the declaration of the integer tables.
3185 * data/lalr1-fusion.cc (b4_table_define): New.
3186 Use it.
3187
1a5246c6
AD
31882008-11-03 Akim Demaille <demaille@gostai.com>
3189
3190 Fix indentation of tables in lalr1.cc
3191 * data/lalr1-fusion.cc: Fix the indentation.
3192
f8a95c9c
AD
31932008-11-03 Akim Demaille <demaille@gostai.com>
3194
3195 Destroy the lhs symbols after reduction.
3196 * data/lalr1-fusion.cc (parse): After the user action, when in
3197 variant mode, destroy the lhs symbols.
3198
d7f4d823
AD
31992008-11-03 Akim Demaille <demaille@gostai.com>
3200
3201 Simplify yysyntax_error_ use.
3202 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
3203 type, but make it unnamed in the declaration when it is not used.
3204
8b9c89fb
AD
32052008-11-03 Akim Demaille <demaille@gostai.com>
3206
3207 Let yy::variant::build return an lvalue.
3208 * data/lalr1-fusion.cc (variant::build): Return a reference to the
3209 object.
3210
83243c24
AD
32112008-11-03 Akim Demaille <demaille@gostai.com>
3212
3213 Define yy::variant only when needed.
3214 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
3215 used.
3216
429b4848
AD
32172008-11-03 Akim Demaille <demaille@gostai.com>
3218
3219 Bench the three-stack lalr1.cc.
3220 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
3221 one-stack one.
3222
414c76a4
AD
32232008-11-03 Akim Demaille <demaille@gostai.com>
3224
3225 Fail on parse error in calc++.
3226 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
3227 status.
3228 * examples/calc++/test ($me, $number, $exit, run): New.
3229 Use them to propagate errors to the exit status.
3230
8a5783fd
AD
32312008-11-03 Akim Demaille <demaille@gostai.com>
3232
3233 Don't specify the skeleton twice in the example.
3234 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
3235 file does what is needed.
3236
0cc5bead
AD
32372008-11-03 Akim Demaille <demaille@gostai.com>
3238
3239 bench: Improve output.
3240 * etc/bench.pl.in (bench_grammar): Tune the printf format.
3241
5b421a4e
AD
32422008-11-03 Akim Demaille <demaille@gostai.com>
3243
3244 bench: check impact of %debug on variants.
3245 * etc/bench.pl.in (variant_grammar): Fix the computation of
3246 $variant.
3247 Generate a grammar file that can work with or without %debug.
3248 Do use the @directive.
3249 (bench_variant_parser): Check impact of %debug.
3250 (@directives): Rename all the occurrences to...
3251 (@directive): this, for consistency.
3252
d11ee647
AD
32532008-11-03 Akim Demaille <demaille@gostai.com>
3254
3255 bench: report the size too.
3256 * etc/bench.pl.in ($iterations): Defaults to -3.
3257 (&bench_grammar): Require hireswallclock.
3258 Compute and display the size of the result.
3259 More comments.
3260
e1b74b92
AD
32612008-11-03 Akim Demaille <demaille@gostai.com>
3262
3263 bench: More use of the verbosity level.
3264 * etc/bench.pl.in ($verbose, &verbose): New.
3265 Use them.
3266 More POD documentation.
3267
7e5f9c54
AD
32682008-11-03 Akim Demaille <demaille@gostai.com>
3269
3270 bench.pl: a command line interface
3271 * etc/bench.pl.in: More doc.
3272 Some fixes in the documentation.
3273 ($cflags, $iterations, &help, &getopt): New.
3274 Use them.
3275 (&variant_grammar): Let the number of stages be 10 times what is
3276 specified.
3277
7109a18d
AD
32782008-11-03 Akim Demaille <demaille@gostai.com>
3279
3280 Bench the use of Boost.Variants.
3281 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
3282 New.
3283 (&compile): Be ready to compile C++ parsers.
3284 (&bench_push_parser): Move debug information to the outermost
3285 level.
3286 * THANKS: Add Michiel De Wilde.
3287
922730fe
AD
32882008-11-03 Akim Demaille <demaille@gostai.com>
3289
3290 bench.pl: Pass directives as a list instead of as a string.
3291 * etc/bench.pl.in (&directives): New.
3292 (&triangular_grammar, &calc_grammar): Use it to format the Bison
3293 directives.
3294 (&triangular_grammar): Do use the directives (were ignored).
3295 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
3296 directives.
3297
7484f1d4
AD
32982008-11-03 Akim Demaille <demaille@gostai.com>
3299
3300 Improve genericity of bench.pl.
3301 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
3302 argument.
3303 (&bench_push_parser): New.
3304 Call it.
3305
15129f25
AD
33062008-11-03 Akim Demaille <demaille@gostai.com>
3307
3308 Add documentation to bench.pl.
3309 * etc/bench.pl.in: Comment changes.
3310
0e0ed236
AD
33112008-11-03 Akim Demaille <demaille@gostai.com>
3312
3313 Fuse the three stacks into a single one.
de62edee 3314
b06df3c2
AD
3315 In order to make it easy to perform benchmarks to ensure that
3316 there are no performance loss, lalr1.cc is forked into
3317 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
3318 lalr1.cc.
3319
3320 Meanwhile, to make sure that lalr1-fusion.cc is correctly
3321 exercized by the test suite, the user must install a symbolic link
3322 from lalr1.cc to it.
de62edee 3323
b06df3c2
AD
3324 Instead of having three stacks (state, value, location), use a
3325 stack of triples. This considerably simplifies the code (and it
3326 will be easier not to require locations as currently does the C++
3327 parser), and also gives a 10% speedup according to
3328 etc/bench (probably mainly since memory allocation is done once
3329 instead of three times).
de62edee 3330
0e0ed236
AD
3331 Another motivation is to make it easier to destruct properly
3332 semantic values: now that they are bound to their state (hence
3333 symbol type) it will be easier to call the appropriate destructor.
de62edee 3334
0e0ed236 3335 These changes should probably benefit the C parser too.
de62edee 3336
b06df3c2
AD
3337 * data/lalr1.cc: Copy as...
3338 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
3339 (b4_rhs_value, b4_rhs_location): New definitions overriding those
3340 from c++.m4.
3341 (state_stack_type, semantic_stack_type, location_stack_type)
3342 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
3343 (data_type, stack_type, yystack_): New.
3344 (YYLLOC_DEFAULT, yypush_): Adjust.
3345 (yyerror_range): Now based on data_type, not location_type.
3346
7dedf26e
AD
33472008-11-03 Akim Demaille <demaille@gostai.com>
3348
3349 Push the state, value, and location at the same time.
3350 This is needed to prepare a forthcoming patch that fuses the three
3351 stacks into one.
de62edee 3352
7dedf26e
AD
3353 * data/lalr1.cc (parser::yypush_): New.
3354 (parser::yynewstate): Change the semantics: instead of arriving to
3355 this label when value and location have been pushed, but yystate
3356 is to be pushed on the state stack, now the three of them must
3357 have been pushed before. yystate still must be the new state.
3358 This allows to use yypush_ everywhere instead of individual
3359 handling of the stacks.
3360
c4585f1e
AD
33612008-11-03 Akim Demaille <demaille@gostai.com>
3362
3363 Prefer references to pointers.
3364 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
3365 definition to use references instead of pointers.
3366 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
3367 Take the value and location as references.
3368 Adjust callers.
3369
56017c17
AD
33702008-11-03 Akim Demaille <demaille@gostai.com>
3371
3372 stack::size instead of stack::height.
3373 * data/lalr1.cc (stack::height): Rename as...
3374 (stack::size): this.
3375 Fix the output type.
3376 Comment changes.
3377
5ab8c47b
AD
33782008-11-03 Akim Demaille <demaille@gostai.com>
3379
3380 Use variants to support objects as semantic values.
b06df3c2
AD
3381 This patch was inspired by work by Michiel De Wilde. But he used
3382 Boost variants which (i) requires Boost on the user side, (ii) is
3383 slow, and (iii) has useless overhead (the parser knows the type of
3384 the semantic value there is no reason to duplicate this
3385 information as Boost.Variants do).
3386
3387 This implementation reserves a buffer large enough to store the
3388 largest objects. yy::variant implements this buffer. It was
3389 implemented with Quentin Hocquet.
de62edee 3390
5ab8c47b
AD
3391 * src/output.c (type_names_output): New.
3392 (output_skeleton): Invoke it.
3393 * data/c++.m4 (b4_variant_if): New.
3394 (b4_symbol_value): If needed, provide a definition for variants.
3395 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
3396 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
3397 (b4_char_sizeof, yy::variant): New.
3398 (parser::parse): If variants are requested, define
3399 parser::union_type, parser::variant, change the definition of
3400 semantic_type, construct $$ before running the user action instead
3401 of performing a default $$ = $1.
3402 * examples/variant.yy: New.
3403 Based on an example by Michiel De Wilde.
3404
1fa5d8bb
AD
34052008-11-03 Akim Demaille <demaille@gostai.com>
3406
3407 Parameterize the extraction of semantic values.
3408 To make future changes easier, no longer rely on ".TYPE" being the
3409 way to get a semantic value.
de62edee 3410
1fa5d8bb
AD
3411 * data/c.m4 (b4_symbol_value): New.
3412 Use it.
3413 * data/c++.m4, data/yacc.c: Use it.
3414 * data/glr.c: Use b4_symbol_value.
3415 (b4_rhs_data): New.
3416 Use it.
3417
91ba8a55
AD
34182008-11-03 Akim Demaille <demaille@gostai.com>
3419
3420 Prepare easier M4 changes.
3421 * data/lalr1.cc: Use escaped [] instead of literals to prepare
3422 future changes.
3423
c9ba9e59
JD
34242008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3425
3426 Initiate further development.
3427 * NEWS: Create an empty section for new entries.
3428 * gnulib: Update submodule to HEAD.
3429
bfb40910
JD
34302008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3431
3432 * NEWS: Version 2.4.
3433
241fda7a
JD
34342008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3435
3436 Prepare for next release.
3437 * NEWS: Briefly mention changes since 2.3b.
3438 * README: Say GNU m4 1.4.6, which we've been requiring in release
3439 announcements already, not 1.4.3, which breaks the build.
3440
ed4d67dc
JD
34412008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3442
3443 Say %language is experimental.
3444 We're thinking of extending it's effect on output file naming. See the
3445 thread at
3446 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
3447 * NEWS: Say it's experimental.
3448 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
3449 recommend it over %skeleton for now.
3450 (Bison Options): Likewise.
3451 (C++ Bison Interface): Use %skeleton not %language.
3452 (Calc++ Parser): Use %skeleton not %language.
3453 * src/getargs.c (usage): Say it's experimental.
3454
e254a580
DJ
34552008-11-01 Di-an Jan <dianj@freeshell.org>
3456 Paolo Bonzini <bonzini@gnu.org>
3457
3458 Support all Java parser class modifiers.
3459 * data/java.m4 (b4_percent_define_get3): New.
3460 (b4_final_if, b4_strictfp_if): New.
3461 * data/lalr1.java (final, strictfp, extends, implements): Support.
3462 * doc/bison.texinfo (final, strictfp, extends, implements): Add
3463 documentation.
3464 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
3465 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
3466 (AT_CHECK_JAVA_GREP): New.
3467 (Java parser class modifiers): New test.
3468 (Java parser class extends and implements): New test.
3469
3470 Model exception propagation better with throws and lex_throws.
3471 * data/java.m4 (b4_list2): New.
3472 (throws): Change default.
3473 * data/lalr1.java (yyaction): Add throws.
3474 (parse): Add lex_throws in addition to throws.
3475 * doc/bison.texinfo (throws, lex_throws): Add documentation.
3476 * tests/java.at (Java throws specifications): New test.
3477
3478 Improve documentation for Java parsers.
3479 * doc/bison.texinfo (Java Parsers): Add subsections.
3480 Don't quote first argument of %define.
3481 (Java Bison Interface): Document output files. Move documentation
3482 of parser class and merge into Java Parser Interface. Document
3483 features that error out. Document directives with no effect.
3484 Move note about Javadoc higher.
3485 (Java Semantic Values): Explicitly mention stype.
3486 Document that generic types cannot be used.
3487 (Java Location Values): Use @deftypeivar. Document constructors.
3488 Correct return value for toString.
3489 (Java Parser Interface): List undocumented constants/fields.
3490 Move documentation of fields added by %parse-param closer to list
3491 of members. Document that token names are added as fields.
3492 Document constructors accurately. Remove error method.
3493 (Java Scanner Interface): Move note on %pure-parser to Java Bison
3494 Interface. Describe %code lexer and yylex accutately.
3495 Remove documentation that does not match the code.
3496 (Java Action Features): New.
3497 (Java Differences): Add reference. Add item on semantic values.
3498 Add note about @{ ... @}. Clarify %% epilogue placement.
3499 (Java Declarations Summary): New.
3500
3501 Fix Java skeleton.
3502 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
3503 (b4_remove_comma): Quote test argument.
3504 (b4_identification): Remove "bison" field.
3505 * tests/java.at (Java parser class and package names): New test.
3506 (Java %parse-param and %lex-param): New test.
3507 (Java stype, position_class and location_class): New test.
3508
f259e4e6
PB
35092008-10-31 Di-an Jan <dianj@freeshell.org>
3510
3511 * data/lalr1.jave: Update copyright years.
3512 (YYParser): Correct name of "generated from" file in Javadoc:
3513 use b4_file_name instead of @ofile@.
3514 (Location constructor): Correct Javadoc parameter name.
3515 (yylloc): Add missing opening m4 quote after b4_location_if.
3516 This removes a stray [ in the Javadoc of Lexer.getStartPos.
3517 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
3518 (YYParser constructor): Correct Javadoc parameter name.
3519
cae5057f
JD
35202008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
3521
3522 Always put auxiliary code files in the same dir as other output files.
3523 * src/files.c (compute_file_name_parts): When the user specifies
3524 --output but not --file-prefix, extract the directory prefix from the
3525 file prefix not from the grammar file name. This affects the location
3526 of files like location.hh generated by the C++ skeleton. The includes
3527 in the other output files require this fix.
3528 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
3529 for expected output files.
3530 (Output files): Add a test for the above.
3531
4af432ba
JD
35322008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
3533
3534 * gnulib: Update submodule to HEAD.
3535
e26d4e43
JD
35362008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3537
3538 Update copyright year.
3539 * src/files.c: Here.
3540
c0ee9e21
DJ
35412008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
3542
3543 Don't overwrite the input file.
3544 * src/files.c (output_file_name_check): Fatal error if using input file
3545 for output.
3546 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
3547 argument.
3548 (Conflicting output files): Add test.
3549
482dc52f
AD
35502008-10-28 Akim Demaille <demaille@gostai.com>
3551
3552 Space changes.
3553 * data/lalr1.cc: Formatting changes.
3554
52cbbe84
AD
35552008-10-28 Akim Demaille <demaille@gostai.com>
3556
3557 Don't define debugging functions when !YYDEBUG.
3558 * data/lalr1.cc (debug_stream, set_debug_stream)
3559 (debug_level_type, debug_level, set_debug_level): Don't
3560 declare them when YYDEBUG is not defined.
3561 The implementation are already YYDEBUG-aware.
3562
0925d5bf
AD
35632008-10-28 Akim Demaille <demaille@gostai.com>
3564
3565 Prefer "continue" for empty loop bodies.
3566 * etc/bench.pl.in: Use "continue" instead of {}.
3567
cf98343c
AD
35682008-10-28 Akim Demaille <demaille@gostai.com>
3569
3570 Space and comments changes.
3571 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3572 * data/c.m4, data/lalr1.cc: Space changes.
3573
9f467b7d
AD
35742008-10-28 Akim Demaille <demaille@gostai.com>
3575
3576 Make gnulib a submodule.
3577 * gnulib: New.
3578 * .gitmodules (gnulib): New.
3579
0f0e1ace
JD
35802008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3581
3582 Fix yyerror_range for user-defined location type in C++. Reported by
3583 Georg Sauthoff at
3584 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3585 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3586 * THANKS (Georg Sauthoff): Add.
3587
548e2104
JD
35882008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3589
3590 Update several administrative files mainly to facilitate releasing.
3591 * HACKING (Administrivia): Make the git-merge-changelog notes more
3592 helpful.
3593 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3594 (Release Procedure): Update for git and add numerous details that were
3595 previously missing.
3596 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3597 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3598 that announcements don't claim we bootstrapped with whatever bison
3599 happened to be in PATH. Add flex as a bootstrap tool.
3600 * Makefile.maint: Remove, previously replaced by maint.mk.
3601 * Makefile.cfg: Remove, and migrate settings to...
3602 * cfg.mk: ... here for the sake of `make announcement'.
3603 * bootstrap.conf (gnulib_modules): Add announce-gen.
3604 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3605 Berry.
3606
ddf17a6e
PB
36072008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3608
3609 Small but important bugfixes for the Java skeleton.
3610 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3611 (yy_symbol_print): Call toString on yyvaluep.
3612
e1145ad8
AD
36132008-08-29 Akim Demaille <demaille@gostai.com>
3614
3615 Clarify UPDATED use.
215b40ac 3616 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 3617 not to the release date of Bison.
215b40ac 3618 Reported by Joel E. Denny.
e1145ad8 3619
0df72d78
AD
36202008-08-29 Akim Demaille <demaille@gostai.com>
3621
3622 * README: Update FAQ pointer.
3623 Reported by Joel E. Denny.
3624
9a90b6bb
EB
36252008-08-27 Eric Blake <ebb9@byu.net>
3626
3627 Resync m4sugar from autoconf.
3628 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3629 (m4_init): Adjust to latest m4.git changes.
3630 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3631 effects.
3632 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3633 (_m4_list_cmp): Reduce side effects.
3634
65015668
AD
36352008-08-27 Akim Demaille <demaille@gostai.com>
3636
3637 Check yyerrok in calc.at.
215b40ac
EB
3638 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3639 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3640 expected.
65015668 3641
98e26a92
AD
36422008-08-27 Akim Demaille <demaille@gostai.com>
3643
3644 Support yyerrok in lalr1.cc.
3645 YYBACKUP is still to import back into lalr1.cc.
215b40ac 3646 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 3647
86c0e784
JD
36482008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3649
3650 For maintainer-check*, don't recompile for a $(VERSION) update.
3651 * cfg.mk: New file.
3652 (_is-dist-target): Override the one in GNUmakefile.
3653 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3654
88511166
JD
36552008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3656
3657 Update for recent change to gnulib.
3658 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3659 string.h now.
3660
6bbb2ed5
EB
36612008-08-15 Eric Blake <ebb9@byu.net>
3662
d67c52e8
EB
3663 Remaining m4sugar merge from autoconf.
3664 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3665 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3666 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3667 * src/output.c (output_skeleton): Tell m4 how to find it.
3668
6bbb2ed5
EB
3669 Partial m4sugar merge from autoconf: m4_map.
3670 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3671 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3672 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3673 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3674 for empty list.
3675 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3676 Likewise.
3677 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3678 declares it.
3679
8dce3875
JD
36802008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3681
3682 Keep .version and PACKAGE_VERSION in sync.
3683 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3684 dependency, and add comments justifying this in more detail. Discussed
3685 starting at
3686 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3687
882a1fbf
EB
36882008-08-06 Eric Blake <ebb9@byu.net>
3689
a3764451
EB
3690 Partial m4sugar merge from autoconf: m4_shiftn.
3691 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3692 (m4_shift2, m4_shift3): New macros.
3693 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3694 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3695 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3696 * data/java.m4 (b4_remove_comma): Likewise.
3697
882a1fbf
EB
3698 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3699 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3700 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3701 (m4_init): Consolidate wrapped text into single m4_wrap.
3702 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3703 in wrapped text.
3704
a30e920d
EB
37052008-08-05 Eric Blake <ebb9@byu.net>
3706
dfcc5959
EB
3707 Partial m4sugar merge from autoconf: builtins, version.m4.
3708 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3709 (m4_prepend): Remove, as it is unused and inherently quadratic,
3710 whereas m4_append is linear in newer m4.
3711 (m4_mkstemp): New builtin.
3712 (m4_symbols): Make rename conditional.
3713 (m4_version_prereq): Ensure fatal error if used in bison, which
3714 intentionally lacks version.m4.
3715
a30e920d
EB
3716 Fix comments in m4sugar.
3717 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3718
445b7470
JD
37192008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3720
3721 Update for recent .gitignore fix in Gnulib.
3722 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3723 anchored .gitignore entries.
3724
a1e50014
JD
37252008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3726
3727 Set gnu or gnits strictness.
3728 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3729 development and gnits strictness for releases. Based on Eric Blake's
3730 suggestion at
3731 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3732
d43f77e7
PB
37332008-07-31 Paolo Bonzini <bonzini@gnu.org>
3734
3735 * NEWS: Clarify documentation of %language.
3736
fee2ed87
PB
37372008-07-31 Paolo Bonzini <bonzini@gnu.org>
3738
3739 Support usage of git-merge-changelog.
3740 * .gitattributes: New.
3741 * HACKING: Document usage of git-merge-changelog.
3742 * bootstrap: Install git-merge-changelog entries in .git/config
3743 if appropriate.
3744
78029cd5
JD
37452008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3746
3747 Remove remaining dependence on CVS Id keyword.
3748 * ChangeLog: For the sake of people still using CVS, don't use dollars
3749 when mentioning Id.
3750 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3751 unusual anyway.
3752 * data/xslt/xml2dot.xsl: Likewise.
3753 * data/xslt/xml2text.xsl: Likewise.
3754 * data/xslt/xml2xhtml.xsl: Likewise.
3755 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3756 * doc/Makefile.am (neutralize): Remove, no longer needed.
3757 (.x.1): Don't use neutralize.
3758 (edit): Don't substitute for ID.
3759 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3760
c53d18b1
JD
37612008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3762
3763 Fix dependence on computed configure variables.
3764 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3765 $(top_srcdir)/configure.ac so that changes to computed variables, such
3766 as PACKAGE_VERSION, are seen.
3767 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3768
5523ac79
JD
37692008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3770
3771 Update copyright dates for recent changes.
3772 * Makefile.am: Here.
3773 * src/Makefile.am: Here.
3774 * src/reduce.c: Here.
3775 * tests/reduce.at: Here.
3776
8fa36911
JD
37772008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3778
3779 Use git-version-gen for version names between releases.
3780 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3781 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3782 * .prev-version: New.
3783 * .version.in: Remove.
78029cd5 3784 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
3785 revision.
3786 * GNUmakefile: Remove, now copied from Gnulib.
3787 * Makefile.am: Add code suggested by comments in
3788 build-aux/git-version-gen.
3789 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3790 .prev-version, and .version.
3791 * NEWS (2.3b+): Rename to...
3792 (?.?): ... this because we're dropping the "+" version naming scheme,
3793 but, in general, we still can't be sure of our next release name.
3794 * bootstrap: Add a quick hack to remove from .gitignore the
3795 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3796 entry. This should really be fixed in gnulib instead.
3797 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3798 * configure.ac (AC_INIT): Set version name by invoking
3799 build-aux/git-version-gen.
3800 (AC_CONFIG_FILES): Remove .version, now generated by
3801 build-aux/git-version-gen.
3802 * maint.mk: New, copied from coreutils.
3803 * doc/.cvsignore (bison.1): Add.
3804 * doc/.gitignore (/bison.1): Add.
3805 * doc/bison.1: Remove, generated.
3806 * src/.cvsignore (revision.c): Remove.
3807 * src/.gitignore (/revision.c): Remove.
3808 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3809 (BUILT_SOURCES): Remove revision.c.
3810 (revision.c): Remove.
3811 * src/getargs.c (version): Don't print revision after the VERSION.
3812 * src/revision.h: Remove.
3813
bcf07cb7
JD
38142008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3815
3816 Fix untranslatable composition of sentences. Reported by Goran
3817 Uddeborg at
3818 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3819 * THANKS (Goran Uddeborg): Add.
3820 * src/reduce.c (reduce_print): Report the number of nonterminals and
3821 rules useless in the grammar in separate sentences.
3822 * tests/reduce.at (Useless Rules): Update output.
3823 (Reduced Automaton): Likewise.
3824 (Underivable Rules): Likewise.
3825 (Empty Language): Likewise.
3826
9aacab9a
JD
38272008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3828
3829 Fix some .gitignore and .cvsignore problems.
3830 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3831 (insert_vc_ignore): ... this new function, which prepends `/' to all
3832 .gitignore entries before passing them to insert_sorted_if_absent.
3833 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3834 .cvsignore files are maintained even though Bison developers run
3835 bootstrap while using Git.
3836 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3837 unneeded by Bison.
3838 (gnulib): Add.
3839 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3840 unneeded. Reported by Eric Blake.
3841 * lib/.gitignore (/*~): Add.
3842 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3843 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3844 Blake.
3845 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3846
a9fc7990
JD
38472008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3848
3849 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3850 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3851 * bootstrap.conf (gnulib_modules): Add unsetenv.
3852 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3853 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3854 (/setenv.m4): Add.
3855 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3856 the first argument because it may become position-dependent, and unset
3857 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3858 Add comments explaining these issues in more detail.
3859
0f1d6f10
JD
38602008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3861
3862 Add .gitignore everywhere based on .cvsignore.
3863 * .gitignore: New.
3864 * build-aux/.gitignore: New.
3865 * data/.gitignore: New.
3866 * doc/.gitignore: New.
3867 * etc/.gitignore: New.
3868 * examples/.gitignore: New.
3869 * examples/calc++/.gitignore: New.
3870 * lib/.gitignore: New.
3871 * m4/.gitignore: New.
3872 * po/.gitignore: New.
3873 * runtime-po/.gitignore: New.
3874 * src/.gitignore: New.
3875 * tests/.gitignore: New.
3876
7bd1665a
JD
38772008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3878
3879 * NEWS (2.3b+): New section, empty for now.
3880 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3881
72c5b982
JD
38822008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3883
3884 * NEWS (2.3b): Update release date since there has been a delay in
3885 getting the announcements and tarballs out.
3886
bd02cd5d
JD
38872008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3888
3889 * NEWS: Version 2.3b.
3890 * configure.ac (AC_INIT): Likewise.
3891 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3892
9126263e
JD
38932008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3894
3895 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
3896 been doing it for years.
3897 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
3898 (Release Procedure): Add FIXME about make alpha being unmaintained.
3899
fa6aa7b3
JD
39002008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
3901
3902 * data/yacc.c: Reformat m4 a little for readability.
3903 * src/lalr.c (build_relations): Correct comment.
3904
d30b312d
JMG
39052008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3906
3907 DJGPP specific issue.
3908 * djgpp/config.sed: Fixes required to run configure scripts generated
3909 by autoconf 2.62.
3910
138d4cd9
JD
39112008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
3912
3913 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
3914 coordinator@translationproject.org.
3915
8f7e2e1f
JD
39162008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3917
3918 * THANKS: Add Eric Blake.
3919
f55efa38
JD
39202008-04-23 Eric Blake <ebb9@byu.net>
3921
3922 Revert prior patch, by working around autoconf regression.
3923 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
3924 ("Output file name: ("): Uncomment test.
3925 ("Output file name: )"): Likewise.
3926 Based on an idea from Noah Misch.
3927
096c9f9d
JD
39282008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3929
3930 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
3931 2.61. Reported by Juan Manuel Guerrero at
3932 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
3933 * tests/output.at ("Output file name: ("): Comment out test case for
3934 now.
3935 ("Output file name: )"): Likewise.
3936
0f664b89
JD
39372008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3938
3939 * GNUmakefile: Update git-version-gen invocation so make dist
3940 succeeds.
3941
1cfe6375
JD
39422008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
3943
3944 Update to the current gnulib CVS repository, and fix trigraph handling
3945 in Bison.
3946 * bootstrap: Update gnulib CVS repository URL.
3947 (symlink_to_dir): Encapsulate the code that guarantees the destination
3948 directory exists into...
3949 (check_dst_dir): ... this new function, and...
3950 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
3951 fail when copying files into lib/uniwidth/.
3952 * src/output.c (prepare_symbols): When writing yytname muscles, where
3953 symbol names will be encoded in C-string literals, tell quotearg to
3954 escape trigraphs. This used to be the default in gnulib.
3955 * tests/regression.at (Token definitions): Because of the change in
3956 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
3957 escapes trigraphs in symbol names. Thus, yytname no longer has
3958 trigraphs unnecessarily doubly escaped. Update test case output.
3959 Extend test case to be sure Bison's own error messages will no longer
3960 have trigraphs in symbol names unnecessarily escaped once.
3961
74c52fc8
JD
39622008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
3963
3964 Fix make dist infinite loop reported by Juan Manuel Guerrero at
3965 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
3966 * .cvsignore: Add .version.
3967 * .version.in: New.
3968 * bootstrap.conf (gnulib_modules): Add git-version-gen.
3969 * configure.ac (AC_CONFIG_FILES): Add .version.
3970 * build-aux/.cvsignore: Add git-version-gen.
3971
8e55b3aa
JD
39722008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
3973
3974 * NEWS (2.3a+): Mention that -g now takes an argument.
3975 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
3976 consistency. Update the -g and -x entries now that they take
3977 arguments. Use brackets to indicate optional arguments.
3978 * src/getargs.c (usage): Explain the relationship between arguments of
3979 long and short options more completely. Document --defines and -d
3980 separately since the former takes an argument but, for POSIX Yacc, the
3981 latter does not.
3982 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 3983 (getargs): Sort cases.
8e55b3aa 3984
59c5ac72
AD
39852008-02-28 Akim Demaille <demaille@gostai.com>
3986
3987 * doc/bison.texinfo: Fix a few typos.
3988
118d4978
AD
39892008-02-28 Akim Demaille <akim@epita.fr>
3990
3991 * doc/bison.texinfo (Bison Options): Document -W.
3992 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
3993
7020f1e9
AD
39942008-02-28 Akim Demaille <akim@epita.fr>
3995
3996 * src/getargs.c (short_options): Split and sort for readability.
3997 -g and -x take optional arguments, just like their long options.
3998 * build-aux/cross-options.pl: Use /x to make the regexp easier to
3999 understand.
4000 Fix the handling of $opt which resulted in all the argument to be
4001 considered as optional.
4002
59da312b
JD
40032008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4004
4005 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4006 say its interface is experimental.
4007 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4008 Java.
4009 (Bison Options): In the -L and --language entry, mention Java.
4010 (Java Bison Interface): Say the interface is experimental.
4011 * src/getargs.c (usage): Mention -L and --language.
4012
4013 * NEWS (2.3a+): Say the push parsing interface is experimental.
4014 * doc/bison.texinfo (Push Decl): Likewise.
4015 (Decl Summary): Likewise in the "%define api.push_pull" entry.
4016 (Push Parser Function): Likewise.
4017 (Pull Parser Function): Likewise.
4018 (Parser Create Function): Likewise.
4019 (Parser Delete Function): Likewise.
4020 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
4021 yypull_parse, and yypush_parse entries.
4022
4023 * NEWS (2.3a+): Mention XML support, and say the schema is
4024 experimental.
4025 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
4026 * src/getargs.c (usage): Say the XML schema is experimental.
4027
4028 * NEWS (2.3a+): Say option instead of flag.
4029
2bb3ebec
WP
40302008-02-21 Wojciech Polak <polak@gnu.org>
4031
4032 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
4033 text.
4034
333e670c
JD
40352008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
4036
4037 Fix impure push parser compile error reported by Bob Rossi at
4038 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
4039 * data/yacc.c: Clean up whitespace in the output a little.
4040 (yypstate_allocated): Define for impure push parsers regardless of
4041 whether the pull interface is also requested.
4042 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
4043 check impure push parsers without the pull interface.
4044
4045 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
4046 yyerror takes arguments specified by %parse-param while yypstate_new
4047 does not.
4048 * doc/bison.texinfo (Parser Create Function): Document that
4049 yypstate_new returns 0 for multiple impure parser instances.
4050 * tests/push.at (Push Parsing: Multiple impure instances): Update
4051 expected stderr output.
4052
798096e1
JD
40532008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4054
4055 * runtime-po/POTFILES.in (push.c): Remove.
4056
9ca7f077
JD
40572008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4058
4059 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
4060 * data/push.c: Rename to...
4061 * data/yacc.c: ... this, overwriting it.
4062 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
4063 `%push-pull-parser' -> `%define api.push_pull "both"'.
4064 Remove old yacc.c tests, and update push.c tests to yacc.c.
4065
42ee26bb
JD
40662008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4067
4068 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
4069 `"%code top" blocks' instead of `%code "top" blocks'.
4070 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
4071 Clean up whitespace in the output a little.
4072
b1cc23c4
JD
40732008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4074
4075 Fix documentation problems reported by Tim Josling at
4076 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
4077 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
4078 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
4079 integers. Explain the effect of literal string aliases on error
4080 messages. Copy token 0 documentation from the C++ skeleton
4081 documentation.
4082
ab7f29f8
JD
40832008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4084
4085 Accept a token number in a %left, %right, or %nonassoc for POSIX
4086 conformance. Reported by Tim Josling at
4087 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
4088 * NEWS (2.3a+): Mention.
4089 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
4090 and code numbers are treated by precedence declarations.
4091 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
4092 of symbols.1.
4093 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
4094 of symbol.
4095 (symbol.prec): New, just like symbol but allows INT.
4096 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
4097 longer holds.
4098 * tests/regression.at (Token number in precedence declaration): New
4099 test case.
4100
a924ef36
JMG
41012008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4102
4103 DJGPP specific issues.
4104 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
4105 be changed. Copyright timestamp adjusted.
4106 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
4107 be changed. Copyright timestamp adjusted.
4108 * djgpp/config.site: Copyright timestamp adjusted.
4109 * djgpp/config_h.sed: Copyright timestamp adjusted.
4110 * djgpp/djunpack.bat: Copyright timestamp adjusted.
4111 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
4112 filename translation list.
4113 * djgpp/subpipe.c (init_subpipe): Check the environment variables
4114 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
4115 files shall be created. Before trying to use the temp dir where the
4116 environment variable points to check that the dir really exists. If
4117 not default to the cwd as temp dir. Copyright timestamp adjusted.
4118 * djgpp/subpipe.h: Copyright timestamp adjusted.
4119 * djgpp/testsuite.sed: Copyright timestamp adjusted.
4120
389c8cfd
PE
41212008-01-30 Paul Eggert <eggert@cs.ucla.edu>
4122
4123 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
4124
5d1cfef4
PE
41252008-01-09 Paul Eggert <eggert@cs.ucla.edu>
4126
4127 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
4128 Problem reported by Claudio Saavedra in
4129 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
4130
e2dcf996
WP
41312008-01-05 Wojciech Polak <polak@gnu.org>
4132
4133 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
4134 document's title with the input grammar file name.
4135
da730230
JD
41362007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
4137
4138 Automate regression testing of the XML/XSLT implementation. Discussed
4139 starting at
4140 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
4141 * configure.ac (XSLTPROC): New substitution.
4142 * Makefile.am (maintainer-xml-check): New phony target invoking...
4143 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
4144 invoking make maintainer-check with BISON_TEST_XML=1.
4145 * tests/atlocal.in (XSLTPROC): New.
4146 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
4147 not to report reachable memory when Bison is expected to have a
4148 non-zero exit status and (2) to compare XML/XSLT output with --graph
4149 and --report=all output for every working grammar when
4150 BISON_TEST_XML=1.
4151 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
4152 (AT_BISON_CHECK_XML): New.
4153 (AT_QUELL_VALGRIND): New.
4154 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
4155 (AT_CHECK): ... don't redefine this since this was the old way to
4156 quell Valgrind.
4157 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
4158 AT_BISON_CHECK invocations.
4159 * tests/c++.at: Likewise.
4160 * tests/calc.at: Likewise.
4161 * tests/conflicts.at: Likewise.
4162 * tests/cxx-type.at: Likewise.
4163 * tests/existing.at: Likewise.
4164 * tests/glr-regression.at: Likewise.
4165 * tests/headers.at: Likewise.
4166 * tests/input.at: Likewise.
4167 * tests/java.at: Likewise.
4168 * tests/output.at: Likewise.
4169 * tests/push.at: Likewise.
4170 * tests/reduce.at: Likewise.
4171 * tests/regression.at: Likewise.
4172 * tests/sets.at: Likewise.
4173 * tests/skeletons.at: Likewise.
4174 * tests/synclines.at: Likewise.
4175 * tests/torture.at: Likewise.
4176 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
4177 tends to hang xsltproc.
4178 (Big horizontal): Likewise.
4179
408476bc
JD
41802007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4181
4182 In XML output, remove redundant class attribute on symbol element.
4183 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
4184 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
4185 look up a symbol to determine whether it's a nonterminal or terminal.
4186 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
4187 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
4188
4189 Add prec/assoc information to XML output.
4190 * src/gram.c (grammar_rules_print_xml): For each rule that has a
4191 %prec, add a percent_prec attribute.
4192 * src/print-xml.c (print_grammar): For each terminal that has a
4193 precedence or associativity, add a prec or assoc attribute.
4194 (xml_indent): New.
4195 (xml_puts): Use xml_indent.
4196 (xml_printf): Use xml_indent.
4197 * src/print-xml.h (xml_indent): Prototype.
4198
4199 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
4200 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
4201
d4a26c48
JD
42022007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4203
4204 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
4205 (bison:ruleByNumber): ... this for clarity.
4206 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
4207 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
4208 (xsl:template match="reduction"): Update.
4209 (xsl:template match="item"): Update.
4210 (xsl:template match="reduction"): Update.
4211
4212 In the XML output, don't print the list of rules where symbols appear.
4213 Compute it in XSLT instead. Discussed at
4214 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
4215 * data/xslt/bison.xsl (bison:ruleByLhs): New.
4216 (bison:ruleByRhs): New.
4217 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
4218 bison:ruleByRhs.
4219 (xsl:template match="terminal/rule"): Remove.
4220 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4221 bison:ruleByRhs.
4222 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4223 Remove.
4224 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
4225 bison:ruleByRhs and mode="number-link" for rule template.
4226 (xsl:template match="terminal/rule"): Remove.
4227 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4228 bison:ruleByRhs and mode="number-link" for rule template.
4229 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4230 Rewrite as...
4231 (xsl:template match="rule" mode="number-link"): ... this.
4232 * src/print-xml.c (print_grammar): Don't print the list of rules.
4233
ef1b4273
JD
42342007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4235
4236 Don't let --report affect XML output; always print all information.
4237 Discussed at
4238 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
4239 * src/conflicts.c (log_resolution): Implement.
4240 * src/print-xml.c (print_core): Implement.
4241 (print_state): Implement.
4242 (print_xml): Implement.
4243
4244 * NEWS (2.3a+): Fix quotes.
4245 * src/parse-gram.y (prologue_declaration): For consistency with -v,
4246 don't let %verbose clear the list specified by --report.
4247
0f6cd9e3
AD
42482007-11-26 Akim Demaille <akim@epita.fr>
4249
4250 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
4251
d80fb37a
JD
42522007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
4253
4254 In the XML output, list useless and unused symbols and rules with the
4255 useful ones and add a "usefulness" attribute. Discussed starting at
4256 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
4257 * src/gram.c (grammar_rules_partial_print_xml): Remove.
4258 (grammar_rules_print_xml): Print all rules instead of just those
4259 useful in the grammar, and add a "usefulness" attribute.
4260 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
4261 * src/print-xml.c (print_rules_useless_in_parser): Remove.
4262 (print_grammar): Print all nonterminals instead of just useful ones,
4263 and add a "usefulness" attribute to nonterminals and terminals.
4264 (print_xml): Don't print a separate "reductions" or
4265 "rules-useless-in-parser" element.
4266 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
4267 (reduce_xml): Remove.
4268 (reduce_token_unused_in_grammar): New.
4269 (reduce_nonterminal_useless_in_grammar): New.
4270 * src/reduce.h (reduce_xml): Remove prototype.
4271 (reduce_token_unused_in_grammar): Add prototype.
4272 (reduce_nonterminal_useless_in_grammar): Add prototype.
4273 * data/xslt/xml2text.xsl: Update for XML changes.
4274 * data/xslt/xml2xhtml.xsl: Update for XML changes.
4275 * tests/reduce.at (Useless Terminals): Update output.
4276 (Useless Rules): Update output.
4277 (Reduced Automaton): Update output.
4278
4279 Say "Terminals unused in grammar" instead of "Unused terminals".
4280 * NEWS (2.3a+): Update.
4281 * doc/bison.texinfo (Understanding): Update example output.
4282 * src/reduce.c (reduce_output): Implement.
4283 * data/xslt/xml2text.xsl: Implement.
4284 * data/xslt/xml2xhtml.xsl: Implement.
4285
1bb2bd75
JD
42862007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
4287
4288 Accept --report-file=FILE to override the default `.output' filename.
4289 * NEWS (2.3a+): Mention.
4290 * doc/bison.texinfo (Bison Options): Add an entry.
4291 * src/files.c (compute_output_file_names): Don't override
4292 spec_verbose_file if already set.
4293 * src/getargs.c (usage): Document --report-file.
4294 (REPORT_FILE_OPTION): New anonymous enum member.
4295 (long_options): Add entry for it.
4296 (getargs): Add case for it setting spec_verbose_file.
4297
4298 * build-aux/cross-options.pl: Don't record a short option just because
4299 there's an arg.
4300 * doc/.cvsignore: Add yacc.1.
4301
a005a9c4
AD
43022007-11-14 Akim Demaille <akim@epita.fr>
4303
4304 * doc/yacc.1.in: New.
4305 * configure.ac, doc/Makefile.am: Adjust.
4306 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
4307 config.h symbol.
4308 Use AC_SUBST for assignments too.
4309 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
4310
cff03fb2
JD
43112007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4312
4313 * src/gram.c: Remove comments that duplicate comments in gram.h.
4314
4315 When reporting useless rules and nonterminals, say "useless in grammar"
4316 instead of "useless", and say "useless in parser" instead of "never
4317 reduced". Discussed starting at
4318 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
4319 * NEWS (2.3a+): Mention this change.
4320 * data/xslt/xml2text.xsl: Update output text and expected input XML
4321 element names to match changes below.
4322 * data/xslt/xml2xhtml.xsl: Likewise.
4323 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4324 Contents: "Rules useless in parser due to conflicts".
4325 * doc/bison.texinfo (Decl Summary): Reword a little.
4326 (Understanding): Update example output for changes below.
4327 * src/gram.c: (rule_useful_p): Rename to...
4328 (rule_useful_in_grammar_p): ... this.
4329 (rule_useless_p): Rename to...
4330 (rule_useless_in_grammar_p): ... this.
4331 (rule_never_reduced_p): Rename to...
4332 (rule_useless_in_parser_p): ... this.
4333 (grammar_rules_print): Update for renames.
4334 (grammar_rules_print_xml): Update for renames.
4335 (grammar_rules_never_reduced_report): Rename to...
4336 (grammar_rules_useless_report): ... this since it is used for either
4337 kind of useless rule.
4338 * src/gram.h: Reword comments and update function names in prototypes.
4339 * src/main.c (main): Say "rule useless in parser due to conflicts".
4340 * src/print-xml.c (print_rules_never_reduced): Rename to...
4341 (print_rules_useless_in_parser): ... this, and rename output XML
4342 element "rules-never-reduced" to "rules-useless-in-parser".
4343 (print_xml): Update for rename.
4344 * src/print.c (print_results): Say "Rules useless in parser due to
4345 conflicts".
4346 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4347 (nonterminals_reduce): Say "nonterminal useless in grammar".
4348 (reduce_output): Say "Nonterminals useless in grammar".
4349 Say "Rules useless in grammar".
4350 (reduce_xml): Rename output XML element "useless" to
4351 "useless-in-grammar".
4352 (reduce_print): Don't report the count of grammatically useless rules
4353 as "rules never reduced" just because %yacc is specified.
4354 In the correct report of this count, say nonterminal(s) and rule(s)
4355 "useless in grammar".
4356 * tests/conflicts.at (S/R in initial): Update expected output.
4357 (Defaulted Conflicted Reduction): Likewise.
4358 (Unreachable States After Conflict Resolution): Likewise.
4359 * tests/existing.at (GNU pic Grammar): Likewise.
4360 * tests/reduce.at (Useless Nonterminals): Likewise.
4361 (Useless Rules): Likewise.
4362 (Reduced Automaton): Likewise.
4363 (Underivable Rules): Likewise.
4364 (Empty Language): Likewise.
4365
66f0441d
JD
43662007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4367
4368 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4369 here document and before the EOF so that BSD's implementation of Bourne
4370 shell doesn't parse the delimiter as part of the here document.
4371 * doc/.cvsignore: Add cross-options.texi.
4372 * src/getargs.c (usage): Add a blank line after the warning categories.
4373
d0ee4105
PB
43742007-11-08 Paolo Bonzini <bonzini@gnu.org>
4375
4376 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4377
e8b1fb9b
AD
43782007-11-05 Akim Demaille <akim@epita.fr>
4379
4380 Remove Id: from bison.1.
4381 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4382 (perl -0777 -pi -e 's/\.PP\nId): New.
4383 (.x.1): Use it to ignore the version control revision.
4384
2f7a96b5
AD
43852007-11-05 Akim Demaille <demaille@gostai.com>
4386
4387 * build-aux/Makefile.am: Ship cross-options.pl.
4388 * doc/Makefile.am: Always refer to cross-options.texi with
4389 $(srcdir).
4390 (MAINTAINERCLEANFILES): Add it.
4391
f4101aa6
AD
43922007-11-04 Akim Demaille <demaille@gostai.com>
4393
4394 Generate the long/short option cross-table.
4395 * build-aux/cross-options.pl: New.
4396 * doc/Makefile.am (cross-options.texi): New.
4397 * doc/bison.texinfo: Use it.
4398
727a1401
AD
43992007-11-04 Akim Demaille <demaille@gostai.com>
4400
4401 Generate bison.1 using help2man.
4402 * doc/common.x, doc/bison.x: New.
4403 * doc/Makefile.am (bison.1, .x.1): New.
4404 The code is taken from autoconf-2.61/man/Makefile.am.
4405 * configure.ac: Look for help2man.
4406
6aeb9c57
AD
44072007-11-04 Akim Demaille <demaille@gostai.com>
4408
4409 Complete --help.
4410 * src/getargs.c (usage): Document -W, make it clear that -d,
4411 -g and -x have optional arguments.
4412
d7be4085
AD
44132007-11-04 Akim Demaille <demaille@gostai.com>
4414
4415 Find sha1sum when named gsha1sum.
4416 * bootstrap (find_tool): New.
4417 ($SHA1SUM): New.
4418
d9df47b6
JD
44192007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4420
4421 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
4422 at
4423 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
4424 * NEWS (2.3a+): Mention.
4425 * data/bison.m4 (b4_pure_if): Don't define it here.
4426 * data/c.m4 (b4_identification): Depend on individual skeletons to
4427 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
4428 values of the %define variables api.pure or api.push_pull. Define
4429 YYPURE, YYPUSH, and YYPULL accordingly.
4430 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
4431 glr.cc has already defined b4_pure_flag.
4432 * data/push.c: Define b4_pure_if based on `%define api.pure'.
4433 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 4434 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
4435 * doc/bison.texinfo (Pure Decl): Update.
4436 (Push Decl): Update.
4437 (Decl Summary): Add api.pure to %define entry.
4438 In %pure-parser entry, say it's deprecated and reference %define.
4439 (Pure Calling): Update.
4440 (Error Reporting): Update.
4441 (C++ Scanner Interface): Update.
4442 (How Can I Reset the Parser): Update.
4443 (Table of Symbols): In %pure-parser entry, say it's deprecated and
4444 reference %define.
4445 * src/getargs.c (pure_parser): Remove global variable.
4446 * src/getargs.h (pure_parser): Remove extern.
4447 * src/output.c (prepare): Don't define pure_flag muscle.
4448 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
4449 wrapper around `%define api.pure'.
4450 * tests/calc.at (Simple LALR Calculator): Update.
4451 (Simple GLR Calculator): Update.
4452 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
4453 Update.
4454 (GLR: Resolve ambiguity, pure, locations): Update.
4455 (GLR: Merge conflicting parses, pure, no locations): Update.
4456 (GLR: Merge conflicting parses, pure, locations): Update.
4457 * tests/glr-regression.at (Uninitialized location when reporting
4458 ambiguity): Update
4459 * tests/input.at (Unused %define api.pure): New test case.
4460 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
4461 AT_PURE_IF and AT_PURE_AND_LOC_IF.
4462 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4463
c373bf8b
JD
44642007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4465
4466 %define push_pull -> %define api.push_pull. Discussed starting at
4467 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
4468 * data/push.c: Expect the new name.
4469 * data/yacc.c: Likewise.
4470 * doc/bison.texinfo (Push Decl): Update.
4471 (Decl Summary): Update %define entry.
4472 (Push Parser Function): Update.
4473 (Pull Parser Function): Update.
4474 (Parser Create Function): Update.
4475 (Parser Delete Function): Update.
4476 * tests/calc.at (Simple LALR Calculator): Update.
4477 * tests/input.at (%define enum variables): Update.
4478 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4479 (Push Parsing: Multiple impure instances): Update.
4480 (Push Parsing: Unsupported Skeletons): Update.
4481 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
4482 (Exploding the Stack Size with Malloc): Update.
4483
4484 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
4485 other entries some.
4486
32f19b6b
JD
44872007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
4488
4489 For the XML output's terminal element, rename @number to @token-number,
4490 and add @symbol-number. In the nonterminal element, rename @number to
4491 @symbol-number. Discussed starting at
4492 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
4493 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
4494 renames.
4495 (xsl:template match="nonterminal"): Likewise.
4496 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
4497 (xsl:template match="nonterminal"): Likewise.
4498 * src/print-xml.c (print_grammar): Implement.
4499
255a6b90
JD
45002007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4501
4502 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4503 2007-10-11 change, the child elements here are items not rules.
408476bc 4504 (xsl:template match="item"): New.
255a6b90
JD
4505 (xsl:template match="rule"): Update for new reduced itemset.
4506 (xsl:template match="point"): Remove.
4507 (xsl:template match="empty"): For consistency with --graph, don't
4508 output "/* empty */".
4509 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
4510 line-wrap, don't pass a negative value as first-line-length since this
4511 won't work with the following changes.
4512 (xsl:template name="line-wrap"): Simplify slightly.
4513 (xsl:template name="ws-search"): Eliminate recursion.
4514 * src/print_graph.c (print_core): Don't print a reduction's lookahead
4515 set next to an item whose dot is not at the end of the RHS even if it
4516 happens to be associated with the same rule.
4517
88c78747
JD
45182007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4519
31984206
JD
4520 Add %define lr.keep_unreachable_states.
4521 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
4522 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
4523 * src/main.c (main): Implement it.
4524 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4525 Extend to test it, and fix a typo.
4526
45272007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4528
4529 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
4530 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
4531 the example .output text.
4532 * tests/regression.at (Extra lookahead sets in report): Improve wording
4533 of comments.
4534
b7a70162
WP
45352007-10-17 Wojciech Polak <polak@gnu.org>
4536
4537 * src/print-xml.c (print_grammar): Renamed
4538 <terminal> and <nonterminal> attributes:
4539 "type" to "number" and "symbol" to "name".
4540 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
4541 Use new attribute names.
4542 (xsl:template match="nonterminal"): Likewise.
4543 * data/xslt/xml2xhtml.xsl: Likewise.
4544
a0de5091
JD
45452007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
4546
4547 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
4548 (Option Cross Key): Likewise.
4549
4550 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
4551 next to an item whose dot is not at the end of the RHS even if it
4552 happens to be associated with the same rule.
4553 * src/print.c (print_core): Likewise.
4554 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4555 (Resolved SR Conflicts): Update output.
4556 * tests/regression.at (Extra lookahead sets in report): New test case.
4557
4c20d18d
WP
45582007-10-11 Wojciech Polak <polak@gnu.org>
4559
4560 * src/print-xml.c (print_core): Remove item set
4561 redundancy.
4562 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4563 Improve processing time. Suggested by Joel E. Denny.
4564 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4565 Write xsl:param "required" attribute as comment.
4566 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4567 (xsl:template match="rule"): Support new reduced itemset.
4568 (xsl:template match="point"): Remove.
4569 * data/xslt/xml2xhtml.xsl: Likewise.
4570
f506ad1c
JD
45712007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4572
4573 * src/getargs.c (version): Update copyright year.
4574
21f1b063
JD
45752007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4576
4577 Make xml2dot.xsl and --graph produce the same output.
4578 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
4579 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4580 escaped later.
4581 (xsl:template name="output-node"): Use the new escape template instead
4582 of the string-replace template directly.
4583 (xsl:template name="output-edge"): Likewise.
4584 (xsl:template name="escape"): New, escapes backslashes and newlines in
4585 addition to quotation marks.
4586 * src/graphviz.c (start_graph, output_node, output_edge): Add
4587 whitespace to output for legibility.
4588
4589 Make xml2text.xsl and --report produce the same output, and remove the
4590 XML "conflicts" element since a conflict summary is easily extracted
4591 from the automaton.
4592 * data/xslt/bison.xsl: New.
4593 (xsl:template match="state" mode="bison:count-conflicts): New.
4594 * data/xslt/xml2text.xsl: Import bison.xsl.
4595 (xsl:template match="bison-xml-report"): Instead of styling the
4596 "conflicts" element, style the "automaton" element with mode
4597 "conflicts". Unlike the former, the latter lists S/R and R/R
4598 conflicts for a state on the same line.
4599 (xsl:template match="conflicts"): Remove.
4600 (xsl:template match="conflict"): Remove.
4601 (xsl:template match="terminal"): Line-wrap the list of rules in which
4602 the terminal is used.
4603 (xsl:template match="nonterminal"): Likewise for nonterminals.
4604 (xsl:template match="automaton" mode="conflicts"): New.
4605 (xsl:template match="state" mode="conflicts"): New.
4606 (xsl:template name="line-wrap"): New.
4607 (xsl:template name="ws-search"): New.
4608 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4609 (xsl:template match="bison-xml-report"): Instead of styling the
4610 "conflicts" element, style the "automaton" element with mode
4611 "conflicts."
4612 (xsl:template match="conflicts"): Remove.
4613 (xsl:template match="conflict"): Remove.
4614 (xsl:template match="automaton" mode="conflicts"): New.
4615 (xsl:template match="state" mode="conflicts): New.
4616 * src/conflicts.c (conflicts_output_xml): Remove.
4617 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4618 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4619 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4620 the corresponding XSLT is easier. Also, never wrap between a word and
4621 the comma that follows it.
4622
793fbca5
JD
46232007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4624
4625 Improve C++ namespace support. Discussed starting at
4626 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4627 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4628 b4_namespace_close): New macros that interpret the %define variable
4629 "namespace" so its value can contain "::" to indicate nested
4630 namespaces.
4631 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4632 the above macros.
4633 * data/lalr1.cc (b4_namespace): Likewise.
4634 * data/location.cc (b4_namespace): Likewise.
4635 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4636 inside a new table in the general %define entry. Document `%define
4637 namespace' there as well. Point the %name-prefix entry to it since it
4638 explains it more completely in the case of C++.
4639 (C++ Bison Interface): Mention `%define namespace' instead of
4640 %name-prefix.
4641 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4642 entry suffices.
4643 * tests/c++.at (Relative namespace references): New test case.
4644 (Absolute namespace references): New test case.
4645 (Syntactically invalid namespace references): New test case.
4646 * tests/input.at (C++ namespace reference errors): New test case.
4647
35b8730d
JD
46482007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4649
4650 Add syncline support and location accessor to internal %define
4651 interfaces.
4652 * data/bison.m4 (b4_percent_define_get_loc): New.
4653 (b4_percent_define_get_syncline): New.
4654 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4655 (b4_percent_define_default): Record defining location as line 1 rather
4656 than 0 for the sake of synchronizing #line's, and define
4657 b4_percent_define_syncline(VARIABLE).
4658 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4659 * src/muscle_tab.c (muscle_syncline_grow): New.
4660 (muscle_code_grow): Use muscle_syncline_grow.
4661 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4662 define b4_percent_define_syncline(VARIABLE).
4663 (muscle_percent_define_get_loc): New.
4664 (muscle_percent_define_get_syncline): New.
4665 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4666 remove some unused variables.
4667 (muscle_percent_define_default): Record defining location as line 1
4668 rather than 0 for the sake of synchronizing #line's, and define
4669 b4_percent_define_syncline(VARIABLE).
4670 (muscle_percent_define_check_values): Use
4671 muscle_percent_define_get_loc.
4672 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4673 (muscle_percent_define_get_syncline): Prototype.
4674 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4675 defaults): Update output for location change.
4676 (Complaining during macro argument expansion): Extend to test
4677 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4678
7dc4a694
JD
46792007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4680
4681 Fix some error-reporting macro bugs.
4682 * data/bison.m4 (b4_cat): New.
4683 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4684 to stdout so they don't become arguments to other macros. Update
4685 comments and add examples.
4686 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4687 add examples.
4688 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4689 after printing the error directive so that M4 doesn't report subsequent
4690 problems that are induced by this problem.
4691 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4692 instead of just in them. Recognize @\n in both places. Both expand to
4693 the empty string. Needed by b4_cat.
4694 * tests/skeletons.at (Complaining during macro argument expansion):
4695 New test case.
4696 (Fatal errors make M4 exit immediately): New test case.
4697
d4bd2295
JD
46982007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4699
4700 Implement --print-datadir.
4701 * src/getargs.c (usage): Mention.
4702 (PRINT_DATADIR_OPTION): New anonymous enum member.
4703 (long_options): Add entry for it.
4704 (getargs): Add case for it calling compute_pkgdatadir.
4705 * src/output.c (output_skeleton): Encapsulate data directory
4706 computation from here...
4707 (prepare): ... and from here...
4708 (compute_pkgdatadir): ... into this new function.
4709 * src/output.h (compute_pkgdatadir): Prototype.
4710
34cdeddf
JD
47112007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4712
4713 * src/print-xml.c (escape_bufs): New static global variable
4714 replacing...
4715 (xml_escape_n): ... the static local variable buf here.
4716 (print_xml): Free memory for escape_bufs.
4717 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4718
d782395d
JD
47192007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4720
4721 Replace `%push-parser' and `%push-pull-parser' with
4722 `%define push_pull "push"' and `%define push_pull "both"'.
4723 `%define push_pull "pull"' is the default.
4724 * doc/bison.texinfo (Push Decl, Push Parser Function,
4725 Pull Parser Function, Parser Create Function, Parser Delete Function):
4726 Update declarations.
4727 (Decl Summary, Table of Symbols): Replace %push-parser and
4728 %push-pull-parser entries with a %define push_pull entry.
4729 * data/bison.m4 (b4_percent_define_check_values): New macro.
4730 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4731 definitions...
4732 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4733 definitions...
4734 * data/push.c: ... to here and compute them from the value of the
4735 %define variable push_pull.
4736 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4737 parsing requests here...
4738 * data/yacc.c: ... hack this to switch to push.c any time
4739 b4_use_push_pull_flag or the %define variable push_pull is set. This
4740 will go away when we mv push.c yacc.c.
4741 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4742 push parsing is not supported since unused %define variables are
4743 reported anyway.
4744 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4745 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4746 comments for consistency with b4_percent_define_check_values.
4747 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4748 muscles.
4749 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4750 Remove.
4751 (prologue_declaration): Remove %push-parser and %push-pull-parser
4752 rules.
4753 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4754 * tests/calc.at: Update declarations.
4755 * tests/input.at (%define enum variables): New test case.
4756 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4757 declaration.
4758 (Push Parsing: Multiple impure instances): Update declaration.
4759 (Push Parsing: Unsupported Skeletons): New test case.
4760 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4761 declaration.
4762 (Exploding the Stack Size with Malloc): Update declaration.
4763
3f999f78
WP
47642007-09-24 Wojciech Polak <polak@gnu.org>
4765
4766 Add XSLT transformations.
4767
4768 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4769 * data/xslt/xml2text.xsl: Transform XML into plain text.
4770 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4771 * data/Makefile.am (xsltdir): New variable.
4772 (dist_xslt_DATA): Add xslt/*.xsl files.
4773
a4f75309
PE
47742007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4775
4776 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4777 Problem reported by Wojciech Polak.
4778 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4779 (xml_printf): Undo change I made on 21 September; that is,
4780 indent 2 spaces, not 1.
4781
ad5feac4
JD
47822007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4783
4784 Pacify ./configure --enable-gcc-warnings.
4785 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4786 `char const *' instead of `char *'.
4787 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4788 local variable `sep'.
4789
41d7a5f2
PE
47902007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4791
4792 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4793 elsewhere.
4794 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4795 (xml_printf): Indent just 1 space for level.
4796 (e_char, xlate_char): Remove.
4797 (xml_escape_string): Rewrite to avoid undefined behavior (used
4798 storage that was freed from the stack).
4799 (xml_escape_n): Don't bother checking for subscript error.
4800
3f999f78
WP
48012007-09-21 Wojciech Polak <polak@gnu.org>
4802
4803 Add Bison XML Automaton Report.
41d7a5f2
PE
4804
4805 Add support for an -x option to generate an XML report.
4806 It is not documented yet.
4807 * src/print-xml.c: New file.
4808 * src/print-xml.h: Likewise.
4809 * lib/timevar.def (TV_XML): New var.
4810 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4811 * src/conflicts.c: Include print-xml.h.
4812 (solved_conflicts_xml_obstack): New var.
4813 (log_resolution, conflicts_solve, conflicts_free):
4814 Add support for XML report.
4815 (conflicts_output_val): New function.
4816 * src/conflicts.h (conflicts_output_val): New decl.
4817 * src/files.c (spec_xml_file): New var.
4818 (compute_output_file_names, output_file_names_free): Add XML support.
4819 * src/files.h (spec_xml_file): New decl.
4820 * src/getargs.c (xml_flag): New var.
4821 (usage, short_options, long_options, getargs): Add XML support.
4822 * src/getargs.h (xml_flag): New decl.
4823 * src/gram.c: Include print-xml.h.
4824 (rule_lhs_print_xml, rule_rhs_print_xml):
4825 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4826 New functions.
4827 * src/gram.h: Declare external ones.
4828 * src/main.c: Include print-xml.h.
4829 (main): Add XML support.
4830 * src/reduce.c: Include print-xml.h.
4831 (reduce_xml): New function.
4832 * src/reduce.h: Declare it.
4833 * src/state.c: Include print-xml.h.
4834 (state_new): Add XML support.
4835 (state_rule_lookahead_tokens_print_xml): New function.
4836 * src/state.h: Declare it.
4837 (struct state): New member solved_conflicts_xml.
4838 * src/symtab.c (symbol_class_get_string): New function.
4839 * src/symtab.h: Declare it.
4840
6d8e724d
PE
48412007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4842
4843 * GNUmakefile: Switch to coreutils's version.
4844 * bootstrap: Likewise.
4845 * Makefile.cfg: Adjust to new GNUmakefile.
4846 * README-hacking: Likewise.
4847
4848 Import from gnulib:
4849
4850 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4851 Bruno Haible <bruno@clisp.org>
4852
4853 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4854 and is a script that invokes bison. Tighten the code. Add comments.
4855
922bdd7f
JD
48562007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4857
4858 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4859 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4860 * doc/bison.texinfo (Decl Summary): Fix.
4861 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4862 * tests/input.at (Boolean %define variables): Update output.
4863 * tests/skeletons.at (%define boolean variables: invalid skeleton
4864 defaults): Rename to...
4865 (%define Boolean variables: invalid skeleton defaults): ... this and
4866 update output.
4867
1b17b01d
JD
48682007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4869
4870 In impure push mode, don't allow more than one yypstate to be allocated
4871 since multiple impure parsers would corrupt yynerrs.
4872 * data/push.c (yypstate_allocated): New static global variable
4873 initialized to 0.
4874 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4875 exhaustion if yypstate_allocated is 1, but still return 2.
4876 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4877 already 1. Otherwise, set it to 1.
4878 (yypstate_delete): Set it to 0.
4879 * tests/push.at (Push Parsing: Multiple impure instances): New test
4880 case.
4881
9987d1b3
JD
48822007-08-17 Bob Rossi <bob@brasko.net>
4883
4884 * doc/bison.texinfo (Push Decl): Document the push parser.
4885 (Table of Symbols): Ditto.
4886 (Pure Decl): Ditto.
4887 (Decl Summary): Ditto.
4888 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4889 Parser Create Function, Parser Delete Function):
4890 Add new push parser symbols.
4891 (Table of Symbols): Document push-parser, push-pull-parser,
4892 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4893
f16b0819
PE
48942007-08-15 Paul Eggert <eggert@cs.ucla.edu>
4895
4896 Update to GPLv3.
4897 * doc/gpl-3.0.texi: New file.
4898 * doc/gpl.texi: Remove.
4899 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
4900 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
4901 * README-hacking, TODO, bootstrap, bootstrap.conf:
4902 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
4903 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
4904 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
4905 * data/lalr1.cc, data/lalr1.java, data/location.cc:
4906 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
4907 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
4908 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
4909 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
4910 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
4911 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
4912 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
4913 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
4914 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
4915 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
4916 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
4917 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
4918 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
4919 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
4920 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
4921 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
4922 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
4923 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
4924 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
4925 * src/complain.c, src/complain.h, src/conflicts.c:
4926 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
4927 * src/files.h, src/flex-scanner.h, src/getargs.c:
4928 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
4929 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
4930 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
4931 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
4932 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
4933 * src/print.c, src/print.h, src/print_graph.c:
4934 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
4935 * src/reduce.h, src/relation.c, src/relation.h:
4936 * src/revision.h, src/scan-code.h, src/scan-code.l:
4937 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
4938 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
4939 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
4940 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
4941 * tests/Makefile.am, tests/actions.at, tests/c++.at:
4942 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
4943 * tests/existing.at, tests/glr-regression.at:
4944 * tests/headers.at, tests/input.at, tests/java.at:
4945 * tests/local.at, tests/output.at, tests/push.at:
4946 * tests/reduce.at, tests/regression.at, tests/sets.at:
4947 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
4948 * tests/torture.at:
4949 Update to GPLv3.
4950
728c4be2
JD
49512007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4952
4953 Get rid of broken %no-parser, -n, and --no-parser implementation and
4954 documentation.
4955 * TODO: Don't mention them.
4956 * doc/bison.1: Likewise.
4957 * doc/bison.texinfo (Decl Summary): Likewise.
4958 (Bison Options): Likewise.
4959 (Option Cross Key): Likewise.
4960 * src/getargs.c (no_parser_flag): Remove global variable.
4961 (usage): Don't print description of -n and --no-parser.
4962 (long_options): Remove --no-parser entry here.
4963 (getargs): Remove -n case in the switch here.
4964 * src/getargs.h (no_parser_flag): Remove extern.
4965 * tests/regression.at (Web2c Actions): Remove comment that mentions
4966 --no-parser.
4967
5d31a216
JD
49682007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
4969
4970 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
4971 name user variables starting with `yy'. Just pass NULL instead of a
4972 dummy local &yylval to yypush_parse.
4973 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
4974 starting with `yy'.
4975
a2ea208d
JD
49762007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
4977
4978 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
4979 true since it's then always used regardless of whether yyoverflow is
4980 defined. Reported by Christian Burger at
4981 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
4982 * THANKS: Add Christian Burger.
4983
91661ebb
JD
4984 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
4985 node names: say "Decl Summary" not "Bison Declaration Summary".
4986
cbd50549
JD
49872007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
4988
4989 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
4990 determine whether this function has already complained about an invalid
4991 value for a %define boolean variable, don't check whether Bison has
4992 ever examined the value. As written, the check was a tautology.
4993 Instead, record and check for this complaint using a separate muscle.
4994
eb1b0740
JD
49952007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4996
4997 Fix push parsing memory leak reported by Brandon Lucia at
4998 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
4999 * THANKS: Add Brandon Lucia.
5000 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5001 but the parse never completed and thus freed it.
5002 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5003 * tests/testsuite.at: Include push.at.
5004 * test/push.at: New.
5005 (Push Parsing: Memory Leak for Early Deletion): New test case.
5006
9d774aff
JD
50072007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5008
5009 Improve handling of multiple S/R conflicts in the same state and of S/R
5010 conflicts involving multiple reductions.
5011 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5012 set for a state here or Bison will abort if it is reassigned on a
5013 later conflicted reduction in the same state.
5014 Similarly, don't finalize and assign the solved conflicts report here
5015 or it will be lost if it is reassigned on a later conflicted reduction
5016 in the same state.
5017 (set_conflicts): Instead, assign them both here after all S/R conflicts
5018 in the state have been fully examined.
5019 * src/print.c (shift_set): Rename to...
5020 (no_reduce_set): ... this.
5021 (print_reductions): Update for rename, and add %nonassoc error action
5022 tokens to no_reduce_set so that, when printing the first remaining
5023 reduction on an error action token, the reduction is enclosed in
5024 brackets.
5025 (print_results): Update for rename.
5026 * tests/conflicts.at (Solved conflicts report for multiple reductions
5027 in a state): New test case.
5028 (%nonassoc error actions for multiple reductions in a state): New test
5029 case.
5030
5031 * src/main.c (main): Don't depend on C99 features.
5032
10159d2a
JD
50332007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5034
5035 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
5036 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
5037 uniwidth.
10159d2a 5038
953b3935
JD
50392007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
5040
5041 * bootstrap (slurp): Create target directories that don't exist.
5042 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
5043
6ce2d93a
JD
50442007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5045
5046 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
5047 than item number.
5048 * closure.c (closure): Likewise.
5049 * state.h (reductions): Comment sorting of rules.
5050 (state): Comment sorting of items.
5051
ce3448d5
JD
50522007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
5053
5054 Fix C++ test cases after recent Gnulib changes. Discussed starting at
5055 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
5056 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
5057 definition in order to avoid Gnulib headers since we don't use config.h
5058 here.
5059 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
5060 rather than AT_DATA so that config.h is included.
5061
8a86eef0
JD
50622007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
5063
5064 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
5065 instead of fprintf. Guard these functions with #if YYDEBUG instead of
5066 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
5067 and so that YYFPRINTF is guaranteed to be defined here.
5068
b1a81613
JD
50692007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5070
5071 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
5072 with...
5073 (muscle_percent_define_check_values): ... this more helpful function.
5074 Again, it's not used yet, but it will be.
5075 * src/muscle_tab.h: Likewise.
5076
71b61d4d
JD
5077 Improve some comments in parser table construction.
5078 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
5079 (generate_states): Don't mention ruleset, which is internal to closure.
5080 * src/closure.c (closure): Explain sorting of core and itemset, which
5081 is required for this function to behave correctly.
5082 * src/closure.h (closure): Mention sorting.
5083
2a6b783d
JD
50842007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
5085
5086 * src/lalr.c (state_lookahead_tokens_count): For code readability,
5087 move the check for disabled transitions to an aver since conflict
5088 resolution hasn't happened yet.
5089
5090 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
5091 labels a state as inconsistent just because it has error transitions.
5092 The original form of this check appeared in revision 1.1 of lalr.c,
5093 which was committed on 1991-12-21. Now (at least), changing the
5094 consistency label on such a state appears to have no useful effect in
5095 any of the places it is examined, which I enumerate below. The key
5096 point to understanding each item in this enumeration is that a state
5097 with an error transition is labelled consistent in the first place only
5098 if it has no rules, so the check cannot matter for states that have
5099 rules. (1) Labelling a state as inconsistent will cause set_conflicts
5100 to try to identify its conflicts, and a state must have *rules* to have
5101 conflicts. (2) Labelling a state as inconsistent will affect how
5102 action_row sets the default *rule* for the state. (3) Labelling a
5103 state as inconsistent will cause build_relations to add lookback edges
5104 to *rules* in that state.
5105 * src/state.h (struct state): Word the comment for member consistent
5106 more carefully.
5107
14462c2b
JD
51082007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5109
5110 Don't depend on C99 features.
5111 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
5112 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
5113 * src/reader.c (check_and_convert_grammar): Fix for-loop.
5114 * src/state.c (state_mark_reachable_states): Fix for-loop.
5115 (state_remove_unreachable_states): Fix for-loop.
5116
5117 Don't widen struct state with member reachable just to temporarily
5118 record reachability. Instead, use a local bitset.
5119 * src/state.h (struct state): Remove member.
5120 * src/state.c (state_new): Don't initialize it.
5121 (state_mark_reachable_states): Rename to...
5122 (state_record_reachable_states): ... this, and use bitset.
5123 (state_remove_unreachable_states): Use bitset.
5124
5a43d418
JD
51252007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
5126
5127 * src/Makefile.am (yacc): Quote target action commands properly so
5128 that the yacc script isn't corrupt. Reported by Hans Aberg at
5129 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
5130
0c650a20
JD
5131 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
5132 the case of pure parsers. Reported by Frans Englich at
5133 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
5134 * THANKS: Add Frans Englich.
5135
61fee93e
JD
5136 * NEWS (2.3a+): In the %code entry, reference section `Bison
5137 Declaration Summary' from the manual now since the %code summary has
5138 moved there.
5139 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
5140 in the rules section must be terminated by semicolons.
5141
f124d423
JD
51422007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
5143
5144 Extend the front-end API for %define variables to more completely
5145 mirror the back-end. This will be useful in the future.
5146 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
5147 Update comments to mention the new front-end counterparts of these
5148 macros.
5149 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
5150 for muscle_string_decode and muscle_location_decode.
5151 (muscle_string_decode): New static function.
5152 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
5153 (muscle_percent_define_get, muscle_percent_define_ifdef): New
5154 functions.
5155 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
5156 muscle_percent_define_get to mimic the b4_percent_define_flag_if
5157 implementation more closely.
5158 (muscle_percent_define_invalid_value): New function.
5159 * src/muscle_tab.h (muscle_percent_define_get,
5160 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
5161 Prototype.
5162
75ad86ee
JD
51632007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5164
5165 * NEWS (2.3a+): Mention yesterday's state-removal change.
5166 (2.3a): Remove the %language entry, which was added after 2.3a.
5167 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
5168 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
5169 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
5170 tests/existing.at: Update copyright date.
5171
5967f0cf
JD
51722007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5173
5174 If conflict resolution makes states unreachable, remove those states,
5175 report rules that are then unused, and don't report conflicts in those
5176 states.
5177 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
5178 New global function.
5179 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
5180 function.
5181 * src/main.c (main): After conflict resolution, remove the unreachable
5182 states and update all data structures that reference states by number.
5183 * src/state.c (state_new): Initialize each state's reachable member to
5184 false.
5185 (state_mark_reachable_states): New static function.
5186 (state_remove_unreachable_states): New global function.
5187 * src/state.h (struct state): Add member bool reachable.
5188 (state_remove_unreachable_states): Prototype.
5189 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5190 New test case.
5191 * tests/existing.at (GNU pic Grammar): Update test case output now that
5192 an unused rule is discovered.
5193
b09f4f48
JD
51942007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5195
5196 Minor code cleanup in parser table construction.
5197 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
5198 (new_itemsets, save_reductions): Update for rename to nitemset.
5199 * src/closure.c (nritemset): Rename to...
5200 (nitemset): ... this since the "r" appears to meaningless and isn't
5201 used in the comments.
5202 (closure): Update for rename.
5203 * src/closure.h (nritemset): Update extern to...
5204 (nitemset): ... this.
5205 * src/lalr.c (LA): Fix a typo in comments.
5206 * src/print.c (print_core): Update for rename to nitemset.
5207 * src/print_graph.c (print_graph): Likewise.
5208 * src/state.h: Fix some typos in header comments.
5209
bbb44d83
PE
52102007-04-04 Paul Eggert <eggert@cs.ucla.edu>
5211
9b33de72
PE
5212 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
5213 still sticks to ASCII. Sorry!
5214
bbb44d83
PE
5215 * README-hacking: New file, taken mostly from coreutils, with changes
5216 for Bison. Contains much of the contents of:
5217 * README-cvs: Remove.
5218 * bootstrap: Sync from gnulib.
5219 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
5220 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
5221
29553547
JD
52222007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
5223
5224 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
5225 Setzer.
5226 (Java Differences): Fix some typos.
5227 * THANKS: Add Sebastian Setzer.
5228
01b477c6
PB
52292007-03-07 Paolo Bonzini <bonzini@gnu.org>
5230
730739e4
AD
5231 * data/java.m4 (b4_single_class_if): Remove.
5232 (b4_abstract_if): Look at "%define abstract".
5233 (b4_lexer_if): New.
5234 (b4_union_name): Rename...
5235 (b4_yystype): ... to this. Map to "%define stype".
5236 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
5237 b4_maybe_throws): Fix quoting.
5238 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
5239 * data/lalr1.java (Lexer interface): Always define.
5240 (Lexer interface within parser class): Remove.
5241 (YYLexer class): New, used when "%code lexer" is present.
5242 (constructor): When "%code lexer" is used, pass %lex-param
5243 to the lexer constructor.
5244 (yylex, yyparse): Remove %lex-param from method invocations
5245 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
5246
5247 * doc/bison.texinfo (Java Bison Interface): Mention "%define
5248 abstract". Rename "%define union_name" to "%define stype".
5249 Rename method names according to previous patch.
5250 (Java Scanner Interface): Describe "%code lexer" instead of
5251 "%pure-parser" and "%define single_class".
5252 (Java Differences): Mention "%code lexer".
5253
5254 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
5255 Include scanner here, using macros from tests/local.at.
5256 (AT_DATA_CALC_Y): Remove final argument.
5257 (_AT_CHECK_JAVA_CALC): Likewise.
5258 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
5259 of %locations and %error-verbose.
5260 (main): Test with and without %lex-param.
5261 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
5262 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 5263
122bea3a
JMG
52642007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5265
5266 DJGPP spefic issue. Inhibit the use of disallowed characters for
5267 file name genertion on Win98, WinXP, etc. These are |<>":?*\
5268 and concern testsuite case 46.
5269 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
5270 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
5271 * djgpp/config.bat: Inhibit the use of disallowed characters.
5272
9611cfa2
JD
52732007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5274
5275 Miscellaneous %define and %code cleanup.
5276 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
5277 values are interpreted.
5278 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
5279 documentation a little more.
5280 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
5281 muscle_percent_define_insert, muscle_percent_code_grow): New
5282 functions/macros.
5283 * src/muscle_tab.h (muscle_percent_define_insert,
5284 muscle_percent_code_grow): Prototype.
5285 * src/parse-gram.y (prologue_declaration): Use
5286 muscle_percent_define_insert and muscle_percent_code_grow when parsing
5287 %define and %code directives.
5288
5289 Make it easy to share %define boolean variables between the front-end
5290 and back-end. Though not used yet, this will be useful in the future.
5291 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
5292 Bison uses of names rather than just skeleton uses of names.
5293 (b4_percent_define_get, b4_percent_define_ifdef): Rename
5294 b4_percent_define_skeleton_variables(VARIABLE) to
5295 b4_percent_define_bison_variables(VARIABLE).
5296 (b4_percent_code_get, b4_percent_code_ifdef): Rename
5297 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
5298 b4_percent_code_bison_qualifiers(QUALIFIER).
5299 (b4_check_user_names_wrap): Update for renames.
5300 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
5301 muscle_percent_define_default): New functions mimicking
5302 b4_percent_define_flag_if and b4_percent_define_default.
5303
5304 For %define variables, report locations for invalid values and
bbb44d83 5305 redefinitions.
9611cfa2
JD
5306 * data/bison.m4 (b4_percent_define_flag_if): Read
5307 b4_percent_define_loc(VARIABLE) to report the location of an invalid
5308 value for VARIABLE.
5309 (b4_percent_define_default): Save a special location in
5310 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
5311 must later be reported as invalid.
5312 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
5313 functions.
5314 (muscle_percent_define_insert): Record the location of VARIABLE in
5315 muscle percent_define_loc(VARIABLE), and use it to report the previous
5316 location for a redefinition.
5317 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
5318 (muscle_percent_define_default): Update like b4_percent_define_default.
5319 (muscle_grow_user_name_list): Rename to...
5320 (muscle_user_name_list_grow): ... this for consistency and use
5321 muscle_location_grow.
5322 * src/muscle_tab.h (muscle_location_grow): Prototype.
5323 * tests/input.at (%define errors): Update expected output.
5324 * tests/skeletons.at (%define boolean variables: invalid skeleton
5325 defaults): New test case.
5326
0bf92491
JD
53272007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5328
5329 * src/print.c (lookahead_set, state_default_rule): Remove.
5330 (print_reductions): Replace state_default_rule invocation with
5331 equivalent use of yydefact, which was computed in token_actions in
5332 tables.c.
5333 (print_results): Don't allocate lookahead_set.
5334
d3b12988
PB
53352007-02-27 Paolo Bonzini <bonzini@gnu.org>
5336
5337 * data/lalr1.java: Prefix all private members with yy.
5338
f57a7536
JD
53392007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5340
5341 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 5342 Sebastien Fricker at
f57a7536 5343 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 5344 * THANKS: Add Sebastien Fricker.
f57a7536
JD
5345 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5346 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5347 accept a variable number of arguments.
5348
6404a5bf
JD
53492007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5350
5351 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5352
e4e09639
JMG
53532007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5354
5355 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5356 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5357 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5358
d7e0a1a7
PE
53592007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5360
5361 Undo my 2007-02-07 change, switching back to the c-strcase module
5362 introduced in the 2007-02-03 change. Bruno Haible reported that
5363 the 2007-02-07 change would be dangerous in Turkish if we add a
5364 language whose name contains "i", since "i" is not lowercase "I"
5365 in Turkish.
5366 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5367 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5368 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5369 * m4/.cvsignore: Remove strcase.m4.
5370 * src/getargs.c: Revert 2007-02-07 change, as follows.
5371 Include c-strcase.h.
5372 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5373
deee93a1
JD
53742007-02-11 Bruno Haible <bruno@clisp.org>
5375
5376 Enable the Java related testsuite tests when the only Java compiler
5377 found is a gcj < 4.3. Discussed at
5378 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5379 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5380
574add85
JD
53812007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5382
5383 * data/Makefile.am: Update copyright date.
5384 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5385 yypstate_new returns NULL.
5386 (yypstate_new): Return NULL if malloc does.
5387 * src/reader.c (packgram): Move translation of rule actions from the
5388 beginning of packgram to...
5389 (check_and_convert_grammar): ... here right before packgram is invoked
5390 so it's easier to write more complete comments, and remove redundant
5391 code.
5392
e785ccf7
JD
53932007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5394
5395 As in semantic actions, make @$ in %initial-action, %destructor, and
5396 %printer imply %locations.
5397 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5398 scanning @$.
5399 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5400 (@$ in %initial-action implies %locations,
5401 @$ in %destructor implies %locations,
5402 @$ in %printer implies %locations): ... these new test cases.
5403
1cfe1ed7
PE
54042007-02-07 Paul Eggert <eggert@cs.ucla.edu>
5405
5406 Undo most of the 2007-02-03 change, switching to the strcase module
5407 now that gnulib strcase has been fixed.
5408 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
5409 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
5410 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
5411 * m4/.cvsignore: Add strcase.m4.
5412 * src/getargs.c: Revert 2007-02-03 change, as follows.
5413 Don't include c-strcase.h.
5414 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
5415 strcasecmp has "unspecified behavior" outside the POSIX locale,
5416 but it works fine in practice if at least one argument is ASCII,
5417 as is the case in Bison.
5418
0049ec86
PB
54192007-02-07 Paolo Bonzini <bonzini@gnu.org>
5420
5421 * tests/java.at: Skip tests if only one of javac/java is present.
5422 Reported by Joel E. Denny.
5423 * tests/atlocal.in: Adjust copyright years.
5424
54252007-02-05 Paolo Bonzini <bonzini@gnu.org>
5426
5427 * data/lalr1.java (Stack): Work around old verifiers that disallow
5428 access to the private fields of an inner class, from the outer class.
5429 We can make Stack's fields public because user code doesn't have access
5430 to the instance of Stack used by parse(). Reported by Paul Eggert.
5431
2c2b7220
PE
54322007-02-03 Paul Eggert <eggert@cs.ucla.edu>
5433
5434 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
5435 the right spot for these files?
5436 * bootstrap.conf (gnulib_modules): Add c-strcase.
5437 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
5438 c-strncasecmp.c.
5439 * src/getargs.c: Include c-strcase.h.
5440 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
5441 to avoid unspecified behavior.
5442
b2b81dae
JD
54432007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
5444
5445 * doc/bison.texinfo (Decl Summary): Correct typo.
5446
c1d19e10
PB
54472007-01-30 Paolo Bonzini <bonzini@gnu.org>
5448
5449 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
5450 Complain if the value does not match empty, "true" or "false".
5451 * data/c++.m4: Adjust default definitions of %define variables.
5452 * data/java.m4: Adjust default definitions of %define variables.
5453 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
5454 to above behavior.
5455 * tests/input.at (Boolean %define variables): Test new behavior.
5456
8405b70c
PB
54572007-01-29 Paolo Bonzini <bonzini@gnu.org>
5458
5459 * NEWS: Mention java.
5460 * TODO: Remove things that are done.
5461 * bootstrap.conf: Add javacomp-script and javaexec-script.
5462 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
5463
5464 * data/Makefile.am: Add new files.
5465 * data/java-skel.m4: New.
5466 * data/java.m4: New.
5467 * data/lalr1.java: New.
5468
5469 * doc/bison.texinfo: Put "A Complete C++ Example" under
5470 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
5471 under Other Languages.
5472
5473 * src/getargs.c (valid_languages): Add Java.
5474 * src/getargs.h (struct bison_language): Update size of string fields.
5475
5476 * tests/Makefile.am: Add java.at.
5477 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
5478 * tests/java.at: New.
5479 * tests/testsuite.at: Include it.
5480
3eb82471
JD
54812007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
5482
5483 Clean up.
5484 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
5485 at_directive_argv arguments so these no longer have to be global
5486 variables. Also, update the implementation for the following changes.
5487 (fail_for_at_directive_too_many_args,
5488 fail_for_at_directive_too_few_args): Add at_directive_name argument.
5489 (at_directive_name): Remove as at_directive_argv[0] will be used for
5490 this now.
5491 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
5492 for the directive name.
5493 (at_directive_argc, at_directive_argv): Make these local within
5494 skel_lex instead of global.
5495 (INITIAL): Update directive start action for above changes.
5496 (SC_AT_DIRECTIVE_ARG): Rename to...
5497 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
5498 (SC_AT_DIRECTIVE_SKIP_WS): Update.
5499 (scan_skel): Move yylex_destroy to...
5500 (skel_scanner_free): ... here.
5501 * tests/skeletons.at (installed skeleton file name): Rename to...
5502 (installed skeleton file names): ... this.
5503
148d66d8
JD
55042007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
5505
5506 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5507 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
5508 Summary" not "Directives".
5509 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
5510 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
5511 since the former is now the more complete one.
5512 (Prologue Alternatives): Likewise and do the same for %defines.
5513 (Table of Symbols): Add summary of %code, add summary of %define, and
5514 move full %code documentation to...
5515 (Decl Summary): ... here for consistency with other entries in these
5516 sections.
5517 Move %define entry in order to keep this list alphabetized.
5518 Reword %define entry a little to put less emphasis on the skeleton
5519 concept, which most users shouldn't have to think about.
5520
665f0c24
PE
55212007-01-26 Paul Eggert <eggert@cs.ucla.edu>
5522
5523 Adjust to recent gnulib changes.
5524 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
5525 Add string.h, string_.h, unistd_.h, wchar_.h.
5526 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
5527 * src/system.h: Don't include <stpcpy.h>; this is now done by
5528 <string.h>.
5529
592d0b1e
PB
55302007-01-23 Paolo Bonzini <bonzini@gnu.org>
5531
5532 Simplify implementation of unqualified %code, implement macros for
5533 uniform treatment of boolean %define flags. Document %define.
5534 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
5535 b4_percent_code_ifdef): New.
5536 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
5537 * data/c++.m4: Define default value for global_tokens_and_yystype.
5538 * data/glr.cc: Likewise.
5539 * data/location.cc: Use b4_percent_define_flag_if.
5540
148d66d8 5541 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
5542
5543 * src/parse-gram.y (Unqualified %code): Change muscle name to
5544 b4_percent_code().
5545 (content.opt): Default to empty.
5546
a7867f53
JD
55472007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5548
5549 Implement support for relative and absolute skeleton file names.
5550 Discussed starting at
5551 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5552 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5553 (Bison Options): Document in --skeleton entry.
5554 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5555 full_skeleton can't necessarily hold all of pkgdatadir.
5556 If the specified skeleton file name contains a `/', don't prepend
5557 pkgdatadir.
5558 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5559 file name contains a `/', prepend the grammar file directory.
5560 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5561 * skeletons.at: New file.
5562 (relative skeleton file names): New test case.
5563 (installed skeleton file names): New test case.
5564 * tests/testsuite.at: Include skeletons.at.
5565
5566 * bootstrap: Update copyright to 2007.
5567
830c9b18
PB
55682007-01-17 Paolo Bonzini <bonzini@gnu.org>
5569
5570 * bootstrap: Remove occurrences of .#bootmp from the files.
5571
a8c2e813
AD
55722007-01-17 Akim Demaille <akim@epita.fr>
5573
5574 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5575 nonterminals.
5576 Use per-type %printer.
5577
279cabb6
JD
55782007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5579
5580 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5581 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5582 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5583 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5584 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5585 tests/glr-regression.at, tests/input.at, tests/local.at,
5586 tests/output.at, tests/torture.at: Update copyright to 2007.
5587
bb32f4f2
AD
55882007-01-16 Akim Demaille <akim@epita.fr>
5589
5590 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5591 error code.
5592 (Calc++ Scanner): Exit with failure if we can't open the input
5593 file.
5594 Accept "-" standing for stdin.
5595 (Calc++ Top Level): Print the result only if the parsing was
5596 successful.
5597
7cff04b5
AD
55982007-01-16 Akim Demaille <akim@epita.fr>
5599
5600 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5601
a4e25e1d
JD
56022007-01-15 Paolo Bonzini <bonzini@gnu.org>
5603 and Joel E. Denny <jdenny@ces.clemson.edu>
5604
5605 Clean up %define and %code implementation in M4 some. Most
5606 importantly, rename all related macros to be in the b4_percent_define
5607 and b4_percent_code namespaces. Also, complete support for `.' in
5608 %define variable names and %code qualifiers.
5609 * data/bison.m4 (b4_check_user_names): Check for special
5610 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5611 m4_foreach loops.
5612 (b4_get_percent_define, b4_get_percent_code): Rename to...
5613 (b4_percent_define_get, b4_percent_code_get): ... these.
5614 Extend documentation with examples.
5615 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5616 b4_percent_define_skeleton_variables and
5617 b4_percent_code_skeleton_qualifiers.
5618 Expect any value for the %define variable `foo' to be stored in the
5619 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5620 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5621 expect any unqualified %code blocks to be stored in a macro named
5622 `b4_percent_code_unqualified'.
5623 Use m4_indir so that %define variable names and %code qualifiers can
5624 contain `.', which is allowed by the grammar parser.
5625 (b4_percent_define_default): New macro to set a default value for a
5626 %define variable.
5627 (m4_wrap): Update wrapped code, and fix some underquoting.
5628 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5629 Expect grammar uses of %define variables and %code qualifiers to be
5630 defined in b4_percent_define_user_variables and
5631 b4_percent_code_user_qualifiers.
5632 * data/c++.m4: Use b4_percent_define_default rather than
5633 m4_define_default. Fix some underquoting. Skeleton usage of %define
5634 variable define_location_comparison now implies skeleton usage of
5635 %define variable filename_type.
5636 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5637 data/push.c, data/yacc.c: Update macro names.
5638 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5639 muscle names.
5640
e37c665c
JMG
56412007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5642
5643 DJGPP specific issues.
5644
5645 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5646 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5647
7d2d521f
JD
56482007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5649
5650 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5651 run parsers in all tests so that Valgrind is invoked during
5652 maintainer-check-valgrind.
5653 (Duplicate representation of merged trees): Free all semantic values.
5654 (Duplicated user destructor for lookahead): Likewise.
5655
e0ac9b4b
JD
56562007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5657
5658 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5659 command-line prefix.
5660 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5661 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5662 miss Valgrind messages.
5663 (Exploding the Stack Size with Malloc): Likewise.
5664
78143faa
JD
56652007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5666
5667 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5668 locals. Reported by Juan Manuel Guerrero at
5669 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5670 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5671 Fix some indentation also.
5672 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5673 explaining this issue.
5674
7ecec4dd
JD
56752007-01-09 Paolo Bonzini <bonzini@gnu.org>
5676 and Joel E. Denny <jdenny@ces.clemson.edu>
5677
5678 Simplify union and prologue handling, and escape union and lex/parse
5679 params with digraphs.
5680 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5681 values to the empty string since these are no longer guaranteed
5682 initialized by the front-end.
5683 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5684 braces around b4_user_stype since this is no longer done by the
5685 front-end.
5686 * src/files.c, src/files.h (pre_prologue_obstack,
5687 post_prologue_obstack): Remove.
5688 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5689 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5690 with digraphs. This fixes lex params and parse params.
5691 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5692 * src/output.c (prepare): Remove muscle insertion of the prologues.
5693 (output): Remove freeing of pre_prologue_obstack and
5694 post_prologue_obstack.
5695 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5696 than prologue_augment for prologue parsing so you don't need prologue
5697 obstacks.
5c80250c
JD
5698 (grammar_declaration): For %union RHS, use `braceless' instead of
5699 "{...}" so that braces are already stripped and code is escaped with
5700 digraphs.
7ecec4dd
JD
5701 * src/reader.c (prologue_augment): Remove.
5702 (reader): Remove initialization of pre_prologue_obstack and
5703 post_prologue_obstack.
5704 * src/reader.h (prologue_augment): Remove.
5705
5706 * data/c.m4: Remove stray parenthesis.
5707
16dc6a9e
JD
57082007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5709
5710 Remove quotes from variables names in %define directives and from
5711 qualifiers in %code directives, and restrict the characters that are
5712 allowed in them to M4-friendly ones. For %define, continue to support
5713 the quoted form as a deprecated feature. Discussed starting at
5714 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5715 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5716 %code.
5717 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
5718 (Decl Summary): In %defines entry, update mention of `%code requires'
5719 and `%code provides'.
16dc6a9e
JD
5720 (C++ Location Values): Update %define uses.
5721 (Calc++ Parser Interface): Likewise.
5722 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 5723 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
5724 * src/parse-gram.y (prologue_declaration): For %define variables, use
5725 `variable' instead of `STRING'.
5726 (grammar_declaration): For %code qualifiers, use `ID' instead of
5727 `STRING'.
5728 (variable): New nonterminal that takes an `ID' or a `STRING'.
5729 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5730 and %define uses.
5731 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5732 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5733 (%define errors): Update %define uses.
5734
e9813cd4
JD
57352007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5736
5737 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5738 instead of muscle_insert for %define values so that M4-special
5739 characters are replaced with digraphs.
5740 * tests/input.at (%define errors): Extend to check weird values.
5741
6afc30cc
JD
57422007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5743
5744 Instead of having skeletons declare all valid %define variables and
5745 %code qualifiers, provide macros that retrieve the associated values
5746 and build these lists automatically. Thus Bison will now warn when a
5747 variable or qualifier is not used by the skeleton in the current
5748 invocation regardless of whether it might sometimes be used by that
5749 skeleton in other invocations. Also, move all %define value macros to
5750 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5751 form, which is replaced by %code.
5752 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5753 (b4_check_user_names): ... this, and change the series of valid name
5754 arguments to a single list argument for names used in the skeleton
5755 similar to the existing list argument for names used in the grammar.
5756 Warn instead of complaining.
5757 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5758 values and %code code, to format %code code properly, and to build
5759 lists of all %define variables and %code qualifiers used in the
5760 skeleton: b4_skeleton_percent_define_variables and
5761 b4_skeleton_percent_code_qualifiers.
5762 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5763 Remove, and...
5764 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5765 the skeleton names lists can finish building first. In place of
5766 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5767 expect the lists b4_user_percent_define_variables and
5768 b4_user_percent_code_qualifiers.
5769 * data/c++.m4: Where setting default values for b4_parser_class_name,
5770 b4_location_type, b4_filename_type, b4_namespace, and
5771 b4_define_location_comparison, update their names to the
5772 b4_percent_define_ namespace.
5773 * data/glr.c: Don't use b4_check_percent_define_variables and
5774 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5775 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5776 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 5777 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
5778 * data/location.cc: Use b4_get_percent_define.
5779 * data/push.c: Don't use b4_check_percent_define_variables and
5780 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5781 * data/yacc.c: Likewise, and don't call m4_exit in
5782 b4_use_push_for_pull_if or m4_wrap code will never execute.
5783 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5784 Rename to...
5785 (muscle_grow_user_name_list): ... this for consistency with the
5786 terminology used in bison.m4.
5787 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5788 %define variable names, and rename muscle used_percent_define_variables
5789 to user_percent_define_variables.
5790 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5791 user_percent_code_qualifiers.
5792 (content): Remove.
5793 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5794 {CODE} form is no longer accepted.
5795 * tests/input.at (Reject bad %code qualifiers): Rename to...
5796 (Reject unused %code qualifiers): ... this, and update test output.
5797 (%define error): Update test output.
5798
7eb8a0bc
JD
57992007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5800
5801 Check for unrecognized %define variables similar to checking for
5802 unrecognized %code qualifiers. Check for redefined %define variables.
5803 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5804 generalizes...
5805 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5806 (b4_check_percent_define_variables): New, also wraps it.
5807 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5808 variables using b4_check_percent_define_variables.
5809 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5810 all those exercised in the test suite and all those listed in the
5811 `Default values' section of c++.m4. Are there others?
5812 * data/push.c, data/yacc.c: Declare no valid %define variables.
5813 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5814 similar to muscle_find, but it works even when the muscle stores a
5815 const value.
5816 (muscle_grow_used_name_list): New function for constructing the used
5817 name list muscles that b4_check_for_unrecognized_names requires.
5818 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5819 %define'd more than once. Define the b4_used_percent_define_variables
5820 muscle with muscle_grow_used_name_list.
5821 (grammar_declaration): Abbreviate %code code with
5822 muscle_grow_used_name_list.
5823 * tests/input.at (%define errors): New.
5824
3fc65ead
JD
58252007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5826
5827 Provide warn_at, complain_at, and fatal_at function callbacks to the
5828 skeletons, and use this for %code qualifier complaints.
5829 * data/bison.m4 (b4_error_at): New, invoked by...
5830 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5831 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5832 @fatal_at(...@) directives.
5833 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5834 qualifiers in b4_used_percent_code_qualifiers and to use
5835 b4_complain_at.
5836 * src/location.c, src/location.h (boundary_set_from_string): New global
5837 function.
5838 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5839 function.
5840 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5841 to b4_used_percent_code_qualifiers.
5842 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5843 function.
5844 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5845 (lineno): Rename to...
5846 (out_lineno): ... this so I don't misunderstand it again.
5847 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5848 here; these newlines are in the input but not the output file.
5849 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5850 (at_directive_perform): ... this new static function, and add handling
5851 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5852 directives.
5853 * tests/input.at (Reject bad %code qualifiers): Update test output with
5854 locations and extend.
5855
5856 * tests/output.at (Output file name: [, Output file name: ]): Remove
5857 bogus comment about these tests failing.
5858
1c7b7e1d
JD
58592007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5860
5861 Clean up b4_check_percent_code_qualifiers a little.
5862 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5863 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5864 documentation and add examples.
5865 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5866 qualifiers here.
5867
08af01c2
JD
58682007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5869
5870 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5871 unreliable -- especially when they're hidden inside another macro.
5872 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5873 data/c.m4: Remove m4_divert(-1).
5874 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5875 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5876 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 5877 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
5878 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5879 pushed and popped by m4sugar, should be first on the stack.
5880
5881 Provide warn, complain, and fatal function callbacks to the skeletons.
5882 This provides more flexibility than m4_fatal, improves the error
5883 message format, and captures messages for translation. Discussed
5884 starting at
5885 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5886 * data/bison.m4 (b4_error): New, invoked by...
5887 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5888 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5889 directives. Because these M4 macros might be called when the current
5890 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5891 the previous removal of uses of m4_divert, which caused trouble.
5892 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5893 m4_fatal to report unrecognized %code qualifiers.
5894 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
5895 push parser requests.
5896 * data/glr.c: Use b4_complain instead of m4_fatal to report
5897 non-deterministic push parser requests.
5898 Update @output usage to @output(...@) form.
5899 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
5900 report missing %defines. Update @output usage to @output(...@) form.
5901 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
5902 @output(...@) form.
5903 * src/main.c (main): Invoke skel_scanner_free.
5904 * src/scan-skel.h (skel_scanner_free): Prototype new function.
5905 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
5906 obstack_for_string from flex-scanner.h.
5907 (YY_DECL): Use to declare skel_lex static.
5908 (decode_at_digraphs): Remove; now handled in the new
5909 SC_AT_DIRECTIVE_ARG start condition.
5910 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
5911 functions.
5912 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
5913 at_directive_argv): New static globals.
5914 (INITIAL): Use fail_for_invalid_at.
5915 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
5916 recognize the start of a generalized `@directive(...@)' form and
5917 start...
5918 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
5919 directive args (using the new obstack_for_string), to decode the
5920 contained @ diagraphs, and to perform the directive. It recognizes
5921 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
5922 @output(...@).
5923 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
5924 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
5925 `@,'.
5926 (scan_skel): Initialize obstack_for_string on the first call.
5927 (skel_scanner_free): New function to free obstack_for_string.
5928 * tests/input.at (Reject bad %code qualifiers): Update test output.
5929
8e0a5e9e
JD
59302007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
5931
5932 Consolidate the 4 prologue alternative directives (%code, %requires,
5933 %provides, and %code-top) into a single %code directive with an
5934 optional qualifier field. Discussed at
5935 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
5936 * NEWS (2.3a+): Rewrite the existing entry for the prologue
5937 alternatives.
5938 * doc/bison.texinfo (Prologue Alternatives): Update.
5939 (Decl Summary): Update to %code "requires" and %code "provides".
5940 (Calc++ Parser): Update to %code "requires".
148d66d8 5941 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
5942 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
5943 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
5944 are replaced by b4_percent_code_provides and b4_percent_code_requires,
5945 which are skeleton-specific.
5946 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
5947 declare what %code qualifiers it supports and to complain if any other
5948 qualifiers were used in the grammar.
5949 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
5950 and b4_user_code([b4_percent_code_provides]) in place of
5951 b4_user_requires and b4_user_provides.
5952 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
5953 Add b4_user_code([b4_percent_code_top]) and
5954 b4_user_code([b4_percent_code]).
5955 Invoke b4_check_percent_code_qualifiers.
5956 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5957 PERCENT_REQUIRES): Remove.
5958 (grammar_declaration): Remove RHS's for %code-top, %provides, and
5959 %requires. Rewrite the %code RHS as the unqualified form defining the
5960 muscle b4_percent_code. Add another RHS for the qualified %code form,
5961 which defines muscles of the form b4_percent_code_QUALIFIER and the
5962 b4_used_percent_code_qualifiers muscle.
5963 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
5964 PERCENT_REQUIRES): Remove.
5965 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
5966 %code "requires" and %code "provides".
5967 * tests/input.at (Reject bad %code qualifiers): New.
5968
95021767
JD
59692007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
5970
5971 Use the new code_props interface for destructors and printers.
5972 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
5973 printer_location members, and change the type of the destructor and
5974 printer members to code_props.
5975 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
5976 symbol_printer_get, semantic_type_destructor_set,
5977 semantic_type_printer_set, default_tagged_destructor_set,
5978 default_tagless_destructor_set, default_tagged_printer_set,
5979 default_tagless_printer_set): Use code_props in arguments and return
5980 types in place of char const * and location.
5981 (symbol_destructor_location_get, symbol_printer_location_get): Remove
5982 since the locations are now contained in the return of
5983 symbol_destructor_get and symbol_printer_get.
5984 * src/output.c (symbol_destructors_output, symbol_printers_output):
5985 Replace with...
5986 (symbol_code_props_output): ... this to eliminate duplicate code.
5987 (output_skeleton): Update to use symbol_code_props_output.
5988 * src/reader.c (symbol_should_be_used): Update use of
5989 symbol_destructor_get.
5990 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
5991 Update uses of the various _destructor_set and _printer_set functions.
5992 * src/symtab.c: (default_tagged_destructor_location,
5993 default_tagless_destructor_location, default_tagged_printer_location,
5994 default_tagless_printer_location): Remove since we...
5995 (default_tagged_destructor, default_tagless_destructor,
5996 default_tagged_printer, default_tagless_printer): ... change the type
5997 of these to code_props.
5998 (symbol_new, semantic_type_new, symbol_destructor_set,
5999 semantic_type_destructor_set, symbol_destructor_get,
6000 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6001 symbol_check_alias_consistency, default_tagged_destructor_set,
6002 default_tagless_destructor_set, default_tagged_printer_set,
6003 default_tagless_printer_set): Update.
6004 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6005 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6006 code_props members.
6007 (symbol_print): Use SYMBOL_CODE_PRINT.
6008
f6857bbf
JD
60092007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6010
6011 Use the new code_props interface for rule actions.
6012 * src/symlist.h (symbol_list): Replace action, action_location, and
6013 used members with a code_props action_props member.
6014 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6015 grammar_midrule_action, grammar_current_rule_merge_set,
6016 grammar_current_rule_symbol_append, packgram): Update.
6017 * src/scan-code.h (translate_rule_action): Remove, no longer used.
6018 * src/scan-code.l (handle_action_dollar): Update.
6019 (translate_rule_action): Remove, no longer used.
6020 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
6021
7c0c6181
JD
60222007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6023
6024 Use the new code_props interface in parse-gram.y.
6025 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
6026 Update all uses of translate_* functions to use the new code_props
6027 interface and to use gram_scanner_last_string_free and
6028 code_scanner_last_string_free where possible.
6029 (grammar_declaration): symbol_list_destructor_set and
6030 symbol_list_printer_set now perform the translation, so don't do it
6031 here. Use gram_scanner_last_string_free where possible.
6032 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
6033 translate_code): Remove, no longer used.
6034 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
6035 symbol_list_printer_set): Perform code translation here rather than
6036 depending on the caller to do so.
6037
6038 * src/symlist.h (struct symbol_list): Correct some documentation typos.
6039 * src/scan-gram.h (gram_last_string): Remove declaration.
6040 * src/scan-gram.l (last_string): Declare it static.
6041
28e52c0d
JD
60422007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6043
6044 Encapsulate code properties and related functionality for the various
6045 destructors, printers, and actions into a code_props structure and
6046 interface. This patch merely implements code_props in scan-code.h and
6047 scan-code.l. Future patches will rewrite other modules to use it.
6048 Discussed starting at
6049 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
6050 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
6051 consistently initialize const structs that have an empty location
6052 field.
6053 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
6054 to ensure consistency.
6055 * src/scan-code.h (code_props): New structure.
6056 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
6057 function, macro, and const global variable for initializing a
6058 code_props with no code.
6059 (code_props_plain_init, code_props_symbol_action_init,
6060 code_props_rule_action_init, code_props_translate_code): The rest of
6061 the new code_props functional interface. Among other things, the init
6062 functions set the code_props kind field so that
6063 code_props_translate_code will know whether to behave like
6064 translate_symbol_action, translate_rule_action, or translate_code.
6065 These old translate functions must remain until all other modules are
6066 updated to use the new code_props interface.
6067 (code_scanner_last_string_free): New function similar to
6068 gram_scanner_last_string_free.
6069 (code_scanner_free): Add documentation.
6070 * src/scan-code.l: Implement the new interface.
6071 (code_lex): Make it static, add a code_props* argument, and remove the
6072 rule argument.
6073 (last_string): New static global similar to the one in scan-gram.l.
6074 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
6075 instead of rule.
6076 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
6077 code_props since Bison may one day use this information for destructors
6078 and printers.
6079 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
6080 (handle_action_dollar): Use symbol_list_n_get and set used flag
6081 directly since symbol_list_n_used_set is removed.
6082 (translate_action): Add a code_props* argument and remove the rule,
6083 action, and location arguments. Pass the code_props* on to code_lex.
6084 (translate_rule_action, translate_symbol_action, translate_code):
6085 Rewrite as wrappers around the new code_props interface.
6086 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
6087 it would eventually need to break the encapsulation of code_props.
6088
96034983
JD
60892007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6090
6091 * etc/.cvsignore: New.
6092
945e396c
JD
60932007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6094
6095 Add maintainer-push-check to run maintainer-check using push parsing in
6096 place of pull parsing where available.
6097 * Makefile.am (maintainer-push-check): New.
6098 * data/bison.m4 (b4_use_push_for_pull_if): New.
6099 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
6100 appropriately based on their existing values.
6101 (yypush_parse): Don't print push-parser-specific diagnostics if push
6102 parsing is being used in place of pull parsing.
6103 * data/yacc.c: If push parsing should replace pull parsing, redirect to
6104 push.c.
6105 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
6106 variable, and insert b4_use_push_for_pull_flag into muscles.
6107 * tests/Makefile.am (maintainer-push-check): New.
6108
7d596384
JD
61092006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6110
6111 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
6112 (whether successful or failed) so that yypush_parse can be invoked
6113 again to start a new parse using the same yypstate.
6114 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
6115 check multiple yypull_parse invocations on the same yypstate. For pull
6116 mode, extend to check multiple yyparse invocations.
6117 (Exploding the Stack Size with Alloca): Extend to try with
6118 %push-pull-parser.
6119 (Exploding the Stack Size with Malloc): Likewise.
6120
6121 * tests/calc.at (Simple LALR Calculator): Don't specify
6122 %skeleton "push.c" since %push-pull-parser implies that now.
6123 * tests/headers.at (export YYLTYPE): Don't check for the push
6124 declarations. Otherwise, this test case can't be used to see if push
6125 mode can truly emulate pull mode.
6126 * tests/input.at (Torturing the Scanner): Likewise.
6127 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
6128 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
6129 AT_YACC_IF, which now includes the case of push mode since %skeleton
6130 need not be used for push mode. This will be more intuitive once
6131 push.c is renamed to yacc.c.
6132
7172e23e
JD
61332006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6134
6135 For push mode, convert yyparse from a macro to a function, invoke yylex
6136 instead of passing a yylexp argument to yypull_parse, and don't
6137 generate yypull_parse or yyparse unless %push-pull-parser is declared.
6138 Discussed starting at
6139 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
6140 * data/bison.m4 (b4_pull_if): New.
6141 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
6142 * data/push.c: Improve M4 quoting a little.
6143 (b4_generate_macro_args, b4_parenthesize): Remove.
6144 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
6145 any time a pull parser is requested.
6146 Don't #define this as a wrapper around yypull_parse. Instead, when
6147 both push and pull are requested, make it a function that does that
6148 same thing.
6149 (yypull_parse): If there's a b4_prefix, #define this to
6150 b4_prefix[pull_parse] when both push and pull are requested.
6151 Don't define this as a function unless both push and pull are
6152 requested.
6153 Remove the yylexp argument and hard-code yylex invocation instead.
6154 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
6155 %push-parser.
6156 * src/getargs.c (pull_parser): New global initialized to true.
6157 * getargs.h (pull_parser): extern it.
6158 * src/output.c (prepare): Insert pull_flag muscle.
6159 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
6160 (prologue_declaration): Set both push_parser and pull_parser = true for
6161 %push-pull-parser. Set push_parser = true and pull_parser = false for
6162 %push-parser.
6163 * src/scan-gram.l: Don't accept %push_parser as an alternative to
6164 %push-parser since there's no backward-compatibility concern here.
6165 Scan %push-pull-parser.
6166 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
6167 instead of %push-parser.
6168 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
6169 prototype it in the module that calls yyparse.
6170 * tests/input.at (Torturing the Scanner): Likewise.
6171 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
6172
2e7944cb
JD
61732006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
6174
6175 Update etc/bench.pl. Optimize push mode a little (the yyn change
6176 deserves most of the credit).
6177 * Makefile.am (SUBDIRS): Add etc subdirectory.
6178 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
6179 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
6180 yytoken, yyval, and yyloc declarations to...
6181 (yyparse or yypush_parse): ... here to improve performance. For
6182 yypush_parse invocations after the first, be sure to assign yyn its old
6183 value again.
6184 (yypstate_new): Don't bother initializing the yyresult field since the
6185 initial value isn't used.
6186 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
6187 remove the #define that, in push mode, set it to yyps->NAME.
6188 * etc/Makefile.am: New.
6189 * etc/bench.pl: Remove and build it instead from...
6190 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
6191 "tests/bison" from the build directory by default rather than just
6192 invoking "bison" from $PATH.
6193 (calc_grammar): Update push parser code: don't declare yylval globally,
6194 don't define yyparse_wrapper, and don't #define yyparse.
6195 (bench_grammar): Update to check all working combinations of yacc.c,
6196 push.c, impure, pure, pull, and push.
6197
c3d50342
JD
61982006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6199
6200 For push mode, add pull wrappers around yypush_parse.
6201 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
6202 (yypull_parse): New function wrapping yypush_parse.
6203 (yyparse): New #define wrapping yypull_parse.
6204 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
6205 is declared.
6206 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
6207 prototype yylex in the module that calls yyparse, and don't prototype
6208 yyparse there. Otherwise, the yyparse expansion won't compile.
6209 * tests/input.at (Torturing the Scanner): Likewise.
6210
94ebeba5
JD
62112006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6212
6213 Enable push parsers to operate in impure mode. Thus, %push-parser no
6214 longer implies %pure-parser. The point of this change is to move
6215 towards being able to test the push parser code by running the entire
6216 test suite as if %push-parser had been declared.
6217 * data/push.c (yypush_parse): For impure mode, remove the
6218 yypushed_char, yypushed_val, and yypushed_loc arguments.
6219 Instead, declare these as local variables initialized to the global
6220 yychar, yylval, and yylloc.
6221 For the first yypush_parse invocation only, restore the initial values
6222 of these global variables when it's time to read a token since they
6223 have been overwritten.
6224 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
6225 %push-parser.
6226 * tests/calc.at (Simple LALR(1) Calculator): Always declare
6227 %pure-parser along with %push-parser since this test case was designed
6228 for pure push parsers.
6229 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
6230 (AT_YACC_OR_PUSH_IF): New.
6231 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
6232 add a note that it's still wrong for some cases (as it has been for a
6233 while).
6234 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
6235 %push-parser no longer implies %pure-parser.
6236
a0633178
JD
62372006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6238
6239 Remove some unnecessary differences between the pull parser code and
6240 the push parser code. This patch enables yynerrs in push mode.
6241 * data/push.c: Reformat M4 a little.
6242 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
6243 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
6244 because push mode is on. Instead, if pure mode is on, move yynerrs
6245 to...
6246 (b4_declare_parser_state_variables): ... here.
6247 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
6248 to yyps->NAME so it can be used in yypush_parse.
6249 (yypush_parse): Don't omit uses of yynerrs in push mode.
6250
8646b6a3
JD
62512006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6252
6253 Fix bug such that the first pushed token's value and location are
6254 sometimes overwritten (sometimes by %initial-action) before being used.
6255 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
6256 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
6257 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
6258 more closely mimic the pull parser logic.
6259 Don't copy the pushed token to yychar, yylval, and yylloc until it's
6260 time to read a token, which is after any initialization of yylval and
6261 yylloc.
6262 (gottoken): Rename label to...
6263 (yyread_pushed_token): ... for clarity and to avoid infringing on the
6264 user namespace.
6265
9baf4d74
JD
62662006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6267
6268 Rearrange initialization of the parser state variables so that the
6269 skeleton doesn't have to have a copy for pull mode and another for push
6270 mode. This patch also fixes at least a bug such that yylloc was not
6271 initialized (with b4_location_initial_line and
6272 b4_location_initial_column) upon calling yypush_parse. However, that
6273 initialization now overwrites the first token's location;
6274 %initial-action assigning @$ already did the same thing, and both bugs
6275 will be fixed in a later patch.
6276 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
6277 (b4_declare_parser_state_variables): Remove initialization of yytoken,
6278 yyss, yyvs, yyls, and yystacksize.
6279 (yypstate_new): Remove initialization of some yypstate fields: yystate,
6280 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
6281 yylsp.
6282 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
6283 yyps->NAME so it can be used in yypush_parse.
6284 (yyparse or yypush_parse): For yypush_parse, don't print the
6285 "Starting parse" diagnostic for invocations after the first.
6286 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
6287 yypush_parse, only do it for the first invocation.
6288 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
6289 initialization to occur in yypush_parse but only on the first
6290 invocation.
6291
23522164
JD
62922006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6293
6294 * data/push.c: Add CPP guards around push parser declarations in both
6295 the header and the code file.
6296 In the code file, move the push parser declarations to the same place
6297 they appear in the header file.
6298 Clean up the M4 some, especially the inconsistent underquoting in
6299 some b4_c_function_def and b4_c_function_decl uses.
6300
bb010fe5
JD
63012006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6302
6303 Encapsulate the push parser state variables into an M4 macro so the
6304 push skeleton doesn't have to list them again for pull mode's yyparse.
6305 For push mode, remove yypush_parse's local equivalents of these
6306 variables to eliminate unnecessary copying between the two sets at
6307 run-time. This patch also fixes at least a bug related to multiple
6308 %initial-action invocations in push mode.
6309 * data/push.c (b4_declare_parser_variables): Rename to...
6310 (b4_declare_scanner_communication_variables): ... this for clarity and
6311 update both uses.
6312 (b4_declare_yyparse_variables): Remove and move its contents to the one
6313 spot where it was invoked.
6314 (b4_declare_parser_state_variables): New macro containing the parser
6315 state variables required by push mode.
6316 (struct yypstate): Replace all fields but yynew with
6317 b4_declare_parser_state_variables.
6318 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
6319 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
6320 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6321 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6322 parser state variable declarations with
6323 b4_declare_parser_state_variables.
6324 Don't initialize parser state variables when calling yypush_parse since
6325 yypstate_new already does that.
6326 Invoke the user's initial action only upon the first yypush_parse
6327 invocation.
6328 Remove all code that copies between the local parser state variables
6329 and the yypstate.
6330
2d212f8c
JD
63312006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6332
6333 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6334 prevent a name collision in a future patch where these names will
6335 sometimes be #define'd.
6336 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6337 since it no longer has the same name as the existing argument.
6338 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6339
e6e704dc
JD
63402006-12-19 Paolo Bonzini <bonzini@gnu.org>
6341 and Joel E. Denny <jdenny@ces.clemson.edu>
6342
6343 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6344 that the argument is case-insensitive, and there's no `=' here.
6345 For the %skeleton entry, mention that %language is better.
6346 (Bison Options): Likewise for --language and --skeleton. Move the
6347 --skeleton entry so that the `Tuning the parser' section is sorted
6348 alphabetically on long options.
6349 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6350 %language directive in detail here; cross-reference the %language
6351 documentation instead.
6352 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6353 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 6354 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
6355 * examples/extexi (normalize): Instead of replacing every %require
6356 argument with the current Bison version, just substitute for
6357 `@value{VERSION}'. This guarantees that we're testing what actually
6358 appears in the documentation.
6359 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6360 rather than `@VERSION@'.
6361
0e021770
PE
63622006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6363
fd575f05
PE
6364 * NEWS: Reword the %language news a bit, and put it earlier.
6365
0e021770
PE
6366 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6367 Rewrite to simplify the logic.
6368 (language_argmatch): Likewise.
fd575f05
PE
6369 (program_name): We now own this var.
6370 * src/getargs.h (struct bison_language): Use char[] rather than
6371 const char *.
0e021770
PE
6372
6373 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6374 Java is supported.
6375 * src/complain.c (program_name): Remove decl; no longer needed.
6376 * src/main.c (program_name): Remove; now belongs to getargs.
6377
63782006-12-18 Paolo Bonzini <bonzini@gnu.org>
6379
6380 * NEWS: Document %language.
6381
6382 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6383
6384 * data/c-skel.m4, data/c++-skel.m4: New files.
6385 * data/glr.c: Complain on push parsers.
6386
6387 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6388 over %skeleton.
148d66d8 6389 (Decl Summary): Document %language and %skeleton.
0e021770
PE
6390 (Command line): Document -L.
6391
6392 * examples/extexi: Rewrite %require directive.
6393 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6394
6395 * src/files.c (compute_exts_from_gc): Look in language structure
6396 for .y extension.
6397 (compute_file_name_parts): Check whether .tab should be added.
6398 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6399 (language, skeleton_arg, language_argmatch): New.
6400 (long_options): Add --language.
6401 (getargs): Use skeleton_arg, add -L/--language.
6402 * src/getargs.h: Include location.h.
6403 (struct bison_language, language, skeleton_arg, language_argmatch): New.
6404 * src/output.c (prepare): Pick default skeleton from struct language.
6405 Don't dispatch C skeletons here.
6406 * src/parse-gram.y (PERCENT_LANGUAGE): New.
6407 (prologue_declaration): Add "%language" rule, use skeleton_arg.
6408 * src/scan-gram.l ("%language"): New rule.
6409
6410 * tests/calc.at: Test %skeleton and %language.
6411 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
6412 (AT_GLR_IF): Look for %skeleton "glr.cc".
6413 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
6414 (AT_YACC_IF): Reject %language.
6415
5691bf57
PE
64162006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6417
db06f0ce
PE
6418 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
6419 since it wasn't used; only the typedef name 'semantic_type' is needed.
6420 Also, omit trailing white space.
6421
5691bf57
PE
6422 * bootstrap: Sync from coreutils.
6423 (gnulib_extra_files): Add build-aux/announce.gen.
6424 (slurp): Adjust .gitignore files like .cvsignore files.
6425 * build-aux/announce-gen: Remove from CVS, since bootstrap
6426 now creates this.
6427
791934e4
JD
64282006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
6429
6430 Make %push-parser imply %pure-parser. This fixes several bugs; see
6431 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
6432 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6433 pure_parser = true.
6434 * data/push.c: Don't bother testing b4_push_if when deciding whether
6435 to expand b4_declare_parser_variables globally.
6436 (yypush_parse): Likewise in here.
6437
6438 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
6439 (yy_reduce_print): Reformat M4 for readability.
6440
ee5abb37
JD
64412006-12-15 Bob Rossi <bob@brasko.net>
6442 and Joel Denny <jdenny@ces.clemson.edu>
6443
6444 * data/push.c (yypstate): Add typedef, and update all uses of
6445 struct yypstate to just yypstate.
6446 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
6447
16ca01f9
JD
64482006-12-14 Bob Rossi <bob@brasko.net>
6449
6450 * data/push.c (yypush_parse): Declare prototype regardless of
6451 %locations option.
6452
ab8e7e1a
JD
64532006-12-14 Bob Rossi <bob@brasko.net>
6454
6455 * data/push.c (yyparse): Remove the prototype and the #define when in
6456 push-parser mode.
6457
9bf32be3
JD
64582006-12-13 Bob Rossi <bob@brasko.net>
6459
6460 * data/push.c (yypstate_init): Rename to...
6461 (yypstate_new): ... this and use b4_c_function_def.
6462 (yypstate_delete): New.
6463 (yypush_parse): Change parameters yynval and yynlloc to be const.
6464 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
6465 yypstate_delete functions.
6466
f02e2948
JD
64672006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
6468
6469 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
6470 strange test case titles. Reported by Bob Rossi.
6471
38eb7751
PE
64722006-12-13 Paul Eggert <eggert@cs.ucla.edu>
6473
6474 * TODO: Add pointer to Sylvain Schmitz's work on static detection
6475 of potential ambiguities in GLR grammers.
6476
bd9d212b
JD
64772006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
6478
6479 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
6480 `bison ', use m4_index instead of m4_substr since chopping up a string
6481 containing M4-special characters causes problems here.
6482
6483 Fix a couple of bugs related to special characters in user-specified
6484 file names, and make it easier for skeletons to compute output file
6485 names with the same file name prefix as Bison-computed output file
6486 names.
6487 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
6488 b4_parser_file_name and b4_spec_defines_file instead of
6489 @output_parser_name@ and @output_header_name@, which are now redundant.
6490 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
6491 b4_parser_file_name, b4_spec_defines_file, and the new
6492 @basename(FILENAME@) instead of @output_parser_name@ and
6493 @output_header_name@, which inappropriately escaped the file names as
6494 C string literals.
6495 * src/files.c (all_but_ext): Remove static qualifier.
6496 (compute_output_file_names): Move `free (all_but_ext)' to...
6497 (output_file_names_free): ... here since all_but_ext is needed later.
6498 * src/files.h (all_but_ext): Extern.
6499 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
6500 exactly what MUSCLE_INSERT_STRING used to do.
6501 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
6502 characters are escaped properly.
6503 * src/output.c (prepare): Define muscle file_name_all_but_ext as
6504 all_but_ext.
6505 For pkgdatadir muscle, maintain previous functionality by using
6506 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
6507 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
6508 digraphs would never be expanded. Hopefully no one has M4-special
6509 characters in his Bison installation path.
6510 * src/scan-skel.l: Don't parse @output_header_name@ and
6511 @output_parser_name@ anymore since they're now redundant.
6512 In @output, use decode_at_digraphs.
6513 Parse a new @basename command that invokes last_component.
6514 (decode_at_digraphs): New.
6515 (BASE_QPUTS): Remove unused.
6516 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
6517 (Output file name): New tests.
6518
3f7ca628
JD
65192006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
6520
6521 Warn about output files that are generated by the skeletons and that
6522 conflict with other output files.
6523 * data/glr.c: Don't generate the header file here when glr.cc does.
6524 * src/files.c (file_names, file_names_count): New static globals.
6525 (compute_output_file_names): Invoke output_file_name_check for files
6526 not generated by the skeletons and remove existing checks.
6527 (output_file_name_check): New function that warns about conflicting
6528 output file names.
6529 (output_file_names_free): Free file_names.
6530 * src/files.h (output_file_name_check): Declare.
6531 * src/scan-skel.l: Invoke output_file_name_check for files generated by
6532 the skeletons.
6533 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
6534 (Conflicting output files): New tests.
6535
178e123e
PE
65362006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6537
6538 * doc/bison.texinfo: Fix a couple of typos.
6539
65402006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
6541
6542 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
6543 Rename to...
6544 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
6545 update all uses.
6546 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
6547 (yypush_parse): Rename yypvars argument to yyps and remove redundant
6548 local pv.
6549 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
6550 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
6551
ea17f233
JD
65522006-12-07 Bob Rossi <bob@brasko.net>
6553 and Joel Denny <jdenny@ces.clemson.edu>
6554
6555 * data/push.c (yypvarsinit): Change return type from void* to struct
6556 yypvars*. No longer cast to void* on return.
6557 (struct yypvars): Remove yylen since it need not be remembered between
6558 yypushparse invocations.
6559 (yypushparse): Don't copy between yylen and pv->yylen.
6560
55a30bda
JD
65612006-12-05 Bob Rossi <bob@brasko.net>
6562
6563 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6564 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6565 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6566 (struct yypvars): Remove b4_declare_parser_variables.
6567 (yypvarsinit): Remove init code for removed variables.
6568 (global scope): Do not declare b4_declare_parser_variables if
6569 push or pure mode.
6570 (yypushparse): Add b4_declare_parser_variables.
6571 Init new local variables, and remove init code for removed
6572 yypvars variables.
6573 (yyparse): Delete.
6574 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6575 and yyparse for other modes.
6576 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6577 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6578 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6579 (AT_PURE_LEX_IF): True if pure or push parser.
6580
85894313
JD
65812006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6582
6583 Document Yacc prologue alternatives and default %destructor's and
6584 %printer's as experimental. Don't mention Java yet. Discussed at
6585 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6586 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6587 (2.3a): Annotate this entry to say the old forms of these features were
6588 also experimental.
6589 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 6590 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
6591 of Java (we'll want this back eventually).
6592
02975b9a
JD
65932006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6594
6595 Support a file name argument to %defines. Deprecate `=' in
6596 %file-prefix, %name-prefix, and %output. Discussed at
6597 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6598 * NEWS (2.3a+): Mention.
148d66d8 6599 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
6600 form of %defines, and remove `=' from entries for %file-prefix,
6601 %name-prefix, and %output.
6602 * src/parse-gram.y (prologue_declaration): Implement.
6603 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6604 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6605 all but one occurrence of %name-prefix.
6606 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6607 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6608 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6609 occurrence of each of %file-prefix and %output. Add check for %defines
6610 with argument.
6611 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6612 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6613 Remove the `=' from %output.
6614
287b314e
JD
66152006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6616
6617 Don't escape $ in test case titles since Autoconf 2.61 now does that
6618 correctly.
6619 * tests/actions.at (Default %printer and %destructor are not for error
6620 or $undefined): Here.
6621 (Default %printer and %destructor are not for $accept): Here.
6622 * tests/input.at (Invalid $n and @n): Here.
6623
3ebecc24
JD
66242006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6625
6626 Rename <!> to <>. Discussed starting at
6627 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6628 * NEWS (2.3a+): Update.
148d66d8 6629 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
6630 Update.
6631 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6632 * src/scan-gram.l (INITIAL): Implement.
6633 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6634 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6635 comment.
6636 * tests/actions.at (Default tagless %printer and %destructor,
6637 Default tagged and per-type %printer and %destructor,
6638 Default %printer and %destructor are not for error or $undefined,
6639 Default %printer and %destructor are not for $accept,
6640 Default %printer and %destructor for mid-rule values): Update.
6641 * tests/input.at (Default %printer and %destructor redeclared,
6642 Unused values with default %destructor): Update.
6643
26b8a438
JD
66442006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6645
6646 Don't let %prec take a nonterminal.
6647 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6648 token.
6649 * tests/input.at (%prec takes a token): New test checking that %prec
6650 won't take a nonterminal.
6651
07c39ae9
JD
66522006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6653
405d53b7
JD
6654 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6655 it was double-quoted.
07c39ae9
JD
6656 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6657 grammar is maintained with Bison's highest standards.
6658 * src/getargs.c: Fix some typos in Doxygen comments.
6659
580b8926
JD
66602006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6661
6662 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6663 later. Reported by Paul Eggert in
6664 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6665 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6666 * src/scan-code.l (translate_action): Don't bother invoking
6667 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6668 (code_scanner_free): Instead of invoking
6669 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6670 which frees more.
6671 * src/scan-gram.l (gram_scanner_free): Likewise.
6672 * src/scan-skel.l (scan_skel): Likewise.
6673
4502eadc
JD
66742006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6675
6676 * src/files.c (tr): Change return type to void.
6677 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6678 has been called previously for the same key.
6679 (muscle_find): Return storage instead of value so that
6680 --enable-gcc-warnings doesn't produce warnings that the return discards
6681 const. aver that the value and storage are the same since storage
6682 could potentially be NULL when value is not.
6683 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6684 same as 0.
6685
7746c8f6
PE
66862006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6687
6688 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6689 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6690 us a slightly cleaner distribution, and also works.
6691 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6692 gnulib changes.
6693
eb095650
PE
66942006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6695 and Paul Eggert <eggert@cs.ucla.edu>
6696
6697 Don't let Bison leak memory except when it complains.
6698 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6699 (spec_defines_file, dir_prefix): Now char *, not const char *,
6700 since they are freed.
6701 * src/files.c: Likewise.
6702 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6703 Likewise.
6704 (tr): Now operates in-place. All uses changed.
6705 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6706 values.
6707 (compute_file_name_parts, compute_output_file_names): Don't store
6708 read-only data in variables that will be freed.
6709 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6710 src_extension, and header_extension.
6711 (output_file_names_free): New public function to free
6712 spec_verbose_file, spec_graph_file, spec_defines_file,
6713 parser_file_name, and dir_prefix.
6714 * src/getargs.c (getargs): Don't store read-only data in variables that
6715 will be freed.
6716 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6717 (which previously existed but was unused), and quotearg_free.
6718 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6719 * src/muscle_tab.c: Likewise.
6720 (muscle_entry): Make the value char const *,
6721 and add a new storage member that is char * and can be freed.
6722 (muscle_entry_free): New private function.
6723 (muscle_init): Use it instead of free.
6724 (muscle_insert, muscle_grow): Update and use new storage member.
6725 (muscle_code_grow): Free the string passed to muscle_grow
6726 since it's not needed anymore.
6727 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6728 add a new `char *code' member.
6729 ("{...}"): Declare semantic type as code.
6730 * src/scan-code.h (translate_rule_action):
6731 (translate_symbol_action, translate_code, translate_action): Return
6732 `char const *' rather than `char *' since external code should not free
6733 these strings.
6734 * src/scan-code.l: Likewise.
6735 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6736 which is "{...}" in the parser.
6737 * tests/Makefile.am (maintainer-check-valgrind): Set
6738 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6739 Valgrind.
6740 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6741 complain.
6742 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6743 expecting a non-zero exit status sets --leak-check=summary and
6744 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6745 this case, and we don't want to hear about it.
6746
ac564be4
PE
67472006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6748
6749 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6750 instead of from the template, to simplify configuration a bit.
6751 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6752 and m4/wint_t.m4, as they are needed with the latest gnulib.
6753
17bd8a73
JD
67542006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6755
6756 Disable unset/unused mid-rule value warnings by default, and recognize
6757 --warnings=midrule-values to enable them. Discussed starting at
6758 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6759 * NEWS (2.3a+): Mention.
6760 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6761 warnings): Add entry for midrule-values subargument.
6762 * src/reader.c (symbol_should_be_used): Don't return true just because
6763 the value is a set/used mid-rule value unless
6764 --warnings=midrule-values was specified.
6765 * tests/input.at (Unused values, Unused values before symbol
6766 declarations): Run tests with and without --warnings=midrule-values.
6767
6768 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6769 than LIST_FREE directly.
6770
89eb3c76
JD
67712006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6772
6773 Finish implementing --warnings=error, which should not be implied by
6774 --warnings=all (or by its synonyms -W and --warnings without
6775 subarguments).
6776 * src/complain.c (set_warning_issued): New function to report that
6777 warnings are being treated as errors and to record an error if so.
6778 Invoke...
6779 (warn_at, warn): ... here.
6780 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6781 "error - warnings are errors" does not appear above "all - all of the
6782 above".
6783 (getargs): For -W and --warnings without subarguments, don't let
6784 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6785 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6786
ba7560e2
JD
67872006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6788
6789 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6790 empty subargument list. For example: `bison --warnings= parser.y'.
6791
31283fc3
JD
67922006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6793
6794 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6795 the parser header file so that gcc doesn't warn.
6796
12e35840
JD
67972006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6798
6799 Split the default %destructor/%printer into two kinds: <*> and <!>.
6800 Discussed starting at
6801 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6802 * NEWS (2.3a+): Mention.
6803 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6804 previous change today related to mid-rules.
148d66d8 6805 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 6806 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
6807 (TYPE_TAG_ANY): Add as <*>.
6808 (TYPE_TAG_NONE): Add as <!>.
6809 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6810 for <*> and <!>.
6811 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6812 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6813 * src/symlist.c (symbol_list_default_new): Split into tagged and
6814 tagless versions.
6815 (symbol_list_destructor_set, symbol_list_printer_set): Split
6816 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6817 SYMLIST_DEFAULT_TAGLESS.
6818 * src/symlist.h: Update symbol_list_default*_new prototypes.
6819 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6820 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6821 * src/symtab.c (default_destructor, default_destructor_location,
6822 default_printer, default_printer_location): Split each into tagged and
6823 tagless versions.
6824 (symbol_destructor_get, symbol_destructor_location_get,
6825 symbol_printer_get, symbol_printer_location_get): Implement tagged
6826 default and tagless default cases.
6827 (default_destructor_set, default_printer_set): Split each into tagged
6828 and tagless versions.
6829 * src/symtab.h: Update prototypes.
6830 * tests/actions.at (Default %printer and %destructor): Rename to...
6831 (Default tagless %printer and %destructor): ... this, and extend.
6832 (Per-type %printer and %destructor): Rename to...
6833 (Default tagged and per-type %printer and %destructor): ... this, and
6834 extend.
6835 (Default %printer and %destructor for user-defined end token): Extend.
6836 (Default %printer and %destructor are not for error or $undefined):
6837 Update.
6838 (Default %printer and %destructor are not for $accept): Update.
6839 (Default %printer and %destructor for mid-rule values): Extend.
6840 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6841 (Unused values with default %destructor): Extend.
6842
f91b1629
JD
68432006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6844
6845 Don't apply the default %destructor/%printer to an unreferenced midrule
6846 value. Mentioned at
6847 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6848 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6849 like $@n instead of just @n so that the default %destructor/%printer
6850 logic doesn't see them as user-defined symbols.
6851 (symbol_is_dummy): Check for both forms of the name.
6852 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6853 name for which the midrule value is referenced in any action.
6854 * tests/actions.at (Default %printer and %destructor for mid-rule
6855 values): New test.
6856 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6857 for change to dummy symbol names.
6858
519d0004
JD
68592006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6860
6861 Warn about unset midrule $$ if the corresponding $n is used.
6862 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6863 $n usage.
6864 (packgram): Before invoking grammar_rule_check on any rule, make sure
6865 all actions have already been scanned in order to set `used' flags.
6866 Otherwise, checking that a midrule's $$ is set will not always work
6867 properly because the midrule check must forward-reference the midrule's
6868 parent rule.
6869 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6870 warning.
6871
a501eca9
JD
68722006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6873
6874 More improvements to the documentation of the prologue alternatives:
6875 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6876 Bison manual.
6877 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6878 some text to clarify the relative importance of the new directives and
6879 to show how these directives may be viewed as code labels.
6880
2cbe6b7f
JD
68812006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6882
6883 Similar to the recently removed %before-header, add %code-top as the
6884 alternative to the pre-prologue. Mentioned at
6885 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6886 Also, let the prologue alternatives appear in the grammar section.
6887 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6888 (prologue_declaration): Move the existing prologue alternatives to...
6889 (grammar_declaration): ... here and add %code-top.
6890 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6891
6892 Clean up and extend documentation for the prologue alternatives.
6893 * NEWS (2.3a+): Describe prologue alternatives.
6894 * doc/bison.texinfo (Prologue): Move discussion of prologue
6895 alternatives to...
6896 (Prologue Alternatives): ... this new section, and extend it to discuss
6897 all 4 directives in detail.
148d66d8
JD
6898 (Table of Symbols): Clean up discussion of prologue alternatives and
6899 add %code-top.
2cbe6b7f 6900
e557d3ea
JMG
69012006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6902
6903 DJGPP specific issues.
6904
6905 * djgpp/config.bat: config.hin has been moved to lib. Adjust
6906 config.bat accordingly.
6907 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
6908 * djgpp/config.site: Likewise.
6909
136a0f76
PB
69102006-10-16 Paolo Bonzini <bonzini@gnu.org>
6911
27bd5d67
PB
6912 Replace %*-header with %provides, %requires, %code. See discussion at
6913 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
6914
136a0f76
PB
6915 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
6916 (b4_user_start_header): Remove.
6917 * data/glr.c: Use new macros instead of b4_*start_header
6918 and b4_*end_header.
6919 * data/glr.cc: Likewise.
6920 * data/lalr1.cc: Likewise.
6921 * data/push.c: Likewise.
6922 * data/yacc.c: Likewise.
6923
6924 * doc/bison.texinfo: Remove %before-header, rename
6925 %{start,end,after}-header to %requires, %provides, %code.
6926
6927 * src/parse-gram.y: Likewise (also rename token names accordingly).
6928 * src/scan-gram.l: Likewise.
6929 * tests/actions.at: Likewise.
6930
10f429ef
PE
69312006-10-14 Paul Eggert <eggert@cs.ucla.edu>
6932
6933 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
6934 Problem reported by Joel E. Denny.
6935
69362006-10-14 Jim Meyering <jim@meyering.net>
6937
6938 (Sync from coreutils.)
6939 Work also when the working directory (with e.g. coreutils sources)
6940 is version controlled with git, rather than CVS.
6941 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
6942 rather than CVS.
6943 In messages and comments, say e.g., "checked-out sources",
6944 rather than "CVS sources".
6945 (version_controlled_file): New function. Work for git as well as
6946 for CVS. Don't use grep's -q option.
6947 (slurp): Call it here, in place of CVS-specific code.
6948
c4bd5bf7
JD
69492006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
6950
6951 Fix testsuite for ./configure --enable-gcc-warnings:
6952 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
6953 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
6954 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
6955 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
6956 * test/regression.at (Diagnostic that expects two alternatives):
6957 Likewise.
6958
46356ea4
PE
69592006-10-12 Paul Eggert <eggert@cs.ucla.edu>
6960
231ed89a
PE
6961 * bootstrap.conf (gnulib_modules): Add config-h.
6962 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
6963 worry about HAVE_CONFIG_H.
6964 * lib/abitset.c: Likewise.
6965 * lib/bitset.c: Likewise.
6966 * lib/bitset_stats.c: Likewise.
6967 * lib/bitsetv-print.c: Likewise.
6968 * lib/bitsetv.c: Likewise.
6969 * lib/ebitset.c: Likewise.
6970 * lib/get-errno.c: Likewise.
6971 * lib/lbitset.c: Likewise.
6972 * lib/subpipe.c: Likewise.
6973 * lib/timevar.c: Likewise.
6974 * lib/vbitset.c: Likewise.
6975 * lib/bitset.c: Include "bitset.h" first, to test interface.
6976 * lib/bitset_stats.c: Include "bitset_stats.h" first.
6977 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
6978 * lib/bitsetv.c: Include "bitsetv.h" first.
6979 * lib/get-errno.c: Include "get-errno.h" first.
6980 * m4/.cvsignore: Add config-h.m4.
6981 * tests/actions.at (Default %printer and %destructor for ...):
6982 Adjust expected line numbers in output to reflect removal of #if
6983 HAVE_CONFIG_H lines.
6984 * tests/glr-regression.at (Missed %merge type warnings when ...):
6985 Likewise.
6986 * tests/regression.at (Braced code in declaration in rules section):
6987 Likewise.
6988 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
6989 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
6990 Include <config.h> unconditionally.
6991
46356ea4
PE
6992 * bootstrap: Sync from coreutils, as follows:
6993
6994 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
6995
6996 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
6997 variable was sometimes used without being initialized. This
6998 messed up the installation of the INSTALL file in some cases.
6999
7000 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7001
7002 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7003 --copy. Inspired by a suggestion from Bruno Haible.
7004
7005 2006-10-03 Jim Meyering <jim@meyering.net>
7006
7007 * bootstrap: Undo last change to this file, since now gnulib-tool
7008 sticks with the automake default in generating dependencies.
7009
dd4bf078
PE
70102006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7011
cf2a5f7c
PE
7012 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7013 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7014
7015 * doc/bison.1: Add copyright notice.
7016
7017 * data/glr.c: Don't include <stdarg.h>; not used.
7018
35fe0834
PE
7019 * NEWS: The -g and --graph options now output graphs in Graphviz
7020 DOT format, not VCG format.
7021 * doc/bison.1: Likewise.
7022 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
7023 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
7024 of this change in
7025 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
7026 * TODO: Remove Graphviz entry.
7027 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
7028 remove vcg.c, vcg.h, vcg_defaults.h.
7029 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
7030 * src/graphviz.c, src/graphviz.h: New files.
7031 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
7032 * src/files.h: Make comment more generic.
7033 * src/main.c (main): Likewise.
7034 * src/print_graph.h: Likewise.
7035 * src/getargs.c (usage): Make usage description more generic.
7036 * src/print_graph.c: Include graphviz.h rather than vcg.h.
7037 (static_graph, fgraph): Remove. All uses changed to pass
7038 arguments instead of sharing a static var.
7039 (print_core, print_actions, print_state, print_graph):
7040 Output graphviz format rather than VCG format.
7041 * tests/.cvsignore: Remove *.vcg; add *.dot.
7042 * tests/output.at: Expect *.dot files, not *.vcg files.
7043
dd4bf078
PE
7044 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
7045 accommodates the 2006-10-08 change.
7046
efdd7421
PE
70472006-10-11 Bob Rossi <bob@brasko.net>
7048
7049 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
7050 (b4_yyssa, b4_yyerror_range): New macros.
7051 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
7052 (yypvarsinit): Remove init of removed fields.
7053 (yypushparse): Remove use of removed fields; use new macros instead.
7054
96a1981a
PE
70552006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7056
7057 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
7058 in a push parser. Reindent slightly to match yacc.c better.
7059
70602006-10-11 Bob Rossi <bob@brasko.net>
7061
46356ea4
PE
7062 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
7063 yymsg_alloc fields.
7064 (yypvarsinit, yypushparse): Remove init of removed fields.
7065 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 7066
c1630a8b
PE
70672006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7068
7069 * THANKS: Add Paolo Bonzini and Bob Rossi.
7070
90b9908d
PB
70712006-10-08 Paolo Bonzini <bonzini@gnu.org>
7072
7073 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
7074 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
7075 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
7076 b4_define_user_cde and uses): Remove.
7077 (b4_comment, b4_prefix, b4_sync_start): New.
7078 * data/bison.m4: New file, with most of the content removed from c.m4.
7079 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
7080 * src/output.c (output_skeleton): Pass bison.m4.
7081 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
7082 only if specified.
7083
cf806753
PE
70842006-10-05 Paul Eggert <eggert@cs.ucla.edu>
7085
7086 Fix test failure reported by Tom Lane in
7087 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
7088 and try to make such failures easier to catch in the future.
7089 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
7090 that's now the caller's responsibility.
7091 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
7092 Set yychar = YYEOF if it's negative.
7093 * tests/actions.at (yylex): Abort if asked to read past EOF.
7094 * tests/conflicts.at (yylex): Likewise.
7095 * tests/cxx-type.at (yylex): Likewise.
7096 * tests/glr-regression.at (yylex): Likewise.
7097 * tests/input.at (yylex): Likewise.
7098 * tests/regression.at (yylex): Likewise.
7099 * tests/torture.at (yylex): Likewise.
7100
0e2f006a
PE
71012006-10-01 Paul Eggert <eggert@cs.ucla.edu>
7102
7103 Fix problems with translating English-language diagnostics.
7104 * bootstrap: Fix bug introduced in recent bootstrap changes, with
7105 respect to bison-runtime pot generation. The YY_ stuff
7106 wasn't being captured.
7107 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
7108 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
7109 * runtime-po/POTFILES.in: Add data/push.c.
7110
e3ddc1e3
PE
71112006-09-29 Paul Eggert <eggert@cs.ucla.edu>
7112
7113 Merge bootstrap changes from coreutils.
7114
7115 2006-09-28 Jim Meyering <jim@meyering.net>
7116
7117 Automatically generated dependencies are important even
7118 when all of the sources in a directory come from gnulib.
7119 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
7120 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
7121
7122 2006-09-23 Jim Meyering <jim@meyering.net>
7123
7124 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
7125
7126 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7127
7128 * bootstrap: Add support for --force.
7129 (usage): New function. Describe usage less tersely.
7130 (CVS_only_file): New var.
7131
01e972b3
PE
71322006-09-21 Paul Eggert <eggert@cs.ucla.edu>
7133
7134 * data/push.c (YYPUSH_MORE): Make it an enum instead.
7135 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
7136 Adjust white space and comments to match GNU style better.
7137
c63d3e90
PE
71382006-09-20 Bob Rossi <bob@brasko.net>
7139
7140 * data/push.c (yyresult_get): Remove function.
7141 (YYPUSH_MORE): Add #define.
7142 (yypushparse): Modify return value.
7143
e70f46d1
PE
71442006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7145
7146 * stamp-h.in: Remove; no longer needed.
7147 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
7148 Remove config.h, config.hin, intl (no longer created).
7149 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
7150 stamp-h1.
7151
7152 Sync bootstrap from coreutils, as follows:
7153
7154 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
7155
7156 * bootstrap (symlink_to_gnulib): New function.
7157 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
7158 to copies-of-gnulib.
7159 (cp_mark_as_generated, slurp, gnulib_files):
7160 Avoid making a copy if it's the same as the old version.
7161 (gnulib_files): Add support for this variable (used by Bison).
7162
a92be413
PE
71632006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7164
7165 * src/getargs.c (usage): Rework to use conventions similar to
7166 coreutils, to make translation a bit easier and the code a bit
7167 smaller. Problem reported by Tim Van Holder.
7168
4f82b42a
PE
71692006-09-15 Paul Eggert <eggert@cs.ucla.edu>
7170
3b2942e6
PE
7171 Use some of gnulib's new modules, taken from coreutils.
7172
7173 * bootstrap: Sync from coreutils, except add support for gnulib_files.
7174 * bootstrap.conf: New file.
7175 (gnulib_modules): Add configmake, inttypes, unistd.
7176 (XGETTEXT_OPTIONS): Add complain, complain_at,
7177 fatal, fatal_at, warn, warn_at, unexpected_end.
7178 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
7179 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
7180 (gl_EARLY): Add.
7181 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
7182 (gl_INIT): Add
7183 (GNULIB_AUTOCONF_SNIPPET): Remove.
7184 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
7185 the pickiest.
7186 * lib/.cvsignore: Add inttypes_.h.
7187 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
7188 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
7189 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
7190 no-longer-necessary initializations.
7191 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
7192 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
7193 use the unistd module.
7194 * src/system.h: Likewise.
7195 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
7196 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
7197 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
7198 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
7199 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
7200 * src/system.h: Include inttypes.h unconditionally, now that we
7201 use the inttypes module. Don't bother to include stdint.h, since
7202 inttypes.h now does that for us.
7203 (LOCALEDIR): Remove, now that we use the configmake module.
7204 * src/getargs.c: Include configmake.h.
7205 * src/main.c: Likewise.
7206 * src/output.c: Likewise.
7207 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
7208 not from $abs_top_builddir, since config.h moved.
7209
7210
4f82b42a
PE
7211 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
7212 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
7213
7214 * src/parse-gram.y (symbol_declaration): Don't put statements
7215 before declarations; it's not portable to C89.
7216 * src/scan-code.l (handle_action_at): Likewise.
7217
7218 * src/scan-code.l: Always initialize braces_level; the old code
7219 left it uninitialized and therefore had undefined behavior.
7220
7221 Don't attempt to redefine 'assert', since it runs afoul of
7222 systems where standard headers (mistakenly) include <assert.h>.
7223 Instead, define and use our own alternative, called 'aver'.
7224 * src/reader.c: Don't include assert.h, since we no longer
7225 use assert.
7226 * src/scan-code.l: Likewise.
7227 * src/system.h (assert): Remove, replacing with....
7228 (aver): New function, taking a bool arg. All uses changed.
7229 * src/tables.c (pack_vector): Ensure that aver arg is bool,
7230 not merely an integer.
7231
31c10e38
PE
72322006-09-15 Bob Rossi <bob@brasko.net>
7233
7234 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
7235 * data/c.m4 (YYPUSH): New.
7236 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
7237 * src/getargs.c (push_parser): New var.
7238 * src/getargs.h (push_parser): New declaration.
7239 * src/output.c (prepare): Add macro insertion of `push_flag'.
7240 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
7241 (prologue_declaration): Parse %push-parser.
7242 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
7243 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
7244 list of removed lines from the traces observed.
7245 (AT_CHECK_CALC_LALR): Added push parser tests.
7246
fa7b79c0
PE
72472006-09-13 Paul Eggert <eggert@cs.ucla.edu>
7248
21fe08ca
PE
7249 * NEWS: Version 2.3a.
7250 * configure.ac (AC_INIT): Likewise.
7251
e8ec4d9b
PE
7252 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
7253 "#define YYSTYPE int" that caused "make maintainer-check" to fail
7254 due to header ordering dependencies. I don't know why the #define
7255 was there.
7256
fa7b79c0
PE
7257 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
7258 runtime cost when YYDEBUG is not defined, and so that some tests
7259 that used to fail now work. Problem and initial suggestion by
7260 Paolo Bonzini.
7261 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
7262 * data/glr.cc (b4_parser_class_name):
7263 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
7264 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
7265 (yydebug_) [YYDEBUG]: New member.
7266 (yycdebug_): Now defined only if YYDEBUG.
7267 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
7268 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
7269 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
7270 if YYYDEBUG.
7271 (debug_stream, set_debug_stream, debug_level, set_debug_level):
7272 Define only if YYDEBUG.
7273 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
7274 set_debug_level.
7275 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
7276 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
7277 AT_CHECK_CALC_GLR_CC that are working now.
7278
4ec13d60
PE
72792006-09-12 Paul Eggert <eggert@cs.ucla.edu>
7280
7281 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
7282 We don't need them in glr.cc, and glr.c defines them.
7283 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
7284 assumes that defining it to anything is the same as defining
7285 it to 1. Problem reported by Paolo Bonzini.
7286
8e1687ae
PE
72872006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
7288
7289 * data/c.m4 (b4_null, b4_case): Define.
7290 * src/output.c (prepare_symbols): Use b4_null.
7291 (user_actions_output): Use b4_case.
7292
3dc5e96b
PE
72932006-09-11 Paul Eggert <eggert@cs.ucla.edu>
7294
aef3da86
PE
7295 * data/glr.c (b4_shared_declarations): Put start-header first,
7296 before any #includes that we generate, so that feature-test
7297 macros work. Problem reported by Michael Deutschmann in
7298 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7299 * data/lalr1.cc: Likewise.
7300 * doc/bison.texinfo (Prologue): Document that feature-test macros
7301 should be defined before any Bison declarations.
7302 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
7303 that depend on location.hh after, not before, Bison decls, since
7304 we now include location.hh after the first user prologue.
7305
3dc5e96b
PE
7306 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
7307 Sander Brandenburg in
7308 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
7309 Also, fix minor white space and comment issues.
aef3da86
PE
7310 (Prologue): Mention that it's better to define feature-test macros
7311 before Bison declarations. Problem reported by Michael Deutschmann.
7312
7313 * README-cvs: Fix typo: "&" should be "&&". Problem reported
7314 by Jim Meyering.
7315 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
7316 This adjusts to recent gnulib changes.
3dc5e96b 7317
b2a0b7ca
JD
73182006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7319
7320 Finish implementation of per-type %destructor/%printer. Discussed
7321 starting at
7322 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7323 and
7324 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7325 * NEWS (2.3+): Add a description of this feature to the default
7326 %destructor/%printer description.
7327 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7328 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7329 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7330 list node contains a semantic type.
7331 * src/symtab.c, src/symtab.h: Extend with a table that associates
7332 semantic types with their %destructor's and %printer's.
7333 (semantic_type_from_uniqstr, semantic_type_get,
7334 semantic_type_destructor_set, semantic_type_printer_set): New functions
7335 composing the public interface of that table.
7336 (symbol_destructor_get, symbol_destructor_location_get,
7337 symbol_printer_get, symbol_printer_location_get): If there's no
7338 per-symbol %destructor/%printer, look up the per-type before trying
7339 the default.
7340 * tests/actions.at (Per-type %printer and %destructor): New test case.
7341 * tests/input.at (Default %printer and %destructor redeclared):
7342 Extend to check that multiple occurrences of %symbol-default in a
7343 single %destructor/%printer declaration is an error.
7344 (Per-type %printer and %destructor redeclared, Unused values with
7345 per-type %destructor): New test cases.
7346
3be03b13
JD
73472006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7348
7349 Require default %destructor/%printer to be declared using
7350 %symbol-default instead of an empty symbol list, and start working on
7351 new per-type %destructor/%printer. Discussed at
7352 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7353 * NEWS (2.3+): Add %symbol-default to example.
7354 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 7355 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
7356 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7357 (generic_symlist, generic_symlist_item): New nonterminals for creating
7358 a list in which each item is a symbol, semantic type, or
7359 %symbol-default.
7360 (grammar_declaration): Use generic_symlist in %destructor and %printer
7361 declarations instead of symbols.1 or an empty list.
7362 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7363 for changes to symbol_list.
7364 * src/reader.c: Update for changes to symbol_list.
7365 * src/scan-code.l: Likewise.
7366 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7367 * src/symlist.c, src/symlist.h: Extend such that a list node may
7368 represent a semantic type or a %symbol-default in addition to just an
7369 ordinary symbol. Add switched functions for setting %destructor's and
7370 %printer's.
7371 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7372 %destructor/%printer declarations.
7373
3508ce36
JD
73742006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7375
7376 Whether the default %destructor/%printer applies to a particular symbol
7377 isn't a question of whether the user *declares* that symbol (in %token,
7378 for example). It's a question of whether the user by any means
7379 *defines* the symbol at all (by simply using a char token, for
7380 example). $end is defined by Bison whereas any other token with token
7381 number 0 is defined by the user. The error token is always defined by
7382 Bison regardless of whether the user declares it with %token, but we
7383 may one day let the user define error as a nonterminal instead.
7384 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7385 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7386 the meaning of "user-defined".
7387 * tests/actions.at (Default %printer and %destructor for user-declared
7388 end token): Rename to...
7389 (Default %printer and %destructor for user-defined end token): ...
7390 this.
7391
7392 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7393 computation of whether to apply the default, don't maintain a list of
7394 every Bison-defined symbol. Instead, just check for a first character
7395 of '$', which a user symbol cannot have, and check for the error token.
7396
9350499c
JD
73972006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7398
7399 Don't apply the default %destructor or %printer to the error token,
7400 $undefined, or $accept. This change fits the general rule that the
7401 default %destructor and %printer are only for user-declared symbols,
7402 and it solves several difficulties that are described in the new test
7403 cases listed below.
7404 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
7405 * tests/actions.at (Default %printer and %destructor are not for error
7406 or $undefined, Default %printer and %destructor are not for $accept):
7407 New test cases.
7408
4d7370cb
JD
74092006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
7410
7411 Allow %start after the first rule.
7412 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
7413 when parsing the first rule.
7414 (check_and_convert_grammar): Search for it here after all grammar
7415 declarations have been parsed. Skip midrules, which have dummy LHS
7416 nonterminals.
7417 * src/symtab.c (symbol_is_dummy): New function.
7418 * src/symtab.h (symbol_is_dummy): Declare it.
7419 * tests/input.at (%start after first rule): New test.
7420
6d0ef4ec
JD
74212006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7422
7423 Redo some of the previous commit: add back the ability to use
7424 non-aliased/undeclared string literals since it might be useful to
7425 those declaring %token-table.
7426 * src/reader.c (check_and_convert_grammar): Undo changes in previous
7427 commit: don't worry about complaints from symbols_pack.
7428 * src/symtab.c (symbol_new, symbol_class_set,
7429 symbol_check_alias_consistency): Undo changes in previous commit: count
7430 each string literal as a new symbol and token, assign it a symbol
7431 number, and don't complain about non-aliased string literals.
7432 (symbols_pack): Since symbol_make_alias still does not decrement symbol
7433 and token counts but does still set aliased tokens to the same number,
7434 symbol_pack_processor now leaves empty slots in the symbols array.
7435 Remove those slots.
7436 * tests/regression.at (Undeclared string literal): Remove test case
7437 added in previous commit since non-aliased string literals are allowed
7438 again.
7439 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
7440 remove unnecessary string literal declarations.
7441 * tests/sets.at (Firsts): Likewise.
7442
965537bc
JD
74432006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7444
7445 Don't allow an undeclared string literal, but allow a string literal to
7446 be used before its declaration.
7447 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
7448 symbols_pack complained.
7449 * src/symtab.c (symbol_new): Don't count a string literal as a new
7450 symbol.
7451 (symbol_class_set): Don't count a string literal as a new token, and
7452 don't assign it a symbol number since symbol_make_alias does that.
7453 (symbol_make_alias): It's not necessary to decrement the symbol and
7454 token counts anymore. Don't assume that an alias declaration occurs
7455 before any uses of the identifier or string, and thus don't assert that
7456 one of them has the highest symbol number so far.
7457 (symbol_check_alias_consistency): Complain if there's a string literal
7458 that wasn't declared as an alias.
7459 (symbols_pack): Bail if symbol_check_alias_consistency failed since
7460 symbol_pack asserts that every token has been assigned a symbol number
7461 although undeclared string literals have not.
7462 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 7463 string literal): New test cases.
965537bc
JD
7464 (Characters Escapes, Web2c Actions): Declare string literals as
7465 aliases.
7466 * tests/sets.at (Firsts): Likewise.
7467
47aee066
JD
74682006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
7469
7470 In the grammar scanner, STRING_FINISH unclosed constructs and return
7471 them to the parser in order to improve error messages.
7472 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
7473 SC_BRACED_CODE, SC_PROLOGUE): Implement.
7474 * tests/input.at (Unclosed constructs): New test case.
7475 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
7476 seen.
7477
7478 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
7479 unused global.
7480
1f6b3679
JD
74812006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
7482
7483 Handle string aliases for character tokens correctly.
7484 * src/symtab.c (symbol_user_token_number_set): If the token has an
7485 alias, check and set its alias's user token number instead of its own,
7486 which is set to indicate the alias. Previously, every occurrence of
7487 the character token in the grammar overwrote that alias indicator with
7488 the character code.
7489 * tests/input.at (String aliases for character tokens): New test.
7490
219741d8
JD
74912006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
7492
7493 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
7494
11daa4e7
PE
74952006-08-11 Paul Eggert <eggert@cs.ucla.edu>
7496
7497 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
7498 to prevent failures when building on older platforms.
7499 Check for autopoint failure.
7500 Set XGETTEXT_OPTIONS to values that check for C format strings,
7501 so that translators are warned about them (this also helps
7502 prevent core dumps).
7503
7504 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
7505 function, since it simplifies our code a bit.
7506
7507 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
7508 rather than -W, so we don't get bogus warnings about sign comparisons.
7509 Add -Wpointer-arith, since that warning is useful (it reports code
7510 that does not conform to C89 and that some compilers reject).
7511 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
7512 since it's no longer needed.
7513
f9bfc42a
JD
75142006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
7515
7516 Clean up scanners a bit.
7517 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
7518 definitions so gcc won't warn when obstack_for_string is unused.
7519 * src/scan-code.l: config.h and system.h are already #include'd by
7520 scan-code-c.c, so get rid of them here.
7521 * src/scan-gram.l: Likewise.
7522 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
7523 definitions rather than duplicating the rest of it.
7524 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
7525
06e8700a
JD
75262006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
7527
7528 Suppress signed/unsigned comparison warnings for yycheck.
7529 * data/c.m4 (b4_safest_int_type): New macro.
7530 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
7531 a signed int type, cast it to b4_safest_int_type first.
7532 * data/yacc.c: Likewise.
7533 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
7534 also overwritten.
7535
9c437126
PE
75362006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
7537
7538 * doc/bison.texinfo: Fix some typos.
7539
284d8a13
PE
75402006-08-02 Paul Eggert <eggert@cs.ucla.edu>
7541
7542 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
7543 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
7544
7545 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
7546 the latest gnulib does this a different way.
7547 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
7548 translation was patched, so stop omitting it.
7549
ec5479ce
JD
75502006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7551
7552 Enable declaration of default %printer/%destructor. Make the parser
7553 use these for all user-declared grammar symbols for which the user does
7554 not declare a specific %printer/%destructor. Thus, the parser uses it
7555 for token 0 if the user declares it but not if Bison generates it as
7556 $end. Discussed starting at
7557 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7558 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7559 and
7560 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7561 * NEWS (2.3+): Mention.
7562 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7563 declare a %destructor for a mid-rule's semantic value. It's just
7564 impossible to declare one specific to it.
7565 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7566 code. Describe default %destructor form.
7567 * src/parse-gram.y (grammar_declaration): Parse default
7568 %printer/%destructor declarations.
7569 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7570 and symbol_destructor_location_get rather than accessing the destructor
7571 and destructor_location members of struct symbol.
7572 (symbol_printers_output): Likewise but for %printer's.
7573 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7574 again.
7575 * src/symtab.c (default_destructor, default_destructor_location,
7576 default_printer, default_printer_location): New static global
7577 variables to record the default %destructor and %printer.
7578 (symbol_destructor_get, symbol_destructor_location_get,
7579 symbol_printer_get, symbol_printer_location_get): New functions to
7580 compute the appropriate %destructor and %printer for a symbol.
7581 (default_destructor_set, default_printer_set): New functions to set the
7582 default %destructor and %printer.
7583 * src/symtab.h: Prototype all those new functions.
7584 * tests/actions.at (Default %printer and %destructor): New test to
7585 check that the right %printer and %destructor are called, that they're
7586 not called for $end, and that $$ and @$ work correctly.
7587 (Default %printer and %destructor for user-declared end token): New
7588 test to check that the default %printer and %destructor are called for
7589 a user-declared end token.
7590 * tests/input.at (Default %printer and %destructor redeclared, Unused
7591 values with default %destructor): New tests to check related grammar
7592 warnings and errors.
7593
868d2d96
JD
75942006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7595
7596 Clean up handling of %destructor for the end token (token 0).
7597 Discussed starting at
7598 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7599 and
7600 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7601
7602 Make the skeletons consistent in how they pop the end token and invoke
7603 its %destructor.
7604 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7605 state, which has token number 0, since this would invoke the
7606 %destructor for the end token.
7607 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7608 until after shifting the end token, or else it won't be popped.
7609 * data/yacc.c (yyparse): Likewise.
7610
7611 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7612 it's the end token. Upon termination, destroy an unshifted lookahead
7613 even when it's the end token.
7614 * data/lalr1.cc (yy::parser::parse): Likewise.
7615 * data/yacc.c (yyparse): Likewise.
7616
7617 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7618 value warnings for the end token when the user gives the end token a
7619 %destructor.
7620
7621 * tests/actions.at (Printers and Destructors): Test all the above.
7622
62a9592d
PE
76232006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7624
7625 Update to latest gnulib and gettext versions.
7626 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7627 Add fopen-safer.
7628 (gnulib_files): Add m4/warning.m4. Don't worry about files
7629 overwritten by autopoint.
7630 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7631 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7632 rejects them.
7633 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7634 so that we can remove the intl files at a better time.
7635 (intl_files_to_remove): Remove aclocal.m4, since it gets
7636 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7637 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7638 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7639 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7640 Remove datarootdir hack; no longer needed.
7641 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7642 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7643 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7644 strdup.h.
7645 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7646 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7647
10d6970f
PE
76482006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7649
7650 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7651 it with --assume-autoconf='latest-stable'.
7652
50a33993
JD
76532006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7654
7655 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7656 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7657 YYSTYPE' and `{'.
7658 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7659 those from muscle_tab.c since the old ones are misleading.
7660
2ce4ed68
AD
76612006-07-13 Akim Demaille <akim@epita.fr>
7662
7663 Support %define "KEY" {VALUE}.
7664 * src/scan-code.h, src/scan-code.l (translate_action)
7665 (translate_rule_action, translate_symbol_action, translate_code):
7666 Return char *, not const char *.
7667 * src/parse-gram.y (declaration): Rename as...
7668 (prologue_declaration): this.
7669 (string_content): Remove this nonterminal, use STRING.
7670 (braceless, content, content.opt): New nonterminal.
7671 Use them.
7672 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7673 as value.
7674 * src/scan-gram.l (getargs.h): Don't include it.
7675
db7e5eb5
PE
76762006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7677
7678 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7679 rather than a for-loop that declares a local bool variable. This
7680 should work around a compatibility problem with a Cray x1e C++
7681 compiler reported by Hung Nguyen in
7682 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7683 The for-loop was introduced in the 2004-11-17 change but I don't
7684 know why it was needed.
7685
a5d80ba5
AD
76862006-07-12 Akim Demaille <akim@epita.fr>
7687
7688 * data/c.m4: Comment changes.
7689
23eb2a69
AD
76902006-07-10 Akim Demaille <akim@lrde.epita.fr>
7691
7692 * src/complain.c (error_message, ERROR_MESSAGE): New.
7693 To factor...
7694 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7695 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7696
ddc8ede1
PE
76972006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7698
7699 * NEWS: Instead of %union, you can define and use your own union type
7700 YYSTYPE if your grammar contains at least one <type> tag.
7701 Your YYSTYPE need not be a macro; it can be a typedef.
7702 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7703 (Union Decl, Decl Summary): Document this.
7704 * data/glr.c (YYSTYPE): Implement this.
7705 * data/glr.cc (YYSTYPE): Likewise.
7706 * data/lalr1.cc (YYSTYPE): Likewise.
7707 * data/yacc.c (YYSTYPE): Likewise.
7708 * src/output.c (prepare): Output tag_seen_flag.
7709 * src/parse-gram.y (declaration, grammar_declaration):
7710 Use 'union_seen' rather than 'typed' to determine whether
7711 %union has been seen, since grammars can now be typed without
7712 %union.
7713 (symbol_declaration, type.opt, symbol_def):
7714 Keep track of whether a tag has been seen.
7715 * src/reader.c (union_seen, tag_seen): New vars.
7716 (typed): remove.
7717 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7718 * src/scan-code.l (untyped_var_seen): New variable.
7719 (handle_action_dollar): Adjust to above changes.
7720 (handle_action_dollar, handle_action_at):
7721 Improve overflow checking for outlandish numbers.
7722 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7723 avoid new diagnostics generated by above changes.
7724 * tests/regression.at (YYSTYPE typedef): Add test to check
7725 for type tags without %union.
7726
7727 * src/symlist.c (symbol_list_length): Return int, not unsigned
7728 int, since callers expect int. This may need to get revisited
7729 once we have proper integer overflow checking.
7730
7731 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7732 object is now static.
7733
7734 * src/getargs.c (flags_argmatch): Return void, not int,
7735 to pacify ./configure --enable-gcc-warnings.
7736
7737 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7738 since last_string is already defined to FLEX_PREFIX (last_string).
7739
7b42569e
AD
77402006-07-09 Akim Demaille <akim@lrde.epita.fr>
7741
7742 Implement --warnings/-W.
7743 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7744 replaced by...
7745 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7746 Adjust callers.
7747 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7748 (warnings_args, warnings_types): New.
7749 (getargs, short_options, long_options): Accept -W/--warnings.
7750 Sort the options by alphabetical order, upper case letter right
7751 before its lower case.
7752
3b452f4e
JD
77532006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7754
7755 Change %merge result type clash warnings to errors. Discussed at
7756 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7757 * src/reader.c (record_merge_function_type): Use complain_at.
7758 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7759 declared later): Update test case results.
7760
b8a41559
AD
77612006-07-09 Akim Demaille <akim@lrde.epita.fr>
7762
7763 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7764 to be in alphabetical order.
7765 (trace_args): Spelling fixes.
7766
cd9e1ba2
PE
77672006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7768
7769 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7770 so they don't collide with user-defined macros.
7771 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7772 this was never guaranteed, and now that we're using gnulib stdint,
7773 which defines int_fast16_t to long int, the problem is exposed.
7774
cb48f191
PE
77752006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7776
b8445a15
PE
7777 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7778 need the full POSIX semantics (and weren't implementing them
7779 anyway).
7780
cb48f191
PE
7781 Adjust to Autoconf 2.60 and today's gnulib.
7782 * bootstrap (gnulib_modules): Add stdint.
7783 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7784 no longer copies it.
7785 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7786 since stdint needs the former and wcwidth (which is now required
7787 by mbswidth) needs the latter.
7788 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7789 work around a compatibility glitch between gettext 0.14.6 and
7790 Autoconf 2.60.
7791 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7792 Do not check for uintptr_t, since new stdint module does the right
7793 thing.
7794 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7795 Add stdint.h, stdint_.h, wcwidth.h.
7796 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7797 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7798 stdint.m4, wchar_t.m4, wcwidth.m4.
7799 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7800 usual order for ../lib/*.h files.
7801 (file_name_split): Use last_component, not base_name, to adjust
7802 to gnulib changes.
7803 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7804 for ../lib/*.h files.
7805 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7806 Define unconditionally, since we now assume the stdint module.
7807 * src/scan-skel.l: Include <dirname.h>.
7808 (BASE_QPUTS): Use last_component, not base_name.
7809 * src/system.h: Include <unlocked-io.h> in the usual order
7810 for ../lib/*.h files. Include <stdint.h> unconditionally,
7811 since we now use the stdint module.
7812 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7813 HAVE_UINTPTR_T, since we now use the stdint module.
7814 (base_name): Remove decl, since files now include <dirname.h>
7815 to get the decl.
7816
cd48d21d
AD
78172006-07-08 Akim Demaille <akim@lrde.epita.fr>
7818
7819 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7820 New, default to 1.
7821 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7822 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7823 default.
7824 * tests/calc.at: Adjust.
7825
8ec0a172
AD
78262006-07-08 Akim Demaille <akim@lrde.epita.fr>
7827
b8445a15 7828 * data/c.m4 (b4_basename): New.
8ec0a172
AD
7829 (b4_syncline): Also output the location of its invocation (from
7830 the skeleton).
7831 (b4_user_action, b4_define_user_action, b4_user_actions)
7832 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7833 (b4_user_stype): New.
7834 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7835
4a678af8
JD
78362006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7837
7838 In the grammar file, the first column is 1 not 0 on the first line as
7839 on every other line.
7840 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7841 * tests/input.at (Torturing the Scanner): Update output.
7842
7843 * src/scan-gram.l (scanner_cursor): Declare it static.
7844
dd60572a
JD
78452006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7846
7847 In warnings, say "previous declaration" rather than "first
7848 declaration".
7849 * src/symtab.c (redeclaration): Do that here.
7850 * src/reader.c (record_merge_function_type): In the case of a result
7851 type clash, report the previous declaration rather than the very first
7852 one in the grammar file.
7853 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7854 declared later): Add a third declaration to check this behavior.
7855 * tests/input.at (Incompatible Aliases): Update output.
7856
2073e1b6
AD
78572006-06-27 Akim Demaille <akim@epita.fr>
7858
7859 * doc/Doxyfile.in: New.
7860 * doc/Makefile.am: Use it.
7861 * src/lalr.h, src/symtab.h: Initial doxygenation.
7862
8ee5b538
JD
78632006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7864
7865 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
7866 declared after the %merge. This continues the effort of the previous
7867 patch.
8ee5b538
JD
7868 * src/reader.c (get_merge_function): Don't set the merger type yet.
7869 (record_merge_function_type): New function for setting the merger type
7870 and checking for clashes.
7871 (grammar_current_rule_merge_set): Set the location of the %merge for
7872 the current rule.
7873 (packgram): Invoke record_merge_function_type for each rule now that
7874 all symbol type declarations have been parsed.
7875 * src/reader.h (merger_list.type_declaration_location): New member
7876 storing the location of the first %merge from which the type for this
7877 merging function was derived.
7878 * src/symlist.h (symbol_list.merger_declaration_location): New member
7879 storing the location of a rule's %merge, if any.
7880 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7881 declared later): New test to catch the error fixed by the above patch.
7882
ffa4ba3a
JD
78832006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7884
7885 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
7886 declarations appear after the rules. Discussed at
7887 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7888 and
7889 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7890 Don't mistake the type of $$ in a midrule to be that of its parent
7891 rule's $$.
ffa4ba3a
JD
7892 * src/reader.c (grammar_current_rule_end): Don't invoke
7893 grammar_rule_check yet since not all symbol declarations may have been
7894 parsed yet.
7895 (grammar_midrule_action): Likewise.
7896 Don't record whether the midrule's $$ has been used yet since actions
7897 haven't been translated yet.
7898 Record the midrule's parent rule and its RHS index within the parent
7899 rule.
7900 (grammar_current_rule_action_append): Don't translate the action yet
7901 since not all symbol declarations may have been parsed yet and, thus,
7902 warnings about types for $$, $n, @$, and @n can't be reported yet.
7903 (packgram): Translate the action and invoke grammar_rule_check now that
7904 all symbol declarations have been parsed.
7905 * src/scan-code.l (handle_action_dollar): Now that this is invoked
7906 after parsing the entire grammar file, the symbol list here in the case
7907 of a midrule is actually the midrule's empty RHS, so reference its
7908 parent rule's RHS where necessary.
7909 On the other hand, now that you can already know it's a midrule, you
7910 aren't forced to think $$ has the same type as its parent rule's $$.
7911 (handle_action_at): In the case of a midrule, reference the parent rule
7912 where necessary.
7913 * src/symlist.c (symbol_list_new): Initialize new midrule-related
7914 members.
7915 (symbol_list_length): Now that this is invoked after all rules have
7916 been parsed, a NULL symbol (rather than a NULL symbol list node)
7917 terminates a rule. symbol_list_print already does this correctly.
7918 * src/symlist.h (symbol_list.midrule_parent_rule,
7919 symbol_list.midrule_parent_rhs_index): New members so that midrules can
7920 remember their relationships with their parents.
7921 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
7922 fixed by the above patch.
7923 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
7924 implementing...
7925 (Unused values): ... this old test case and...
7926 (Unused values before symbol declarations): ... this new test case.
7927 This one is the same as `Unused values' except that all symbol
7928 declarations appear after the rules in order to catch the rest of the
7929 errors fixed by the above patch.
7930
e256e17f
JD
79312006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7932
300a1930
JD
7933 More cleanup.
7934 * src/reader.c (current_rule): Declare it static since it's no longer
7935 used outside this file.
7936 (grammar_current_rule_action_append): Remove redundant arguments from
7937 translate_rule_action invocation.
7938 * src/reader.h (current_rule): Remove this unused extern.
7939 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
7940 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 7941
381ecb06
JD
79422006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
7943
7944 Clean up yesterday's patch.
7945 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
7946 to...
7947 * src/reader.c (grammar_current_rule_action_append): ... here for
7948 consistency with grammar_current_rule_symbol_append.
7949 * tests/regression.at (Braced code in declaration in rules section):
7950 Make yyerror and yylex static as usual.
7951
4210cd0b
JD
79522006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
7953
7954 Fix bug that mistakes braced code in a declaration in the rules section
7955 to be a rule action. Mentioned at
7956 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
7957 * src/scan-gram.l: Move midrule action detection from the start of the
7958 scanning of any braced code to...
7959 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
7960 action. For readability, use $2 and @2 rather than the equivalent
7961 global variables.
7962 * tests/regression.at (Braced code in declaration in rules section):
7963 New test to catch the error fixed by the above patch.
7964
7965 Work on code readability some.
7966 * src/scan-code.l (current_rule): Get rid of this misleading and
7967 redundant declaration: it's actually extern'ed in reader.h.
7968 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
7969 translate_action): Add a rule argument and use it instead of the global
7970 current_rule.
7971 (translate_rule_action): This already receives current_rule through an
7972 argument, so pass it on to translate_action instead of assigning
7973 current_rule to current_rule.
7974 (translate_symbol_action, translate_code): Pass rule = NULL to
7975 translate_action.
7976
34f98f46
JD
79772006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
7978
7979 Rename %before-definitions to %start-header and %after-definitions to
7980 %end-header. Don't use these declarations to separate pre-prologue
7981 blocks from post-prologue blocks. Add new order-independent
7982 declarations %before-header and %after-header as alternatives to the
7983 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
7984 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
7985 * NEWS (2.3+): Update for these changes.
7986 * data/glr.c (b4_before_definitions): Update to...
7987 (b4_start_header): ... this.
7988 (b4_after_definitions): Update to...
7989 (b4_end_header): ... this.
7990 * data/glr.cc: Likewise.
7991 * data/lalr1.cc: Likewise.
7992 * data/yacc.c: Likewise.
7993 * doc/bison.texinfo (The prologue): Update names, and replace remaining
7994 prologue blocks with %*-header declarations.
7995 (Calc++ Parser): Likewise.
91661ebb 7996 (Decl Summary): Update names.
148d66d8 7997 (Table of Symbols): Update description.
34f98f46
JD
7998 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
7999 (PERCENT_END_HEADER): ... this.
8000 (PERCENT_BEFORE_DEFINITIONS): Update to...
8001 (PERCENT_START_HEADER): ... this.
8002 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8003 (declaration): Update token names and m4 macro names.
8004 When parsing %end-header and %start-header, invoke translate_code
8005 before muscle_code_grow, and no longer set global booleans to remember
8006 whether these declarations have been seen.
8007 Parse new %after-header and %before-header.
8008 * src/reader.c (before_definitions, after_definitions): Remove.
8009 (prologue_augment): Accept a new bool argument to specify whether to
8010 augment the pre-prologue or post-prologue.
8011 * src/reader.h (before_definitions, after_definitions): Remove these
8012 extern's.
8013 (prologue_augment): Add new bool argument.
8014 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
8015 (PERCENT_END_HEADER): ... this.
8016 (PERCENT_BEFORE_DEFINITIONS): Update to...
8017 (PERCENT_START_HEADER): ... this.
8018 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8019 * tests/actions.at (Printers and Destructors): Update names.
8020
31b2b07e
JD
80212006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
8022
8023 Add comparison operators for C++ location classes. Discussed at
8024 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
8025 * data/c++.m4 (b4_define_location_comparison): New boolean %define
8026 declaration indicating whether filename_type has an operator==. If
8027 filename_type is `std::string', it defaults to `1', `0' otherwise.
8028 * data/location.cc: Iff b4_define_location_comparison is `1', add
8029 operator== and operator!= for class position and for class location.
8030
8031 Some minor fixes.
8032 * src/scan-action.l: Remove unused file.
8033 * src/symtab.c (symbol_printer_set): Use printer_location not
8034 destructor_location.
8035 * src/symtab.h (struct symbol): Replace incorrect source comment for
8036 printer members.
8037 * tests/input.at (Incompatible Aliases): Update output with correct
8038 printer location.
8039
9bc0dd67
JD
80402006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
8041
8042 Don't put the pre-prologue in the header file. For the yacc.c code
8043 file and the glr.c header and code files, move the pre-prologue before
8044 the token definitions. Add new %before-definitions and
8045 %after-definitions to declare code that will go in both the header file
8046 and code file. Discussed at
8047 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
8048 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
8049 and
8050 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
8051 * NEWS (2.3+): Describe these changes.
8052 * data/glr.c (b4_pre_prologue): Move from within to before...
8053 (b4_shared_declarations): ... this.
8054 Add new b4_before_definitions before b4_token_enums.
8055 Add new b4_after_definitions at the end.
8056 * data/glr.cc (b4_pre_prologue): Replace with...
8057 (b4_before_definitions): ... this in the header file.
8058 (b4_after_definitions): New near the end of the header file.
8059 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
8060 code file right before including the header file.
8061 (b4_before_definitions): New in the previous position of
8062 b4_pre_prologue in the header file.
8063 (b4_after_definitions): New near the end of the header file.
8064 * data/yacc.c: Clean up some m4 quoting especially in the header file.
8065 (b4_token_enums_defines): In the code file, move to right before
8066 YYSTYPE for consistency with the header file.
8067 (b4_before_definitions): New right before b4_token_enums_defines in
8068 both the header and code file.
8069 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
8070 header and code file.
8071 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
8072 of prologues for %union dependencies.
91661ebb
JD
8073 (Decl Summary): In %defines description, mention the effect of
8074 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
8075 (Calc++ Parser): Forward declare driver in a %before-definitions rather
8076 than in the pre-prologue so that make check succeeds.
148d66d8 8077 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
8078 %after-definitions.
8079 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
8080 %before-definitions.
8081 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
8082 (declaration): Parse those declarations and append to
8083 b4_before_definitions and b4_after_definitions, respectively.
8084 * src/reader.c (before_definitions, after_definitions): New bools to
8085 track whether those declarations have been seen.
8086 (prologue_augment): Add to the post-prologue if %union,
8087 %before-definitions, or %after-definitions has been seen.
8088 * src/reader.h (before_definitions, after_definitions): New extern's.
8089 * src/scan-gram.l: Scan the new declarations.
8090 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
8091 prologue block in a %before-definitions or a %after-definitions based
8092 on whether the %union is declared.
8093 * tests/regression.at (Early token definitions with --yacc, Early token
8094 definitions without --yacc): Move tests for token definitions into the
8095 post-prologue since token names are no longer defined in the
8096 pre-prologue.
8097
203b9274
AD
80982006-06-20 Akim Demaille <akim@epita.fr>
8099
8100 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
8101 (symbol_get): Use it.
8102 * src/parse-gram.y: Use it.
8103
a7ee59cf
JD
81042006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
8105
8106 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
8107 build succeeds when configured with --enable-gcc-warnings.
8108
5a2baae7
PE
81092006-06-19 Paul Eggert <eggert@cs.ucla.edu>
8110
33ad1a9c
PE
8111 * src/parse-gram.y (char_name): New function.
8112 (CHAR, STRING, string_content): For %printer, properly escape.
8113 (ID): Prefer fputs to fprintf.
8114 (id): Reindent to be consistent with other rules.
8115 Properly quote char.
8116
5a2baae7
PE
8117 The Translation Project changed its way of publishing translations
8118 to maintainers. I haven't received any responses to my request
8119 for supporting the old way, or for documenting the new way. I
8120 have modified 'bootstrap' to use screen scraping
8121 (in this case, HTML scraping). This is unreliable and inelegant,
8122 but I don't see any better way. Yuck.
8123 * bootstrap (TP_URL, WGET_COMMAND): New vars.
8124 (get_translations): New function, which uses HTML scraping to
8125 deduce locations of latest translations.
8126 Use this function to grab both bison and bison-runtime .po files.
8127 Don't bother priming the pump for the runtime-po domain any more,
8128 as it's now translated better than bison is.
8129
58d7a1a1
AD
81302006-06-19 Akim Demaille <akim@epita.fr>
8131
8132 * src/scan-gram.l: No longer "parse" things after `%union' until
8133 `{'. Rather, return a single "%union" token.
8134 No longer make symbols: return strings, and leave the conversion
8135 to symbols to the parser.
8136 (SC_PRE_CODE, token_type): Remove.
8137 * src/parse-gram.y (%union): New field `character'.
8138 Sort tokens.
8139 (CHAR): New token.
8140 (ID, ID_COLON): Now that the scanner no longer makes them
8141 identifiers, adjust all uses to invoke symbol_get.
8142 (id_colon): New, wraps the conversion from string to symbol.
8143 (%union): Accept a possible union_name.
8144 (symbol): Now can be a char.
8145 * data/c.m4 (b4_union_name): Leave a default value.
8146 * data/glr.c, data/yacc.c: Use it.
8147
b931235e
JD
81482006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
8149
8150 For associating token numbers with token names for "yacc.c", don't use
8151 #define statements unless `--yacc' is specified; always use enum
8152 yytokentype. Most important discussions start at:
8153 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
8154 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
8155 and
8156 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
8157 * NEWS (2.3+): Mention.
8158 * data/c.m4 (b4_yacc_if): New.
8159 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
8160 token #define's.
8161 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
8162 on token name definitions.
8163 * src/getargs.c (usage): Capitalize `Yacc' in English.
8164 * src/output.c (prepare): Define b4_yacc_flag.
8165 * tests/regression.at (Early token definitions): Test that tokens names
8166 are defined before the pre-prologue not just before the post-prologue.
8167 Remove this test case and copy to...
8168 (Early token definitions with --yacc): ... this to test #define's.
8169 (Early token definitions without --yacc): ... and this to test enums.
8170
9e6e7ed2
PE
81712006-06-11 Paul Eggert <eggert@cs.ucla.edu>
8172
8173 * NEWS: Reword the post-2.3 change to not be so optimistic about
8174 removing the old "look-ahead" spelling.
8175 Update previous look-ahead/lookahead change reports.
8176 * REFERENCES: look-ahead -> lookahead (since that's
8177 what he actually wrote).
8178 * doc/refcard.tex: look ahead -> lookahead,
8179 look-ahead -> lookahead
8180
742e4900
JD
81812006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
8182
8183 For consistency, use `lookahead' instead of `look-ahead' or
8184 `look_ahead'. Discussed starting at
8185 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
8186 and then at
8187 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
8188 * NEWS: For the next release, note the change to `--report'.
8189 * TODO, doc/bison.1: Update English.
8190 * doc/bison.texinfo: Update English.
8191 (Understanding Your Parser, Bison Options): Document as
8192 `--report=lookahead' rather than `--report=look-ahead'.
8193 * src/conflicts.c: Update English in comments.
8194 (lookahead_set): Rename from look_ahead_set.
8195 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
8196 (resolve_sr_conflict): Rename local look_ahead_tokens to
8197 lookahead_tokens, and update other uses.
8198 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
8199 count_rr_conflicts, conflicts_free): Update uses.
8200 * src/getargs.c (report_args): Move "lookahead" before alternate
8201 spellings.
8202 (report_types): Update uses.
8203 (usage): For `--report' usage description, state `lookahead' spelling
8204 rather than `look-ahead'.
8205 * src/getargs.h (report.report_lookahead_tokens): Rename from
8206 report_look_ahead_tokens.
8207 * src/lalr.c: Update English in comments.
8208 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
8209 (state_lookahead_tokens_count): Rename from
8210 state_look_ahead_tokens_count.
8211 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8212 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
8213 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8214 Update other uses.
8215 Update English in output.
8216 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
8217 * src/print.c: Update English in comments.
8218 (lookahead_set): Rename from look_ahead_set.
8219 (print_reduction): Rename argument lookahead_token from
8220 look_ahead_token.
8221 (print_core, state_default_rule, print_reductions, print_results):
8222 Update uses.
8223 * src/print_graph.c: Update English in comments.
8224 (print_core): Update uses.
8225 * src/state.c: Update English in comments.
8226 (reductions_new): Update uses.
8227 (state_rule_lookahead_tokens_print): Rename from
8228 state_rule_look_ahead_tokens_print, and update other uses.
8229 * src/state.h: Update English in comments.
8230 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
8231 (state_rule_lookahead_tokens_print): Rename from
8232 state_rule_look_ahead_tokens_print.
8233 * src/tables.c: Update English in comments.
8234 (conflict_row, action_row): Update uses.
8235 * tests/glr-regression.at
8236 (Incorrect lookahead during deterministic GLR,
8237 Incorrect lookahead during nondeterministic GLR): Rename
8238 print_look_ahead to print_lookahead.
8239 * tests/torture.at: Update English in comments.
8240 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
8241 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
8242 (Many lookahead tokens): Update uses.
8243 * data/glr.c: Update English in comments.
8244 * lalr1.cc: Likewise.
8245 * yacc.c: Likewise.
8246 * src/conflicts.h: Likewise.
8247 * src/lalr.h: Likewise.
8248 * src/main.c: Likewise.
8249 * src/output.c: Likewise.
8250 * src/parse-gram.c: Likewise.
8251 * src/tables.h: Likewise.
8252 * tests/calc.at: Likewise.
8253
3c40d0b5
JD
82542006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
8255
8256 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
8257
5d278082
PE
82582006-06-07 Paul Eggert <eggert@cs.ucla.edu>
8259
8260 * TODO: Add request from Nelson H. F. Beebe to be able to install
8261 Bison without installing the yacc script.
8262
9e668899
JD
82632006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8264
8265 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
8266 and yytext if they're already #define'd.
8267 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
8268 * src/scan-code-c.c: ... here.
8269 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
8270 <config.h>.
8271
0c8e079f
JD
82722006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8273
8274 Get Bison to build again when configured with --enable-gcc-warnings.
8275 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
8276 missing #include's.
8277 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
8278 loc argument as it shadows a global.
8279 * src/scan-gram.l: Remove stray comma that prevents boundary_set
8280 invocation.
8281
8282 * src/.cvsignore: Add scan-code.c.
8283
2346344a
AD
82842006-06-07 Akim Demaille <akim@epita.fr>
8285
8286 * src/scan-gram.l: Move the "add a trailing ; to actions" code
8287 to...
8288 * src/scan-code.l: here.
8289 * tests/input.at (Torturing the Scanner): Fix another location
8290 error.
8291
4862bdfd
AD
82922006-06-07 Akim Demaille <akim@epita.fr>
8293
8294 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
8295
e9071366
AD
82962006-06-06 Akim Demaille <akim@epita.fr>
8297
8298 Extract the parsing of user actions from the grammar scanner.
8299 As a consequence, the relation between the grammar scanner and
8300 parser is much simpler. We can also split "composite tokens" back
8301 into simple tokens.
8302 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
8303 * src/scan-gram.l (add_column_width, adjust_location): Move to and
8304 rename as...
8305 * src/location.h, src/location.c (add_column_width)
8306 (location_compute): these.
8307 Fix the column count: the initial column is 0.
8308 (location_print): Be robust to ending column being 0.
8309 * src/location.h (boundary_set): New.
8310 * src/main.c: Adjust to scanner_free being renamed as
8311 gram_scanner_free.
8312 * src/output.c: Include scan-code.h.
8313 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
8314 Use boundary_set.
8315 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
8316 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
8317 which is now, again, a separate token.
8318 Adjust all dependencies.
8319 Whereever actions with $ and @ are used, use translate_code.
8320 (action): Remove this nonterminal which is now useless.
8321 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8322 (grammar_current_rule_action_append): Use translate_code.
8323 (packgram): Bound check ruleno, itemno, and rule_length.
8324 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8325 (last_string, last_braced_code_loc, max_left_semantic_context)
8326 (scanner_initialize, scanner_free, scanner_last_string_free)
8327 (gram_out, gram_lineno, YY_DECL_): Move to...
8328 * src/scan-gram.h: this new file.
8329 (YY_DECL): Rename as...
8330 (GRAM_DECL): this.
8331 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8332 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8333 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8334 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8335 Move these declarations, and...
8336 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8337 these to...
8338 * src/flex-scanner.h: this new file.
8339 * src/scan-gram.l (rule_length, rule_length_overflow)
8340 (increment_rule_length): Remove.
8341 (last_braced_code_loc): Rename as...
8342 (gram_last_braced_code_loc): this.
8343 Adjust to the changes of the parser.
8344 Move all the handling of $ and @ into...
8345 * src/scan-code.l: here.
8346 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8347 (handle_action_dollar, handle_action_at): Move to...
8348 * src/scan-code.l: here.
8349 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8350 scan-code.h, scan-code-c.c, scan-gram.h.
8351 (EXTRA_bison_SOURCES): Add scan-code.l.
8352 (BUILT_SOURCES): Add scan-code.c.
8353 (yacc): Be robust to white spaces.
8354
8355 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8356 * tests/regression.at: Adjust the column numbers.
8357 * tests/regression.at: Adjust the error message.
7891a7c4 8358
184e42f0
JD
83592006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8360
8361 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8362 Use Akim's wording from
8363 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8364
7891a7c4
JD
83652006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8366
8367 Between Bison releases, manually append `+' to the previous Bison
8368 release number, and use that as a signal to automatically print the
8369 ChangeLog's CVS Id keyword from --version. Discussed starting at
8370 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8371 * ChangeLog: Add Id header.
8372 * configure.ac (AC_INIT): Append `+' to `2.3'.
8373 * src/.cvsignore: Add revision.c.
8374 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8375 (BUILT_SOURCES): Add revision.c.
8376 (revision.c): New target rule. This file defines a new global variable
8377 named revision. It initializes it with either the Id from ChangeLog
8378 or, if VERSION doesn't contain `+', with the empty string.
8379 * src/getargs.c (version): Print the value of revision.
8380 * src/revision.h: Extern revision.
8381
4ad3ed84
PE
83822006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8383
8384 * NEWS: Version 2.3.
8385 * configure.ac (AC_INIT): Likewise.
8386
02103984
PE
83872006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8388
8389 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8390 with no arguments, not as an object-like macro. This is for
8391 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8392 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8393 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8394 Document this.
8395
2c08afa5
JD
83962006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8397
8398 * src/getargs.c (usage): Back out yesterday's modification of the
8399 --help output so that we don't have to wait for translation before
8400 releasing 2.3.
8401
6077da58
PE
84022006-05-29 Paul Eggert <eggert@cs.ucla.edu>
8403
8404 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
8405 Problem reported by Akim Demaille.
8406
2a26b6c2
JD
84072006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
8408
8409 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8410
aefef0d6
PE
84112006-05-26 Paul Eggert <eggert@cs.ucla.edu>
8412
8413 * data/yacc.c (yy_reduce_print): Omit trailing white space in
8414 generated source code. Problem reported by Frans Englich in
8415 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
8416
fcd8e201
PE
84172006-05-22 Paul Eggert <eggert@cs.ucla.edu>
8418
8419 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
8420 shell, not within 'make', so that 'make' by an ordinary builder
8421 (using GNU make) does not worry about configuring gzip. This also
8422 works around a bug reported independently by Keith Thompson and by
8423 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
8424 stderr rather than stdout, messing up the build logs.
8425
7b5cdcbd
JD
84262006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8427
8428 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
8429 to make sure that YYID will never be unused. This fixes a 'make
8430 maintainer-check' failure caused by the recent changes to the 'Trivial
8431 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
8432 not used.
8433 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
8434
5ad0a449
JD
84352006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8436
8437 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
8438 state before an empty RHS is always resolved here. Only the location
8439 of that state is guaranteed to be resolved, and that's enough. This
8440 fixes the remaining bug reported by Derek M. Jones in
8441 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8442 * tests/glr-regression.at (Uninitialized location when reporting
8443 ambiguity): Test the above case.
8444 Also, the embedded comments in this test case claim it checks the case
8445 of an empty RHS that has inherited the initial location. However, the
8446 corresponding LHS was already resolved, so yyresolveLocations didn't
8447 actually have reason to modify it. Fix this by forcing
8448 nondeterministic operation at the beginning of the parse.
8449
50cce58e
PE
84502006-05-20 Paul Eggert <eggert@cs.ucla.edu>
8451
8452 * data/c.m4 (b4_yy_symbol_print_generate):
8453 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
8454 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
8455 of the bugs reported today by Derek M Jones in
8456 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8457 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
8458 defined to be a type name without parens or brackets.
8459 (Location Type): Similarly for YYLTYPE.
8460 * tests/regression.at (Trivial grammars): Put in a test for this
8461 bug that will be caught by 'make maintainer-check' (though not,
8462 alas, by 'make check' unless your compiler is picky).
8463
ab8d9dc5
PE
84642006-05-19 Paul Eggert <eggert@cs.ucla.edu>
8465
0d2c8934 8466 * NEWS: Version 2.2.
ab8d9dc5
PE
8467 * configure.ac (AC_INIT): Likewise.
8468
9138c575
JD
84692006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
8470
8471 * data/glr.c (yyreportTree): Make room in yystates for the state
8472 preceding the RHS. This fixes the segmentation fault reported by Derek
8473 M. Jones in
8474 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
8475 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
8476 to the user. Reported for yyreportTree by Derek M. Jones later in the
8477 same thread.
8478 * THANKS: Add Derek M. Jones.
8479 Update my email address.
8480 Fix typo in Steve Murphy's name.
8481
276f48df
PE
84822006-05-14 Paul Eggert <eggert@cs.ucla.edu>
8483
d6645148
PE
8484 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
8485 checking against YYLAST that caused the parser to miss a potential
8486 alternative in its diagnostic.
8487 Problem reported by Maria Jose Moron Fernandez in
8488 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
8489 * data/lalr1.cc (yysyntax_error_): Likewise.
8490 * data/yacc.c (yysyntax_error): Likewise.
8491 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
8492 tokens, in case we run into an older C compiler.
8493 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
8494 Use them to check for the off-by-one error fixed above.
8495
276f48df
PE
8496 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
8497 YYSIZE_T, not size_t.
8498 * tests/regression.at (Trivial grammars): New test, to catch
8499 the error fixed by the above patch.
8500
cd8b5791
AD
85012006-05-14 Akim Demaille <akim@lrde.epita.fr>
8502
8503 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
8504 scheme.
8505 Reported by Steve Murphy.
8506
34376418
AD
85072006-05-14 Akim Demaille <akim@lrde.epita.fr>
8508
8509 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
8510 * data/glr.cc: b4_location_flag is now b4_locations_flag.
8511
327afc7c
AD
85122006-05-14 Akim Demaille <akim@lrde.epita.fr>
8513
8514 Implement --trace=m4.
8515 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
8516 * src/output.c (output_skeleton): When set, pass -dV to m4.
8517
8518 Factor the handling of flags in m4.
8519 * src/output.c (prepare): Rename the muscle names debug, defines,
8520 error_verbose to debug_flag, defines_flag, error_verbose_flag.
8521 * data/c.m4: Adjust.
8522 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
8523 Use b4_define_flag_if to define other b4_FLAG_if macros.
8524 (b4_location_if): As a consequence, rename as...
8525 (b4_locations_if): this, for consistency.
8526 Adjust all the skeletons.
8527
ba9ecd19
AD
85282006-05-14 Akim Demaille <akim@lrde.epita.fr>
8529
8530 * etc/bench.pm: Shorten bench names.
8531
4e83ea15
AD
85322006-05-14 Akim Demaille <akim@lrde.epita.fr>
8533
8534 * src/output.h, src/output.c (error_verbose): Move to...
8535 * src/getargs.h, src/getargs.c: here.
8536 Sort the flags.
8537 Adjust dependencies.
8538
6e93d810
PE
85392006-05-13 Paul Eggert <eggert@cs.ucla.edu>
8540
8541 * data/c.m4 (b4_copyright): Put the special exception for Bison
8542 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
8543 uses changed. Suggested by Akim Demaille. Also, wrap the
8544 copyright notice, in case it is longer than 80 columns. Replace
8545 comma by newline after title.
6e93d810 8546
eaea13f5
PE
85472006-05-11 Paul Eggert <eggert@cs.ucla.edu>
8548
8549 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
8550 incompatibility, not a bug. Mention that it wasn't fixed as of
8551 flex 2.5.33.
8552
3cf084ec
AD
85532006-05-11 Akim Demaille <akim@lrde.epita.fr>
8554
8555 * examples/extexi: Enforce the precedence of concatenation over
8556 >>.
0a9f1c7d 8557 Reported by Tommy Nordgren.
3cf084ec 8558
32c96bd7
AD
85592006-05-11 Akim Demaille <akim@lrde.epita.fr>
8560
8561 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8562 with the member "token".
f94705b2 8563 Reported by Martin Nylin.
32c96bd7 8564
eaea13f5
PE
85652006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8566
8567 * data/glr.c: Switch to Bison 2.2 special-exception language in
8568 the copyright notice. Use more-regular format for titles and
8569 copyright notices.
8570 * data/glr.cc: Likewise.
8571 * data/location.cc: Likewise.
8572 * data/yacc.cc: Likewise.
8573 * doc/bison.texinfo (Conditions): Document this.
8574 * NEWS: likewise. Upgrade version to 2.2.
8575
6e2d1146
AD
85762006-04-27 Akim Demaille <akim@lrde.epita.fr>
8577
8578 * data/glr.cc: Remove dead code.
8579
47671055
PE
85802006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8581
8582 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8583 that variable and the line breaks the bootstrap. Problem reported
8584 by Juan M. Guerrero.
8585
ed2e6384
AD
85862006-04-24 Akim Demaille <akim@lrde.epita.fr>
8587
8588 * doc/bison.texinfo (Multiple start-symbols): New.
8589
3cedc2dc
AD
85902006-04-24 Akim Demaille <akim@lrde.epita.fr>
8591
8592 * etc/README, etc/bench.pl: New.
8593
b2ddc3f3
AD
85942006-04-03 Akim Demaille <akim@lrde.epita.fr>
8595
8596 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8597 rule.
8598 Reported by Mickael Labau.
8599 * tests/input.at (Torturing the Scanner): Test it.
8600
91e3ac9a
PE
86012006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8602
8603 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8604 Problem reported by Bob Rossi.
8605
86062006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8607
8608 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8609 and didn't really work.
8610 For the index, use @ifnotinfo, not @iftex.
8611 Minor cleanups of spacing and terminology.
8612
5cf61e93
AD
86132006-03-12 Akim Demaille <akim@lrde.epita.fr>
8614
8615 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8616 of AT_NAME_PREFIX when %name-prefix is not used.
8617
aa08666d
AD
86182006-03-12 Akim Demaille <akim@lrde.epita.fr>
8619
8620 Apply --prefix to C++ skeletons too: they change the namespace.
8621 The test suite already exercize these cases.
8622 * data/c++.m4 (b4_namespace): New.
8623 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8624 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8625 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8626 * doc/bison.texinfo: Document it.
8627 (Option Cross Key): Use @multitable in all formats. It looks
8628 nicer, even in TeX outputs.
8629 (Rules): Use the same code whatever the output type is.
8630 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8631 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8632 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 8633
45567173
AD
86342006-03-10 Akim Demaille <akim@lrde.epita.fr>
8635
8636 * TODO: Remove dead items.
8637
e9d8f881 86382006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
8639
8640 * doc/FAQ: Remove, merged into...
8641 * doc/bison.texinfo (FAQ): this.
8642 * doc/Makefile.am (EXTRA_DIST): Adjust.
8643
c095d689
AD
86442006-03-10 Akim Demaille <akim@lrde.epita.fr>
8645
8646 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8647 even if empty.
8648 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8649 * doc/bison.texinfo (Calc++ Scanner): Use it.
8650
6e0f8287
PE
86512006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8652
8653 Fix two nits reported by twlevo, plus one more that I discovered.
8654
8655 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8656 this is the usual Bison style.
8657 * src/location.h (location_print): Likewise.
8658
8659 * src/reader.h (token_name): Likewise.
8660
d6b771c3
PE
86612006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8662
8663 Fix some nits reported by twlevo.
8664 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8665 and "POSIX". Use more-modern syntax for URLs. Mention C++
8666 and ask for Java. Don't hardwire OS version numbers. Add
8667 copyright notice.
8668 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8669 * src/conflicts.c (solved_conflicts_obstack): Now static.
8670
1e137b71
JD
86712006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8672
8673 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8674 page. Say "you can use it" not "you may use it" as on the web page;
8675 we're describing capabilities not granting permission.
8676
73f2e47e
PE
86772006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8678
6d05403d
PE
8679 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8680 shadowing warnings. Use usual patter for iterating through RHS.
8681 * tests/glr-regression.at
8682 (Uninitialized location when reporting ambiguity):
8683 Modify yylex so that it uses its argument, rather than trying
8684 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8685 const char -> char const.
8686
73f2e47e
PE
8687 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8688 Don't use tabs inside commands; it messes up 'ps'.
8689 Problem reported by twlevo.
8690
8710fc41
JD
86912006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8692
8693 * tests/glr-regression.at (Uninitialized location when reporting
8694 ambiguity): New test case.
8695 * data/glr.c (yyresolveLocations): New function, which uses
8696 YYLLOC_DEFAULT.
8697 (yyresolveValue): Invoke yyresolveLocations before reporting an
8698 ambiguity.
8699 * doc/bison.texinfo (Default Action for Locations): Note
8700 YYLLOC_DEFAULT's usage for ambiguity locations.
8701 (GLR Semantic Actions): Cross-reference those notes.
8702
ae952af2
JD
87032006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8704
8705 * tests/glr-regression.at (Leaked semantic values when reporting
8706 ambiguity): Remove unnecessary union and type declarations.
8707 (Leaked lookahead after nondeterministic parse syntax error): New test
8708 case.
8709 * data/glr.c (yyparse): Check for zero stacks remaining before
8710 attempting to shift the lookahead so that you don't lose it.
8711
35ee866a
JD
87122006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8713
8714 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8715 * tests/glr-regression.at (Leaked semantic values when reporting
8716 ambiguity): New test case.
8717 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8718 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8719 now unnecessary yystackp parameter.
8720 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8721 destructors can be called.
8722
8723 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8724 in existing testcases.
8725
520181ab
JD
87262006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8727
8728 Don't leak semantic values for parent RHS when a user action cuts the
8729 parser, and clean up related code a bit.
8730 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
8731 cuts parse): Rename to...
8732 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
8733 for leaked parent RHS values.
8734 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8735 between an unresolved state (non-empty chain of semantic options) and
8736 an incomplete one (signaled by an empty chain).
ae952af2 8737 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
8738 successfully or unsuccessfully resolved yyGLRState to...
8739 (yyresolveValue): ... here so that yyresolveValue always leaves a
8740 yyGLRState with consistent data and thus is easier to understand.
8741 Remove the yyvalp and yylocp parameters since they are always just
8742 taken from the yys parameter. When reporting a discarded merged value
8743 in debugging output, note that it is incompletely merged. Document the
8744 interface.
8745 (yyresolveAction): If resolving any of the RHS states fails, destroy
8746 them all rather than leaking them. Thus, as long as user actions are
8747 written to clean up the RHS correctly, yyresolveAction always cleans up
8748 the RHS of a semantic option. Document the interface.
8749
18d9185c
PE
87502006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8751
8752 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8753 led to a segmentation fault in GNU Pascal. Problem reported
8754 by Waldek Hebisch.
8755
841a7737
JD
87562006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8757
8758 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8759 mid-rule action inside a nonterminal symbol in order to declare a
8760 destructor for its semantic value.
8761
fc3f467f
PE
87622006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8763
8764 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8765 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8766 __cplusplus && ! defined _STDLIB_H && !
8767 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8768 defined free))]: Include <stdlib.h> rather than rolling our own
8769 declarations of malloc and free, to avoid problems with
8770 incompatible declarations (using 'throw') C++'s stdlib.h. This
8771 should fix Debian bug 340012
8772 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8773 reported by Guillaume Melquiond.
8774
a3af26dd
PE
87752006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8776
4d7bc38c
PE
8777 * NEWS: Clarify symbols versus types in unused-value warnings.
8778
a3af26dd
PE
8779 * configure.ac (AC_INIT): Bump version number.
8780
4e26c69e
PE
87812006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8782
8783 * NEWS: Version 2.1a.
8784 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8785 since C99 requires this.
8786
498e897c
PE
87872006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8788
8789 * m4/c-working.m4: New file.
8790 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8791
57bb17ca
PE
87922006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8793
8794 * Makefile.maint: Merge from coreutils.
8795
0be105dc
PE
87962006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8797
8798 More portability fixes for problems summarized by Nelson H. F. Beebe.
8799
8800 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8801 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8802 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8803 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8804 messes up because C++ code is compiled in 32-bit mode but linked
8805 in 64-bit mode.
8806
6fc0c024
PE
88072006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8808
8809 More portability fixes for problems summarized by Nelson H. F. Beebe.
8810
7870f699
PE
8811 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8812 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8813
6fc0c024
PE
8814 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8815 nodist_PROGRAMS, since we don't need to actually compile the
8816 example if we're just doing a plain 'make'. This avoids bothering
8817 the installer unnecessarily about problems due to weird C++
8818 compilers.
8819
fe6c2fde
PE
88202006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8821
8822 More portability fixes for problems summarized by Nelson H. F. Beebe.
8823
8824 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8825 than #include "...", and compile with -I'.'. The old method was
8826 not portable, according to Posix and the C standard, and it does
8827 not work with Sun C 5.7, where previous #line directives affect
8828 the working directory used in later #include "..." directives.
8829
927b425b
JMG
88302006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8831
8832 Various DJGGP specific issues in /djgpp
8833
d9735e9e
PE
88342006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8835
8836 More portability fixes for problems summarized by Nelson H. F. Beebe.
8837
8838 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8839 '#include <map>' works and that you can apply ++ to iterators.
8840
5a6755af
PE
88412006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8842
67a0dc4f
PE
8843 Work around portability problems summarized by Nelson H. F. Beebe in
8844 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8845
8c86f0ef
PE
8846 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8847 that '#include <string>' works.
8848
de35dd59
PE
8849 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8850 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8851 "warning: sorry: semantics of inline function static data `const
8852 unsigned char translate_table[262]' are wrong (you'll wind up with
8853 multiple copies)".
8854
67a0dc4f
PE
8855 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8856 or, xor to not_, and_, or_, and xor_, respectively. This works
8857 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8858 random system header somewhere that includes the equivalent of
8859 <iso646.h>.
8860
5a6755af
PE
8861 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8862 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 8863 Suite Version 2.0.
5a6755af 8864
3f001415
JD
88652006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8866
8867 During deterministic GLR operation, user actions should be able to
8868 influence the parse by changing yychar. To make this easier to fix and
8869 to make glr.c easier to evolve in general, don't maintain yytoken in
8870 parallel with yychar; just compute yytoken when needed.
8871 * tests/glr-regression.at (Incorrect lookahead during deterministic
8872 GLR): Check that setting yychar in a user action has the intended
8873 effect.
8874 * data/glr.c (yyGLRStack): Remove yytokenp member.
8875 (yyclearin): Don't set *yytokenp.
8876 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8877 yychar rather than *yytokenp to determine the current lookahead.
8878 Compute yytoken locally when needed.
8879 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8880 point to.
8881
8882 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8883 after `--report' documentation.
8884
e2a8c0f5
PE
88852006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8886
8887 * src/parse-gram.y (grammar_declaration): Location of printer
8888 symbol is @1, not list->location. Bug reported by twlevo.
8889 * tests/input.at (Incompatible Aliases): Adjust to above change.
8890
6b702268
PE
88912006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8892
27622431
PE
8893 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8894 all the test at once. This makes the output easier to read in the
8895 normal case.
8896
6b702268
PE
8897 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
8898 got from <http://bro-ids.org/download.html>. The bug is that
8899 when two actions appeared in succession, the second one was
8900 scanned before the first one was added to the grammar rule
8901 as a midrule action. Bison then output the incorrect warning
8902 "parse.y:905.17-906.36: warning: unused value: $3".
8903 * src/parse-gram.y (BRACED_CODE, action): These are no longer
8904 associated with a value.
8905 (rhs): Don't invoke grammar_current_rule_action_append.
8906 (action): Invoke it here instead.
8907 * src/reader.c (grammar_midrule_action): Now extern.
8908 (grammar_current_rule_action_append): Don't invoke
8909 grammar_midrule_action; that is now the scanner's job.
8910 * src/reader.h (last_string, last_braced_code_loc):
8911 (grammar_midrule_action): New decls.
8912 * src/scan-gram.l (last_string): Now extern, sigh.
8913 (last_braced_code_loc): New extern variable.
8914 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
8915 rule already has an action.
8916 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
8917 * tests/input.at (AT_CHECK_UNUSED_VALUES):
8918 Add some tests to check that the above changes fixed the bug.
8919
d40ba6c2
PE
89202006-01-27 Paul Eggert <eggert@cs.ucla.edu>
8921
8922 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
8923 All used changed. Check whether the symbol has a destructor,
8924 not whether it is typed.
8925 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
8926 that the values are still reported as unused. All line numbers
8927 adjusted.
8928
401aace6
PE
89292006-01-23 Paul Eggert <eggert@cs.ucla.edu>
8930
8931 Work around a bug in bro 0.8, which underparenthesizes its
8932 definition of YYLLOC_DEFAULT.
8933 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
8934 their arguments.
8935 * data/lalr1.cc: Likewise.
8936 * data/yacc.cc: Likewise.
8937
06f01bc4
PE
89382006-01-22 Paul Eggert <eggert@cs.ucla.edu>
8939
401aace6
PE
8940 Work around a bug in Pike 7.0, and give the Pike folks a
8941 better way to override the usual int widths.
8942 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
8943 user can override the types.
8944 (short): #undef, to work around a bug in Pike 7.0.
8945 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
8946 (union yyalloc.yyss): Use yytype_int16 rather than short.
8947 All uses changed.
8948 (yysigned_char): Remove.
8949 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
8950 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
8951 * tests/regression.at (Web2c Actions): Adjust to above changes.
8952
8953 * src/reader.c (check_and_convert_grammar): New function.
8954 (reader): Close the input file even if something went wrong during
8955 parsing. Minor file descriptor leak reported by twlevo.
8956
06f01bc4
PE
8957 * src/assoc.c (assoc_to_string): Use a default: abort (); case
8958 to pacify gcc -Wswitch-default.
8959 * src/scan-gram.l (adjust_location): Use a default: break; case
8960 to pacify gcc -Wswitch-default.
8961 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
8962 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
8963 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
8964 Move these decls to scan-skel.l, since they don't need to be
8965 visible elsewhere.
8966 * src/scan-skel.l: Accept the above decls.
8967 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
8968 is used.
8969
02650b7f
PE
89702006-01-21 Paul Eggert <eggert@cs.ucla.edu>
8971
8972 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
8973 since we don't want to insist on a version number at the start
8974 of the changelog every time.
8975 * Makefile.maint: Sync from coreutils a bit better.
8976 (sc_trailing_blank): Renamed from sc_trailing_space.
8977 All uses changed.
8978 (sc_no_if_have_config_h, sc_require_config_h):
8979 (sc_prohibit_assert_without_use): New rules.
8980 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
8981 (sc_dd_max_sym_length): Fix leading spaces in rule.
8982 (sc_system_h_headers): Prefix with @.
8983 (sc_useless_cpp_parens, m4-check): Output line numbers.
8984 (changelog-check): Allow version only in head.
8985 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
8986 satisfy new Makefile.maint rule.
8987 * data/glr.c: Likewise.
8988 * data/glr.cc: Likewise.
8989 * data/lalr1.cc: Likewise.
8990 * data/yacc.c: Likewise.
8991 * lib/ebitsetv.c: Likewise.
8992 * lib/lbitset.c: Likewise.
8993 * lib/subpipe.c: Likewise.
8994 * lib/timevar.c: Likewise.
8995 * src/system.h: Likewise.
8996 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
8997 * djgpp/Makefile.maint: Add copyright notice.
8998 * djgpp/README.in: Likewise.
8999 * djgpp/config.bat: Likewise.
9000 * djgpp/config.site: Likewise.
9001 * djgpp/config_h.sed: Likewise.
9002 * djgpp/djunpack.bat: Likewise.
9003 * djgpp/config.sed: Fix copyright notice to match standard format.
9004 * djgpp/subpipe.h: Likewise.
9005 * lib/bitsetv-print.c: Likewise.
9006 * lib/bitsetv.c: Likewise.
9007 * lib/subpipe.h: Likewise.
9008 * lib/timevar.c: Likewise.
9009 * lib/timevar.h: Likewise.
9010 * djgpp/subpipe.c: Use standard recipe for config.h.
9011 * lib/abitset.c: Likewise.
9012 * lib/bitset.c: Likewise.
9013 * lib/bitset_stats.c: Likewise.
9014 * lib/bitsetv-print.c: Likewise.
9015 * lib/bitsetv.c: Likewise.
9016 * lib/ebitsetv.c: Likewise.
9017 * lib/get-errno.c: Likewise.
9018 * lib/lbitset.c: Likewise.
9019 * lib/subpipe.c: Likewise.
9020 * lib/timevar.c: Likewise.
9021 * lib/vbitset.c: Likewise.
9022 * tests/local.at: Likewise.
9023 * src/scan-gram.l: Don't include verify.h, since system.h does
9024 that for us.
9025 * .x-sc_require_config_h: New file.
9026 * .x-sc_unmarked_diagnostics: New file.
9027
287c78f6
PE
90282006-01-20 Paul Eggert <eggert@cs.ucla.edu>
9029
287c78f6
PE
9030 Be a bit more systematic about using 'abort'.
9031 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
9032 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
9033 Put 'default: abort ();' before some other case, to satisfy older
9034 pedantic compilers.
9035 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9036 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
9037 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
9038 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
9039 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
9040 (get_decision_str, get_orientation_str, get_node_alignment_str):
9041 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
9042 (get_linestyle_str, get_arrowstyle_str): Likewise.
9043 * src/conflicts.c (resolve_sr_conflict):
9044 Use a default case rather than one for the one remaining enum
9045 value, to catch invalid enum values as well.
9046 * src/lalr.c (set_goto_map, map_goto):
9047 Prefer "assert (FOO);" to "if (!FOO) abort ();".
9048 * src/nullable.c (nullable_compute, token_definitions_output):
9049 Likewise.
9050 * src/reader.c (packgram, reader): Likewise.
9051 * src/state.c (transitions_to, state_new, state_reduction_find):
9052 Likewise.
9053 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
9054 (symbol_pack): Likewise.
9055 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
9056 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
9057 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
9058 * src/system.h: Don't include <assert.h>.
9059 (assert): New macro.
9060
9061 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
9062 (Destructor Decl, Parser Function, Pure Calling):
9063 Describe rules for braces inside C code more carefully.
287c78f6 9064
c66dfadd
PE
90652006-01-19 Paul Eggert <eggert@cs.ucla.edu>
9066
c21493b8
PE
9067 Fix some porting glitches found by Nelson H. F. Beebe.
9068 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
9069 compilers that don't understand that abort () does not return.
9070 * src/state.c (transitions_to): Likewise.
9071 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9072 that '#include <cstdlib>' works.
9073 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
9074 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
9075 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
9076 for the benefit of some pre-C99 compilers.
9077
b6e3facf
PE
9078 * bootstrap: Undo changes to gnulib files that autoreconf made.
9079
c66dfadd
PE
9080 Minor fixups to get 'make maintainer-check' to work.
9081 * configure.ac: Don't use -Wnested-externs, as it's incompatible
9082 with the new verify.h implementation.
9083 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
9084 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
9085 * data/yacc.c (YYUSE): Likewise.
9086 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
9087 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
9088 * src/parse-gram.y (declaration): Don't pass a string constant
9089 to a function that expects char *, since GCC might complain
9090 about the constant value.
9091 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
9092 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
9093 before #defining them.
9094 * tests/glr-regression.at
9095 (Incorrectly initialized location for empty right-hand side in GLR):
9096 In yyerror, use the msg arg.
9097 (Corrupted semantic options if user action cuts parse):
9098 (Incorrect lookahead during deterministic GLR):
9099 (Incorrect lookahead during nondeterministic GLR):
9100 Don't name a local var 'index'; it shadows string.h's 'index'.
9101
ed94ef2a
AD
91022006-01-19 Akim Demaille <akim@epita.fr>
9103
9104 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
9105 location, not just parts of it.
9106
e9ad4aec
PE
91072006-01-18 Paul Eggert <eggert@cs.ucla.edu>
9108
d6ca7905
PE
9109 * NEWS: Document the fact that multiple %unions are now allowed.
9110 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
9111 * TODO: This feature is now implemented, so remove it from
9112 the wishlist.
d6ca7905 9113
ef1b70e0
PE
9114 * Makefile.maint: Merge with coreutils Makefile.maint.
9115 (CVS_LIST): Use build-aux version if available.
9116 (VERSION_REGEXP): New macro.
9117 (syntax-check-rules): Add sc_no_if_have_config_h,
9118 sc_prohibit_assert_without_use, sc_require_config_h,
9119 sc_useless_cpp_parens.
9120 (sc_obsolete_symbols): Check for O_NDELAY.
9121 (sc_dd_max_sym_length): Track coreutils.
9122 (sc_unmarked_diagnostics): Look in all files, not just *.c.
9123 (sc_useless_cpp_parens): New rule.
9124 (news-date-check): Look for version or today's date.
9125 (changelog-check): Don't require version number near head.
9126 (copyright-check): Use current year instead of hardwiring 2005.
9127 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
9128 (announcement): Add --gpg-key-ID.
9129
9130 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
9131 with "file system".
9132
2073ce56 9133 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
9134 array. Problem reported by twlevo.
9135 * src/reader.c (packgram): Prepend a new sentinel before ritem.
9136 * src/lalr.c (build_relations): Rely on new sentinel.
9137 * src/gram.c (gram_free): Adjust to new sentinel.
9138
b7691f15
JD
91392006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
9140
9141 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
9142 yylookaheadNeeds. All uses updated.
9143 (yysplitStack): Rename local yynewLookaheadStatuses to
9144 yynewLookaheadNeeds.
9145 * data/glr-regression.at (Incorrect lookahead during nondeterministic
9146 GLR): In comments, change `lookahead status' to `lookahead need'.
9147
ddee1b06
PH
91482006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9149
9150 * data/glr.c (yysplitStack): A little stylistic rewrite.
9151
12f4614d
PH
91522006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9153
9154 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
9155
32c29292
JD
91562006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
9157
9158 * doc/bison.texinfo: Fix some typos.
9159 (GLR Semantic Actions): New subsection discussing special
9160 considerations because GLR semantic actions might be deferred.
9161 (Actions): Mention look-ahead usage of yylval.
9162 (Actions and Locations): Mention look-ahead usage of yylloc.
9163 (Special Features for Use in Actions): Add YYEOF entry and mention it
9164 in the yychar entry.
9165 In the yychar entry, remove mention of the local yychar case (pure
9166 parser) since this is irrelevant information when writing semantic
148d66d8 9167 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
9168 yychar is otherwise described as an external variable.
9169 In the yychar entry, don't call it the `current' look-ahead since it
9170 isn't when semantic actions are deferred.
9171 In the yychar and yyclearin entries, add note about deferred semantic
9172 actions.
9173 Add yylloc and yylval entries discussing look-ahead usage.
9174 (Look-Ahead Tokens): When discussing yychar, don't call it the
9175 `current' look-ahead, and do mention yylval and yylloc.
9176 (Error Recovery): Cross-reference `Action Features' when mentioning
9177 yyclearin.
148d66d8 9178 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
9179 look-ahead.
9180 In the yylloc and yylval entries, mention look-ahead usage.
9181
de366a2f 91822006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
9183
9184 * tests/glr-regression.at: Update copyright year to 2006.
9185
bf70fa87
JD
91862006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9187
9188 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
9189 use during nondeterministic operation to track which stacks have
9190 actually needed the current lookahead.
9191 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
9192 Allocate, deallocate, resize, and otherwise shuffle space for
9193 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
9194 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
9195 appropriately during nondeterministic operation.
9196 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
9197 members to store the current lookahead to be used by the deferred
9198 user action.
9199 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
9200 from which the RHS is taken. Set the lookahead members of the new
9201 yySemanticOption according to the lookahead status for stack yyk.
9202 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
9203 yyaddDeferredAction.
9204 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
9205 members of yySemanticOption before invoking yyuserAction, and then set
9206 them back to their current values afterward.
9207 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
9208 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
9209 * tests/glr-regression.at: Remove `.' from the ends of recent test case
9210 titles for consistency.
9211 (Leaked merged semantic value if user action cuts parse): In order to
9212 suppress lint warnings, use arguments in merge function, and assign
9213 char value < 128 in main.
9214 (Incorrect lookahead during deterministic GLR): New test case.
9215 (Incorrect lookahead during nondeterministic GLR): New test case.
9216
05449a2c
JD
92172006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9218
de366a2f 9219 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
9220 !yyvaluep as signal that no semantic value is available to print.
9221 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
9222 to print a semantic value.
9223
4158e0a1 92242006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 9225
4158e0a1
JD
9226 * tests/glr-regression.at: For consistency with my newer test cases,
9227 don't thank myself.
9228
d659304d
JD
92292006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
9230
9231 * data/glr.c (yyresolveValue): When merging semantic options, if at
9232 least one user action succeeds but a later one cuts the parse, then
9233 destroy the semantic value before returning rather than leaking it.
9234 (yyresolveStates): If a user action cuts the parse and thus
9235 yyresolveValue fails, ignore the (unset) semantic value rather than
9236 corrupting the yyGLRState, and empty the semantic options list since
9237 the user actions should have called all necessary destructors.
9238 Simplify code with YYCHK.
9239 * tests/glr-regression.at (Corrupted semantic options if user action
9240 cuts parse): New test case.
9241 (Undesirable destructors if user action cuts parse): New test case.
9242 Before applying any of this patch, this test case never actually failed
9243 for me... but only because the corrupted semantic options usually
9244 masked this bug.
9245 (Leaked merged semantic value if user action cuts parse): New test
9246 case.
9247
6ec2c0f2
AD
92482006-01-05 Akim Demaille <akim@epita.fr>
9249
9250 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
9251
1b9c21fb
PE
92522006-01-04 Paul Eggert <eggert@cs.ucla.edu>
9253
9254 * data/c.m4 (b4_c_modern): New macro, with a new provision for
9255 _MSC_VER. Problem reported by Cenzato Marco.
9256 (b4_c_function_def): Use it.
9257 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
9258 b4_c_modern.
9259 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
9260 than rolling our own.
9261
84866159
AD
92622006-01-04 Akim Demaille <akim@epita.fr>
9263
9264 Also warn about non-used mid-rule values.
9265 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
9266 member.
9267 (symbol_list_new): Adjust.
9268 * src/reader.c (symbol_typed_p): New.
9269 (grammar_rule_check): Use it.
9270 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
9271 Check its rule.
9272 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
9273 Use it.
9274 * tests/actions.at (Exotic Dollars): Adjust.
9275
378f4bd8
AD
92762006-01-04 Akim Demaille <akim@epita.fr>
9277
9278 * src/reader.c (grammar_midrule_action): If $$ is set in a
9279 mid-rule, move the `used' bit to its lhs.
9280 * tests/input.at (Unused values): New.
9281 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
9282
e2a21b6f
PE
92832006-01-03 Paul Eggert <eggert@cs.ucla.edu>
9284
54662697
PE
9285 * doc/bison.texinfo (Bison Options): Say more accurately what
9286 --yacc does.
9287 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
9288 about declarations in the grammar when in Yacc mode, as POSIX does
9289 not require a diagnostic when the grammar uses extensions.
9290
9291 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
9292
073f9288
PE
9293 Warn about dubious constructions like "%token T T".
9294 Reported by twlevo.
9295 * src/symtab.h (struct symbol.declared): New member.
9296 * src/symtab.c (symbol_new): Initialize it to false.
9297 (symbol_class_set): New arg DECLARING, specifying whether
9298 this is a declaration that we want to warn about, if there
9299 is more than one of them. All uses changed.
9300
1221b78a
PE
9301 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
9302 Allow multiple %union directives, whose contents concatenate.
9303 * src/parse-gram.y (grammar_declaration): Likewise.
9304 Use muscle_code_grow, so that we don't need stype_line any more.
9305 All uses changed.
9306
9307 * src/muscle_tab.c (muscle_grow): Fix comment.
9308
e2a21b6f
PE
9309 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
9310 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
9311 Update copyright year to 2006.
9312
8f7e3cf9
AD
93132006-01-03 Akim Demaille <akim@epita.fr>
9314
9315 Have glr.cc pass (some of) the calc.at tests.
9316 * data/glr.cc (b4_parse_param_orig): New.
9317 (b4_parse_param): Improve its definition, and bound it more
9318 clearly in the skeleton.
9319 (b4_epilogue): Append, instead of prepending, in order to keep
9320 #line consistency.
9321 Simplify the generation of auxiliary functions: locations and
9322 purity are mandated.
9323 (b4_global_tokens_and_yystype): Honor it.
9324 * data/location.cc (c++.m4): Don't include it.
9325 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9326 and AT_SKEL_CC_IF.
9327 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9328 AT_LALR1_CC_IF.
9329 Be sure to initialize the first position's filename.
9330 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9331 mandated anyway.
9332 (AT_CHECK_CALC_GLR_CC): New.
9333 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9334
3953ed88
AD
93352006-01-02 Akim Demaille <akim@epita.fr>
9336
9337 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9338 c.m4.
0a96ba81 9339 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
9340 * data/glr.cc: Do not include stack.hh.
9341
9ecafbbf
AD
93422006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9343
9344 * data/glr.c: Reformat whitespace with tabs.
9345 (b4_lpure_formals): Remove this unused m4 macro.
9346 * tests/cxx-type.at: Reformat whitespace with tabs.
9347 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9348 since it's a member. Rename type to isNterm for clarity.
9349
c4d497a0
AD
93502005-12-29 Akim <akim@sulaco.local>
9351
9352 Let glr.cc catch up with symbol_value_print.
9353 * data/glr.cc (b4_yysymprint_generate): Replace by...
9354 (b4_yy_symbol_print_generate): this.
9355 (yy_symbol_print, yy_symbol_value_print): Declare them.
9356
4517da37
PE
93572005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9358
9359 * src/location.h (boundary): Note that a line or column equal
9360 to INT_MAX indicates an overflow.
9361 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9362 (rule_length_overflow, increment_rule_length, add_column_width):
9363 New functions.
9364 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9365 (<SC_BRACED_CODE>"}"):
9366 Use increment_rule_length rather than incrementing it by hand.
9367 (adjust_location, handle_syncline): Diagnose overflow.
9368 (handle_action_dollar, handle_action_at):
9369 Fix bug with monstrosities like $-2147483648.
9370 Remove now-unnecessary checks.
9371 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9372 (convert_ucn_to_byte): Verify assumptions.
9373 (handle_syncline): New arg LOC. All callers changed.
9374 Don't store through a value derived from char const * pointer.
9375
9376 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9377 GCC warnings.
9378
e3233bf6
PE
93792005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9380
9381 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9382 Remove unnecessary forward static decls.
9383
8f3596a6
AD
93842005-12-27 Akim Demaille <akim@epita.fr>
9385
9386 * src/reader.c (grammar_current_rule_check): Also check that $$
9387 is used.
9388 Take the rule to check as argument, hence rename as...
9389 (grammar_rule_check): this.
9390 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9391 Rename as...
9392 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9393 (grammar_midrule_action, grammar_symbol_append): Now static.
9394 * tests/torture.at (input): Don't rely on the default action
9395 being always performed.
9396 * tests/calc.at: "Set" $$ even when the action is "cut" with
9397 YYERROR or other.
9398 * tests/actions.at (Exotic Dollars): Instead of using unused
9399 values, check that the warning is issued.
9400
721be13c
PE
94012005-12-22 Paul Eggert <eggert@cs.ucla.edu>
9402
9403 * NEWS: Improve wording for unused-value warnings.
9404
a0af42fc
AD
94052005-12-22 Akim Demaille <akim@epita.fr>
9406
9407 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
9408 (b4_yysymprint_generate): Rename as...
9409 (b4_yy_symbol_print_generate): this.
9410 Generate yy_symbol_print instead of yysymprint.
9411 Generate also yy_symbol_value_print, and use it.
9412
affac613
AD
94132005-12-22 Akim Demaille <akim@epita.fr>
9414
721be13c 9415 * NEWS: Warn about unused values.
affac613
AD
9416 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
9417 a `used' member.
9418 (symbol_list_n_get, symbol_list_n_used_set): New.
9419 (symbol_list_n_type_name_get): Use symbol_list_n_get.
9420 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
9421 * src/reader.c (grammar_current_rule_check): Check that values are
9422 used.
9423 * src/symtab.c (symbol_print): Accept 0.
9424 * tests/existing.at: Remove the type information.
9425 Empty the actions.
9426 Remove useless actions (beware of mid-rule actions: perl -000
9427 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
9428 * tests/actions.at (Exotic Dollars): Use unused values.
9429 * tests/calc.at: Likewise.
9430 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9431 Likewise.
9432
9433 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
9434 rule_useful_p.
9435
9d9b8b70
PE
94362005-12-21 Paul Eggert <eggert@cs.ucla.edu>
9437
8bb4c753
PE
9438 Undo 2005-12-01 tentative license wording change. The wording is
9439 still being reviewed by the lawyers, and we don't want to wait for
9440 them before publishing a test release. For now, revert to the
9441 previous wording.
9442 * NEWS: Undo 2005-12-01 change.
9443 * data/glr.c: Revert to previous license wording.
9444 * data/glr.cc: Likewise.
9445 * data/lalr1.cc: Likewise.
9446 * data/location.cc: Likewise.
9447 * data/yacc.c: Likewise.
9448
9d9b8b70
PE
9449 * NEWS: Reword %destructor vs YYABORT etc.
9450 * data/glr.c: Use American spacing, for consistency.
9451 * data/glr.cc: Likewise.
9452 * data/lalr1.cc: Likewise.
9453 * data/yacc.c: Likewise.
9454 * data/yacc.c: Reformat comments slightly.
9455 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
9456 for consistency. Fix some spelling errors and reword recently-included
9457 text slightly.
9458 * tests/cxx-type.at: Cast results of malloc, for C++.
9459
2c3b392a
AD
94602005-12-21 Joel E. Denny <address@hidden>
9461
9462 * tests/cxx-type.at: Construct a tree, count the parents of shared
9463 nodes, and free each node once and only once. Previously, the memory
9464 for semantic values was leaked instead.
9465
d6cff4dc
AD
94662005-12-21 Joel E. Denny <address@hidden>
9467
9468 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
9469 (yylval, yylloc): If pure, #define to yystackp->yyval and
9470 yystackp->yyloc similar to yychar and yynerrs.
9471 (yyparse): If pure, remove local yylval and yylloc. Add local
9472 yystackp to accommodate pure definitions of yylval and yylloc.
9473 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
9474 yylvalp and yyllocp to &yylval and &yylloc.
9475 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
9476 namespace. Previously, nerrs and char were missing, but lval and lloc
9477 weren't necessary.
9478 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
9479 yylvalp and yyllocp parameters since, if pure, these are now always
9480 accessible through yystackp. If not pure, they are still accessible
9481 globally.
9482 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
9483 `if (YYID (N))' to pacify lint.
9484
a85284cf
AD
94852005-12-21 Akim Demaille <akim@epita.fr>
9486
9487 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
9488 destroy the RHS symbols of a rule.
9489 * data/yacc.c (yylen): Initialize to 0.
9490 Keep its value to the number of items to possibly shift.
9491 In particular, a regular successful parse that ends on YYFINAL by
9492 a (internal) YYACCEPT must not have yylen != 0.
9493 (yyerrorlab, yyreturn): Pop the RHS.
9494 Reorder a bit to emphasize the `shifting' bits of code.
9495 (YYPOPSTACK): Now accept a number of items to pop.
9496 * data/lalr1.cc: Likewise.
9497 * data/glr.c: Formatting changes.
9498 Use goto instead of fall through.
9499 * doc/bison.texinfo (Destructor Decl): Complete.
9500
d508c281
JMG
95012005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9502
9503 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9504 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
9505 * djgpp/config.bat: Replace every occurence of the file name
9506 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9507 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9508 * djgpp/config.sed: Replace every occurence of the file name
9509 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9510 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9511 * djgpp/djunpack.bat: DJGPP specific file.
9512 * djgpp/fnchange.lst: DJGPP specific file.
9513 * djgpp/README.in: Add new information about how to unpack the bison
9514 source on MSDOS and other systems which have 8.3 file name restrictions
9515 using djunpack.bat and fnchange.lst.
9516
3e7a2cd9
PE
95172005-12-12 Paul Eggert <eggert@cs.ucla.edu>
9518
9519 * bootstrap (build_cvs_prefix): Remove; unused.
9520 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
9521 when getting gnulib.
9522
95232005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
9524
9525 * data/glr.c: Reorder typedef declarations for structs to match order
9526 of struct declarations.
9527 Rename yystack everywhere to yystackp except in yyparse where it's not
9528 a pointer.
9529 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
9530 consistency.
9531 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
9532 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
9533 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
9534 lint.
9535
877519f8
PE
95362005-12-09 Paul Eggert <eggert@cs.ucla.edu>
9537
0eca5a39
PE
9538 * tests/sets.at (Accept): Fix typos in regular expression used to
9539 sed out the final state number.
9540
2cec9080
PE
9541 Work around portability problem on Solaris 10: flex-generated
9542 files include <stdio.h> before <config.h>, which messes up
9543 because the latter defines __EXTENSIONS__. Address the problem
9544 by creating two new little files that include <config.h> first,
9545 then include the flex-generated files. Rewrite everyone else
9546 to include <config.h> first, as well.
9547 * lib/timevar.c: Always include "config.h".
9548 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
9549 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
9550 (EXTRA_bison_SOURCES): New macro.
9551 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9552 * src/system.h: Don't include config.h.
9553 * src/LR0.c: Include <config.h> first.
9554 * src/assoc.c: Likewise.
9555 * src/closure.c: Likewise.
9556 * src/complain.c: Likewise.
9557 * src/conflicts.c: Likewise.
9558 * src/derives.c: Likewise.
9559 * src/files.c: Likewise.
9560 * src/getargs.c: Likewise.
9561 * src/gram.c: Likewise.
9562 * src/lalr.c: Likewise.
9563 * src/location.c: Likewise.
9564 * src/main.c: Likewise.
9565 * src/muscle_tab.c: Likewise.
9566 * src/nullable.c: Likewise.
9567 * src/output.c: Likewise.
9568 * src/parse-gram.y: Likewise.
9569 * src/print.c: Likewise.
9570 * src/print_graph.c: Likewise.
9571 * src/reader.c: Likewise.
9572 * src/reduce.c: Likewise.
9573 * src/relation.c: Likewise.
9574 * src/state.c: Likewise.
9575 * src/symlist.c: Likewise.
9576 * src/symtab.c: Likewise.
9577 * src/tables.c: Likewise.
9578 * src/uniqstr.c: Likewise.
9579 * src/vcg.c: Likewise.
9580
877519f8
PE
9581 * src/parse-gram.y: Fix minor problems uncovered by lint.
9582 (current_lhs, current_lhs_location): Now static.
9583 (current_assoc): Remove unused variable.
9584
9585 Cleanups so that Bison-generated parsers have less lint.
9586 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9587 Prepend /*ARGSUSED*/, for lint's sake.
9588 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9589 definition if 'lint' is defined.
9590 (YYID): New macro (or function, if lint).
9591 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9592 * data/yacc.c: Likewise.
9593 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9594 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9595 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9596 is C++ only.
9597 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9598 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9599 Use YYID(0) rather than 0, for lint.
9600 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9601 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9602
f5228370
PE
96032005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9604
9605 * tests/glr-regression.at
9606 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9607 Close memory leak reported by twlevo.
9608
69ce078b
PE
96092005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9610
6ff99711
PE
9611 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9612 all stacks.
9613 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
9614 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9615 New test case.
9616 (Duplicated user destructor for lookahead): This test now is expected
9617 to succeed.
9618
af3412cd
PE
96192005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9620
32b5b719 9621 * NEWS: Document the following change.
af3412cd
PE
9622 * data/yacc.c: Say "parser skeleton" rather than "file", since
9623 it's no longer just a file.
9624 * data/glr.c: Grant a special exception for C GLR parsers, that
9625 reads like the already-existing exception for C LALR(1) parsers.
9626 * data/glr.cc: Likewise.
9627 * data/lalr1.cc: Likewise.
9628 * data/location.cc: Likewise.
9629 * data/yacc.c: Reword the "written by" statement to clarify that
9630 it was the parser skeleton, not the entire output file.
9631 * data/glr.c: Written by Paul Hilfinger.
9632 * data/glr.cc: Written by Akim Demaille.
9633 * data/lalr1.cc: Likewise.
9634
035aa4a0
PE
96352005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9636
d9963c85
PE
9637 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9638 Fix typos in previous change that broke 'make check'.
9639 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9640 supported in C.
9641 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9642 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9643 We can revert this once things settle down.
9644
035aa4a0
PE
9645 * src/conflicts.c (conflicts_print): Don't print file name twice
9646 when %expect fails because there were no conflicts.
9647 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9648 change.
9649 * tests/conflicts.at (%expect not enough, %expect too much):
9650 (%expect with reduce conflicts): Adjust to new behavior.
9651
96522005-11-18 Akim Demaille <akim@epita.fr>
9653
9654 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9655 errors.
9656 * NEWS: Document this.
9657 * doc/bison.texinfo (Expect Decl): Likewise.
9658
d1ff7a7c
AD
96592005-11-16 Akim Demaille <akim@epita.fr>
9660
9661 Generalize the display of semantic values and locations in traces.
9662 * data/glr.c (yy_reduce_print): Fix indices (again).
9663 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9664 literal integers.
9665 * data/lalr1.cc (yyreduce_print): Rename as...
9666 (yy_reduce_print): this.
9667 Display values and locations.
9668 * data/yacc.c (yy_reduce_print): Likewise.
9669 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9670 (yysymprint): Move higher to be visible from yy_reduce_print).
9671 (yyparse): Adjust.
9672 * tests/calc.at: Adjust the expected length of the traces.
9673
6de5398d
AD
96742005-11-14 Akim Demaille <akim@epita.fr>
9675
9676 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9677 from 1 to N, while values and location start at 0.
9678 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9679
a1373f55
AD
96802005-11-14 Akim Demaille <akim@epita.fr>
9681
9682 * data/glr.c (yy_reduce_print): Fix the $ number.
9683
613d8952
AD
96842005-11-14 Akim Demaille <akim@epita.fr>
9685
9686 "Use" parse parameters.
9687 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9688 * data/glr.c, data/glr.cc: Use them.
9689 * data/glr.c (YYUSE): Have a C++ definition that supports
9690 non-pointer types.
9691
b2741627
AD
96922005-11-14 Akim Demaille <akim@epita.fr>
9693
9694 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9695
5059b5c8
AD
96962005-11-14 Akim Demaille <akim@epita.fr>
9697
42249483
AD
9698 * data/glr.cc: New.
9699 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 9700
4626a15d
AD
97012005-11-12 Akim Demaille <akim@epita.fr>
9702
9703 Let position and location be PODs.
9704 * data/location.cc (position::initialize, location::initialize): New.
9705 (position::position, location::location): Define only if
9706 b4_location_constructors is defined.
9707 * data/lalr1.cc (b4_location_constructors): Define it for backward
9708 compatibility.
9709 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9710
97112005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
9712
9713 * data/lalr1.cc: Move the body of the ctor and dtor into the
9714 parser file (instead of the header).
9715 Wrap the implementations in a "namespace yy".
9716
97172005-11-12 Akim Demaille <akim@epita.fr>
9718
9719 Have glr.c include its header file when created.
9720 * data/glr.c (b4_shared_declarations): New.
9721 Output them verbatim in the parser if !%defines, otherwise
9722 output then in the header file, and include it instead.
9723
1989d947
AD
97242005-11-11 Akim Demaille <akim@epita.fr>
9725
9726 * data/glr.c: Comment changes.
9727
97282005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
9729
9730 When yydebug, report semantic and location values for reductions.
9731 * data/glr.c (yy_reduce_print): Report the semantic values and the
9732 locations.
9733 (YY_REDUCE_PRINT): Adjust.
9734 (yyglrReduce): Use them.
9735 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9736 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9737 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9738 traces.
9739
02998094
AD
97402005-11-10 Akim Demaille <akim@epita.fr>
9741
9742 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9743 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9744 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9745
5210672f
PE
97462005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9747
9748 * m4/cxx.m4, examples/Makefile.am: Don't build
9749 examples/calc++ if no C++ compiler is available. (trivial change)
9750
a8991a1d
AD
97512005-11-09 Akim Demaille <akim@epita.fr>
9752
9753 * src/scan-skel.l: Use a couple of asserts.
9754
36b5e963
AD
97552005-11-03 Akim Demaille <akim@epita.fr>
9756
9757 In some (weird) cases, the final state number is incorrect.
9758 Reported by Alexandre Duret-Lutz.
9759 * src/LR0.c (state_list_append): Remove the computation of
9760 final_state.
9761 (save_reductions): Do it here.
9762 (get_state): Alpha conversion.
9763 (generate_states): Use a for loop.
9764 * src/gram.h (item_number_is_rule_number)
9765 (item_number_is_symbol_number): New.
9766 * src/state.c: Use assert.
9767 * src/system.h: Include assert.h.
9768 * tests/sets.at (Accept): New.
9769
44e7ead1
PH
97702005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9771
9772 * data/glr.c (yyfill): Adjust comment.
36b5e963 9773 (yyresolveAction): Initialize default location properly
44e7ead1
PH
9774 for empty right-hand sides.
9775 (yydoAction): Ditto.
9776 Add comment explaining apparently dead code.
36b5e963
AD
9777 * tests/glr-regression.at
9778 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 9779 New test.
36b5e963 9780
e10a80ee
PE
97812005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9782
9783 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9784 gnulib when interrupted. This fixes some race conditions and
9785 works around some portability problems (one noted by Paul
9786 Hilfinger).
9787
067b32ee
AD
97882005-10-22 Akim <akim@epita.fr>
9789
9790 * Makefile.cfg: Adjust to config -> build-aux.
9791 Reported by twledo.
9792
4b367315
AD
97932005-10-21 Akim Demaille <akim@epita.fr>
9794
9795 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9796 the %parse-params.
9797 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9798 * data/yacc.c (b4_Pure_if): Rename as...
9799 (b4_yacc_pure_if): this.
9800 (YY_SYMBOL_PRINT, yyparse): Adjust.
9801 * doc/bison.texinfo: Formatting changes.
9802
24cc23d9
AD
98032005-10-21 Akim Demaille <akim@epita.fr>
9804
9805 Finish the transition config -> build-aux.
9806 * configure.ac, Makefile.am: Use build-aux.
9807 * config/prev-version, config/announce-gen, config/Makefile.am:
9808 Move to...
9809 * build-aux/prev-version, build-aux/announce-gen,
9810 * build-aux/Makefile.am: here.
9811
d4476375
AD
98122005-10-14 Akim Demaille <akim@epita.fr>
9813
9814 * examples/calc++/test: Use set -x only when VERBOSE.
9815
302c0aee
PE
98162005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9817
9818 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9819 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9820
7625ec2c
AD
98212005-10-13 Akim Demaille <akim@epita.fr>
9822
9823 * src/scan-skel.l: Output the base name parts of the parser and
9824 header file names.
302c0aee 9825 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
9826 additional checks.
9827 Use this to exercise C++ outputs in subdirs.
9828 Reported by Oleg Smolsky.
9829
ba0fe3c7
PE
98302005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9831
9832 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9833 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9834 Problem reported by John P. Hartmann.
9835 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9836 already defined it.
9837
9b8a5ce0
AD
98382005-10-12 Akim Demaille <akim@epita.fr>
9839
9840 * src/parse-gram.y (version_check): Exit 63 to please missing
9841 (stands for "version mismatch).
9842 * tests/input.at, doc/bison.texinfo: Adjust.
9843
4f6e011e
PE
98442005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9845
9846 Work around portability problems with Visual Age C compiler
9847 (xlc and xlC_r) reported by John P. Hartmann.
9848 * data/location.cc (initial_column, initial_line): Remove.
9849 All uses replaced by 0 and 1.
9850 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9851 that xlc complains about.
9852 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 9853 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 9854 as __STDC__.
4d7aa45e
PE
9855 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9856 __STDC_VERSION__. Use it everywhere instead of looking at
9857 __STDC__ and __cplusplus.
4f6e011e 9858
a1b3bf8c
AD
98592005-10-10 Akim Demaille <akim@epita.fr>
9860
9861 * examples/calc++/test: Be quiet unless VERBOSE.
9862
412e44aa
PE
98632005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9864
2a4647a3
PE
9865 * data/c.m4 (yydestruct, yysymprint):
9866 Use YYUSE instead of casting to void.
9867 * data/glr.c (YYUSE): New macro.
9868 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9869 Use it instead of rolling our own.
9870 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9871 (YYCHK1):
9872 Use /*CONSTCOND*/ to suppress lint warnings.
9873 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9874 (YY_STACK_PRINT): Use 'false' not '0'.
9875 (YYUSE): New macro.
9876 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9877 * data/yacc.c (YYUSE): New macro.
9878 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9879 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9880 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9881
9882
412e44aa
PE
9883 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9884 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9885
88c6637f
PE
98862005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9887
2f4f028d
PE
9888 Undo the parts of the unlocked-I/O change that substituted
9889 putc or puts for printf. This might hurt performance a bit,
9890 but some people prefer the printf style.
9891 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9892 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9893 All uses replaced by YYFPRINTF and YYDPRINTF.
9894 * data/yacc.c: Likewise.
9895 * lib/bitset.c (bitset_print): Likewise.
9896 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
9897 putc and puts.
9898 * lib/lbitset.c (debug_lbitset): Likewise.
9899 * src/closure.c (print_firsts, print_fderives): Likewise.
9900 * src/gram.c (grammar_dump): Likewise.
9901 * src/lalr.c (look_ahead_tokens_print): Likewise.
9902 * src/output.c (escaped_output): Likewise.
9903 (user_actions_output): Break apart two printfs.
9904 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
9905 * src/reduce.c (reduce_print): Likewise.
9906 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
9907 * src/system.h: Include unlocked-io.h rathe than stdio.h.
9908
88c6637f
PE
9909 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9910 Use assignments rather than casts-to-void to suppress
9911 unused-variable warnings. This pacifies 'lint'.
9912 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
9913 unused-variable warnings.
9914
fb32e373
JMG
99152005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9916
9917 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9918
edb8f44f
PE
99192005-10-02 Paul Eggert <eggert@cs.ucla.edu>
9920
fb9c0b33
PE
9921 Use unlocked I/O for a minor performance improvement on hosts like
9922 GNU/Linux and Solaris that support unlocked I/O. The basic idea
9923 is to use the gnlib unlocked-io module, and to prefer putc and
9924 puts to printf when either will work (since the latter doesn't
9925 come in an unlocked flavor).
9926 * bootstrap (gnulib_modules): Add unlocked-io.
9927 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
9928 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
9929 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
9930 and similarly for puts and putc and printf.
9931 * data/yacc.c: Likewise.
9932 * lib/bitset.c (bitset_print): Likewise.
9933 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
9934 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
9935 to printf.
9936 * lib/lbitset.c (debug_lbitset): Likewise.
9937 * src/closure.c (print_firsts, print_fderives): Likewise.
9938 * src/gram.c (grammar_dump): Likewise.
9939 * src/lalr.c (look_ahead_tokens_print): Likewise.
9940 * src/output.c (escaped_output): Likewise.
9941 (user_actions_output): Coalesce two printfs.
2f4f028d 9942 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
9943 * src/reduce.c (reduce_print): Likewise.
9944 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 9945 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 9946
edb8f44f
PE
9947 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
9948 this confuses xgettext.
9949
b50d2359
AD
99502005-10-02 Akim Demaille <akim@epita.fr>
9951
9952 * bootstrap (gnulib_modules): Add strverscmp.
9953 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
9954 * m4/.cvsignore: Add strverscmp.m4.
9955 * src/parse-gram.y (%require): New token, new rule.
9956 (version_check): New.
9957 * src/scan-gram.l (%require): Adjust.
9958 * tests/input.at (AT_REQUIRE): New.
9959 Use it.
9960 * doc/bison.texinfo (Require Decl): New.
9961 (Calc++ Parser): Use %require.
9962
21667f64
AD
99632005-10-02 Akim Demaille <akim@epita.fr>
9964
9965 * data/location.cc: New.
9966
2b81e969
AD
99672005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
9968 Akim Demaille <akim@epita.fr>
9969
9970 Make sure -odir/foo.cc creates dir/location.hh etc.
9971 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
9972 (spec_file_prefix, spec_verbose_file, spec_graph_file)
9973 (spec_defines_file): Now const.
9974 (dir_prefix): New.
9975 (short_base_name): Remove.
9976 * src/files.c: Adjust.
9977 (dirname.h): Include.
9978 (base_name): Don't prototype it.
9979 (finput): Remove, duplicates gram_in.
9980 (full_base_name, short_base_name): Replace by...
9981 (all_but_ext, all_but_tab_ext): these.
9982 (compute_base_names): Rename as...
9983 (compute_file_name_parts): this.
9984 Update to compute the new variables, including dir_prefix.
9985 Adjust dependencies.
9986 * src/output.c (prepare): Output them.
9987 * src/reader.c: Adjust to use gram_in, not finput.
9988 * src/scan-skel.l (@dir_prefix@): New.
9989
ad6a9b97
JMG
99902005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9991
9992 * lib/subpipe.c: New function end_of_output_subpipe() added
9993 to allow support for non-posix systems. This is a no-op function
9994 for posix systems.
9995
9996 * lib/subpipe.h: New function end_of_output_subpipe() added
9997 to allow support for non-posix systems. This is a no-op function
9998 for posix systems.
9999
10000 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10001 handle the lack of pipe/fork functionality on non-posix systems.
10002
10003 * djgpp/Makefile.maint: DJGPP specific file.
10004
10005 * djgpp/README.in: DJGPP specific file.
10006
10007 * djgpp/config.bat: DJGPP specific configuration file.
10008
10009 * djgpp/config.sed: DJGPP specific configuration file.
10010
10011 * djgpp/config.site: DJGPP specific configuration file.
10012
10013 * djgpp/config_h.sed: DJGPP specific configuration file.
10014
10015 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
10016
10017 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
10018
fc695704
AD
100192005-10-02 Akim Demaille <akim@epita.fr>
10020
10021 * data/location.cc: New, extract from...
10022 * data/lalr1.cc: here.
10023 (location.hh): Include it after the user prologue, in case the
10024 filename type is defined by the user.
10025 Forward declation location and position before the pre-prologue.
10026 (yyresult_): Rename as...
10027 (yyresult): this, it's a local variable, not an attribute.
10028 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
10029
100302005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
10031
10032 * examples/extexi: Restore the #line generation.
10033
fb9712a9
AD
100342005-09-30 Akim Demaille <akim@epita.fr>,
10035 Alexandre Duret-Lutz <adl@gnu.org>
10036
10037 Move the token type and YYSTYPE in the parser class.
10038 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
10039 (parser::token): New, from the moved free definition of tokens.
10040 (parser::semantic_value): Now a full definition instead of an
10041 indirection to YYSTYPE.
10042 (b4_post_prologue): No longer included in the header file, but
10043 in the implementation file.
10044 * doc/bison.texi (C+ Language Interface): Update.
10045 * src/parse-gram.y: Support unary %define.
10046 * tests/actions.at: Define global_tokens_and_yystype for backward
10047 compatibility until we update the tests.
10048 * tests/calc.at: Idem.
10049 (first_line, first_column, last_line, last_column): Define for lalr1.cc
10050 to simplify the code.
10051
55f0c7b1
PE
100522005-09-29 Paul Eggert <eggert@cs.ucla.edu>
10053
10054 Port to SunOS 4.1.4, which lacks strtoul and strerror.
10055 Ah, the good old days! Problem reported by Peter Klein.
10056 * bootstrap (gnulib_modules): Add strerror, strtoul.
10057 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
10058 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
10059
fb9712a9 100602005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
10061
10062 * data/c.m4 (b4_error_verbose_if): New.
10063 * data/lalr1.cc: Use it.
10064 (YYERROR_VERBOSE_IF): Remove.
10065 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
10066 parser members, replaced by...
10067 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
10068 local variables.
10069 (yysyntax_error_): Takes the state number as argument.
10070 (yyreduce_print_): Use the argument yyrule, not the former
10071 attribute yyn_.
10072
8a6f72f3
PE
100732005-09-26 Paul Eggert <eggert@cs.ucla.edu>
10074
10075 * bootstrap (gnulib_modules): Add verify.
10076 * lib/.cvsignore: Add verify.h.
10077 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
10078 * src/system.h (verify): Remove.
10079 Include verify.h instead.
10080 * src/tables.c (tables_generate): Use new API for 'verify'.
10081
0d50976f
PE
100822005-09-21 Paul Eggert <eggert@cs.ucla.edu>
10083
ebc3737e
PE
10084 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
10085 local variables whose names begin with 'yy'.
10086 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10087 Trivial changes from Joel E. Denny.
10088
0d50976f
PE
10089 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
10090 it itself.
10091 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
10092 don't use alloca any more.
10093
10094 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
10095 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 10096 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
10097 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
10098 to match yacc.c, to test more hosts.
10099
a05b79df
PE
101002005-09-20 Paul Eggert <eggert@cs.ucla.edu>
10101
55289366
PE
10102 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
10103 doesn't affect behavior.
10104 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
10105 Solaris, AIX, MSC.
10106 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
10107 This works a bit better with glibc, if user code has already included
10108 stdlib.h.
10109 * doc/bison.texinfo (Bison Parser): Document that users can't
10110 arbitrarily use malloc and free for other purposes. Document
10111 that <alloca.h> and <malloc.h> might be included.
10112 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
10113 user must declare alloca.
10114
a05b79df
PE
10115 * HACKING (release): Forwarn the Translation Project about
10116 stable releses.
10117
3ab2ca22
AD
101182005-09-20 Akim Demaille <akim@epita.fr>
10119
10120 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
10121
a9739e7c
PE
101222005-09-19 Paul Eggert <eggert@cs.ucla.edu>
10123
a702593e
PE
10124 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
10125 (YYSTACK_ALLOC_MAXIMUM): Use it.
10126 (yysyntax_error): New function.
10127 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
10128 multiple syntax errors are reported, and alloca is being used.
10129 Instead, reallocate buffers twice as big each time, so that
10130 we waste at most half the allocated memory. Start with a small
10131 (128-byte) buffer that will suffice in most cases anyway.
10132 Use yysyntax_error to do most of the work.
10133
10134 * doc/bison.texinfo (Error Reporting, Table of Symbols):
10135 yynerrs is the number of errors reported, not the number of
10136 errors encountered.
10137
a9739e7c
PE
10138 * tests/glr-regression.at (Duplicated user destructor for lookahead):
10139 Mark it as expected to fail.
10140 Cast result of malloc; problem reported by twlevo@xs4all.nl.
10141 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
10142 Don't start user-code symbols with "yy", to avoid name space problems.
10143
f479c6c6
AD
101442005-09-19 Akim Demaille <akim@epita.fr>
10145
10146 Remove the traits, failed experiment.
10147 It never proved useful, and anyway because of the current
10148 definition, it was not possible to have several specialization of
10149 this traits, making it useless.
10150 * data/lalr1.cc (yy:traits): Remove.
10151 Inline its definitions in the parser class.
10152
e2586f82
AD
101532005-09-19 Akim Demaille <akim@epita.fr>
10154
10155 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
10156 least Mac OSX with a /usr/local install of gettext.
10157
2e8cf949
AD
101582005-09-19 Akim Demaille <akim@epita.fr>
10159
10160 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
10161 and yytoken for similarity with the other skeletons.
10162
c7fb0b90
AD
101632005-09-19 Akim Demaille <akim@epita.fr>
10164
4e26c69e 10165 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 10166
1bd0deda
PE
101672005-09-16 Paul Eggert <eggert@cs.ucla.edu>
10168
10169 * NEWS: Version 2.1.
10170
10171 * NEWS: Remove notice of yytname change, since it was never in an
10172 official release.
10173 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
10174 diagnostic.
10175 * src/output.c (prepare): Likewise.
10176 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
10177 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
10178 is not defined. This is an awful hack, but it's enough for now.
10179 All callers changed.
10180 * tests/glr-regression-at (make_value): Args are const pointers now,
10181 to avoid GCC warning.
10182 (Duplicated user destructor for lookahead): New test. Currently
10183 skipped. It fails on my host but I'm not sure it'll always fail.
10184
101852005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
10186
10187 * src/symtab.h (struct symbol): Declare the printer and destructor
10188 as const, to avoid accidental calls to free.
10189 (symbol_destructor_set, symbol_printer_set): Adjust.
10190 * src/symtab.c: Adjust.
10191
1bd0deda 101922005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
10193
10194 * data/c.m4 (b4_token_enums): New.
10195 (b4_token_defines): Rename as...
10196 (b4_token_enums_defines): this.
10197 (b4_token_defines): New, output only the #defines.
10198 * data/yacc.c, data/glr.c: Adjust.
10199 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
10200 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
10201 as default values.
10202
dbcdae2d
AD
102032005-09-16 Akim Demaille <akim@epita.fr>
10204
10205 * data/lalr1.cc (yylex_): Remove, inline its code.
10206 (yyreport_syntax_error_): Remove, replaced by...
10207 (yysyntax_error_): this which returns a string and leaves to the
10208 caller the call to the users' error function.
10209 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
10210 Move from members of the parser object...
10211 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
10212 to local variables of the parse function.
10213
70d8f291
AD
102142005-09-16 Akim Demaille <akim@epita.fr>
10215
10216 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
10217 since it's in Bison's name space.
10218
b47dbebe
PE
102192005-09-15 Paul Eggert <eggert@cs.ucla.edu>
10220
ae199bf1
PE
10221 * data/glr.c (yyresolveValue): Add default case to pacify
10222 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
10223
b47dbebe
PE
10224 * NEWS: Document when yyparse started to return 2.
10225 * doc/bison.texinfo (Parser Function): Document when yyparse
10226 returns 2.
10227
10228 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
10229 (b4_filename_type): Renamed back from b4_file_name_type. All uses
10230 changed.
10231 (class position): file_name -> filename (reverting). All uses changed.
10232
102332005-09-14 Paul Eggert <eggert@cs.ucla.edu>
10234
10235 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
10236 do anything if $@ exists. This reverts part of the 2005-07-07
10237 patch.
10238
00292f66
PE
102392005-09-11 Paul Eggert <eggert@cs.ucla.edu>
10240
10241 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
10242 contains obsolete information and isn't worth distributing as a
10243 separate file anyway.
10244 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
10245 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
10246 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
10247 (yyparse): Abort if user code uses longjmp to throw an unexpected
10248 value.
10249
a420f962
PE
102502005-09-09 Paul Eggert <eggert@cs.ucla.edu>
10251
00292f66
PE
10252 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
10253 Suggested by twlevo@xs4all.nl.
10254
127287e9
PE
10255 * data/glr.c (YYCHK1): Do not assume YYE is in range.
10256 This avoids a diagnostic from gcc -Wswitch-enum.
10257 Problem reported by twlevo@xs4all.nl.
10258
a420f962
PE
10259 * doc/bison.texinfo: Don't use "filename", as per GNU coding
10260 standards. Use "file name" or "file" or "name", depending on
10261 the context.
10262 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
10263 not to hack/foo.tab.c.
10264 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
10265 * data/glr.c: b4_filename -> b4_file_name.
10266 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
10267 All uses changed.
10268 (class position): filename -> file_name. All uses changed.
10269 * data/yacc.c: b4_filename -> b4_file_name.
10270 * lib/bitset.h: filename -> file_name in local vars.
10271 * lib/bitset_stats.c: Likewise.
10272 * src/files.c: Likewise.
10273 * src/scan-skel.l ("@output ".*\n): Likewise.
10274 * src/files.c (file_name_split): Renamed from filename_split.
10275 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
10276
102772005-09-08 Paul Eggert <eggert@cs.ucla.edu>
10278
10279 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
10280 to accommodate latest gnulib.
10281
10282 * tests/glr-regression.at (Duplicate representation of merged trees):
10283 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
10284
10285 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
10286 needed.
10287
42a6501d
PE
102882005-08-26 Paul Eggert <eggert@cs.ucla.edu>
10289
10290 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
10291 All uses changed. Invoke user destructor after an error during a
10292 split parse (trivial change from Joel E. Denny).
10293
10294 * tests/glr-regression.at
10295 (User destructor after an error during a split parse): New test case.
10296 Problem reported by Joel E. Denny in:
10297 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
10298
ef9a1faf
PE
102992005-08-25 Paul Eggert <eggert@cs.ucla.edu>
10300
5b4aaf78
PE
10301 * README-cvs: Give URLs for recommended tools.
10302 Mention Gzip version problem, and bootstrapping issues.
10303 Remove troubleshooting section, as it's somewhat obsolete.
10304
b5240ba5
PE
10305 * bootstrap (no_cache): New var, to accommodate different wget
10306 variants. Use it instead of '-C off'. Problem reported by
10307 twlevo@xs4all.nl.
10308
ef9a1faf
PE
10309 * data/glr.c (yydestroyStackItem): New function.
10310 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
10311 debugging information. Problem reported by Joel E. Denny.
10312
e6efa9da
AD
103132005-08-25 Akim Demaille <akim@epita.fr>
10314
10315 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
10316
adc90f13
PE
103172005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10318
10319 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10320 Don't invoke destructor on unresolved entries.
10321 * tests/glr-regression.at
10322 (User destructor for unresolved GLR semantic value): New test case.
10323 Problem reported by Joel E. Denny in:
10324 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10325
f9315de5
PE
103262005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10327
15d29c1f
PE
10328 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10329 Add strnlen.c.
10330 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10331 lib-prefix.m4, po.m4.
10332
dd5f2af2
PE
10333 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10334 in yydestruct diagnostic, since it might not be an error.
10335 Problem reported by Joel Denny near end of
10336 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 10337 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
10338 * data/yacc.c (yyreturn): Likewise.
10339 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10340
10341 * src/files.c: Remove obsolete FIXME comment.
10342
10343 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10344 with the other templates, and to fix bogus run-on messages such
10345 as the one reported at the end of
10346 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10347 All callers changed to avoid the newline.
10348 (yyprocessOneStack): Output two lines rather than one, to accommodate
10349 the above change. This changes the debug output format slightly.
10350
f9315de5
PE
10351 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10352 reported by Joel E. Denny in
10353 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10354 (trivial change).
10355 * tests/glr-regression.at (Duplicate representation of merged trees):
10356 New test, from Joel E. Denny in:
10357 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10358 * THANKS: Add Joel E. Denny.
10359
10360 * configure.ac (AC_INIT): Bump to 2.0c.
10361
04098407
PE
103622005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10363
10364 * NEWS: Version 2.0b.
10365
ca5d2013
PE
10366 * Makefile.am (SUBDIRS): Put examples before tests, so that
10367 "make check" doesn't finish with "All 1 tests passed".
10368
3d54b576
PE
10369 * tests/regression.at (Token definitions): Don't rely on
10370 AT_PARSER_CHECK for data that contains backslashes. It currently
10371 uses 'echo', and 'echo' isn't portable if its argument contains
10372 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10373 that the byte '\0xff' is not printable in the C locale; it is,
10374 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10375 not printable, so use '\0x81' to test.
10376
d53ae497
PE
10377 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10378 version of GCC, since the macro is used with non-GCC compilers.
10379
fc01665e
PE
10380 Fix core dump reported by Pablo De Napoli in
10381 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10382 * tests/regression.at (Invalid inputs with {}): New test.
10383 * src/parse-gram.y (token_name): Translate type before using
10384 it as an index.
10385
04098407
PE
10386 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10387 the user's name space. All uses changed to __attribute__
10388 ((__unused__)).
10389 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10390 Add __attribute__ ((__noreturn__)).
10391
10392 * etc/clcommit: Remove. We weren't using it, and it failed
10393 "make maintainer-distcheck".
10394 * Makefile.maint: Merge from coreutils.
10395 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10396 (syntax-check-rules): Change list of rules as described below.
10397 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10398 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10399 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10400 (sc_trailing_space): New rules.
10401 (sc_xalloc_h_in_src): Remove.
10402 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
10403 (sc_space_tab, sc_error_exit_success, sc_changelog):
10404 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
10405 (makefile-check, po-check, author_mark_check):
10406 (makefile_path_separator_check, copyright-check):
10407 Use grep -n, to make it easier to find violations.
10408 Use CVS_LIST and CVS_LIST_EXCEPT.
10409 (header_regexp, h_re): Remove.
10410 (dd_c): New macro.
10411 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
10412 (my-distcheck): Use more-modern GCC flags.
10413 (signatures, %.asc): Remove.
10414 (rel-files, announcement): Remove signatures.
10415 Restore old updating code, even though we don't use it, so
10416 that we're the same as coreutils.
10417 (alpha, beta, major): Depend on news-date-check.
10418 Make the upload commands.
10419
10420 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
10421 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
10422 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
10423 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
10424 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
10425 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
10426 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
10427 * tests/sets.at: Likewise.
10428
10429 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
10430 we comment out the Autoconf version number.
10431 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
10432 it's error-prone and "make maintainer-distcheck" rejects it.
10433
10434 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
10435 Indent calls to "error" to pacify "make maintainer-distcheck",
10436 when the calls are not intended to be translated.
10437 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
10438
10439 * src/Makefile.am (DEFS): Use +=, to pacify
10440 "make maintainer-distcheck".
10441 (bison_SOURCES): Add scan-skel.h.
10442 (sc_tight_scope): New rule, from coreutils.
10443
10444 * src/files.c (src_extension, header_extension):
10445 Now static, not extern.
10446 * src/getargs.c (short_options): Likewise.
10447 * src/muscle_tab.c (muscle_table): Likewise.
10448 * src/parse-gram.y (current_class, current_type, current_prec):
10449 Likewise.
10450 * src/reader.c (grammar_end, previous_rule_end): Likewise.
10451 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
10452 * src/main.c (main): Cast bindtextdomain and textdomain calls to
10453 void, to avoid warning when NLS is disabled.
10454 * src/output.c: Include scan-skel.h.
10455 (scan_skel): Remove decl, since scan-skel.h does this.
10456 (output_skeleton):
10457 Indent calls to "error" to pacify "make maintainer-distcheck".
10458 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
10459 * src/reader.h (gram_end, gram_lineno): New decls to pacify
10460 "make maintainer-distcheck".
10461 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
10462 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
10463 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
10464 (skel_lex_destroy, scan_skel): Move these decls to...
10465 * src/scan-skel.h: New file.
10466 * src/uniqstr.c (uniqstr_assert):
10467 Indent calls to "error" to pacify "make maintainer-distcheck".
10468
10469 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
10470 not @VAR@.
10471
10472 * tests/torture.at: Revamp to avoid misuse of atoi that
10473 "make maintainer-distcheck" complained about.
10474
10475 * examples/extexi (message): Don't print a message more than once,
10476 and omit line-number decoration that makes Emacs compile think
10477 that informative messages are worth worrying about.
10478
104792005-07-22 Paul Eggert <eggert@cs.ucla.edu>
10480
10481 * configure.ac: Update version number.
10482
10483 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
10484 accidentally.
10485 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
10486 autogenerated by the maintainer.
10487 * examples/calc++/.cvsignore: Add *.yy.
10488
10489 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
10490 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10491 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10492
10493 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
10494
10495 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
10496 from maintainer-distcheck about casting the argument of 'free'.
10497
10498 * NEWS: Mention recent yytname changes.
10499 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
10500
10501 * bootstrap: For translations that have not yet been upgraded to
10502 the new runtime-po domain, prime the pump by extracting the
10503 relevant strings from the obsolete translations. This code can be
10504 removed once the bison-runtime domain has been translated by each
10505 team.
10506
10507 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
10508 now that token names are already quoted.
10509
10510 Fix problem reported by Anthony Heading.
10511 * data/glr.c (YYTOKEN_TABLE): New macro.
10512 (yytname): Define if YYTOKEN_TABLE.
10513 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
10514 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
10515 (YYERROR_VERBOSE): Define the same way the other skeletons do.
10516 * src/output.c (prepare_symbols): Output token_table_flag.
10517
0ffda363
PE
105182005-07-21 Paul Eggert <eggert@cs.ucla.edu>
10519
10520 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
10521 again if the first call fails.
10522
10523 * data/glr.c (yytnamerr): New function.
10524 (yyreportSyntaxError): Use it to dequote most string literals.
10525 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
10526 with other skeletons. All uses changed.
10527 (yytnameerr_): New function.
10528 (yyreport_syntax_error): Use it to dequote most string literals.
10529 * data/yacc.c (yytnamerr): New function.
10530 (yyerrlab): Use it to decode most string literals.
10531 * doc/bison.texinfo (Decl Summary, Calling Convention):
10532 Clarify quoting convention of yytname.
10533 * src/output.c (prepare_symbols): Quote all names. This undoes
10534 the 2005-04-17 change, which is now accomplished (mostly) via
10535 changes in the parsers as described above.
10536 * tests/regression.at (Token definitions, Web2c Actions):
10537 Undo most 2005-04-17 change here, too.
10538
105392005-07-20 Paul Eggert <eggert@cs.ucla.edu>
10540
10541 Fix more problems reported by twlevo@xs4all.nl.
10542 * tests/cxx-type.at: Don't pipe output of ./types through sed to
10543 remove trailing spaces. This loses the exit status of ./types,
10544 and isn't needed since ./types shouldn't be emitting trailing
10545 spaces.
10546 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
10547 as the stack isn't valid in that case.
10548
10549 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10550 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10551 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10552 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10553 is used.
10554 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10555 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10556 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10557 Likewise.
10558
10559 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10560 overly-picky compilers that reject 'char *foo = "bar";'.
10561
10562 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10563 to FILE * parameter, not to stderr. This fixes a typo introduced
10564 in the 2005-07-12 change.
10565
10566 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10567 warnings from GCC 4.
10568
10569 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10570 (yyglrShiftDefer, yysplitStack):
10571 Remove unused parameters b4_pure_formals. All uses changed.
10572 (yyglrShift): Remove unused parameters b4_user_formals.
10573 All uses changed.
10574 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10575
6100a9aa
PE
105762005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10577
258b75ca
PE
10578 Destructor cleanups and regularization among the three skeletons.
10579 * NEWS: Document the behavior changes.
10580 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10581 stack before failing, as the cleanup code will do it for us now.
10582 * data/lalr1.cc (yyerrlab): Likewise.
10583 * data/glr.c (yyparse): Pop everything off the stack before
10584 freeing it, so that destructors get called properly.
10585 * data/lalr1.cc (yyreturn): Likewise.
10586 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10587 This is more consistent.
10588 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10589 why destructors might be called. 1.875 -> 2.1.
10590 (Destructor Decl, Decl Summary, Table of Symbols):
10591 Some English-language cleanups for %destructor.
10592 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10593 Add output line for destructor of start symbol.
10594 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10595 because of that same extra output line.
10596
1a059451
PE
10597 * NEWS: Document minor wording changes in diagnostics of
10598 Bison-generated parsers.
10599 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10600 Remove unused formals. All uses changed.
10601 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10602 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10603 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10604 Rename yyoverflowab to yyexhaustedlab.
10605 When memory exhaustion occurs during syntax-error reporting,
10606 report it separately rather than in a single diagnostic; this
10607 eases translation.
10608 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10609 (Memory Exhausted): Renamed from Parser Stack Overflow.
10610 Revamp wording slightly to prefer "memory exhaustion".
10611 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10612
97460c78
PE
10613 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10614
30757c8c
PE
10615 Add i18n support to the GLR skeleton. Partially fix the C++
10616 skeleton; a C++ expert needs to finish this. Remove debugging
10617 msgids; there's little point to having them translated, since they
10618 can be understood only by someone who can read the
10619 (English-language) source code.
10620
10621 Generate runtime-po/bison-runtime.pot automatically, so that we
10622 don't have to worry about garbage getting in that file. We'll
10623 make sure after the next official release that old msgids don't
10624 get lost. See
10625 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10626
10627 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10628 Now auto-generated.
10629 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10630 Fix typos in explanations of the runtime file.
10631 * bootstrap: Change gettext keyword from YYI18N to YY_.
10632 Use standard Makefile.in.in in runtime-po, since we'll arrange
10633 for backward-compatible bison-runtime.po files in a different way.
10634 * data/glr.c (YY_): New macro, from yacc.c.
10635 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10636 Translate messages intended for users.
10637 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10638 the wording in the other skeletons. We don't know that the memory
10639 is virtual.
10640 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10641 Use same method that yacc.c uses.
10642 Don't translate debugging messages.
10643 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10644 it doesn't work (yet), and requires C++ expertise to fix.
10645 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10646 Move defn to a more logical place, to be consistent with other
10647 skeletons.
10648 Don't translate debugging messages.
10649 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10650 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10651 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10652 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10653
ac8c5689
PE
10654 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10655 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10656 void, not int.
10657 * tests/glr-regression.at (Badly Collapsed GLR States):
10658 Likewise.
10659 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10660 yylex should return 0 at EOF rather than aborting.
10661
6100a9aa
PE
10662 Improve tests for stack overflow in GLR parser.
10663 Problem reported by twlevo@xs4all.nl.
10664 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10665 All uses removed.
10666 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10667 can handle the problem.
10668 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10669 (yyparse): New local variable yyresult to record the result.
10670 Use result of setjmp to set it, rather than storing itinto
10671 struct.
10672 (yyDone): Remove label.
10673 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10674 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10675 if YYABORT is used).
10676 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10677 yyparse status; put status > 1 into diagnostic.
10678 Check that status==2 works.
10679 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10680 Use exit status 3 for failure to open (which shouldn't happen).
10681
15f40952
PE
106822005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10683
67fd79c4
PE
10684 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10685 1 on syntax error; just let yyparse do its thing.
10686 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10687 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10688 (Exploding the Stack Size with Alloca):
10689 (Exploding the Stack Size with Malloc):
10690 Expect exit status 2, not 1, since the parser is supposed to blow
10691 its stack. Problem reported by twlevo@xs4all.nl.
10692
15f40952
PE
10693 * data/glr.c (yyparse): Don't assume that the initial calls
10694 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10695 Print a stack-overflow message and fail instead.
10696 Initialize the line-number information before creating the stack,
10697 so that the stack-overflow message can report line zero safely.
10698
f32c66b5
PE
106992005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10700
a22ff96f 10701 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
10702 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10703 (yyuserMerge): Provide a default case if b4_mergers is empty.
10704 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10705 * tests/glr-regression.at
10706 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 10707 Add casts to pacify C++ compilers.
1beb0b24
PE
10708 * tests/glr-regression.at (Improper merging of GLR delayed action
10709 sets): Declare yylex before using it.
f32c66b5 10710 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
10711 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10712 test for valgrind; valgrind is independent of g++.
10713 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10714 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10715 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10716 Use a destructor, so that we can expand the stack. Change
10717 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 10718
d741bd1b
PE
107192005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10720
10721 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10722 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10723
0410a6e0
PE
107242005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10725
10726 * PACKAGING: New file, suggested by Bruno Haible and taken from
10727 similar wording in gettext's PACKAGING file.
10728 * NEWS: Mention PACKAGING.
10729 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10730
f7ab6a50
PE
107312005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10732
baf785db 10733 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
10734 * bootstrap: Get runtime translations into runtime-po.
10735 Create runtime-po files automatically, if possible.
10736 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10737 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10738 does not infringe on the user's name space.
10739 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10740 * doc/bison.texinfo (Internationalization): Revamp the English
10741 and Texinfo syntax a bit, to try to make it clearer.
10742 (Bison Options, Option Cross Key): Mention --print-localedir.
10743 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10744 YYENABLE_NLS. Quote a bit more.
10745 * runtime-po/.cvsignore: New file.
10746 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10747 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10748 * runtime-po/quot.sed: Likewise.
10749 * runtime-po/boldquot.sed: Likewise.
10750 * runtime-po/en@quot.header: Likewise.
10751 * runtime-po/en@boldquot.header: Likewise.
10752 * runtime-po/insert-header.sin: Likewise.
10753 * runtime-po/remove-potcdate.sin: Likewise.
10754 * runtime-po/Makevars: Likewise.
10755 * runtime-po/LINGUAS: Likewise.
10756 * runtime-po/de.po: Likewise; we will rely on the translation project
10757 to maintain this, so "bootstrap" should get it.
0410a6e0 10758 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
10759 its value.
10760 * src/main.c (main): Bind the bison-runtime domain, too.
10761
107622005-07-12 Bruno Haible <bruno@clisp.org>
10763
10764 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10765 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10766 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10767 * runtime-po: New directory.
10768 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10769 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10770 * runtime-po/Rules-quot: New file, copied from po/.
10771 * runtime-po/quot.sed: Likewise.
10772 * runtime-po/boldquot.sed: Likewise.
10773 * runtime-po/en@quot.header: Likewise.
10774 * runtime-po/en@boldquot.header: Likewise.
10775 * runtime-po/insert-header.sin: Likewise.
10776 * runtime-po/remove-potcdate.sin: Likewise.
10777 * runtime-po/Makevars: New file.
10778 * runtime-po/POTFILES.in: New file.
10779 * runtime-po/LINGUAS: New file.
10780 * runtime-po/bison-runtime.pot: New file.
10781 * runtime-po/de.po: New file.
10782 * m4/bison.m4: New file.
10783 * Makefile.am (SUBDIRS): Add runtime-po.
10784 (aclocaldir, aclocal_DATA): New variables.
10785 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10786 Define aclocaldir.
10787 * src/getargs.c (usage): Document --print-localedir option.
10788 (PRINT_LOCALEDIR_OPTION): New enum item.
10789 (long_options): Add --print-localedir option.
10790 (getargs): Handle --print-localedir option.
10791 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10792 (Internationalization): New section.
10793
22dda0f0
AD
107942005-07-12 Akim Demaille <akim@epita.fr>
10795
10796 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10797 for consistency with the rest of the code.
10798 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10799 Add separators.
10800
82b248ad
AD
108012005-07-12 Akim Demaille <akim@epita.fr>
10802
10803 * src/parse-gram.y: Use %printer instead of YYPRINT.
10804
fa0e9314
AD
108052005-07-12 Akim Demaille <akim@epita.fr>
10806
867a3e00
AD
10807 * src/symtab.h, src/symtab.c (symbol_print): New.
10808 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10809 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10810
108112005-07-12 Akim Demaille <akim@epita.fr>
10812
10813 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
10814 b4_at_dollar and b4_dollar_dollar.
10815
e054b190
PE
108162005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10817
10818 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10819 and Pennello's paper.
10820
34160ec4
PE
108212005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10822
407d4a75
PE
10823 * data/yacc.c (yyparse): Undo previous patch. Instead,
10824 set yylsp[0] and yyvsp[0] only if the initial action
10825 sets yylloc and yylval, respectively.
10826
34160ec4
PE
10827 * data/yacc.c (yyparse): In the initial action, set
10828 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10829 This avoids the use of undefined variables if the initial
10830 action does not set yylloc and/or yylval.
10831
c3d5a4a7
PE
108322005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10833
b34d96c1
PE
10834 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10835 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10836 Remove from CVS. These files are automatically generated.
10837 * examples/extexi: Clarify that this file is now part of Bison,
10838 not GNU M4, and that it works with any POSIX-compatible Awk.
10839 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10840 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10841 so that we also get calc++-parser.yy. Geneate it.
10842 Use $(AWK), not gawk, since any conforming Awk will do.
10843 Put comment before action, since older 'make' can't handle comment
10844 in action.
10845 $(BUILT_SOURCES): List all built sources, not just some of them.
10846 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10847 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10848 $($(calc_sources_generated)): Remove unnecessary test for existence
10849 of target. (This had a shell syntax error anyway; a stray "x".)
10850 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10851 calc++-parser.yy.
10852 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10853
c3d5a4a7
PE
10854 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10855 implied by the other modules.
10856
828c373b
AD
108572005-07-06 Akim Demaille <akim@epita.fr>
10858
10859 Bind examples/calc++ to the package.
10860 * examples/calc++/Makefile: Remove, replaced by...
10861 * examples/calc++/Makefile.am: ... this new file.
10862 * examples/calc++/test: Remove input.
10863 * examples/calc++/compile: Remove.
10864 * examples/Makefile.am: New.
10865 * configure.ac, Makefile.am: Adjust.
10866 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10867
63cb01d6
PE
108682005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10869
fd2df2ed
PE
10870 * data/glr.c (yyFail): Drastically simplify; since the format argument
10871 never had any % directives, we can simply pass it to yyerror.
10872 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10873 be modified later, as that is the usual style in glr.c.
10874 Problems reported by Paul Hilfinger.
10875
63cb01d6
PE
10876 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10877 and size overflow errors.
10878 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10879 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10880 (YYSIZEMAX): New macro.
10881 (yystpcpy): New function, taken from yacc.c.
10882 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10883 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10884 so that we don't have to maintain their signatures.
10885 (yyFail): Check for buffer overflow, by using vsnprintf rather
10886 than vsprintf. Allocate a bigger buffer if possible.
10887 Report an error if buffer allocation fails.
10888 (yyStackOverflow): New function.
10889 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10890 the initialization was successful. It might fail if storage was
10891 exhausted.
10892 (yyexpandGLRStack): Add more checks for storage allocation failure.
10893 Use yyStackOverflow to report failures.
10894 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
10895 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
10896 Don't assume stack number fits in int.
10897 (yysplitStack): Check for storage allocation failure.
10898 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
10899 can print diagnostics on storage allocation failure. All callers
10900 changed.
10901 (yyresolveValue): Use yybool for boolean.
10902 (yyreportSyntaxError): Check for size-calculation overflow.
10903 This code is taken from yacc.c.
10904 (yyparse): Check for storage allocation errors when allocating
10905 the initial stack.
10906
1c59e0a1
AD
109072005-07-05 Akim Demaille <akim@epita.fr>
10908
10909 Extract calc++ from the documentation.
10910 * doc/bison.texinfo (Calc++): Add the extraction marks.
10911 * examples/extexi: New, from the aborted GNU Programming 2E.
10912 Separate the different paragraph of a file with empty lines.
10913 * examples/Makefile: Use it to extract the whole calc++ example.
10914
8a0adb01
AD
109152005-06-24 Akim Demaille <akim@epita.fr>
10916
10917 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
10918 class typedefs.
10919
12545799
AD
109202005-06-22 Akim Demaille <akim@epita.fr>
10921
10922 * doc/bison.texinfo (C++ Language Interface): First stab.
10923 (C++ Parsers): Remove.
10924
99be0235
AD
109252005-06-22 Akim Demaille <akim@epita.fr>
10926
10927 * data/lalr1.cc (yylex_): Honor %lex-param.
10928
0ffd4fd1
AD
109292005-06-22 Akim Demaille <akim@epita.fr>
10930
10931 Start a set of simple examples.
10932 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
10933 * examples/calc++/calc++-driver.hh,
10934 * examples/calc++/calc++-parser.yy,
10935 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
10936 * examples/calc++/compile, examples/calc++/test: New.
10937
0925ebb4
PE
109382005-06-09 Paul Eggert <eggert@cs.ucla.edu>
10939
10940 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
10941 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
10942 which stems from the 2005-05-27 patch.
10943
43d3b664
PH
109442005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10945
10946 * data/glr.c: Modify treatment of unused parameters to permit use
10947 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
10948
3062864d
PE
109492005-05-30 Paul Eggert <eggert@cs.ucla.edu>
10950
10951 Fix infringement on user name space reported by Janos Zoltan Szabo.
10952 * data/yacc.c (yyparse): strlen -> yystrlen.
10953
989b5b8e
AD
109542005-05-30 Akim Demaille <akim@epita.fr>
10955
10956 * data/lalr1.cc (_): New.
10957 Translate the various messages.
10958
bedf57f5
PE
109592005-05-27 Paul Eggert <eggert@cs.ucla.edu>
10960
10961 Fix infringement on user name space reported by Bruno Haible.
10962 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
10963 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
10964 the user's name space.
10965 (alloca): Include <stdlib.h> to get it, if it's not built in.
10966 (YYMALLOC, YYFREE): Define only if needed.
10967 (malloc, free): Declare, but only if needed, as this infringes on
10968 the user name space.
10969
4d1801f1
PE
109702005-05-25 Paul Eggert <eggert@cs.ucla.edu>
10971
10972 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
10973 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
10974 with %d format.
10975 * lib/ebitset.c (min, max): Undef before defining.
10976 * lib/vbitset.c (min, max): Likewise.
10977 * lib/subpipe.c (create_subpipe): Save local variables in case
10978 vfork clobbers them.
10979
109802005-05-24 Bruno Haible <bruno@clisp.org>
10981
10982 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
10983 error message syntax used by gcc-4.0.
10984
b94a9e1e
PE
109852005-05-23 Paul Eggert <eggert@cs.ucla.edu>
10986
85ac3861
PE
10987 * README: Mention m4 1.4.3. Remove obsolete advice about
10988 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
10989
b94a9e1e
PE
10990 * bootstrap: Remove workaround for problem I encountered with
10991 gettext 0.14.1; it seems to be fixed now.
10992
51c30d21
PE
109932005-05-22 Paul Eggert <eggert@cs.ucla.edu>
10994
009ce67d
PE
10995 * NEWS: Version 2.0a.
10996
f2a97c62
PE
10997 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
10998 the previous change.
10999
c8775f93
PE
11000 Various maintainer cleanups.
11001 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11002 conftest*, for benefit of CVS commands run at the same time as
11003 "configure". Add build-aux, since "bootstrap" now creates it and
11004 its subfiles.
11005 * Makefile.cfg (move_if_change): Remove.
11006 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11007 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11008 (po_repo, do-po-update, po-update, wget_files, get-targets):
11009 (config.guess-url_prefix, config.sub-url_prefix):
11010 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11011 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11012 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
11013 Remove.
11014 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
11015 this is now the recommended name.
11016 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
11017 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
11018 ylwrap. These files now go into build-aux.
11019 * config/move-if-change: Remove.
11020 * config/prev-version.txt: Bump from 1.75 to 2.0.
11021
3ea5f0ec
PE
11022 * bootstrap: Add stdio-safer, unistd-safer modules.
11023 Remove m4/glibc2.m4 (introduced by latest gnulib, but
11024 we don't need it).
11025 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
11026 fopen-safer.c, stdio-safer.h, unistd-safer.h.
11027 * lib/subpipe.c: Include "unistd-safer.h".
11028 (create_subpipe): Make sure all the newly-created
11029 file descriptors are > 2, so that diagnostics don't
11030 get sent down them (which might cause Bison to hang, in theory).
11031 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
11032 * src/files.c (xfopen): Use fopen_safer, not fopen.
11033
51c30d21
PE
11034 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
11035 yesterday's yacc.c fix.
11036
cea1469d
PE
110372005-05-21 Paul Eggert <eggert@cs.ucla.edu>
11038
3ea5f0ec
PE
11039 * data/glr.c, data/lalr1.cc: Update copyright date.
11040
cea1469d
PE
11041 Fix a destructor bug reported by Wolfgang Spraul in
11042 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
11043 * data/yacc.c (yyabortlab): Don't call destructor, and
11044 don't set yychar to EMPTY.
11045 (yyoverflowlab): Don't call destructor.
11046 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
11047 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
11048 since we no longer output the message "discarding lookahead token
11049 end of input ()".
11050
5e6f62f2
PH
110512005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11052
11053 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
11054 fix a small glitch in debugging output.
11055 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
11056 after YY_SYMBOL_PRINT where needed.
11057
11058 (struct yyGLRState): Add some comments.
11059 (struct yySemanticOption): Add some comments.
11060 (union yyGLRStackItem): Add comment.
11061
11062 (yymergeOptionSets): Correct this to properly perform the union,
11063 avoiding infinite reported by Michael Rosien.
11064 Update comment.
11065
11066 * tests/glr-regression.at: Add test for GLR merging error reported
11067 by M. Rosien.
cea1469d 11068
0fb669f9
PE
110692005-05-13 Paul Eggert <eggert@cs.ucla.edu>
11070
11071 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
11072 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
11073 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
11074 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
11075 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
11076 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
11077 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
11078 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
11079 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
11080 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
11081 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
11082 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
11083 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
11084 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
11085 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
11086 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
11087 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
11088 src/derives.h, src/files.c, src/files.h, src/getargs.c,
11089 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
11090 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
11091 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
11092 src/output.h, src/parse-gram.c, src/parse-gram.h,
11093 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
11094 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
11095 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
11096 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
11097 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
11098 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
11099 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
11100 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
11101 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
11102 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
11103 tests/reduce.at, tests/regression.at, tests/sets.at,
11104 tests/synclines.at, tests/testsuite.at, tests/torture.at:
11105 Update FSF postal mail address.
11106
51f4735e
PE
111072005-05-11 Paul Eggert <eggert@cs.ucla.edu>
11108
11109 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
11110 Problem reported by Ralf Menzel.
11111
80ce3401
PE
111122005-05-01 Paul Eggert <eggert@cs.ucla.edu>
11113
11114 * tests/actions.at: Test that stack overflow invokes destructors.
11115 From Marcus Holland-Moritz.
11116 * data/yacc.c (yyerrlab): Move the code that destroys the stack
11117 from here....
11118 (yyreturn): to here. That way, destructors are called properly
11119 even if the stack overflows, or the user calls YYACCEPT or
11120 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
11121 (yyoverflowlab): Destroy the lookahead.
11122
111232005-04-24 Paul Eggert <eggert@cs.ucla.edu>
11124
11125 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
11126
72f000b0
PE
111272005-04-17 Paul Eggert <eggert@cs.ucla.edu>
11128
11129 * NEWS: Bison-generated C parsers no longer quote literal strings
11130 associated with tokens.
11131 * src/output.c (prepare_symbols): Don't escape strings,
11132 since users don't want to see C escapes.
11133 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
11134 in diagnostics.
c19683bb 11135 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
11136 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
11137
1094323f
PE
111382005-04-16 Paul Eggert <eggert@cs.ucla.edu>
11139
11140 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
11141 the data size is known to be too small and we can't increase it.
11142 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
11143
ca407bdf
PE
111442005-04-15 Paul Eggert <eggert@cs.ucla.edu>
11145
11146 * src/parse-gram.y: Include quotearg.h.
11147 (string_as_id): Quote $1 before using it as a key, since the
11148 lexer no longer quotes it for us.
11149 (string_content): Don't strip quotes, since lexer no longer
11150 quotes it for us.
11151 * src/scan-gram.l: Include quotearg.h.
11152 ("\""): Omit quote.
11153 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
11154 a key, since the rest of the lexer doesn't quote it.
11155 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
11156 * tests/regression.at (Token definitions): Check for backslashes
11157 in token strings.
11158
11159 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
11160 (YYSIZE_T): Define to unsigned long int when using an older compiler.
11161 (yyparse): Revamp code to generate long syntax error message, to
11162 make it easier to translate, and to avoid problems with arithmetic
11163 overflow. Change "virtual memory" to "memory" in diagnostic, since
11164 we don't know whether the memory is virtual.
11165
1ce59070
PE
111662005-04-13 Paul Eggert <eggert@cs.ucla.edu>
11167
11168 * NEWS: Bison-generated C parsers now use the _ macro to
11169 translate strings.
11170 * data/yacc.c (_) [!defined _]: New macro.
11171 All English strings wrapped inside this macro.
11172 * doc/bison.texinfo (Bison Parser): Document _.
11173 * po/POTFILES.in: Include src/parse-gram.c, since it now
11174 includes translateable strings that parse-gram.y doesn't.
11175
a749a695
PE
111762005-04-12 Paul Eggert <eggert@cs.ucla.edu>
11177
11178 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
11179 reverting the 2004-10-11 change to this function.
11180 (symbol_check_alias_consistency): Don't call symbol_type_set
11181 if the type name is already correct.
11182 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
11183
8fb1053b
PE
111842005-03-25 Paul Eggert <eggert@cs.ucla.edu>
11185
11186 * tests/regression.at (Token definitions): Don't use a token named
11187 c, as that generates a "#define c ..." that runs afoul of buggy
11188 stdlib.h that uses the identifier c as a member of struct
11189 drand48_data. Problem reported by Horst Wente.
11190
ff498c4a
PE
111912005-03-21 Paul Eggert <eggert@cs.ucla.edu>
11192
11193 * bootstrap: Change translation URL from
11194 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
11195 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
11196 redirection glitches. Problem reported by twlevo@xs4all.nl.
11197
65211d70
PE
111982005-03-20 Paul Eggert <eggert@cs.ucla.edu>
11199
11200 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
11201 after operands; POSIX says this isn't portable for the c99 command.
11202
9577fb1f
PE
112032005-03-18 Paul Eggert <eggert@cs.ucla.edu>
11204
11205 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
11206 immediately if a data overrun has occurred; this may help us track
11207 down what may be a spurious failure on MacOS.
11208
78b178f7
PE
112092005-03-17 Paul Eggert <eggert@cs.ucla.edu>
11210
a2599d0f
PE
11211 Respond to problems reported by twlevo@xs4all.nl.
11212
11213 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
11214
78b178f7
PE
11215 * src/vcg.h: Comment fix.
11216 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
11217 (G_CMAX): Change to -1 instead of INT_MAX.
11218
11219 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 11220
7296e729
PE
112212005-03-15 Paul Eggert <eggert@cs.ucla.edu>
11222
11223 * src/tables.c (state_number_to_vector_number): Put it inside an
11224 "#if 0", since it's not currently used. Problem reported by
11225 Roland McGrath.
11226
05ac60f3
PE
112272005-03-06 Paul Eggert <eggert@cs.ucla.edu>
11228
11229 * src/output.c (escaped_output): Renamed from
11230 escaped_file_name_output, since we now use it for symbol tags as
11231 well. All uses changed.
11232 (symbol_destructors_output, symbol_printers_output):
11233 Escape symbol tags too.
11234 Problem reported by Matyas Forstner in
11235 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
11236
11237 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
11238 not needed.
11239 * src/output.c (user_actions_output, token_definitions_output,
11240 symbol_destructors_output, symbol_printers_output): Likewise.
11241 * src/reader.c (prologue_augment): Likewise.
11242 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
11243
11244 * src/vcg.c (output_edge): Don't quote linestyle arg.
11245 Problem reported by twlevo@xs4all.nl.
11246
7eb453ac
PE
112472005-02-28 Paul Eggert <eggert@cs.ucla.edu>
11248
11249 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
11250 example, reported by Derek M Jones. Also, make the example even
11251 more outrageous, to better illustrate how bad the problem is.
11252
4c04c52a
PE
112532005-02-24 Paul Eggert <eggert@cs.ucla.edu>
11254
11255 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
11256 putsym. Typo reported by Sebastian Piping.
11257
a61e1620
PE
112582005-02-23 Paul Eggert <eggert@cs.ucla.edu>
11259
11260 * doc/bison.texinfo (Language and Grammar): some -> same
11261 (Epilogue): int he -> in the
11262 Typos reported by Sebastian Piping via Justin Pence.
11263
9ec93868
PE
112642005-02-07 Paul Eggert <eggert@cs.ucla.edu>
11265
11266 * tests/glr-regression.at (Improper handling of embedded actions
11267 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
11268 embedded actions and $-N in GLR parsers", work around an Autoconf bug
11269 with dollar signs in test names.
11270 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
11271 for a similar reason.
11272
73ce7e7e
PE
112732005-01-28 Paul Eggert <eggert@cs.ucla.edu>
11274
11275 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
11276 wants to redefine G_VIEW.
11277
2e72b98e
PE
112782005-01-27 Paul Eggert <eggert@cs.ucla.edu>
11279
11280 * src/vcg.c (get_view_str): Remove case for normal_view.
11281 Problem reported by twlevo@xs4all.nl.
11282
e0d634e5
PE
112832005-01-24 Paul Eggert <eggert@cs.ucla.edu>
11284
ccf830a4
PE
11285 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
11286 Problem reported by twlevo@xs4all.nl.
11287
e0d634e5
PE
11288 * doc/bison.texinfo: Change @dircategory from "GNU programming
11289 tools" to "Software development". Requested by Richard Stallman
11290 via Karl Berry.
11291
7bbc8cb0
PE
112922005-01-23 Paul Eggert <eggert@cs.ucla.edu>
11293
11294 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
11295 Problem reported by twlevo@xs4all.nl.
11296
08b770bc
PE
112972005-01-21 Paul Eggert <eggert@cs.ucla.edu>
11298
11299 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
11300 keyword; it's not needed with modern compilers, and it doesn't
11301 affect correctness with older compilers. Suggested by
11302 twlevo@xs4all.nl.
11303
95f22ad2
PE
113042005-01-17 Paul Eggert <eggert@cs.ucla.edu>
11305
11306 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
11307 gcc -Wswitch-default.
11308 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11309 * data/yacc.c (yyparse): Likewise.
11310
d229d15c
PE
113112005-01-12 Paul Eggert <eggert@cs.ucla.edu>
11312
11313 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
11314 already. Let config.h define any nonstandard values.
11315
ecadd90f
PE
113162005-01-10 Paul Eggert <eggert@cs.ucla.edu>
11317
11318 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11319 for the benefit of slower hosts. Problem reported by
11320 Nelson H. F. Beebe.
11321
213744b5
PE
113222005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11323
11324 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11325 being defined and not used.
11326 * data/lalr1.cc (yyparse): Likewise.
11327 Use "if (false)" rather than "if (0)".
11328
249d3236
PE
113292005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11330
11331 * TODO: Mention that we should allow NUL bytes in tokens.
11332
987cc1fb
PE
113332005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11334
11335 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11336 Problem reported by Hans Aberg.
11337
08fe02d9
PE
113382005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11339
11340 * src/getargs.c (version): Happy new year; update overall
11341 program copyright date from 2004 to 2005.
11342
11343 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11344 Problem reported by Hans Aberg.
11345 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11346 (Output file names.): Add a test for the case when standard output
11347 is closed.
11348
010c0266
PE
113492004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11350
11351 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11352 to fix an oversight in the Bison 2.0 manual.
11353
da12206a
PE
113542004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11355
11356 * NEWS: Version 2.0. Reformat the existing news items since
11357 1.875, so that related items are grouped together.
3a4734aa 11358 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
11359 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11360
c935d934
PE
11361 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11362 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11363 otherwise, we're not testing alloca. Unfortunately there's no
11364 simple way to consult HAVE_ALLOCA here.
11365
da12206a
PE
11366 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11367 for yymsg, too.
11368
11369 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11370 hand. This avoids a warning about comparing int to size_t when
11371 GCC warnings are enabled.
11372
0a2c5137
PE
113732004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11374
d7e14fc0
PE
11375 * NEWS: Bison-generated parsers no longer default to using the
11376 alloca function (when available) to extend the parser stack, due
11377 to widespread problems in unchecked stack-overflow detection.
11378 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11379 responsibility to set it to a positive value. This lets the user
11380 specify a value that is not a preprocessor constant.
11381 * data/yacc.c (YYMAXDEPTH): Likewise.
11382 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11383 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11384 to be a compile-time constant. However, explain the constraints on it.
11385 Also, explain the constraints on YYINITDEPTH.
11386 (Table of Symbols): Explain that alloca is no longer the default.
11387 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11388 to 1.
11389
0a2c5137
PE
11390 * doc/bison.texinfo (Location Default Action): Mention that n must
11391 be zero when k is zero. Suggested by Frank Heckenbach.
11392
e019c247
AD
113932004-12-22 Akim Demaille <akim@epita.fr>
11394
11395 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11396 (parser::state_type, parser::semantic_type, parser::location_type):
11397 Private, not public.
11398 (parser::parse): Return ints, not bool.
11399 Returning a bool introduces a problem: 0 corresponds to false, and
11400 it seems weird to return false on success. Returning true changes
11401 the conventions for yyparse.
11402 Alternatively we could return void and send an exception.
11403 There is no clear consensus (yet?).
11404 (state_stack, semantic_stack, location_stack): Rename as...
11405 (state_stack_type, semantic_stack_type, location_stack_type): these.
11406 Private, not public.
11407 * tests/c++.at: New.
11408 * tests/testsuite.at, tests/Makefile.am: Adjust.
11409
72731bb7
AD
114102004-12-21 Akim Demaille <akim@epita.fr>
11411
11412 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
11413
9a0d8bec
AD
114142004-12-21 Akim Demaille <akim@epita.fr>
11415
11416 Don't impose std::string for filenames.
11417
11418 * data/lalr1.cc (b4_filename_type): New.
11419 (position::filename): Use it.
11420 (parser.hh): Move the inclusion of stack.hh and location.hh below
11421 the user code, so that needed headers for the filename type can be
11422 included first.
72731bb7
AD
11423 Forward declare them before the user code.
11424 * tests/Makefile.am (check-local, installcheck-local): Pass
11425 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 11426
99880de5
AD
114272004-12-20 Akim Demaille <akim@epita.fr>
11428
11429 Use more STL like names: my_class instead of MyClass.
11430
11431 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
11432 (SemanticStack, SemanticType, StateStack, StateType)
11433 (TokenNumberType, Stack, Slice, Traits, Parser::location)
11434 (Parser::value): Rename as...
11435 (location_stack, location_type, rhs_number_type, semantic_stack)
11436 (semantic_type, state_stack, state_type, token_number_type, stack)
11437 (slice, traits, parser::yylloc, parser::yylval): these.
11438
11439 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
11440
9bec482e
PE
114412004-12-19 Paul Eggert <eggert@cs.ucla.edu>
11442
11443 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
11444 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11445
f6fbd3da
PE
114462004-12-17 Paul Eggert <eggert@cs.ucla.edu>
11447
11448 Remove uses of 'short int' and 'unsigned short int'. This raises
11449 some arbitrary limits. It uses more memory but nowadays that's
11450 not much of an issue.
11451
11452 This change does not affect the generated parsers; that's a different
11453 task, as some users will want to conserve memory there.
11454
11455 Ideally we should use size_t to represent all object counts, and
11456 something like ptrdiff_t to represent signed differences of object
11457 counts; but that will require more code-cleanup than I have the
11458 time to do right now.
11459
11460 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
11461 Use size_t, not int or short int, to count objects.
11462 * src/closure.c (nritemset, closure): Likewise.
11463 * src/closure.h (nritemset, closure): Likewise.
11464 * src/nullable.c (nullable_compute): Likewise.
11465 * src/print.c (print_core): Likewise.
11466 * src/print_graph.c (print_core): Likewise.
11467 * src/state.c (state_compare, state_hash): Likewise.
11468 * src/state.h (struct state): Likewise.
11469 * src/tables.c (default_goto, goto_actions): Likewise.
11470
11471 * src/gram.h (rule_number, rule): Use int, not short int.
11472 * src/output.c (prepare_rules): Likewise.
11473 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
11474 errs, reductions): Likewise.
11475 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
11476 Likewise.
11477 * src/tables.c (vector_number, tally, action_number,
11478 ACTION_NUMBER_MINIMUM): Likewise.
11479 * src/output.c (muscle_insert_short_int_table): Remove.
11480
efeed023
AD
114812004-12-17 Akim Demaille <akim@epita.fr>
11482
11483 * data/lalr1.cc: Extensive Doxygenation.
11484 (error_): Rename as...
11485 (error): this, since it is visible to the user.
11486 Adjust callers.
11487 (Parser::message): Now an automatic variable from...
11488 (Parser::yyreport_syntax_error_): here.
11489 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
11490 Parser::error.
11491 * tests/input.at: Escape $.
11492
bc82c5a5
PE
114932004-12-16 Paul Eggert <eggert@cs.ucla.edu>
11494
11495 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
11496 Parenthesize rhs to avoid obscure problems with mistakes like
11497 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
11498 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11499 b4_rhs_location): Likewise.
11500 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11501 b4_rhs_location): Likewise.
11502
fd19f271
AD
115032004-12-16 Akim Demaille <akim@epita.fr>
11504
11505 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
11506 yacc.c: be sure to stay within yycheck_.
11507 * tests/actions.at: Re-enable C++ tests.
11508
10454ea4
AD
115092004-12-16 Akim Demaille <akim@epita.fr>
11510
11511 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
11512 real.
11513
c5b95ccf
AD
115142004-12-16 Akim Demaille <akim@epita.fr>
11515
11516 Use #define to handle the %name-prefix.
11517
11518 * data/glr.c, data/yacc.c: Comment changes.
11519 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
11520 so that one can refer to yylex in the parser file, and have it
11521 renamed, as is the case with other skeletons.
11522
617a8f12
AD
115232004-12-16 Akim Demaille <akim@epita.fr>
11524
11525 Move lalr1.cc internals into yy*.
11526
11527 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
11528 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
11529 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
11530 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
11531 (empty_, final_, terror_, errcode_, ntokens_)
11532 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
11533 (looka_, ilooka_, error_range_, nerrs_):
11534 Rename as...
11535 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
11536 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
11537 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
11538 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
11539 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
11540 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
11541 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
11542 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
11543 these.
11544
1e547e6e
PE
115452004-12-15 Paul Eggert <eggert@cs.ucla.edu>
11546
11547 Fix some problems reported by twlevo at xs4all.
11548 * src/symtab.c (symbol_new): Report an error if the input grammar
11549 contains too many symbols. This is better than calling abort() later.
11550 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
11551 (struct node, struct graph):
11552 Rename member expand to stretch. All uses changed.
11553 (struct graph): Remove member layoutalgorithm. All uses removed.
11554 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11555 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11556 All uses changed.
11557 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11558
735d6bd4
AD
115592004-12-15 Akim Demaille <akim@epita.fr>
11560
11561 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11562 Add more Doxygen comments.
11563 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11564 (report_syntax_error_, translate_): Rename as...
11565 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11566 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11567
2e1f5829
AD
115682004-12-15 Akim Demaille <akim@epita.fr>
11569
11570 * data/lalr1.cc (lex_): Rename as...
11571 (yylex_): this.
11572 Move the trace here.
11573 Take the %name-prefix into account.
11574 Reported by Alexandre Duret-Lutz.
11575
a3cb6248
AD
115762004-12-15 Akim Demaille <akim@epita.fr>
11577
11578 Simplify the C++ parser constructor.
11579
11580 * data/lalr1.cc (debug_): Rename as...
11581 (yydebug_): so that the parser's internals are always in the yy*
11582 pseudo namespace.
11583 Adjust uses.
11584 (b4_parse_param_decl): Remove the leading comma as it is now only
11585 called as unique argument list.
11586 (Parser::Parser): Remove the constructor accepting a location and
11587 an initial debugging level.
11588 Remove from the other ctor the argument for the debugging level.
11589 (debug_level_type, debug_level, set_debug_level): New.
11590
11591 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11592 constructor calls.
11593
07fed891
AD
115942004-12-15 Akim Demaille <akim@epita.fr>
11595
11596 Remove b4_root related material: failure experiment
a3cb6248 11597 (which goal was to allow to derive from a class).
07fed891
AD
11598
11599 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11600 definitions and uses.
11601
e603eaa5
PE
116022004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11603
11604 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11605 not 2, since it's not portable to subtract 1 from the start of an
11606 array. The new item 0 is never set or used. All uses changed.
11607
11608 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11609 the default definition of YYLLOC_DEFAULT. Problem reported
11610 by Frank Heckenbach.
11611
fafb007d
PE
116122004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11613
11614 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11615 the normal case and one for the error case. Just use the
11616 first one uniformly. Problem reported by Frank Heckenbach.
11617 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11618 use exactly the same macro in both places.
11619 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11620 so that the normal-case YYRHSLOC works for the error case too.
11621 All uses changed.
11622 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11623 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11624 * doc/bison.texinfo (Location Default Action): Don't claim that
11625 we have an array of locations. Use the same macro for both glr
11626 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11627 the index is 0.
11628
48814dcd
PE
116292004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11630
a4e1a53b
PE
11631 * HACKING: Update email addresses to send announcements to.
11632
48814dcd
PE
11633 * configure.ac (AC_INIT): Bump version to 1.875f.
11634
337116ba
PE
116352004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11636
11637 * NEWS: Version 1.875e.
11638 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11639
11640 * src/scan-skel.l: Include "complain.h", for "fatal".
11641
11642 * src/relation.h (relation_print, relation_digraph):
11643 Relation sizes are of type relation_node, not size_t (this is
11644 merely a doc fix, since the two types are equivalent).
11645 (relation_transpose): Relation sizes are of type relation_node,
11646 not int.
11647 * src/relation.c: Likewise.
11648 (top, infinity): Now of type relation_node, not int.
11649 (traverse, relation_transpose): Use relation_node, not int.
11650
11651 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11652 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11653 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11654
11655 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 11656 specifying whether the test should be skipped. Use it tp
337116ba 11657 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 11658 fail on some hosts, and should be skipped.
337116ba 11659
da2a7671
PE
116602004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11661
11662 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11663 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11664 unless otherwise specified below.
11665
11666 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11667 to allocate kernel_base, kernel_items, kernel_size, since
11668 they needn't be initialized to 0.
11669 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11670 * src/closure.c (new_closure): Likewise, for itemset.
11671 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11672 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11673 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11674 (build_relations): Likewise for edge, states1, includes.
11675 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11676 * src/reader.c (packgram): Likewise, for ritem, rules.
11677 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11678 * src/relation.c (relation_digraph): Likewise for VERTICES.
11679 (relation_transpose): Likewise for new_R, end_R.
11680 * src/symtab.c (symbols_token_translations_init): Likewise for
11681 token_translations.
11682 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11683 (token_actions): Likewise for yydefact, actrow, conflrow,
11684 conflict_list.
11685 (save_column): Likewise for froms[symno], tos[symno].
11686 (goto_actions): Likewise for state_count.
11687 (pack_table): Likewise for base, pos, check.
11688 (tables_generate): Likewise for width.
11689
11690 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11691 for initial core. Just have a separate core, so we needn't worry
11692 about whether kernel_size and kernel_base are initialized.
11693
11694 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11695 kernel_size, kernel_items): Remove unnecessary initialization.
11696 * src/conflicts.c (conflicts): Likewise.
11697 * src/derives.c (derives): Likewise.
11698 * src/muscle_tablc (muscle_insert): Likewise.
11699 * src/relation.c (relation_digraph): Likewise.
11700 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11701 conflrow, conflict_table, conflict_list, table, check):
11702 Likewise.
11703
11704 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11705 This is because all callers pass unsigned int.
11706 * src/closure.h (new_closure): Likewise.
11707
11708 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11709 (build_relations): Initialize includes[i] in all cases.
11710 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11711 and rules[ruleno].precsym. Initialize members in order.
11712 * src/relation.c (relation_transpose): Always initialize new_R[i]
11713 and end_R[i].
11714 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11715
11716 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11717 conflict_list[0] was always 0, but now it isn't initialized.
11718
11719 * src/table.c (table_grow): When conflict_table grew, the grown
11720 area wasn't cleared. Fix this.
11721
11722 * lib/.cvsignore: Add strdup.c, strdup.h.
11723 * m4/.cvsignore: Add strdup.m4.
11724
00baeeac
PE
117252004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11726
11727 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11728 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11729 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11730 ngotos + 1 without checking for overflow.
11731 (build_relations): Use END_NODE, not -1, to denote end of edges.
11732 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11733 build_relations): Use goto_number, not int, for goto numbers.
11734 * src/tables.c (save_column, default_goto): Likewise.
11735
be3d9d42
AD
117362004-11-23 Akim Demaille <akim@epita.fr>
11737
11738 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11739 of #defining from yystype.
11740 Don't typedef yystype, C++ does not need it.
11741 This lets it possible to forward declare it as union.
11742
78e526d5
PE
117432004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11744
11745 * bootstrap (gnulib_modules): Add extensions.
11746 Problem reported by Jim Meyering.
11747
afbb696d
PE
117482004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11749
11750 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11751 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11752 src/system.h, src/tables.c: XFREE -> free, to accommodate
11753 recent change to gnulib xalloc.h.
78e526d5 11754 Problem reported by Jim Meyering.
afbb696d 11755
c1f8f16a
AD
117562004-11-17 Akim Demaille <akim@epita.fr>
11757
11758 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11759
db7e5eb5 117602004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
11761 Alexandre Duret-Lutz <adl@gnu.org>
11762
11763 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11764 changes.
11765 (YYCDEBUG): Adjust.
11766 Use it instead of cdebug_.
11767 (Parser::debug_stream, Parser::set_debug_stream): New.
11768 (Parser::symprint_): Define cdebug_ for temporary backward
11769 compatibility.
11770 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11771 debug_stream ().
11772
68e11668
AD
117732004-11-17 Akim Demaille <akim@epita.fr>
11774
11775 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11776 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11777 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11778 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11779
97cbc73e
PE
117802004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11781
11782 * data/glr.c (yyloc_default): Remove; not used.
11783 Problem reported by Frank Heckenbach.
11784
e342c3be
AD
117852004-10-25 Akim Demaille <akim@epita.fr>
11786
11787 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11788 Introduce another definition to address simple location arrays.
11789 (yyGLRStack): New member: yyerror_range.
11790 (yyrecoverSyntaxError, yyparse): Update it.
11791 (yyrecoverSyntaxError): Use it when shifting the error token to
11792 have an accurate range, equivalent to the one computed by both
11793 yacc.c and lalr1.cc.
11794 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11795 that column numbers start at column 0, as per GNU Coding
11796 Standards, the others tests, and the doc.
11797 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11798 Adjust to the above change (first column is 0).
11799 And adjust the location of the "<error>", now covering the whole
11800 line.
11801
93602feb 118022004-10-22 Akim Demaille <akim@epita.fr>
04098407 11803 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
11804
11805 Remove some arbitrary limits on goto numbers and relations.
11806 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11807 initial values, since they're never used.
11808 (set_goto_map): ngotos is now unsigned, so test for overflow
11809 by seeing whether it wraps around to zero.
11810 * src/lalr.h (goto_number): Now size_t, not short int.
11811 (GOTO_NUMBER_MAXIMUM): Remove.
11812 * src/relation.c (relation_print, traverse, relation_transpose):
11813 Check for END_NODE rather than looking at sign.
11814 * src/relation.h (END_NODE): New macro.
11815 (relation_node): Now size_t, not short int.
11816
dba08b04
PE
118172004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11818
11819 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11820 keyword, not an identifier. Problem reported by Baron Schwartz in
11821 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11822
df09ef2e
AD
118232004-10-11 Akim Demaille <akim@epita.fr>
11824
11825 * src/symtab.c (symbol_check_alias_consistency): Also check
11826 type names, destructors, and printers.
11827 Reported by Alexandre Duret-Lutz.
11828 Recode the handling of associativity and precedence in terms
11829 of symbol_precedence_set.
11830 Accept no redeclaration at all, not even equal to the previous
11831 value.
11832 (redeclaration): New.
11833 Use it to factor redeclaration complaints.
11834 (symbol_make_alias): Don't set the type of the alias, let
11835 symbol_check_alias_consistency do it as for other features.
11836 * src/symtab.h (symbol): Add new member prec_location, and
11837 type_location.
11838 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11839 * tests/input.at (Incompatible Aliases): New.
11840
146bc99d
PE
118412004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11842
11843 .cvsignore fixes to accommodate gnulib changes,
11844 and the practice of naming build directories "_build".
11845 * .cvsignore: Add "_*". Sort.
11846 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11847 * m4/.cvsignore: Add "*_gl.m4".
11848
e503aa60
AD
118492004-10-06 Akim Demaille <akim@epita.fr>
11850
11851 * src/parse-gram.y (add_param): Fix the truncation of trailing
11852 spaces.
11853
b4a20338
AD
118542004-10-05 Akim Demaille <akim@epita.fr>
11855
11856 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11857 whether the reducion was empty or not. This leaves room to
11858 improve the use of YYLLOC_DEFAULT in such a case.
11859 lalr1.cc is still experimental, so changing this is acceptable.
11860 And finally, there are probably not many users who changed the
11861 handling of locations in GLR, so changing is admissible too.
11862
11863 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11864 empty reduction, set @$ to an empty location ending the previously
11865 stacked symbol.
11866 Adjust uses to make sure the code is triggered on empty
11867 reductions.
11868 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11869 expected output: empty reductions have empty locations.
11870
f85a5e6f
AD
118712004-09-29 Akim Demaille <akim@epita.fr>
11872
11873 * data/lalr1.cc: Move towards a more standard C++ coding style
11874 for templates: Class < T > -> Class<T>.
11875
b203fc2c
AD
118762004-09-29 Akim Demaille <akim@epita.fr>
11877
11878 * data/lalr1.cc: Reinstall the former ctor, for sake of
11879 compatibility, but warn it will be removed.
11880 Move towards a more standard C++ coding style (i.e., type *var ->
11881 type* var).
11882
5b7e1e73
PE
118832004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11884
3fee967f
PE
11885 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11886 since it's less likely to work if NULs are involved in the future.
5b7e1e73 11887
0dcca5c2
AD
118882004-09-27 Akim Demaille <akim@epita.fr>
11889
11890 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11891
6dde1c82
AD
118922004-09-27 Akim Demaille <akim@epita.fr>
11893
11894 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 11895 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
11896 and argument names.
11897 (b4_cc_constructor_call): Likewise.
11898
b233d555
AD
118992004-09-24 Akim Demaille <akim@epita.fr>
11900
11901 * src/parse-gram.y (add_param): Strip the leading and trailing
11902 blanks from a formal argument declaration.
11903 (YY_LOCATION_PRINT): New.
11904
619404e3
AD
119052004-09-24 Akim Demaille <akim@epita.fr>
11906
11907 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
11908 after the location.
11909
dd8d9022
AD
119102004-09-24 Akim Demaille <akim@epita.fr>
11911
11912 * doc/bison.texinfo (Table of Symbols): Sort.
11913
0092f063
AD
119142004-09-21 Akim Demaille <akim@epita.fr>
11915
11916 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
11917 the useless parentheses.
11918 Suggested by Paul Eggert.
11919
451364ed
AD
119202004-09-20 Akim Demaille <akim@epita.fr>
11921
11922 Let the initial-action act on the look-ahead, and use it for the
11923 "initial push" (corresponding to an hypothetical beginning-of-file).
11924 And let lalr1.cc honor %initial-action.
11925
11926 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
11927 example.
11928 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
11929 (Parser::Parser): Remove the ctor that used to initialize it.
11930 (Parser::parse): Like in the other skeletons, issue the "starting
11931 parse" message before any action.
11932 Honor %initial-action.
11933 Initialize the stacks with the lookahead.
11934 * data/yacc.c: Let $$ and @$ in %initial-action designate the
11935 look-ahead.
11936 Push them in the stacks.
11937 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
11938
18d192f0
AD
119392004-09-20 Akim Demaille <akim@epita.fr>
11940
11941 * doc/bison.texinfo (Initial Action Decl): New.
11942
b8458aa5
AD
119432004-09-20 Akim Demaille <akim@epita.fr>
11944
11945 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
11946 clearer criterion to define it.
11947 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
11948 When reducing on an empty RHS, use the latest stacked location as
11949 location.
11950 yylloc is not always available.
11951 * data/glr.c: Likewise.
11952 Also, honor initial-actions.
11953
3fc16193
AD
119542004-09-20 Akim Demaille <akim@epita.fr>
11955
11956 * data/yacc.c (YY_LOCATION_PRINT): New.
11957 Define when we know YYLTYPE's structure, i.e., when the default
11958 YYLLOC_DEFAULT is used.
11959 * data/c.m4 (b4_yysymprint_generate): Use it.
11960 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
11961 value of the result.
11962 (error_start_): Replace with...
11963 (error_range_): this location array.
11964 This allows to replace code relying on the implementation of
11965 locations by portable code.
11966 * data/yacc.c (yylerrsp): Replace with...
11967 (yyerror_range): this.
11968 Every time a token is popped, update yyerror_range[0], to have an
11969 accurate location for the error token.
11970 * data/glr.c (YY_LOCATION_PRINT): New.
11971 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
11972 deference a pointer.
11973 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
11974 report the location in %printers.
11975
11976 * src/scan-skel.l: Instead of abort, report error messages to ease
11977 understanding skeleton scanning failures.
11978
ecfe33e7
AD
119792004-09-16 Akim Demaille <akim@epita.fr>
11980
11981 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
11982 (iterator, const_iterator): these, to be more in the C++ spirit.
11983 Also, return reverse iterators so that when displaying the stack
11984 we display its bottom first.
11985 (Parser::stack_print_, Parser::reduce_print_): Match the messages
11986 from yacc.c.
11987 We should probably use vector here though.
11988
1576d44d
AD
119892004-09-16 Akim Demaille <akim@epita.fr>
11990
11991 Have more complete shift traces.
11992
11993 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
11994 to report Shifts instead of ad hoc YYDPRINTF invocations,
11995 including for the error token.
11996 * data/lalr1.cc (symprint_): Output the location.
11997 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
11998 output the location within the %printer.
11999 Activate GLR tests, at least to make sure they compile properly.
12000 They still don't pass though.
12001 * tests/calc.at: Adjust expect verbose output, since now "Entering
12002 state..." is on a different line than the "Shifting" message.
12003
9c66f418
AD
120042004-09-08 Akim Demaille <akim@epita.fr>
12005
12006 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12007 Bison directive from the Bison file to the invocation of this
12008 macro, so that these directives are passed to
12009 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12010 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12011 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12012 the extra Bison directives instead of the whole series.
12013 Change the grammar so that there are recoverable errors, and
12014 unrecoverable errors. Now we can have the parser give up before
12015 consuming the whole input. As a result we now can observe that
12016 the lookahead is freed when needed.
12017 Change the parser source to parse argv[1] instead of a hard coded
12018 string.
12019 Simplify yylex, and give a value and location to EOF.
12020 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
12021 passed directives already coded in the file.
12022 Add some tests to check the location of "error".
12023 For some tests, the C++ parser is correct, and not yacc.c.
12024 For other tests, they provide different, but unsatisfying, values,
12025 so keep the C++ value so that at least one parser is "correct"
12026 according to the test suite.
12027 (Actions after errors): Remove, this is subsumed by the
12028 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
12029
52d5733f
AD
120302004-09-06 Akim Demaille <akim@epita.fr>
12031
12032 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 12033 (Parser::pop): New.
52d5733f
AD
12034 Use it.
12035
a0e68930
AD
120362004-09-06 Akim Demaille <akim@epita.fr>
12037
12038 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
12039 argument, an informative message.
12040 Call YY_SYMBOL_PRINT.
12041 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
12042 * data/lalr1.cc (destruct_): Likewise.
12043 In addition, no longer depend on b4_yysymprint_generate and
12044 b4_yydestruct_generate to generate these functions, do it "by
12045 hand".
12046
e757bb10
AD
120472004-09-03 Akim Demaille <akim@epita.fr>
12048
12049 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
12050 invoked, yydestruct the lookahead.
12051 * tests/calc.at (Calculator $1): Update the expected lengths of
12052 traces: there is an added line for the discarded lookahead.
12053 * doc/bison.texinfo (Destructor Decl): Some rewording.
12054 Define "discarded" symbols.
12055
0fe1f06d
AD
120562004-09-02 Akim Demaille <akim@epita.fr>
12057
12058 * data/lalr1.cc (translate_, destruct_): No reason to be static.
12059
284acc8b
AD
120602004-09-02 Akim Demaille <akim@epita.fr>
12061
12062 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
12063 (YYDSYMPRINTF): Rename as...
12064 (YY_SYMBOL_PRINT): this.
12065 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
12066 two.
12067 Use it instead of direct symprint_ calls.
12068 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
12069 one.
12070
a5eb1ed2
AD
120712004-09-02 Akim Demaille <akim@epita.fr>
12072
b7c72fe1
AD
12073 * data/lalr1.cc (b4_yysymprint_generate): New.
12074 (symprint_): New member function, defined when YYDEBUG.
12075 Use it consistently instead of token/nterm debugging output by
12076 hand.
a5eb1ed2
AD
12077 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
12078 %printer calls to use cdebug_ when using lalr1.cc.
12079
417141dd
AD
120802004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
12081
12082 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
12083 with #ifdef YYDEBUG.
12084
2fa09258
AD
120852004-08-26 Akim Demaille <akim@epita.fr>
12086
12087 * doc/bison.texinfo (Implementing Loops): Rename as...
12088 (Implementing Gotos/Loops): this.
12089
9378b508
PE
120902004-08-13 Paul Eggert <eggert@cs.ucla.edu>
12091
12092 Adjust to latest gnulib.
12093 * bootstrap (gnulib_modules): Add xalloc-die.
12094 Set LC_ALL=C so that file names sort consistently.
12095 Prefer the gnulib copies of gettext.m4, glibc21.m4,
12096 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
12097 uintmax_t.m4, ulonglong.m4.
12098 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
12099 po.m4 since we are now using _gl.m4 instead.
12100
87a8ad5c
PE
121012004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
12102
12103 * src/scan-action.l: Remove. Scanning of semantic actions is
12104 handled in scan-gram.l.
12105
dca81a78
PE
121062004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
12107
12108 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
12109
12110 * src/location.h (struct): The file member is a uniqstr.
12111 (equal_boundaries): Use UNIQSTR_EQ for comparison.
12112
c9cbf7c5
PE
121132004-07-22 Paul Eggert <eggert@cs.ucla.edu>
12114
12115 Fix bug with non-%union parsers that have printers or destructors,
12116 which led to a Bison core dump. Reported by Peter Fales in
12117 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 12118
c9cbf7c5
PE
12119 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
12120 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
12121 not to our own type.
12122 * src/output.c (symbol_destructors_output, symbol_printers_output):
12123 Don't assume %union.
12124 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
12125 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
12126 UNION-FLAG. All callers changed.
12127 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
12128 Use type char, not unsigned int, when declaring an array of char;
12129 this lets us remove a cast.
12130 (Printers and Destructors): Add non-%union test cases.
12131
fa7e68c3
PE
121322004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12133
12134 * doc/bison.texinfo: Minor editorial changes, mostly to the new
12135 GLR writeups. E.g., avoid frenchspacing and the future tense,
12136 change "lookahead" to "look-ahead", and change "wrt" to "with
12137 respect to".
2fa09258 12138
fa7e68c3
PE
121392004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12140
12141 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
12142 New sections, split off from the GLR Parsers section. Put the new
12143 Simple GLR Parser near the start of the GLR section, for clarity.
12144 Rewrite connective text.
12145
99a9344e
PE
121462004-06-21 Frank Heckenbach <frank@g-n-u.de>
12147
12148 * doc/bison.texinfo (Simple GLR Parsers): New section.
12149
8dd162d3
PE
121502004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12151
12152 * NEWS, TODO, doc/bison.texinfo:
12153 Use "look-ahead" instead of "lookahead", to be consistent.
12154 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
12155 while we're fixing "look-ahead".
12156 * src/conflicts.c (shift_set): Renamed from shiftset.
12157 (look_ahead_set): Renamed from lookaheadset.
12158 * src/print.c: Likewise.
12159 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
12160 name for "lookahead".
12161 (report_types, usage): Likewise.
12162 * src/getargs.h (report_look_ahead_tokens): Renamed from
12163 report_lookaheads.
12164 * src/lalr.c (compute_look_ahead_tokens): Renamed from
12165 compute_lookaheads.
12166 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
12167 (look_ahead_tokens_print): Renamed from lookaheads_print.
12168 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
12169 state_rule_lookaheads_print.
12170 * src/state.h: Likewise.
12171 (reductions.look_ahead_tokens): Renamed from lookaheads.
12172 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
12173 AT_DATA_LOOKAHEADS_GRAMMAR.
12174
57a90331
PE
121752004-06-03 Paul Eggert <eggert@cs.ucla.edu>
12176
12177 * README: Update location of patched M4 distribution.
12178
8ed3234a
PE
121792004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
12180
12181 Don't assume the C++ compiler takes the same arguments as the C compiler
12182 (trivial change).
12183 * configure.ac (O0CXXFLAGS): New var.
12184 * tests/atlocal.in (CXXFLAGS): Use it.
12185
07971983
PE
121862004-05-29 Paul Eggert <eggert@cs.ucla.edu>
12187
12188 Fix some "make check" problems with C++ reported by
12189 Albert Chin-A-Young for Tru64 C++ in this thread:
12190 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
12191
12192 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
12193 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12194 Output to a .cc file for C++, not to a .c file.
12195 * tests/calc.at (AT_CHECK_CALC): Likewise.
12196 * tests/regression.at (AT_CHECK_DANCER): Likewise.
12197 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
12198
29058652
PE
121992004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
12200
12201 * tests/calc.at, tests/actions.at: Workaround for SGI
12202 C++ compiler. (trivial change)
12203
62cb8a99
PE
122042004-05-27 Paul Eggert <eggert@cs.ucla.edu>
12205
fd418816
PE
12206 Spent a few hours checking out which prerequisite versions the
12207 current sources actually require. I went all the way back to
12208 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
12209 a seemingly endless set of combinations of versions more recent
12210 than that. The bottom line is that the current sources require
12211 fairly recent versions of the build tools, and it'll be some work
12212 to change this.
12213 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
12214 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
12215 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
12216 Add comments explaining why those particular versions are
12217 currently needed.
2fa09258 12218
62cb8a99
PE
12219 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
12220 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 12221 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
12222
12223 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
12224 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
12225
caa52c10
PE
122262004-05-26 Paul Eggert <eggert@cs.ucla.edu>
12227
12228 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
12229 0.11.5. Suggested by Bruno Haible.
12230 * bootstrap: Remove gettext version checking.
12231
12232 * doc/bison.texinfo (Decl Summary): Also mention that %union
12233 can depend on prerequisite types. Problem reported by Tim
12234 Van Holder.
12235
4bfd5e4e
PE
122362004-05-25 Paul Eggert <eggert@cs.ucla.edu>
12237
2cef3017
PE
12238 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
12239 * README-alpha: Don't tell people not to package this.
12240
b9c85d5c
PE
12241 * bootstrap: Don't assume $(...) works; use `...` instead.
12242 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
12243 gettext better.
12244
4bfd5e4e
PE
12245 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
12246 put into the -d output file, and mention what to do if YYSTYPE is
12247 defined as a macro.
12248
6a36ff94
PE
122492004-05-24 Paul Eggert <eggert@cs.ucla.edu>
12250
6712933e
PE
12251 Undo change made earlier today: it caused autopoint to not bring
12252 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
12253 autopoint's.
12254
12255 * bootstrap: Check that gettext version matches what's in
12256 configure.ac. Warn users to ignore robots.txt ERROR 404.
12257 * bootstrap: Undo today's earlier change (logged below).
12258 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 12259
6a36ff94
PE
12260 The gettext version checking is causing more trouble than it's
12261 curing; remove it. Problem reported by Paul Hilfinger.
12262
12263 * bootstrap: Issue a warning that one can expect a message
12264 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
12265 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
12266
209ea708
PE
122672004-05-23 Paul Eggert <eggert@cs.ucla.edu>
12268
12269 Ensure that the C++ compiler used for testing actually works on a
12270 simple test program; if not, skip the C++-related tests. Problem
12271 reported by Vin Shelton in:
161a71f3 12272 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
12273
12274 * m4/cxx.m4: New file.
12275 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
12276 * tests/atlocal.in (BISON_CXX_WORKS): Add.
12277 * tests/local.at (AT_COMPILE_CXX): Use it.
12278
41ca2549
PE
122792004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12280
383e69dc
PE
12281 * data/glr.c (yylloc): Output this macro even if locations are not
12282 being generated, as the GLR parser needs it even in that case.
12283 Problem reported by Troy A. Johnson
12284 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
12285
41ca2549
PE
12286 * configure.ac (AC_INIT): Update to 1.875e.
12287
e476c87d
PE
122882004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12289
12290 * NEWS: Version 1.875d.
12291 * configure.ac (AC_INIT): Likewise.
12292 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
12293
12294 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
12295 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
12296 lalr1.cc runs afoul of the first, and the last two are no longer
12297 supported by GCC 3.4.0.
12298 * README: Mention GNU m4 1.4 or later; mention m4 patches.
12299 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
12300
233a88ad
PE
123012004-05-06 Paul Eggert <eggert@cs.ucla.edu>
12302
12303 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
12304 unsigned int, for compatibility with latest gnulib hash module.
12305 * src/state.c (state_hash, state_hasher): Likewise.
12306 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
12307 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 12308
12ffdd28
PE
123092004-05-03 Paul Eggert <eggert@cs.ucla.edu>
12310
12311 * NEWS: Unescaped newlines are no longer allowed in char & strings.
12312
12313 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
12314 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
12315 character and string literals.
12316 (unexpected_end): New function.
12317 (unexpected_eof): Use it.
12318 (unexpected_newline): New function.
12319 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12320 actions.
e476c87d 12321
12ffdd28
PE
12322 * NEWS: Document %expect-rr.
12323
12324 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12325 Fix typo by replacing $1 with $option.
12326 Remove more 'intl'-related files.
9668e2be 12327 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
12328
12329 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12330 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12331 strtoul.c.
12332 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12333 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12334 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12335 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12336 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12337 * src/.cvsignore: Add *.output.
12338
12339 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12340 gets copied to the output file.
e476c87d 12341
1f65350a
PE
123422004-04-28 Paul Eggert <eggert@twinsun.com>
12343
12344 Get files from the gnulib and po repositories, instead of relying
12345 on them being in our CVS. Upgrade to latest versions of gnulib
12346 and Automake.
12347
12348 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12349 * bootstrap: Bootstrap from gnulib and po repositories.
12350 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12351 * README-cvs: Document these changes. Remove version numbers from
12352 mentions of build tools, since they change so often. Mention Flex.
12353
12354 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12355 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
12356 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12357 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 12358 does this for us.
12ffdd28
PE
12359 (AC_ISC_POSIX): Remove; we no longer support this
12360 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
12361 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12362 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12363 Do not check for C89 headers, except for locale.h which is used
12364 by the Yacc library and must port to K&R hosts.
12365 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12366 Do not check for C89 functions, except for setlocale which is
12367 used by the Yacc library.
12368 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12369 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12370 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12371 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12372 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12373 AM_GNU_GETTEXT): Remove; now done by:
12374 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12375 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12376 for us.
12377
12378 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12379 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12380 Define to empty, as gnulib.mk will do the rest for us.
12381 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12382 for us.
12383 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12384 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12385
12386 * src/files.c: Include gnulib's xstrndup.h.
12387
12388 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12389 (REALLOC): Use xnrealloc, for likewise.
12390 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12391 (strnlen, memrchr): Remove decls; functions no longer used.
12392 Include <stpcpy.h>.
12393
12394 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12395 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12396 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12397 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12398 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12399 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12400 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12401 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
12402 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
12403 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
12404 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
12405 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12406 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
12407 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
12408 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
12409 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
12410 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
12411 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
12412 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
12413 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
12414 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
12415 Remove, as these files are now generated automatically
12416 by bootstrap or automake.
12417
12418 * po/ChangeLog: Remove: all but one entry was a duplicate
12419 of this file, and I moved that 2000-11-02 entry here.
12420
12421 * config/.cvsignore: Add Makefile, depcomp, install-sh.
12422 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
12423 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
12424 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
12425 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
12426 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
12427 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
12428 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
12429 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
12430 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
12431 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
12432 xstrndup.h.
12433 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
12434 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
12435 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
12436 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
12437 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
12438 * src/.cvsignore: Remove *_.c.
12439
12440
12441 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
12442 support it. (The latest stable gzip doesn't.)
12443
124442004-04-27 Paul Eggert <eggert@twinsun.com>
12445
12446 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
12447 case, as stos_ is now used by destructors due to the 2004-02-09
12448 change.
12449
12450 Remove more K&R C support.
12451 * lib/libiberty.y (PARAMS): Remove. All uses removed.
12452 * lib/subpipe.c (errno): Remove decl.
12453 Include <stdlib.h> unconditionally.
12454 (EXIT_FAILURE): Remove macro.
12455 * src/complain.c (vfprintf, strerror): Remove.
12456 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
12457 unconditionally.
12458 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
12459 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
12460 (strchr, strspn, memchr): Remove decls.
12461 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
12462 unconditionally. Do not declare perror.
12463 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
12464 unconditionally.
12465
12466 * src/complain.c (_): Remove useless defn, as system.h defines this.
12467
12468 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
12469 with latest obstack.h.
12470 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
12471 to procedure types, as obstack.h now does that for us.
12472 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
12473
12474 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
12475 so that this include file can stand alone.
12476 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
12477 does this now. Include subpipe.h first after config.h, to
12478 test whether it can stand alone.
12479
12480 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
12481 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
12482 unused declaration.
12483
12484 * tests/synclines.at (%union synch line): Put a dummy member in
12485 the union, because empty unions aren't allowed in C. Caught
12486 by GCC 3.4.0.
12487
4f16766c
PE
124882004-04-13 Jim Meyering <jim@meyering.net>
12489
12490 * src/conflicts.c (conflicts_print): Correct format string typo:
12491 use `%%' to produce literal `%'. (trivial change)
12492
779e7ceb
PE
124932004-03-30 Paul Eggert <eggert@twinsun.com>
12494
12495 * src/getargs.c (version): Update copyright year to 2004.
12496
12497 * data/c.m4 (b4_int_type): Use 'short int' rather than
12498 'short', and similarly for 'long', 'unsigned', etc.
12499 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
12500 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
12501 yy_yypstack, yydumpstack): Likewise.
12502 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
12503 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
12504 Likewise.
12505 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
12506 yy_stack_print, yyparse): Likewise.
12507 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
12508 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
12509 * lib/bitset.c (bitset_print): Likewise.
12510 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
12511 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12512 * lib/bitsetv.c (bitsetv_dump): Likewise.
12513 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
12514 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
12515 Likewise.
12516 * src/LR0.c (allocate_itemsets): Likewise.
12517 * src/gram.h (rule_number, rule): Likewise.
12518 * src/lalr.h (goto_number): Likewise.
12519 * src/nullable.c (nullable_compute): Likewise.
12520 * src/output.c (prepare_rules): Likewise.
12521 * src/relation.c (relation_print, relation_digraph): Likewise.
12522 * src/relation.h (relation_node): Likewise.
12523 * src/state.h (state_number, transitions, errs, reductions,
12524 struct state): Likewise.
12525 * src/symtab.h (symbol_number, struct symbol): Likewise.
12526 * src/tables.c (vector_number, tally, action_number,
12527 default_goto, goto_actions): Likewise.
12528 * tests/existing.at (GNU Cim Grammar): Likewise.
12529 * tests/regression.at (Web2c Actions): Likewise.
12530
12531 * src/output.c (muscle_insert_short_int_table): Renamed from
12532 muscle_insert_short_table. All uses changed.
12533
d6328241
PH
125342004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12535
12536 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
12537 (declaration): Replace expected_conflicts with expected_sr_conflicts.
12538 Add %expect-rr rule.
4f16766c 12539
d6328241
PH
12540 * src/scan-gram.l: Recognize %expect-rr.
12541
4f16766c 12542 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 12543 expected_conflicts.
4f16766c 12544 (expected_rr_conflicts): Declare.
d6328241
PH
12545
12546 * src/conflicts.c (expected_sr_conflicts): Rename from
12547 expected_conflicts.
12548 (expected_rr_conflicts): Define.
12549 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
12550 for GLR parsers.
12551 Use expected_sr_conflicts in place of expected_conflicts.
12552 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 12553
d6328241 12554 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 12555
1452af69
PE
125562004-03-08 Paul Eggert <eggert@gnu.org>
12557
12558 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 12559 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
12560
12561 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12562 in lalr1.cc.
12563 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12564 * src/scan-gram.l (scan_integer): New function.
12565 ({int}): Use it.
12566 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12567 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12568 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12569 Say "long int", not "long", for uniformity with GNU style.
12570
006d217d
PE
125712004-02-25 Paul Eggert <eggert@twinsun.com>
12572
12573 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12574 compilers. This fixes a problem with Intel's C++ compiler being
12575 chatty, reported by Guido Trentalancia in
161a71f3 12576 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 12577
c2729758
ADL
125782004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12579
12580 Support %destructor and merge error locations in lalr1.cc.
12581
12582 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12583 (Parser::stos_): Define unconditionally.
12584 (Parser::destruct_): New method. Generate its body with
12585 b4_yydestruct_generate.
12586 (Parser::error_start_): New attribute.
12587 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12588 token which are discarded.
12589 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12590 error_start_ when erroneous token are discarded.
12591 (Parser::parse) <yyerrlab1>: Compute the location of the error
12592 token so that it covers all the discarded tokens.
12593 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12594 it can be called with `%skeleton "lalr1.cc"', and do that.
12595
dd0e0635
PE
125962004-02-02 Paul Eggert <eggert@twinsun.com>
12597
12598 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12599 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12600 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12601 There's no need to mention top_builddir since Automake does that
12602 for us.
12603 (INCLUDES): Remove, as Automake says it's obsolescent.
12604 Contents migrated into AM_CPPFLAGS as described above.
12605 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12606
126072004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12608
12609 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12610 (yyreportSyntaxError): Handle case where lookahead token is
12611 YYEMPTY.
12612
be16239b
PH
126132004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12614
12615 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12616 resulting parsers are compilable with C++.
12617
5fa90832
PE
126182003-12-23 Paul Eggert <eggert@twinsun.com>
12619
12620 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12621 * src/output.c (output_skeleton): Rename local var.
12622 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12623 Bison tokens, as this runs afoul of the 2003-10-07 change that
12624 disallowed NUL bytes in character constants or string literals.
12625
12626 * tests/local.at: Require Autoconf 2.59's Autotest.
12627 * tests/testsuite.at: Don't include local.at, since we now assume
12628 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12629 including it.
12630 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12631 multiple inclusion warnings.
dd0e0635 12632
b165c324
AD
126332003-12-02 Akim Demaille <akim@epita.fr>
12634
12635 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12636 conditions.
12637 From Bruno Haible.
12638
26e06a21
ADL
126392003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12640
12641 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12642
92ac3705
PE
126432003-10-07 Paul Eggert <eggert@twinsun.com>
12644
6a5ecb38
PE
12645 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12646 if testsuite doesn't exist.
12647
92ac3705
PE
12648 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12649 literals, unfortunately.
12650 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12651 Complain about NUL bytes in character constants or string literals.
12652
91d2c560
PE
126532003-10-05 Paul Eggert <eggert@twinsun.com>
12654
12655 * NEWS: Don't document %no-default-prec, as it's still
12656 too experimental.
12657 * doc/bison.texinfo: Document %no-default-prec only if
12658 the defaultprec flag is set. Normally it's not.
12659
0cc3da3a
PE
126602003-10-04 Paul Eggert <eggert@twinsun.com>
12661
12662 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12663 non-modifiable lvalue, instead of a modifiable one.
12664 * doc/bison.texinfo (Actions): Document that $$ can
12665 be assigned to. Do not claim that $$ and $N are
12666 array element references: user code should not rely on this.
12667
22fccf95
PE
126682003-10-01 Paul Eggert <eggert@twinsun.com>
12669
12670 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12671 (grammar_declaration): Use it.
12672 * src/scan-gram.l: New token %no-default-prec.
12673 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12674 * NEWS, doc/bison.texinfo: Document the above.
12675
fc8f2965
AD
126762003-10-01 Akim Demaille <akim@epita.fr>
12677
12678 VCG no longer supports long_straight_phase.
12679
12680 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12681 * src/print_graph.c (print_graph): Adjust.
12682
39a06c25
PE
126832003-09-30 Frank Heckenbach <frank@g-n-u.de>
12684 and Paul Eggert <eggert@twinsun.com>
12685
12686 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12687 Table of Symbols): Document %default-prec.
12688 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12689 (grammar_declaration): Set default_prec on %default-prec.
12690 * src/scan-gram.l (%default-prec): New token.
12691 * src/reader.h (default_prec): New flag.
12692 * src/reader.c: Likewise.
12693 (packgram): Handle it.
12694 * tests/conflicts.at (%default-prec without %prec,
12695 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 12696
39a06c25
PE
126972003-09-30 Paul Eggert <eggert@twinsun.com>
12698
12699 * tests/testsuite.at: Include local.at, not input.at, fixing
12700 a typo in the 2003-08-25 patch.
12701
62b6aef9
AD
127022003-08-27 Akim Demaille <akim@epita.fr>
12703
12704 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12705 GCC warnings.
12706
89e1cc61
AD
127072003-08-26 Akim Demaille <akim@epita.fr>
12708
12709 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12710 "<\#" to avoid magic from Gnus when posting parts of this script.
12711
a08460b0
AD
127122003-08-26 Akim Demaille <akim@epita.fr>
12713
12714 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12715 (Parser::parse): here.
12716 Adjust: nerrs and errstatus is now replaced by...
12717 (Parser::nerrs_, Parser::errstatus_): New.
12718
603f1cfd
AD
127192003-08-25 Akim Demaille <akim@epita.fr>
12720
12721 * config/announce-gen, Makefile.cfg: New.
12722 * Makefile.am: Adjust.
12723 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12724 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12725
cd3684cf
AD
127262003-08-25 Akim Demaille <akim@epita.fr>
12727
12728 When reducing initial empty rules, Bison parser read an initial
12729 location that is not defined. This results in garbage, and that
12730 affects Bison's own parser. Therefore we need (i) to extend Bison
12731 to support a means to initialize this location, and (ii) to use
12732 this CVS Bison to fix CVS Bison's parser.
12733
12734 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12735 with...
12736 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12737 * src/parse-gram.y: Adjust.
12738 (%initial-action): New.
12739 (%error-verbose): Since we require CVS Bison, there is no reason
12740 not to use it.
12741 * src/scan-gram.l: Adjust.
12742 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12743 * data/yacc.c (yyparse): Use b4_initial_action.
12744
4e03e201
AD
127452003-08-25 Akim Demaille <akim@epita.fr>
12746
12747 * doc/bison.texinfo: Don't promote stdout for error messages.
12748
8c182d05
AD
127492003-08-25 Akim Demaille <akim@epita.fr>
12750
12751 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12752 From Alexandre Duret-Lutz.
12753
6a60c4cf
PE
127542003-08-25 Akim Demaille <akim@epita.fr>
12755
12756 Version 1.875c.
12757
25f66e1a
AD
127582003-08-25 Akim Demaille <akim@epita.fr>
12759
12760 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12761 Use them.
12762
5348bfbe
AD
127632003-08-25 Akim Demaille <akim@epita.fr>
12764
12765 * data/lalr1.cc (Parser::reduce_print_): New.
12766 Use it.
12767
47301314
AD
127682003-08-25 Akim Demaille <akim@epita.fr>
12769
12770 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12771 error recovery loops. This patch is based on
161a71f3 12772 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
12773 Also, augment the similarity between lalr1.cc and yacc.c.
12774 Note: the locations of error recovery rules are not correct yet.
12775
12776 * data/lalr1.cc: Comment changes to augment the similarity between
12777 lalr1.cc and yacc.c.
12778 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12779 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12780 yyerrlab), when hitting EOF, pop the whole stack here instead of
12781 merely falling thru the default error handling mechanism.
12782 (yyerrorlab): New label, with the old contents of YYERROR,
12783 plus the following change: pop the stack of rhs corresponding
12784 to the production that invoked YYERROR. That is how Yacc
12785 behaves (required by POSIX).
12786 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12787 fail.
12788
1f7a61ff
AD
127892003-08-25 Akim Demaille <akim@epita.fr>
12790
12791 Tune local.at so that people can "autom4te -l autotest calc.at -o
12792 calc" for instance, to extract a sub test suite.
12793
12794 * tests/testsuite.at: Move the initialization, Autotest version
12795 requirement, and AT_TESTED invocation into...
12796 * tests/local.at: here.
12797 * tests/testsuite.at: Include it for compatibility with Autoconf
12798 2.57.
12799 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12800 be ignore.
12801
327b5b56
PE
128022003-08-04 Paul Eggert <eggert@twinsun.com>
12803
12804 Rework code slightly to avoid gcc -Wtraditional warnings.
12805 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12806 The returned value is now stored in *YY0. All callers changed.
12807 * src/output.c (merge_output): Adjust to the above change.
12808
0051e3ed
PE
128092003-07-26 Paul Eggert <eggert@twinsun.com>
12810
12811 * data/glr.c (YYASSERT): New macro.
12812 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12813 yyresolveStates, yyprocessOneStack):
12814 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12815 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 12816
137437c6
PE
128172003-07-25 Paul Eggert <eggert@twinsun.com>
12818
5b620e06
PE
12819 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12820 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 12821 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
12822 by Frank Heckenbach, though I have omitted the structure-initialization
12823 part of his glr-knr.diff patch since I recall that the Portable
12824 C Compiler didn't require that change.
12825
137437c6
PE
12826 Let the user specify how to allocate and free memory.
12827 Derived from a suggestion by Frank Heckenbach in
161a71f3 12828 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
12829 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12830 All uses of free, malloc, realloc changed to use these macros,
12831 and unnecessary casts removed.
12832 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12833
ddb85ca5
PE
128342003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12835
12836 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12837 use s.empty() rather than s == "" to test for empty string; see
161a71f3 12838 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
12839 (trivial change)
12840
39910e09
AD
128412003-06-25 Akim Demaille <akim@epita.fr>
12842
12843 * config/depcomp, config/install-sh: Update from masters.
12844
0ae99356
PE
128452003-06-20 Paul Eggert <eggert@twinsun.com>
12846
12847 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12848 and return properly parenthesized result.
12849 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12850 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12851 Remove unnecessary parentheses from uses.
12852 * doc/bison.texinfo (Location Default Action): Describe the
12853 conventions for parentheses.
12854
cd05d13c
PE
128552003-06-19 Paul Eggert <eggert@twinsun.com>
12856
81fd08ca
PE
12857 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12858 yyreportTree): Do not assume that size_t is the same width as int,
12859 when printing sizes. Print sizes using an unsigned format.
12860 Problem reported by Frank Heckenbach in
161a71f3 12861 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 12862
cd05d13c
PE
12863 Port to Forte Developer 7 C compiler.
12864 * data/glr.c (struct YYLTYPE): If locations are not being used,
12865 declare a single dummy member, as empty structs do not conform
12866 to the C standard.
12867 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12868 the Forte Developer 7 C compiler complains that end-of-loop
12869 code is not reached.
12870
4dcf140b
PE
128712003-06-17 Paul Eggert <eggert@twinsun.com>
12872
12873 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12874 avoid warnings from picky compilers about redefinition of PARAMS.
12875
8dd76bee
PE
128762003-06-17 Paul Eggert <eggert@twinsun.com>
12877
12878 Version 1.875b.
12879
12880 * NEWS: Document 1.875b.
12881
12882 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12883 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12884 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12885 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12886 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12887 per recent gettext manual's suggestion.
12888 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12889 Use prototypes, not old-style definitions.
12890 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12891 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12892 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12893 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12894 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
12895 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
12896 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
12897 vbitset_or_and_cmp, vbitset_copy): Likewise.
12898
12899 * lib/libiberty.h: Do not include config.h; that's the includer's job.
12900 Do not include <stdlib.h>.
12901 (PARAMS): Define unconditionally for C89.
12902 (ATTRIBUTE_NORETURN): Remove.
12903 (ATTRIBUTE_UNUSED): Define unconditionally.
12904
12905 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 12906 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
12907 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
12908 * lib/vbitset.c, lib/vbitset.h: New files.
12909 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12910 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
12911 from libbitset.
12912
12913 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
12914 `How Can I Reset @code{yyparse}', since texinfo does not allow
12915 arbitrary @ in node names.
12916
12917 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
12918 shouldn't be needed according to the gettext 0.12.1 documentation
12919 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 12920 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 12921 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 12922 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 12923
8dd76bee
PE
12924 * lib/.cvsignore: Add stdbool.h.
12925 * m4/.cvsignore: Add nls.m4, po.m4.
12926
12927 Upgrade to CVS gnulib.
12928 * stdbool_.h: File renamed from stdbool.h.in.
12929 * configure.ac (AM_STDBOOL_H): Invoke this instead of
12930 AC_HEADER_STDBOOL.
12931 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
12932 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
12933 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
12934 (MOSTLYCLEANFILES): New var.
12935 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
12936 (stdbool.h): New rule.
12937 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
12938 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
12939 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
12940 m4/quote.m4: Upgrade to today's gnulib.
12941
12942 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
12943 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
12944 the tests right now.
12945 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
12946 yyerror are declared before use; C99 requires this.
12947
25005f6a
PH
129482003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12949
12950 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
12951 first.
12952 (yyrecoverSyntaxError): Correct the logic for setting and testing
12953 yyerrState.
12954 Correct comment on handling EOF.
12955 Allow states with only a default reduction, rather than failing
8dd76bee 12956 (I can't quite reconstruct why these were not allowed before).
25005f6a 12957
137437c6 12958 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 12959 buffer overruns, corrupting state.
8dd76bee
PE
12960
12961 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
12962 definition.
12963 * src/reader.h (max_left_semantic_context): New variable declaration.
12964 * src/scan-gram.l (max_left_semantic_context): Define.
12965 (handle_action_dollar): Update max_left_semantic_context.
12966 * data/glr.c (YYMAXLEFT): New definition.
12967 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
12968 (yyresolveAction): Ditto.
12969
12970 Fixes to problems with location handling in GLR parsers reported by
12971 Frank Heckenbach (2003/06/05).
12972
12973 * data/glr.c (YYLTYPE): Make trivial if locations not used.
12974 (YYRHSLOC): Add parentheses, and define only if locations used.
12975 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
12976 locations not used.
12977 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
12978 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 12979
25005f6a
PH
12980 * tests/cxx-type.at: Exercise location information; update tests
12981 to differentiate output with and without locations.
8dd76bee 12982 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
12983 because default YYLTYPE not yet defined.
12984 Change semantic actions to compute strings, rather than printing
12985 them directly (to test proper passing of semantics values). Change
12986 output to prefix notation and update test data and expected results.
12987 (yylex): Track locations.
12988 (stmtMerge): Return value rather than printing, and include arguments
12989 in value.
8dd76bee 12990
711f40b7
PE
129912003-06-03 Paul Eggert <eggert@twinsun.com>
12992
12993 Avoid warnings generated by GCC 2.95.4 when Bison is
12994 configured with --enable-gcc-warnings.
12995 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
12996 yy::]b4_parser_class_name[::translate_,
12997 yy::Stack::operator[] (unsigned),
12998 yy::Stack::operator[] (unsigned) const,
12999 yy::Slice::operator[] (unsigned),
13000 yy::Slice::operator[] (unsigned) const):
13001 Rename local vars to avoid warnings.
13002 * tests/glr-regression.at (Improper handling of embedded actions
13003 and $-N in GLR parsers): Remove unused local variable from yylex.
13004 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13005 (void) as arg when not pure, since we now assume C89 when building
13006 Bison. Pacify GCC by using parameter.
13007
ac695f7d
PE
130082003-06-02 Paul Eggert <eggert@twinsun.com>
13009
13010 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13011 yy::Location::lines, yy::Location::columns): Rename arguments
13012 to avoid shadowing; this removes a warning generated by GCC 3.3.
13013
26ec81e0
PE
130142003-06-01 Paul Eggert <eggert@twinsun.com>
13015
13016 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
13017 to g++, as GCC 3.3 complains if you do it.
13018 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
13019 everything that WARNING_CFLAGS has, except omit warnings
13020 not suitable for C++.
13021 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
13022 * tests/atlocal.in (CXXFLAGS): New var.
13023 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
13024
13025 Fix a GLR parser bug I reported in February; see
161a71f3 13026 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
13027 The problem was that GLR parsers did not conform to the C standard,
13028 because actions like { $1 = $2 + $3; } expanded to expressions
13029 that invoked YYFILL in separate subexpressions, and YYFILL assigned
13030 to a local variable. The C standard says that expressions
13031 like (var = f ()) + (var = f ()) have undefined behavior.
13032 Another problem was that GCC sometimes issues warnings that
13033 yyfill and its parameters are unused.
13034
13035 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
13036 as possibly unused.
13037 (yyfill): New function.
13038 (YYFILL): Use it.
13039 (yyuserAction): Change type of yynormal to bool, so that it matches
13040 the new yyfill signature. Mark it as possibly unused.
13041
13042
13043 Follow up on a bug I reported in February, where a Bison-generated
13044 parser can loop. Provide a test case and a fix for yacc.c. I
13045 don't have a fix for lalr1.cc or for glr.c, unfortunately.
13046 The original bug report is in:
161a71f3 13047 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
13048
13049 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
13050 macro's size was becoming unwieldy.
13051 (yyerrlab): Do not discard an empty lookahead symbol, as this
13052 might destroy garbage.
13053 (yyerrorlab): New label, with the old contents of YYERROR,
13054 plus the following change: pop the stack of rhs corresponding
13055 to the production that invoked YYERROR. That is how Yacc
13056 behaves, and POSIX requires this behavior.
13057 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
13058 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
13059 Define 'alarm' to do nothing if unistd.h is not available.
13060 Add a new rule "exp: '-' error;" to test the above change to
13061 data/yacc.c. Use 'alarm' to abort any test taking longer than
13062 10 seconds, as it's probably looping.
13063 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
13064 Also, the new yacc.c generates two fewer diagnostics for an
13065 existing test.
13066
d0829076
PE
130672003-05-24 Paul Eggert <eggert@twinsun.com>
13068
c6ae27df
PE
13069 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
13070 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
13071 This fixes a problem reported by John Bowman when the Compaq/HP
13072 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
13073 -ansi -Wall -gall).
13074 * data/yacc.c (union yyalloc): Likewise.
13075 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 13076
d0829076
PE
13077 Switch from 'int' to 'bool' where that makes sense.
13078
13079 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
13080 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
13081 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
13082 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
13083 Return or accept bool, not int. All callers changed.
13084 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
13085 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
13086 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
13087 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
13088 bitset_or_and_cmp_): Likewise.
13089 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
13090 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
13091 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
13092 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
13093 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
13094 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
13095 bitset_stats_or_and_cmp): Likewise.
13096 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
13097 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
13098 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
13099 ebitset_xor_cmp): Likewise.
13100 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
13101 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
13102 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
13103 lbitset_xor_cmp): Likewise.
13104 * lib/bbitset.h: Include <stdbool.h>.
13105 (struct bitset_vtable): The following members now return bool, not
13106 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
13107 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
13108 or_and_cmp).
13109 * src/conflicts.c (count_rr_conflicts): Likewise.
13110 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
13111 All uses changed.
13112 * lib/ebitset.c (ebitset_obstack_init): Likewise.
13113 * lib/lbitset.c (lbitset_obstack_init): Likewise.
13114 * src/getargs.c (debug_flag, defines_flag, locations_flag,
13115 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13116 graph_flag): Likewise.
13117 * src/getargs.h (debug_flag, defines_flag, locations_flag,
13118 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13119 graph_flag): Likewise.
13120 * src/output.c (error_verbose): Likewise.
13121 * src/output.h (error_verbose): Likewise.
13122 * src/reader.c (start_flag, typed): Likewise.
13123 * src/reader.h (typed): Likewise.
13124 * src/getargs.c (LOCATIONS_OPTION): New constant.
13125 (long_options, getargs): Use it.
13126 * src/lalr.c (build_relations): Use bool, not int.
13127 * src/nullable.c (nullable_compute): Likewise.
13128 * src/print.c (print_reductions): Likewise.
13129 * src/tables.c (action_row, pack_vector): Likewise.
13130 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
13131 * src/output.c (prepare): Use it.
13132 * src/output.c (token_definitions_output,
13133 symbol_destructors_output, symbol_destructors_output): Use string,
13134 not boolean integer, to keep track of whether to output separator.
13135 * src/print_graph.c (print_core): Likewise.
13136 * src/state.c (state_rule_lookaheads_print): Likewise.
13137
13138 * config/install-sh: Sync from automake 1.7.5.
13139
6b2584b7
PE
131402003-05-14 Paul Eggert <eggert@twinsun.com>
13141
13142 * src/parse-gram.y (rules_or_grammar_declaration): Require a
13143 semicolon after a grammar declaration, in the interest of possible
13144 future changes to the Bison input language.
13145 Do not allow a stray semicolon at the start of the grammar.
13146 (rhses.1): Allow one or more semicolons after any rule, including
13147 just before "|" as required by POSIX.
13148 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
13149 grammar.
13150
caf37a36
ADL
131512003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
13152
13153 %parse-param support for lalr1.cc.
13154
13155 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
13156 b4_cc_constructor_calls, b4_cc_constructor_call,
13157 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
13158 definitions.
13159 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
13160 parse-param arguments.
13161 (yy::b4_parser_class_name): Declare instance variables to
13162 hold parse-param arguments.
13163 * tests/calc.at: s/value/semantic_value/ because value clashes
13164 with a member of yy::b4_parser_class_name. Adjust C++ code
13165 to handle %parse-param. Enable %parse-param test in C++.
13166
3ab37077
PE
131672003-05-12 Paul Eggert <eggert@twinsun.com>
13168
13169 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
13170 English a bit. Fix fclose typo. Change "const char" to "char
13171 const", and use ANSI C rather than K&R for "main". Suggest
13172 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
13173 and suggest yy_switch_to_buffer.
13174
131752003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
13176
13177 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
13178 C89. This avoids a diagnostic on compilers that define __STDC__
13179 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 13180 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 13181
e743727f
PE
131822003-05-03 Paul Eggert <eggert@twinsun.com>
13183
13184 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
13185 Do not overrun array bounds.
13186 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 13187 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 13188
916708d5
AD
131892003-04-29 Akim Demaille <akim@epita.fr>
13190
13191 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
13192 * src/getargs.c, src/getargs.h: here, as bool, not int.
13193 (nondeterministic_parser): New.
13194 * src/parse-gram.y, src/scan-gram.l: Support
13195 %nondeterministic-parser.
13196 * src/output.c (prepare): Use nondeterministic_parser instead
13197 of glr_parser where appropriate.
13198 * src/tables.c (conflict_row, action_row, save_row)
13199 (token_actions, token_actions, pack_vector): Ditto.
13200
a06ea4aa
AD
132012003-04-29 Akim Demaille <akim@epita.fr>
13202
13203 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
13204
211074ca
AD
132052003-04-29 Akim Demaille <akim@epita.fr>
13206
13207 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
13208 with %pure-parser and %locations to exercise the patch from Yakov
13209 Markovitch below.
13210
6175ffe3
PE
132112003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
13212
13213 * data/yacc.c: (b4_lex_param): Corrected for the case where
13214 %lex-param is provided and %pure-parser isn't.
13215
b1e95857
PE
132162003-04-27 Paul Eggert <eggert@twinsun.com>
13217
13218 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 13219 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
13220 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
13221 if it is not defined.
13222 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
13223
acda9df6
PE
132242003-04-26 Paul Eggert <eggert@twinsun.com>
13225
3470c57b
PE
13226 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
13227 Declare to be of type suitable for the ninf value itself, not of
13228 type suitable for the corresponding table, since the latter might
13229 be unsigned but the ninf value might be negative. This fixes a
13230 bug reported by Alexandre Duret-Lutz in
161a71f3 13231 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 13232
acda9df6
PE
13233 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
13234 invokes it. We shouldn't invoke it twice because it will attempt
13235 to put error.o in the archive twice. This fixes a glitch reported
13236 by Martin Mokrejs in
161a71f3 13237 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 13238
b5250f26
PE
132392003-04-21 Paul Eggert <eggert@twinsun.com>
13240
13241 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
13242 to gnulib.
13243
089ac0f1
PE
132442003-04-21 Yakov Markovitch <Markovitch@iso.ru>
13245
13246 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
13247 Fix obvious typo that results in uncompilable GLR parsers
13248 when both %pure-parser and %locations are used. (trivial change)
13249
5ededac6
PE
132502003-04-17 Paul Eggert <eggert@twinsun.com>
13251
1b8f2fff
PE
13252 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
13253 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
13254 Do not insert the expected token via unput, as this runs afoul
13255 of a POSIX-compatibility bug in flex 2.5.31.
13256 All uses changed to BEGIN the parent state,
13257 since we no longer insert the expected token via unput.
13258 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
13259 that is no longer emitted after the above change.
13260
5ededac6
PE
13261 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
13262 the first one. This change is from Paul Hilfinger, and it fixes
13263 regression reported by Werner Lemberg in
161a71f3 13264 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
13265
13266 (resolve_sr_conflict): Don't invoke state_errs_set
13267 unless one or more tokens have been explicitly made errors.
13268 Otherwise, the above change causes Bison to abort.
13269
13270 * tests/existing.at (GNU pic Grammar): New test case, taken from
13271 Lemberg's email.
13272
b8be9132
AD
132732003-03-31 Akim Demaille <akim@epita.fr>
13274
13275 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
13276
d423d460
AD
132772003-03-31 Akim Demaille <akim@epita.fr>
13278
13279 * src/output.c (prepare_symbols): Avoid trailing spaces in the
13280 output.
13281
c7e441b4
AD
132822003-03-31 Akim Demaille <akim@epita.fr>
13283
13284 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
13285 From Paul Hilfinger.
13286
231897ad
AD
132872003-03-29 Akim Demaille <akim@epita.fr>
13288
13289 * m4/error.m4: Do not put under dynamic conditions some code which
13290 expansion is under static control.
13291
5b066063
AD
132922003-03-29 Akim Demaille <akim@epita.fr>
13293
13294 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
13295
22a74fec
AD
132962003-03-29 Akim Demaille <akim@epita.fr>
13297
13298 * doc/bison.texinfo (Strings are Destroyed): New.
13299
0eee27e7
PE
133002003-03-13 Paul Eggert <eggert@twinsun.com>
13301
13302 * .cvsignore: Add configure.lineno.
13303 * src/.cvsignore: Add yacc.
13304 * tests/.cvsignore: Add testsuite.log.
13305 * doc/fdl.texi: Sync with latest FSF version.
13306
f61aad93
PE
133072003-03-12 Paul Eggert <eggert@twinsun.com>
13308
537636c7
PE
13309 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
13310 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
13311 cursor, instead of leaving it undefined. This fixes a bug
13312 reported by Tim Van Holder in
161a71f3 13313 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
13314 * tests/input.at (Torturing the Scanner): Test the scanner on
13315 an empty input file, which was Tim Van Holder's test case.
13316
13317 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13318 <sys/resource.h> can be included, include sys/time.h and
13319 sys/times.h first, if available. This works around the SunOS
13320 4.1.4 porting bug reported by Bruce Becker in
161a71f3 13321 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
13322
13323 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13324 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13325 AC_HEADER_SYS_WAIT.
13326
f61aad93
PE
13327 Merge changes from gnulib. This was prompted because the CVS
13328 snapshot didn't build on Solaris 7 due to strnlen problems.
13329
13330 These changes need to be merged back into gnulib:
13331 * lib/hash.c: Include <stdbool.h> unconditionally.
13332 * m4/onceonly.m4 (m4_quote): New macro.
13333 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13334 Quote AC_FOREACH variable-expansions properly.
13335 The 2003-01-03 obstack.h change also needs merging.
13336 {end of changes requiring merging}
5b066063 13337
f61aad93
PE
13338 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13339 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13340 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13341 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13342 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13343 New files, imported from gnulib.
13344 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13345 above.
13346
13347 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13348 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13349 gnulib sources.
13350
13351 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13352 Add.
13353 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13354 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13355 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13356 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13357 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13358 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13359 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13360 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13361 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13362 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13363 (jm_PREREQ_ARGMATCH): Remove.
13364 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13365 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13366
13367 * src/system.h: Include <stdbool.h> unconditionally.
13368
13369 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13370 assuming at least C89 in the bitset code for some time now.
13371
d2ffe116
AD
133722003-03-03 Akim Demaille <akim@epita.fr>
13373
13374 * ro.po: New.
13375
052826fd
AD
133762003-03-02 Akim Demaille <akim@epita.fr>
13377
13378 * doc/bison.texinfo (Table of Symbols): Reactivate the
13379 documentation for %lex-param, and %parse-param.
13380
c4749565
AD
133812003-03-02 Akim Demaille <akim@epita.fr>
13382
13383 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13384 generate verbose error messages.
13385 Use the number of tokens as an upper bound in yytname, as it
13386 cannot be a non terminal.
13387
d5286af1
AD
133882003-03-02 Akim Demaille <akim@epita.fr>
13389
13390 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13391 message.
13392
22e304a6
AD
133932003-03-02 Akim Demaille <akim@epita.fr>
13394
22e304a6
AD
13395 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13396 Use them to exercise yycheck overrun.
13397 Based on Andrew Suffield's grammar.
13398
67a25fed
AD
133992003-03-02 Akim Demaille <akim@epita.fr>
13400
13401 Create tests/local.at for Bison generic testing macros.
13402
13403 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
13404 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
13405 This new file.
13406 * tests/calc.at (AT_CHECK_CALC): Adjust.
13407 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
13408 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
13409 * tests/local.at: here.
13410 (AT_COMPILE_CXX): Tags the tests using it as c++.
13411 Ignore the test if CXX is not functional.
13412
9c2b381f
PE
134132003-03-01 Paul Eggert <eggert@twinsun.com>
13414
13415 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
13416 not loc->end, since loc->end might contain garbage and this leads
13417 to undefined behavior on some platforms.
13418 (id_loc, token_start): Use (IF_LINTed) initial values that do not
13419 depend on *loc, so that the reader doesn't give the the false
13420 impression that *loc is initialized.
13421 (<INITIAL>"%%"): Do not bother setting code_start, since its value
13422 does not survive the return.
13423
0433ba88
AD
134242003-03-01 Akim Demaille <akim@epita.fr>
13425
13426 * src/scan-gram.l (code_start): Always initialize it when entering
13427 into yylex, as SC_EPILOGUE is activated *before* the corresponding
13428 yylex invocation. An alternative would be making it static, but
13429 then it starts with the second %%'s beginning, instead of its end.
13430
b305ea69
PE
134312003-02-28 Paul Eggert <eggert@twinsun.com>
13432
13433 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
13434 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 13435 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 13436
c3d25e01
PE
134372003-02-26 Paul Eggert <eggert@twinsun.com>
13438
13439 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
13440 Remove Sequent/Pyramid discussion (nobody uses them any more).
13441 Merge VMS and MS-DOS discussion; these ports may well be dead
13442 but let's keep mentioning them for now. Put <> around email
13443 addresses. Add copyright notice.
13444
c267ffbc
PE
134452003-02-24 Paul Eggert <eggert@twinsun.com>
13446
13447 * data/glr.c (yy_reduce_print): yylineno -> yylno,
13448 to avoid collision with flex use of yylineno.
13449 Problem reported by Bruce Lilly in
161a71f3 13450 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
13451 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13452 * data/yacc.c (yy_reduce_print): Likewise.
13453
13454 * config/depcomp: Sync with Automake 1.7.3.
13455
f939fc12
AD
134562003-02-21 Akim Demaille <akim@epita.fr>
13457
13458 * data/lalr1.cc: Use temporary variables instead of casts to
13459 change integer types.
13460 Suggested by Paul Eggert.
13461
95923bd6
AD
134622003-02-21 Akim Demaille <akim@epita.fr>
13463
13464 * doc/bison.texinfo: Use "location" consistently to refer to @n,
13465 to avoid confusions with lalr1.cc's notion of Position.
13466 Suggested by Paul Eggert.
13467
2cdc240e
AD
134682003-02-20 Akim Demaille <akim@epita.fr>
13469
13470 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
13471 before initial_columns.
13472 (location.hh): Use consistent variable names when defining the
13473 operator<<.
13474 Use "last" so that we subtract from Positions, not from unsigned.
13475
5d003116
AD
134762003-02-20 Akim Demaille <akim@epita.fr>
13477
13478 * data/lalr1.cc (position.hh): New subfile, including the extended
13479 and Doxygen'ed documentation of class Position.
13480 (location.hh): Use it.
13481 Document a` la Doxygen.
ba1ecc07 13482 With the help of Benoit Perrot.
5d003116 13483
d02b25f9
AD
134842003-02-20 Akim Demaille <akim@epita.fr>
13485
13486 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
13487 AT_YACC_IF.
13488 Redefine AT_YYERROR_SEES_LOC_IF using it.
13489 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
13490 not defined.
13491 Don't use the location in yy::Parser::error_ and
13492 yy::Parser::print_ when not %locations.
13493 Activate more lalr1.cc tests.
13494
0d1c3a04
AD
134952003-02-19 Akim Demaille <akim@epita.fr>
13496
13497 * data/lalr1.cc: When displaying a line number, be sure to make it
13498 an int.
13499
60a777aa
AD
135002003-02-19 Akim Demaille <akim@epita.fr>
13501
13502 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
13503 Remove, useless.
13504 (YYABORT, YYACCEPT, YYERROR): New.
13505 * tests/calc.at: Renable the lalr1.cc test.
13506
0b86fc41
AD
135072003-02-19 Akim Demaille <akim@epita.fr>
13508
13509 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
13510 error recovery, mixing with/without pops and discarding of the
13511 lookahead.
13512 Exercise YYERROR.
13513 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
13514
da99a5dc
PE
135152003-02-17 Paul Eggert <eggert@twinsun.com>
13516
13517 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
13518 * tests/testsuite.at (AT_COMPILE): Use them.
13519 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 13520 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 13521
93b8c255
PE
135222003-02-12 Paul Eggert <eggert@twinsun.com>
13523
13524 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
13525 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 13526 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
13527 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
13528 Check for malloc failure, for consistency with yacc.c.
13529 (yytname_size): Remove, for consistency with yacc.c.
13530
13531 The bug still remains in data/lalr1.cc, as I didn't have time
13532 to fix it there.
13533
7548fed2
AD
135342003-02-06 Akim Demaille <akim@epita.fr>
13535
13536 * configure.ac (GXX): Rename as...
13537 (CXX): this, to keep the original Autoconf semantics.
13538 Require 2.57.
13539 * data/lalr1.cc: Fix b4_copyright invocations.
13540 If YYDEBUG is not defined, don't depend upon name_ being defined.
13541 (location.hh): Include string and iostream.
13542 (Position::filename): New member.
13543 (Position::Position ()): New.
13544 (operator<< (Position)): New.
13545 (operator- (Position, int)): New.
13546 (Location::first, Location::last): Rename as...
13547 (Location::begin, Location::end): these, to mock the conventional
13548 iterator names.
13549 (operator<< (Location)): New.
13550 * tests/atlocal.in (CXX): New.
13551 * tests/testsuite.at (AT_COMPILE_CXX): New.
13552 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13553 locations in a more synthetic way.
13554 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13555 lalr1.cc is used.
13556 Adjust the C locations to match those from Emacs: first column is
13557 column 0.
13558 Change all the expected results.
13559 Conform to the GCS: simplify the locations when applicable.
13560 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13561 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13562 these CPP macros with the m4 macros new defined by...
13563 (AT_CHECK_PUSHDEFS): this, i.e.:
13564 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 13565 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
13566 New macros.
13567 (AT_CHECK_POPDEFS): Undefine them.
13568 (AT_CHECK_CALC_LALR1_CC): New.
13569 Use it for the first lalr1.cc test.
13570
43a176ef
AD
135712003-02-04 Akim Demaille <akim@epita.fr>
13572
13573 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13574 Location as is defined.
13575
fc049e9c
AD
135762003-02-04 Akim Demaille <akim@epita.fr>
13577
13578 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13579 name_ being defined.
13580
a737b216
PE
135812003-02-03 Paul Eggert <eggert@twinsun.com>
13582
13583 * src/gram.h (start_symbol): Remove unused decl.
13584
13585 Use more-consistent naming conventions for local vars.
13586
13587 * src/derives.c (derives_compute): Change type of local var from
13588 int to rule_number.
13589 * src/gram.c (grammar_rules_partial_print): Likewise.
13590 * src/print.c (print_core): Likewise.
13591 * src/reduce.c (reduce_grammar_tables): Likewise.
13592
13593 * src/gram.c (grammar_dump): Change name of item_number *
13594 local var from r to rp.
13595 * src/nullable.c (nullable_compute): Likewise.
13596
13597 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13598
13599 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13600 for symbol or symbol_number var.
13601 * src/reader.c (grammar_start_symbol_set): Likewise.
13602 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13603 Likewise.
13604 * src/state.c (transitions_to): Likewise.
13605 * src/state.h: Likewise.
13606 * src/tables.c (symbol_number_to_vector_number): Likewise.
13607
13608 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13609 char * var.
13610
13611 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13612 var.
13613
13614 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13615 var.
13616
13617 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13618 Use str, not s, for char * var. Use ch, not c, for character var.
13619 Use size for size var.
13620
13621 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13622 char * var.
13623 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13624 uniqstr var.
13625 * src/uniqstr.h: Likewise.
13626
13627 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13628 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13629 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13630 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13631 param to have same name as that of enum, so that we don't use
13632 "s" to stand for a non-state.
13633
68e93ad5
AD
136342003-02-02 Akim Demaille <akim@epita.fr>
13635
13636 * src/scan-skel.l: Scan more than one inert character per yylex
13637 invocation.
13638
92898986
PE
136392003-02-01 Paul Eggert <eggert@twinsun.com>
13640
13641 Version 1.875a.
13642
1d9d5d71
PE
13643 * po/LINGUAS: Add ms.
13644
0435d061
AD
136452003-01-30 Akim Demaille <akim@epita.fr>
13646
13647 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13648
6029a57f
PH
136492003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13650
13651 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13652 of $1.
0435d061
AD
13653
13654 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 13655 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 13656 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 13657
6029a57f
PH
13658 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13659 (b4_rhs_location): Ditto.
0435d061 13660 (yyfill): New function to copy from stack tree into array
6029a57f 13661 incrementally.
0435d061
AD
13662 (yyuserAction): Modify to allow incremental move of semantic values
13663 to rhs array when in GLR mode.
13664 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
13665 as needed.
13666 Remove dummy use of yystack, as there is now a guaranteed use.
13667 (yydoAction): Modify to allow incremental move of semantic values
13668 to rhs array when in GLR mode.
13669 (yyresolveAction): Ditto.
13670 (yyglrShiftDefer): Update comment.
0435d061 13671 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
13672 (yyglrReduce): Ditto.
13673 (yydoAction): Ditto
0435d061 13674
6029a57f
PH
13675 * tests/glr-regr1.at: Rename to ...
13676 * tests/glr-regression.at: Add new regression test for the problems
13677 described above (adapted from S. Eken).
13678 Update copyright notice.
13679 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13680 * tests/Makefile.am: Ditto.
13681
6cee6297
PE
136822003-01-28 Paul Eggert <eggert@twinsun.com>
13683
13684 * data/lalr1.cc: Do not use @output_header_name@ unless
13685 b4_defines_flag is set. This fixes two bugs reported by
13686 Tim Van Holder in
161a71f3
PE
13687 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13688 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 13689
b2a836b5
PE
136902003-01-21 Paul Eggert <eggert@twinsun.com>
13691
13692 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13693 we don't need to worry about yyerrlab1 being reported as an
13694 "unused label" by non-GCC C compilers. The downside is that if
13695 locations are used then a couple of statements are duplicated each
13696 time YYERROR is invoked, but the upside is that the warnings
13697 should vanish.
13698 (yyerrlab1): Move code to YERROR.
13699 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13700 This reverts some of the 2002-12-27 change.
13701
4196b931
PE
137022003-01-17 Paul Eggert <eggert@twinsun.com>
13703
13704 * src/output.c (symbol_printers_output): Fix typo that led
13705 to core dump. Problem reported by Antonio Rus in
161a71f3 13706 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 13707
3ae831b4
AD
137082003-01-13 Akim Demaille <akim@epita.fr>,
13709 Quoc Peyrot <chojin@lrde.epita.fr>,
13710 Robert Anisko <anisko_r@lrde.epita.fr>
13711
13712 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13713 when the stacks contain one element, as the loop would otherwise
13714 free the last state, and then use the top state (the one we just
13715 popped). This means that the initial elements will not be freed
13716 explicitly, as is the case in yacc.c; it is not a problem, as
13717 these elements have fake values.
13718
e3aa65c5
PE
137192003-01-11 Paul Eggert <eggert@twinsun.com>
13720
13721 * NEWS: %expect-violations are now just warnings, reverting
13722 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13723 bootstrapping problem reported by Matthias Klose; see
161a71f3 13724 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
13725 * src/conflicts.c (conflicts_print): Likewise.
13726 * tests/conflicts.at (%expect not enough, %expect too much,
13727 %expect with reduce conflicts): Likewise.
13728 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13729 that the warning is enabled if the number of conflicts changes
13730 (not necessarily increases).
13731
13732 * src/getargs.c (version): Update copyright year.
13733
f0057011
AD
137342003-01-09 Akim Demaille <akim@epita.fr>
13735
13736 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13737
1ee6d2a0
PE
137382003-01-08 Paul Eggert <eggert@twinsun.com>
13739
13740 * Makefile.maint (WGETFLAGS):
13741 New macro, containing "-C off" to disable proxy caches.
13742 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13743 (rel-check): Use $(WGET) instead of wget.
13744
d4fd77c4
PE
137452003-01-06 Paul Eggert <eggert@twinsun.com>
13746
13747 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13748 the GLR paper of Scott, Johnstone and Hussain.
13749
464c6927
PE
137502003-01-04 Paul Eggert <eggert@twinsun.com>
13751
d600ee67
PE
13752 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13753 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13754 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13755 (EXTRA_LIBRARIES): New var, for liby.a.
13756 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13757 (EXTRA_SCRIPTS): New var, for yacc.
13758
464c6927
PE
13759 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13760 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13761 Problem reported by Nelson H. F. Beebe.
13762
137632003-01-03 Paul Eggert <eggert@twinsun.com>
13764
13765 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13766 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13767 when compiling Bison 1.875's `bitset bset = obstack_alloc
13768 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13769
13770 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13771 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13772 grow to a huge size with typical invocation.
d600ee67 13773
464c6927
PE
13774 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13775 Use the pattern recommended by Autoconf 2.57, except also protect
13776 against double-definition.
13777 * src/system.h: Likewise.
13778 Portability issues reported by Nelson H. F. Beebe.
d600ee67 13779
464c6927
PE
13780 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13781 All uses changed. Provide a definition in both C and C++.
13782 (yytrue, yyfalse): Define even if defined (__cplusplus).
13783
13784 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13785 Reported by Nelson H. F. Beebe.
d600ee67 13786
464c6927
PE
13787 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13788
0f42c7d5
PE
137892003-01-02 Paul Eggert <eggert@twinsun.com>
13790
13791 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13792 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13793 Bug reported by Nelson H. F. Beebe.
13794
dc546b0f
PE
137952003-01-01 Paul Eggert <eggert@twinsun.com>
13796
13797 * Version 1.875.
13798
2c09b6a7
PE
137992002-12-30 Paul Eggert <eggert@twinsun.com>
13800
13801 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13802 Moved here from...
13803 (<INITIAL>","): Here. This causes stray "," to be treated
13804 more uniformly.
13805
dc546b0f 13806 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
13807 last brace in braced code when not in Yacc mode, for compatibility
13808 with Bison 1.35. This resurrects the 2001-12-15 patch to
13809 src/reader.c.
13810
13811 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13812 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13813
535c0f63
PE
138142002-12-28 Paul Eggert <eggert@twinsun.com>
13815
13816 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13817 that of SYM's type. This fixes Debian bug 168069, reported by
13818 Thomas Olsson.
d600ee67 13819
963fcc17
PE
138202002-12-28 Paul Eggert <eggert@twinsun.com>
13821
13822 Version 1.75f.
13823
13824 Switch back to the Yacc style of conflict reports, undoing some
13825 of the 2002-07-30 change.
13826 * doc/bison.texinfo (Understanding): Use Yacc style for
13827 conflict reports. Also, use new way of locating rules.
13828 * src/conflicts.c (conflict_report):
13829 Renamed from conflict_report_yacc, removing the old
13830 'conflict_report'. Translate the entire conflict report at once,
13831 so that we don't assume that "," has the same interpretation in
13832 all languages.
13833 (conflicts_output): Use Yacc-style conflict report for each state,
13834 instead of our more-complicated style.
13835 (conflicts_print): Use Yacc-style conflict report, except print
13836 the input file name when not emulating Yacc.
13837 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13838 Conflicted Reduction, %expect not enough, %expect too much,
13839 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13840 * tests/existing.at (GNU Cim Grammar): Likewise.
13841 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13842
13843 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13844 fatal): Don't invoke fflush; it's not needed and it might even be
13845 harmful for stdout, as stdout might not be open.
13846 * src/reduce.c (reduce_print): Likewise.
13847
b1efe548
PE
138482002-12-27 Paul Eggert <eggert@twinsun.com>
13849
13850 Fix a bug where error locations were not being recorded correctly.
13851 This problem was originally reported by Paul Hilfinger in
161a71f3 13852 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
13853
13854 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13855 top of the location stack's error locations.
13856 (yyerrlab): Set it. When discarding a token, push its location
13857 onto yylerrsp so that we don't lose track of the error's end.
13858 (yyerrlab1): Now is only the target of YYERROR, so that we can
13859 properly record the location of the action that failed. For GCC
13860 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13861 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13862 (yyerrlab2): New label, which yyerrlab now falls through to.
13863 Compute the error's location by applying YYLLOC_DEFAULT to
13864 the locations of all the symbols that went into the error.
13865 * doc/bison.texinfo (Location Default Action): Mention that
13866 YYLLOC_DEFAULT is also invoked for syntax errors.
13867 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13868 Error locations include the locations of all the tokens that were
13869 discarded, not just the last token.
d600ee67 13870
983c5c2c
PE
138712002-12-26 Paul Eggert <eggert@twinsun.com>
13872
b1efe548
PE
13873 * src/files.c: Include quote.h.
13874 (compute_output_file_names): Warn if we detect conflicting
13875 outputs to the same file. This should catch the misunderstanding
13876 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13877
13878 * src/conflicts.c (conflicts_print): If the user specifies
13879 "%expect N", report an error if there are any reduce/reduce
13880 conflicts. This is what the manual says should happen.
13881 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13882 * tests/conflicts.at (%expect with reduce conflicts): New test.
13883
983c5c2c
PE
13884 Don't use m4_include on relative file names, as it doesn't work as
13885 desired if there happens to be a file with that name under ".".
d600ee67 13886
983c5c2c
PE
13887 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13888 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13889 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13890 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13891 * src/output.c (output_skeleton): Use full path names when
13892 specifying a file to include; don't rely on include path, as
13893 it's unreliable when the working file contains a file with
13894 that name.
d600ee67 13895
983c5c2c
PE
138962002-12-25 Paul Eggert <eggert@twinsun.com>
13897
13898 Remove obsolete references to bison.simple and bison.hairy.
13899 Problem mentioned by Aubin Mahe in
161a71f3 13900 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
13901 * data/glr.c: Comment fix.
13902 * doc/bison.1: Remove references. Also, mention "yacc".
13903
13904 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
13905 with -g option.
13906
13907 * src/parse-gram.y (declaration): Use enum "report_states" rather
13908 than its numeric value 1.
13909
13910 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
13911 opening a new one. This fixes Debian bug 165349, reported by
13912 Bruce Stephens.
13913
23f2d9dc
PE
139142002-12-24 Paul Eggert <eggert@twinsun.com>
13915
13916 Version 1.75e.
13917
13918 * Makefile.maint (cvs-update): Don't assume that the shell
13919 supports $(...), as Solaris sh doesn't.
13920
13921 * src/parse-gram.y (lloc_default): Remove test for empty
13922 nonterminals at the end, since it didn't change the result.
13923
139242002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
13925
13926 If the user does not define YYSTYPE as a macro, Bison now declares it
13927 using typedef instead of defining it as a macro. POSIX requires this.
13928 For consistency, YYLTYPE is also declared instead of defined.
13929
13930 %union directives can now have a tag before the `{', e.g., the
13931 directive `%union foo {...}' now generates the C code
13932 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
13933 The default union tag is `YYSTYPE', for compatibility with Solaris 9
13934 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
13935 instead of `yyltype'.
13936
13937 `yystype' and `yyltype' are now obsolescent macros instead of being
13938 typedefs or tags; they are no longer documented and will be
13939 withdrawn in a future release.
13940
13941 * data/glr.c (b4_location_type): Remove.
13942 (YYSTYPE): Renamed from yystype.
13943 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
13944 (struct YYLTYPE): Renamed from struct yyltype.
13945 (YYLTYPE): Renamed from yyltype.
13946 (yyltype, yystype): New (and obsolescent) macros,
13947 for backward compatibility.
13948 * data/yacc.c: Likewise.
13949
13950 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
13951 does not specify a union tag. This is for compatibility with
13952 Solaris 9 yacc.
13953
13954 * src/parse-gram.y (add_param): 2nd arg is now char * not char
13955 const *, since it is now modified by stripping surrounding { }.
13956 (current_braced_code): Remove.
13957 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
13958 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
13959 trailing " {...}". Now of type <chars>.
13960 (grammar_declaration): Adjust to bundled tokens.
13961 (code_content): Remove; stripping is now done by add_param.
13962 (print_token_value): Print contents of bundled tokens.
13963 (token_name): New function.
13964
13965 * src/reader.h (braced_code, current_braced_code): Remove.
13966 (token_name): New decl.
13967
13968 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
13969 token_type, not braced_code code_kind. All uses changed.
13970 (SC_PRE_CODE): New state, for scanning after a keyword that
13971 has (or usually has) an immediately-following braced code.
13972 (token_type): New local var, to keep track of which token type
13973 to return when scanning braced code.
13974 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 13975 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
13976 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
13977 instead of returning a token type immediately.
13978 (<INITIAL>"{"): Set token type.
13979 (<SC_BRACED_CODE>"}"): Use it.
13980 (handle_action_dollar, handle_action_at): Now returns bool
13981 indicating success. Fail if ! current_rule; this prevents a core dump.
13982 (handle_symbol_code_dollar, handle_symbol_code_at):
13983 Remove; merge body into caller.
13984 (handle_dollar, handle_at): Complain in invalid contexts.
13985
13986 * NEWS, doc/bison.texinfo: Document the above.
13987 * NEWS: Fix years and program names in copyright notice.
13988
879ca4f8
PE
139892002-12-17 Paul Eggert <eggert@twinsun.com>
13990
13991 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
13992 Reporting, Table of Symbols): Omit mentions of %lex-param and
13993 %parse-param from the documentation for now.
13994
1c5fe69d
PE
139952002-12-15 Paul Eggert <eggert@twinsun.com>
13996
13997 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
13998 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
13999 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
14000 disagreed with the Bison documentation. Bug
14001 reported by Andrew Walrond.
d600ee67 14002
1c5fe69d
PE
14003 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14004 as the caller now does that.
14005 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14006 (YYEMPTY): Parenthesize right hand side, since others use it.
14007 (yyparse): Don't assume that our generated code is the only code
14008 that sets yychar.
14009
d1de5372
PE
140102002-12-13 Paul Eggert <eggert@twinsun.com>
14011
14012 Version 1.75d.
14013
14014 POSIX requires a "yacc" command.
14015 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
14016 (MOSTLYCLEANFILES): Add yacc.
14017 (yacc): New rule.
1c5fe69d 14018 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
14019 as an alias for bison y.
14020
14021 * po/LINGUAS: Add da.
d600ee67 14022
d1de5372
PE
14023 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
14024 problem with latest <getopt.h>.
14025 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
14026
14027 * doc/fdl.texi: Upgrade to 1.2.
14028 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
14029 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
14030 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
14031 gnulib.
14032 * config/install-sh: Sync with autotools.
14033
14034 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 14035 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
14036 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
14037 locations are requested.
14038 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
14039 locations are requested.
14040
d0f3fe23
PE
140412002-12-12 Paul Eggert <eggert@twinsun.com>
14042
14043 Remove unportable casts and storage allocation tricks.
14044 While we're at it, remove almost all casts, since they
14045 usually aren't needed and are a sign of trouble.
14046
14047 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
14048
14049 * src/derives.c (derives_compute): Do not subtract NTOKENS from
14050 the pointer DSET returned by malloc; this isn't portable.
14051 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
14052 Similarly for DERIVES.
14053 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
14054 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
14055 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
14056
14057 * src/derives.c (derives_compute): Do not bother invoking
14058 int_of_rule_number, since rule numbers are integers.
14059
14060 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
14061 rather than XMALLOC (char, N).
14062
14063 * src/files.c (filename_split): Rewrite to avoid cast.
14064
14065 * src/gram.h (symbol_number_as_item_number,
14066 item_number_as_symbol_number, rule_number_as_item_number,
14067 item_number_as_rule_number):
14068 Now inline functions rather than macros, to avoid casts.
14069 * src/state.h (state_number_as_int): Likewise.
14070 * src/tables.c (state_number_to_vector_number,
14071 symbol_number_to_vector_number): Likewise.
14072
14073 * src/gram.h (int_of_rule_number): Remove; no longer used.
14074
14075 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
14076 since the resulting storage is always stored into.
14077
14078 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
14079 where it's needed.
14080
14081 * src/muscle_tab.c (muscle_m4_output):
14082 Now inline. Return bool, not int.
14083 * src/state.c (state_compare): Likewise.
14084 * src/symtab.c (symbol_check_defined,
14085 symbol_check_alias_consistency, symbol_pack, symbol_translation,
14086 hash_compare_symbol, hash_symbol):
14087 Likewise.
14088 * src/uniqstr.c (uniqstr_print): Likewise.
14089 * src/muscle_tab.c (muscle_m4_output_processor):
14090 New function, to avoid casts.
14091 * src/state.c (state_comparator, stage_hasher): Likewise.
14092 * src/symtab.c (symbol_check_defined_processor,
14093 symbol_check_alias_consistency_processor, symbol_pack_processor,
14094 symbol_translation_processor, hash_symbol_comparator,
14095 hash_symbol_hasher): Likewise.
14096 * src/uniqstr.c (uniqstr_print_processor): Likewise.
14097 * src/muscle_tab.c (muscles_m4_output):
14098 Use new functions instead of casting old functions unportably.
14099 * src/state.c (state_hash_new): Likewise.
14100 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
14101 symbols_token_translations_init):
14102 Likewise.
14103 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
14104
14105 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
14106 var instead of casting to long, to avoid casts.
14107 (prepare_states): Use MALLOC rather than alloca, so that we don't
14108 have to worry about alloca.
14109 * src/state.c (state_hash_lookup): Likewise.
14110
14111 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
14112 local var instead of casting to unsigned char, to avoid casts.
14113
14114 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
14115 STATE_ALLOC): Remove.
14116 (transitions_new, errs_new, reductions_new, state_new): Use malloc
14117 rather than calloc, and use offsetof to avoid allocating slightly
14118 too much storage.
14119 (state_new): Initialize all members.
14120
14121 * src/state.c (state_hash): Use unsigned accumulator, not signed.
14122
14123 * src/symtab.c (symbol_free): Remove; unused.
14124 (symbol_get): Remove cast in lhs of assignment.
14125 (symbols_do): Now static. Accept generic arguments, not
14126 hashing-related ones.
14127
14128 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
14129 (symbol_processor): Remove.
14130 (symbols_do): Remove decl; now static.
14131
14132 * src/system.h (alloca): Remove; decl no longer needed.
14133 (<stddef.h>): Include, for offsetof.
14134 (<inttypes.>, <stdint.h>): Include if available.
14135 (uintptr_t): New type, if system lacks it.
14136 (CALLOC, MALLOC, REALLOC): New macros.
14137 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
14138 new macros.
14139
14140 * src/tables.c (table_size): Now int, to pacify GCC.
14141 (table_grow, table_ninf_remap): Use signed table size.
14142 (save_row): Don't bother initializing locals when not needed.
14143 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
14144 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
14145
14146 * src/vcg.h: Correct misspellings.
14147
14148 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
14149
14150
14151 * src/getargs.c (getargs): Don't assume EOF == -1.
14152
26b4a969
PE
141532002-12-09 Paul Eggert <eggert@twinsun.com>
14154
14155 Change identifier spellings to avoid collisions with names
14156 that are reserved by POSIX.
14157
14158 Don't use names ending in _t, since POSIX reserves them.
14159 For consistency, remove _e and _s endings -- they're weren't
14160 needed to remove ambiguity. All uses changed.
14161 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
14162 turn was just renamed from struniq_t.
14163 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
14164 which in turn was just renamed from struniq_processor_t.
14165 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
14166 in turn was renamed from hash_compare_struniq_t.
14167 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
14168 (state_list): Renamed from state_list_t.
14169 * src/assoc.h (assoc): Renamed from assoc_t.
14170 * src/conflicts.c (enum conflict_resolution): Renamed from
14171 enum conflict_resolution_e.
14172 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
14173 (rule_list): Renamed from rule_list_t.
14174 * src/getargs.h (enum trace): Renamed from enum trace_e.
14175 (enum report): Renamed from enum report_e.
14176 * src/gram.h (item_number): Renamed from item_number_t.
14177 (rule_number): Renamed from rule_number_t.
14178 (struct rule_s): Remove the "rule_s" part; not used.
14179 (rule): Renamed from rule_t.
14180 (rule_filter): Renamed from rule_filter_t.
14181 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
14182 (goto_list): Renamed from goto_list_t.
14183 * src/lalr.h (goto_number): Renamed from goto_number_t.
14184 * src/location.h (location): Renamed from location_t.
14185 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
14186 and moved here from:
14187 * src/muscle_tab.h (muscle_entry_t): here.
14188 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
14189 (rule_list): Renamed from rule_list_t.
14190 * src/print_graph.c (static_graph): Renamed from graph.
14191 * src/reader.h (braced_code): Renamed from braced_code_t.
14192 Remove brace_code_e tag.
14193 * src/relation.h (relation_node): Renamed from relation_node_t.
14194 (relation_nodes): Renamed from relation_nodes_t.
14195 (relation): Renamed from relation_t.
14196 * src/state.h (state_number): Renamed from state_number_t.
14197 (struct state): Renamed from struct state_s.
14198 (state): Renamed from state_t.
14199 (transitions): Renamed from transitions_t. Unused (and
14200 misspelled) transtion_s tag removed.
14201 (errs): Renamed from errs_t. Unused errs_s tag removed.
14202 (reductions): Renamed from reductions_t. Unused tag
14203 reductions_s removed.
14204 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
14205 (struct symbol_list): Renamed from struct symbol_list_s.
14206 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
14207 (struct symbol): Renamed from struct symbol_s.
14208 (symbol): Renamed from symbol_t.
14209 * src/tables.c (vector_number): Renamed from vector_number_t.
14210 (action_number): Renamed from action_t.
14211 * src/tables.h (base_number): Renamed from base_t.
14212 * src/vcg.h (enum color): Renamed from enum color_e.
14213 (enum textmode): Renamed from enum textmode_e.
14214 (enum shape): Renamed from enum shape_e.
14215 (struct colorentry): Renamed from struct colorentry_s.
14216 (struct classname): Renamed from struct classname_s.
14217 (struct infoname): Renamed from struct infoname_s.
14218 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
14219 (enum decision): Renamed from enum decision_e.
14220 (enum orientation): Renamed from enum orientation_e.
14221 (enum alignment): Renamed from enum alignment_e.
14222 (enum arrow_mode): Renamed from enum arrow_mode_e.
14223 (enum crossing_type): Renamed from enum crossing_type_e.
14224 (enum view): Renamed from enum view_e.
14225 (struct node): Renamed from struct node_s.
14226 (node): Renamed from node_t.
14227 (enum linestyle): Renamed from enum linestyle_e.
14228 (enum arrowstyle): Renamed from enum arrowstyle_e.
14229 (struct edge): Renamed from struct edge.
14230 (edge): Renamed from edge_t.
14231 (struct graph): Renamed from struct graph_s.
14232 (graph): Renamed from graph_t.
14233 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
14234 Rename value_t -> value.
14235 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
14236 value_t_as_yystype -> value_as_yystype.
14237
14238 Don't include <errno.h> in the mainstream code, since it
14239 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
14240 * lib/get-errno.c, lib/get-errno.h: New files.
14241 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
14242 get-errno.c.
14243 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
14244 * src/output.c (output_skeleton): Likewise.
14245 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
14246 instead of errno.
14247 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
14248 Likewise.
14249 (handle_action_dollar, handle_action_at): Likewise.
14250 * src/system.h: Do not include <errno.h>.
14251 (TAB_EXT): Renamed from EXT_TAB.
14252 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
14253
14254 Avoid str[a-z]*, since <string.h> reserves that name space.
14255 Change all instances of "struniq" in names to "uniqstr", and
14256 likewise for "STRUNIQ" and "UNIQSTR".
14257 * src/uniqstr.c: Renamed from src/struniq.c.
14258 * src/uniqstr.h: Renamed from src/struniq.h.
14259 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
14260 * src/files.c (strsuffix): Remove; unused.
14261 (concat2): Renamed from stringappend. Now static.
14262 * src/files.h (strsuffix, stringappend): Remove; unused.
14263 * src/parse-gram.y (<chars>): Renamed from <string>.
14264 (<uniqstr>): Renamed from <struniq>.
14265 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
14266 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
14267 (struct graph_s.expand): Renamed from struct graph_s.stretch.
14268 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
14269 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
14270 (N_EXPAND): Renamed from N_STRETCH.
14271
14272 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
14273 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
14274 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
14275 Remove; unused.
14276 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
14277 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
14278 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
14279 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
14280 (BASE_MAXIMUM): Renamed from BASE_MAX.
14281 (BASE_MINIMUM): Renamed from BASE_MIN.
14282 (ACTION_MAX): Remove; unused.
14283 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
14284 Unnecessary casts removed from above defines.
14285
14286
14287 Fix misspelling in names.
14288 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
14289 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
14290 G_NODE_ALIGNEMENT.
14291
14292
14293 * lib/timevar.c (timevar_report): Renamed from time_report,
14294 for consistency with other names.
14295 * lib/timevar.h (timevar_report): New decl.
14296 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
14297
14298
14299 Sort include-file uses.
14300
14301 Reorder all include files under src to be in the order "system.h".
14302 then the ../lib include files in angle brackets (alphabetized),
14303 then the . include files in double-quotes (alphabetized). Fix
14304 dependency breakages encountered in this process, as follows:
14305 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
14306 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
14307 * src/state.h: Include "symtab.h".
14308
996b1c7e
PE
143092002-12-08 Paul Eggert <eggert@twinsun.com>
14310
14311 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
14312 since this causes problems when __file__ contains character
14313 sequences like "@" that are treated specially by src/scan-skel.l.
14314 Instead, just use the file's basename. This fixes the bug
14315 reported by Martin Mokrejs in
161a71f3 14316 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 14317
e19c4e5d
PE
143182002-12-06 Paul Eggert <eggert@twinsun.com>
14319
14320 Add support for rules that do not have trailing semicolons, as
14321 POSIX requires. Improve the quality of locations in Bison
14322 diagnostics.
26b4a969 14323
e19c4e5d
PE
14324 * src/location.c: Include <quotearg.h>.
14325 (empty_location): Now const.
14326 (location_print): New function. Follow the recommendation of the
14327 GNU Coding Standards for locations that span file boundaries.
14328 * src/location.h: Do not include <quotearg.h>; no longer needed.
14329 (boundary): New type.
14330 (location_t): Use it. This allows locations to span file boundaries.
14331 All member uses changed: file -> start.file or end.file (as needed),
14332 first_line -> start.line, first_column -> start.column,
14333 last_line -> end.line, last_column -> end.column.
14334 (equal_boundaries): New function.
14335 (LOCATION_RESET, LOCATION_STEP): Remove.
14336 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14337 (empty_location): Now const.
14338 (location_print): New decl.
14339 * src/parse-gram.y (lloc_default): New function, which handles
14340 empty locations more accurately.
14341 (YYLLOC_DEFAULT): Use it.
14342 (%token COLON): Remove.
14343 (%token ID_COLON): New token.
26b4a969 14344 (rules): Use it.
e19c4e5d
PE
14345 (declarations, rules): Remove trailing semicolon.
14346 (declaration, rules_or_grammar_declaration):
14347 Allow empty (";") declaration.
14348 (symbol_def): Remove empty actions; no longer needed.
14349 (rules_or_grammar_declaration): Remove trailing semicolon.
14350 (semi_colon.opt): Remove.
14351 * src/reader.h: Include location.h.
14352 (scanner_cursor): New decl.
14353 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14354 rolling our own.
14355 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14356 of *loc.
14357 (STEP): Remove. No longer needed, now that adjust_location does
14358 the work. All uses removed.
14359 (scanner_cursor): New var.
14360 (adjust_location): Renamed from extend_location. It now sets
14361 *loc and adjusts the scanner cursor. All uses changed.
14362 Don't bother testing for CR.
14363 (handle_syncline): Remove location arg; now updates scanner cursor.
14364 All callers changed.
14365 (unexpected_end_of_file): Now accepts start boundary of token or
14366 comment, not location. All callers changed. Update scanner cursor,
14367 not the location.
14368 (SC_AFTER_IDENTIFIER): New state.
14369 (context_state): Renamed from c_context. All uses changed.
14370 (id_loc, code_start, token_start): New local vars.
14371 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14372 processing of Yacc white space and equivalents here.
14373 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14374 instead of returning ID immediately, since we need to search for
14375 a subsequent colon.
14376 (<INITIAL>"'", "\""): Save token_start.
14377 (<INITIAL>"%{", "{", "%%"): Save code_start.
14378 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14379 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14380 BEGIN context_state at end, not INITIAL.
14381 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14382 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14383 Return correct token start.
14384 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14385 the start of a character, string or multiline comment is found.
14386 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14387 Reduction): Adjust reported locations to match the more-precise
14388 results now expected.
14389 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14390 * tests/reduce.at (Useless Rules, Reduced Automaton,
14391 Underivable Rules): Likewise.
14392 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14393 or "|"' now that so many other tokens are allowed by the new grammar.
14394
14395 * src/complain.h (current_file): Remove duplicate decl;
14396 current_file is now owned by files.h.
14397 * src/complain.c, src/scan-gram.l: Include files.h.
14398
143992002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 14400
e19c4e5d
PE
14401 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
14402 promotes to int; it might be unsigned int.
14403 * data/yacc.c (yy_reduce_print): Likewise.
14404
14405 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
14406 be #defined in the prologue, not in the Bison declarations.
14407 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 14408
b64755e3
PE
144092002-12-02 Paul Eggert <eggert@twinsun.com>
14410
14411 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
14412 * lib/strtoul.c: New file, from gnulib.
14413 This fixes a porting bug reported by Peter Klein in
161a71f3 14414 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 14415
6e746484
PE
144162002-11-30 Paul Eggert <eggert@twinsun.com>
14417
b64755e3
PE
14418 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
14419 and put only a forward declaration in the prologue. This is for
14420 consistency with the other scanner helper functions.
14421
6ba55592
PE
14422 Type clashes now generate warnings, not errors, since it
14423 appears that POSIX may allow some grammars with type clashes.
14424 * src/reader.c (grammar_current_rule_check): Warn about
14425 type clashes instead of complaining.
14426 * tests/input.at (Type Clashes): Expect warnings, not complaints.
14427
6e746484
PE
14428 Add Yacc library, since POSIX requires it.
14429 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
14430 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
14431 * lib/main.c, lib/yyerror.c: New files.
14432
14433 gram_error can be static; it need not be extern.
14434 * src/reader.h (gram_error): Remove decl.
14435 * src/parse-gram.y (gram_error): Now static. Add static decl.
14436 (print_token_value): Omit parameter names from forward decl,
14437 for consistency.
14438
88510f9c
PE
144392002-11-29 Paul Eggert <eggert@twinsun.com>
14440
6e746484
PE
14441 * doc/bison.texinfo: Emphasize that yylex and yyerror must
14442 be declared before being used. E.g., one should typically
14443 declare them in the prologue. Use GNU coding style in examples.
14444 Put "const" consistently after the type it modifies. Mention
14445 that C99 supports "inline". Mention that yyerror traditionally
14446 returns "int".
14447
88510f9c
PE
14448 %parse-param and %lex-param now take just one argument, the
14449 declaration; the argument name is deduced from the declaration.
14450
14451 * doc/bison.texinfo (Parser Function, Pure Calling, Error
14452 Reporting, Table of Symbols): Document this.
14453 * src/parse-gram.y (add_param): New function.
14454 (COMMA): Remove.
14455 (declaration): Implement new rule for %parse-param and %lex-param.
14456 * src/scan-gram.l: "," now elicits a warning, rather than being
14457 a token; this is more compatible with byacc.
14458 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
14459
bb92250c
PE
144602002-11-27 Paul Eggert <eggert@twinsun.com>
14461
14462 Rename identifiers to avoid real and potential collisions.
14463
14464 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
14465 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 14466 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
14467 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
14468 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
14469 * src/parse-gram.y (print_token_value): Renamed from yyprint.
14470 All uses changed.
14471 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
14472 The name "yycontrol" violates the name space rules, and this stuff
14473 wasn't being used anyway.
14474 (input): Remove action; this stuff wasn't being used.
14475 (gram_error): Rename local variable yylloc -> loc.
14476 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
14477 (YY_DECL): Don't use "yy" at start of local variables.
14478 All uses changed, e.g., yylloc -> loc.
14479 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
14480 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
14481 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
14482 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
14483
14484 * src/parse-gram.y (gram_error): loc is now const *.
14485 * src/reader.h (gram_error): Likewise.
14486
3af4feb2
PE
144872002-11-24 Paul Eggert <eggert@twinsun.com>
14488
14489 Version 1.75c.
14490
14491 * tests/actions.at (Actions after errors): Use an output format
14492 more similar to that of the Printers and Destructors test.
14493 Test the position of the ';' token too.
14494 (Printers and Destructors): Likewise.
14495 (Printers and Destructors: %glr-parser): Remove for now, to avoid
14496 unnecessarily alarming people when the test fails.
14497
14498 * data/yacc.c (yyerrlab1): Move this label down, so that the
14499 parser does not discard the lookahead token if the user code
14500 invokes YYERROR. This change is required for POSIX conformance.
14501
14502 * lib/error.c: Sync with gnulib.
14503
145042002-11-22 Paul Eggert <eggert@twinsun.com>
14505
14506 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
14507 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
14508 * lib/xmalloc.c: Likewise.
26b4a969 14509
58004308
PE
145102002-11-20 Paul Eggert <eggert@twinsun.com>
14511
14512 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
14513
145142002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 14515
58004308
PE
14516 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
14517 should use `if (! x) abort ();' rather than `assert (x);', and
14518 anyway it's one less thing to worry about configuring.
14519
14520 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
14521 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
14522 and replace all instances of assert with abort.
14523 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
14524 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
14525
14526 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
14527 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
14528 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
14529 hash_find_entry, hash_rehash, hash_insert): Likewise.
14530 * src/conflicts.c (resolve_sr_conflict): Likewise.
14531 * src/lalr.c (set_goto_map, map_goto): Likewise.
14532 * src/nullable.c (nullable_compute): Likewise.
14533 * src/output.c (prepare_rules, token_definitions_output): Likewise.
14534 * src/reader.c (packgram, reader): Likewise.
14535 * src/state.c (state_new, state_free, state_transitions_set,
14536 state_reduction_find): Likewise.
14537 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
14538 symbol_pack): Likewise.
14539 * src/tables.c (conflict_row, pack_vector): Likewise.
14540 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14541 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14542 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
14543 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
14544
14545 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
14546 (ARGMATCH_CONSTRAINT): New macro.
14547 (ARGMATCH_ASSERT): Use it.
14548
14549 * src/system.h (verify): New macro.
14550 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
14551 rather than assert.
14552 * src/tables.c (tables_generate): Likewise.
14553
14554 * src/struniq.c (struniq_assert): Now returns void, and aborts
14555 if the assertion is false.
14556 (struniq_assert_p): Remove.
14557 * src/struniq.h: Likewise.
14558
76ae8198
PE
145592002-11-18 Paul Eggert <eggert@twinsun.com>
14560
14561 * data/glr.c (yygetLRActions): Replace `yyindex' with
14562 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14563 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 14564 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 14565
d3c4e709
AD
145662002-11-18 Akim Demaille <akim@epita.fr>
14567
14568 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14569 space.
14570 From Tim Van Holder.
14571
8d8a7238
PE
145722002-11-17 Paul Eggert <eggert@twinsun.com>
14573
14574 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14575 to "SyntaxError" for consistency with my 2002-11-15 change.
14576
14577 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14578 not define to {}, since this breaks the common use of `YYDPRINTF
14579 ((...));' if a single statement is desired (e.g. before `else').
14580 Work around GCC warnings by surrounding corresponding calls with
14581 {} if needed.
14582 (yyhasResolvedValue): Remove unused function.
14583 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14584 loop body.
14585 (yyreportSyntaxError): Renamed from yyreportParseError.
14586 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14587 All uses changed.
14588 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14589 extern when possible. Remove unused initializations.
14590
b0937b22
AD
145912002-11-16 Akim Demaille <akim@epita.fr>
14592
14593 Augment the similarity between GLR and LALR traces.
14594
14595 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14596 (YY_REDUCE_PRINT): New.
14597 (yyparse): Use them.
14598 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14599 YYDPRINT here.
14600 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14601 state reached after the reduction/recovery, since...
14602 (yyparse, yyprocessOneStack): Report the state we are entering in.
14603
c5e3e510
AD
146042002-11-16 Akim Demaille <akim@epita.fr>
14605
14606 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14607 Add support for --trace=skeleton.
14608 * src/scan-skel.l: %option debug.
14609 Scan strings of non-@ or \n instead of character by character.
14610 (scan_skel): Handle trace_skeleton.
14611 (QPUTS): New.
14612 (@output_parser_name@, @output_header_name@): ``Restore'' their
14613 support (used to be M4 macros).
14614 * data/yacc.c: Quote larger chunks, a la glr.c.
14615 * data/lalr1.cc: Likewise.
14616 The header guards are no longer available, so use some other
14617 string than `YYLSP_NEEDED'.
14618
4c6cc1db
AD
146192002-11-16 Akim Demaille <akim@epita.fr>
14620
14621 Make the ``Printers and Destructors'' test more verbose, taking
14622 `yacc.c''s behavior as (possibly wrong) reference.
14623
14624 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14625 instead of fprint on stdout.
14626 Set and report the last_line of the symbols.
14627 Consistently display values and locations.
14628
6d9e8019
PE
146292002-11-16 Paul Eggert <eggert@twinsun.com>
14630
14631 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14632
6e649e65
PE
146332002-11-15 Paul Eggert <eggert@twinsun.com>
14634
b25d88f6
PE
14635 * tests/actions.at (Actions after errors): New test case.
14636
6e649e65
PE
14637 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14638 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14639 tests/action.at, tests/calc.at, tests/conflicts.at,
14640 tests/cxx-type.at, tests/regression.at:
14641 "parse error" -> "syntax error" for POSIX compatibility.
14642 "parsing stack overflow..." -> "parser stack overflow" so
14643 that code matches Bison documentation.
14644
0f39aab9
AD
146452002-11-15 Akim Demaille <akim@epita.fr>
14646
14647 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14648 take two BRACED_CODE, not two string_content.
14649 Free the scanner's obstack when we are done.
14650 (code_content): New.
14651 * tests/calc.at: Adjust.
14652 * doc/bison.texinfo: Adjust.
14653 Also, make sure to include the `,' for these declarations.
14654
761c1926
AD
146552002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14656
14657 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14658 definition; avoids potential autoreconf problems.
14659
b0f98b10
AD
146602002-11-15 Akim Demaille <akim@epita.fr>
14661
14662 Always check the value returned by yyparse.
14663
14664 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14665 returned by yyparse.
14666 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14667 Adjust calls.
14668 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14669 returned by yyparse.
14670
970785f1
PH
146712002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14672
14673 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14674 on input.at test.
14675
8fcc7db1
PE
146762002-11-14 Paul Eggert <eggert@twinsun.com>
14677
7ec1b48e
PE
14678 * src/output.c (output_skeleton): Call xfopen instead of
14679 duplicating xfopen's body.
14680
cfff7583 14681 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 14682 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 14683
8fcc7db1
PE
14684 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14685 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14686 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14687 file twice in the grammar, as an extra check.
14688
14689 * tests/input.at (Torturing the Scanner): Surround the
14690 backslash-newline tests with "#if 0", to make it less likely that
14691 we'll run into compiler bugs. Bring back solitary \ inside
14692 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 14693 test backslash-newline in C character constant.
8fcc7db1 14694
4e8d992c
AD
146952002-11-14 Akim Demaille <akim@epita.fr>
14696
14697 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14698 status of the compiler.
f32b346d 14699 Calling `exit 1' is no longer needed.
4e8d992c
AD
14700 Reported by Nelson H. F. Beebe.
14701
9501dc6e
AD
147022002-11-14 Akim Demaille <akim@epita.fr>
14703
14704 * tests/atlocal.in (CPPFLAGS): We have config.h.
14705 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14706 New.
14707 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14708 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14709 * tests/regression.at, tests/torture.at: Use them for all the
14710 grammars that are to be compiled.
14711 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14712 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14713 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14714
18b519c0
AD
147152002-11-14 Akim Demaille <akim@epita.fr>
14716
14717 * doc/bison.texinfo: Various formatting changes (alignments in
14718 samples, additional @group/@end group, GCS in samples.
14719 Use @deffn instead of simple @table to define the directives,
14720 macros, variables etc.
14721
9a86cdb9
PE
147222002-11-13 Paul Eggert <eggert@twinsun.com>
14723
daa33def 14724 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 14725 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 14726
daa33def 14727 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 14728 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
14729 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14730 * tests/headers.at (export YYLTYPE): Likewise.
14731
14732 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 14733 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 14734
9a86cdb9
PE
14735 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14736 comments, since they're not portable. Use GNU coding style.
14737
9c1e26bd
AD
147382002-11-13 Akim Demaille <akim@epita.fr>
14739
14740 * data/yacc.c: Leave bigger chunks of quoted text.
14741 (YYDSYMPRINTF): New.
14742 Use it to report symbol activities.
14743 * data/glr.c (YYDSYMPRINTF): New.
14744 Use it.
14745
87f721cc
PE
147462002-11-12 Paul Eggert <eggert@twinsun.com>
14747
14748 Version 1.75b.
14749
14750 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14751 (yyglrReduce): Return yyok, not 0.
14752 This should avoid the enumerated-type warnings reported
464c6927 14753 by Nelson H. F. Beebe in
161a71f3 14754 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
14755
14756 * lib/bbitset.h (BITSET_INLINE): Remove.
14757 * lib/bitset.h [! BITSET_INLINE]: Remove.
14758 (bitset_set, bitset_reset, bitset_test): Rename local vars
14759 to avoid shadowing warnings by GCC.
14760
14761 * data/glr.c (inline): Remove #define. It's the user's
14762 responsibility to #define it away, just like 'const'.
464c6927 14763 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 14764 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 14765
87f721cc
PE
14766 * Makefile.maint (po-check): Scan .l and .y files instead of the
14767 .c and the .h files that they generate. This fixes the bug
14768 reported by Tim Van Holder in:
161a71f3 14769 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
14770 Look for N_ as well as for _. Try to avoid matching #define for
14771 N_ and _.
14772 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14773 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14774 * src/scan-gram.l: Revamp regular expressions so that " and '
14775 do not confuse xgettext.
14776
14777 * src/struniq.h (struniq_new): Do not declare the return type
14778 to be 'const'; this violates the C standard.
14779 * src/struniq.c (struniq_new): Likewise.
14780
be14ade5
AD
147812002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14782
14783 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14784 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14785 linker.
14786
05291fbc
AD
147872002-11-12 Akim Demaille <akim@epita.fr>
14788
14789 * Makefile.maint: Sync with Autoconf:
14790 (local_updates): New.
14791
1f5fd52e
AD
147922002-11-12 Akim Demaille <akim@epita.fr>
14793
14794 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14795
283f1e64
AD
147962002-11-12 Akim Demaille <akim@epita.fr>
14797
14798 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14799 locations.
14800
886b69d1
AD
148012002-11-12 Akim Demaille <akim@epita.fr>
14802
14803 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14804 not yyvalue.
14805
3df37415
AD
148062002-11-12 Akim Demaille <akim@epita.fr>
14807
14808 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14809 Use it to test the GLR parser.
14810
7bd6c77e
AD
148112002-11-12 Akim Demaille <akim@epita.fr>
14812
14813 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14814 defines it.
14815 * data/glr.c (yystos): New.
14816 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14817 (YYDSYMPRINT): New.
14818 (yyval): Don't define it, it is handled via M4.
14819 (yyrecoverParseError): Free verbosely the discarded symbols.
14820 * data/yacc.c (yysymprint): Remove, rather...
14821 (b4_yysymprint_generate): invoke.
14822 * data/c.m4 (b4_yysymprint_generate): New.
14823 Accept pointers as arguments, as opposed to the version from
14824 yacc.c.
14825 (b4_yydestruct_generate): Likewise.
14826 * tests/cations.at (Printers and Destructors): Use Bison directives
14827 instead of CPP macros.
14828 Don't rely on internal details.
14829
b0400cc6
AD
148302002-11-12 Akim Demaille <akim@epita.fr>
14831
14832 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14833 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14834 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14835 it against YYEMPTY and so forth), work on yytoken (i.e., set
14836 it to YYEMPTY etc.).
14837 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14838 (b4_symbol_actions): Remove.
14839 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14840 for 0, end-of-input.
14841
72f889cc
AD
148422002-11-12 Akim Demaille <akim@epita.fr>
14843
14844 * doc/bison.texinfo (Destructor Decl): New.
14845
b1ae9233
AD
148462002-11-12 Akim Demaille <akim@epita.fr>
14847
14848 * src/tables.c (tables_generate): Use free for pointers that
14849 cannot be NULL, not XFREE.
14850 (pack_vector): Use assert, not fatal, for bound violations.
14851 * src/state.c (state_new): Likewise.
14852 * src/reader.c (reader): Likewise.
14853 * src/lalr.c (set_goto_map): Likewise.
72f889cc 14854 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
14855 the file name.
14856
7ec2d4cd
AD
148572002-11-12 Akim Demaille <akim@epita.fr>
14858
14859 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14860 Restore.
14861 * src/scan-gram.l (last_string): Is global to the file, not to
14862 yylex.
14863 * src/parse-gram.y (input): Don't append the epilogue here,
14864 (epilogue.opt): do it here, and free the scanner's obstack.
14865 * src/reader.c (epilogue_set): Rename as...
14866 (epilogue_augment): this.
14867 * data/c.m4 (b4_epilogue): Defaults to empty.
14868
573a6cd3
AD
148692002-11-12 Akim Demaille <akim@epita.fr>
14870
14871 * src/getargs.c (long_options): Remove duplicates.
14872 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14873 Remove.
14874 * doc/bison.rnh: Remove.
14875 * doc/bison.texinfo (VMS Invocation): Remove.
14876
95612cfa
AD
148772002-11-12 Akim Demaille <akim@epita.fr>
14878
14879 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14880 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14881
14882 Use struniq for symbols.
14883
14884 * src/symtab.h (symbol_t): The tag member is a struniq.
14885 (symbol_type_set): Adjust.
14886 * src/symtab.c (symbol_new): Takes a struniq.
14887 (symbol_free): Don't free the tag member.
14888 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14889 (hash_compare_symbol, hash_symbol): these.
14890 Use the fact that tags as struniqs.
14891 (symbol_get): Use struniq_new.
14892 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14893 Returns a strniq.
14894 * src/reader.h (merger_list, grammar_currentmerge_set): The name
14895 and type members are struniqs.
14896 * src/reader.c (get_merge_function)
14897 (grammar_current_rule_merge_set): Adjust.
14898 (TYPE, current_type): Are struniq.
14899
14900 Use struniq for file names.
14901
14902 * src/files.h, src/files.c (infile): Split into...
14903 (grammar_file, current_file): these.
14904 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
14905 * src/reduce.c (reduce_print): Likewise.
14906 * src/getargs.c (getargs): Likewise.
14907 * src/complain.h, src/complain.c: Likewise.
14908 * src/main.c (main): Call struniqs_new early enough to use it for
14909 file names.
14910 Don't free the input file name.
14911
3e6656f9
AD
149122002-11-12 Akim Demaille <akim@epita.fr>
14913
14914 * src/symtab.c (symbol_free): Remove dead deactivated code:
14915 type_name are properly removed.
14916 Don't use XFREE to free items that cannot be NULL.
14917 * src/struniq.h, src/struniq.c: New.
14918 * src/main.c (main): Initialize/free struniqs.
14919 * src/parse-gram.y (%union): Add astruniq member.
14920 (yyprint): Adjust.
14921 * src/scan-gram.l (<{tag}>): Return a struniq.
14922 Free the obstack bit that used to store it.
14923 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
14924
7672019c
PE
149252002-11-11 Paul Eggert <eggert@twinsun.com>
14926
14927 Revamp to fix many (but not all) of the C- and M4-related quoting
14928 problems. Among other things, this fixes the Bison bug reported
14929 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 14930 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
14931
14932 Use new @ escapes consistently. Represent brackets with @{ and @}
14933 rather than @<:@ and @:>@, since this works a bit better with dumb
14934 editors like vi. Represent @ with @@, since @ is now consistently
14935 an escape. Use @oline@ and @ofile@ rather than __oline__ and
14936 __ofile__, to avoid unexpected expansions. Similarly, use @output
14937 rather than #output.
14938
14939 * data/c.m4 (b4_copyright): Omit file name from comment, since
14940 the file name could contain "*/".
14941 (b4_synclines_flag): Don't quote the 2nd argument; it should already
14942 be quoted. All uses changed.
14943
14944 * data/glr.c: Use new @ escapes consistently.
14945 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
14946 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
14947 Remove, since they couldn't handle arbitrary characters in file
14948 names.
14949 * data/lalr1.cc: Likewise.
14950 * data/yacc.c: Likewise.
14951
14952 * src/files.c (output_infix): Remove; all uses removed.
14953 * src/files.h: Likewise.
14954
14955 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
14956 mishandled funny characters in file names, and anyway it isn't
14957 needed any more.
14958 * data/yacc.c: Likewise.
14959 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
14960
14961 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
14962 * data/yacc.c: Likewise.
14963
14964 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
14965 strings now.
14966 (muscle_init): Quote filename as a C string.
14967 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
14968 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
14969 * src/output.c (escaped_file_name_output): New function.
14970 (prepare_symbols): Quote tokens for M4.
14971 (prepare): Don't insert output_infix, output_prefix,
14972 output_parser_name, output_header_name; this is now down by scan-skel.
14973 Insert skeleton as a C string.
14974
14975 * src/output.c (user_actions_output, symbol_destructors_output,
14976 symbol_printers_output): Quote filenames for C and M4.
14977 * src/reader.c (prologue_augment, epilogue_set): Likewise.
14978
14979 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
14980 escapes other than \\ and \'; this simplifies the code.
14981 (<SC_STRING>): Likewise, for \\ and \".
14982 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
14983 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
14984 Use new escapes @{ and @} for [ and ].
14985
14986 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
14987 them with auto vars.
14988 Switch to new escape scheme, where @ is the escape character uniformly.
14989 Abort if a stray escape character is found. Avoid unbounded input
14990 buffer when parsing non-escaped text.
14991
14992 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
14993 __oline__, #output, $@, and @{ do not have unintended meanings.
14994
acea4f3b
PE
149952002-11-09 Paul Eggert <eggert@twinsun.com>
14996
14997 Fix the test failure due to GCC warnings described in
161a71f3 14998 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
14999 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15000 evaluate to 0 if it's impossible for NINF to be in the respective
15001 table.
15002 (yygetLRActions, yyrecoverParseError): Use them.
15003
15004 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15005 counted in the token inserted at end of file. Now takes
15006 location_t *, not location_t, so that the location can be
15007 adjusted. All uses changed.
15008
15009 * tests/regression.at (Invalid inputs): Adjust wording in
15010 diagnostic to match the new behavior.
15011
15012 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
15013 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
15014 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
15015 abort ();'. This reduces the runtime of the "Many lookaheads"
15016 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
15017 GCC 3.2.
15018
20ef1ad5
PE
150192002-11-07 Paul Eggert <eggert@twinsun.com>
15020
15021 * src/parse-gram.y (CHARACTER): Remove unused token.
15022 All uses removed.
15023
15024 * src/scan-gram.l: Remove stack option. We no longer use the
15025 stack, since the stack was never deeper than 1; instead, use the
15026 new auto var c_context to record the stacked value.
15027
15028 Remove nounput option. At an unexpected end of file, we now unput
15029 the minimal input necessary to end cleanly; this simplifies the
15030 code.
15031
15032 Avoid unbounded token sizes where this is easy.
15033
15034 (unexpected_end_of_file): New function.
15035 Use it to systematize the error message on unexpected EOF.
15036 (last-string): Now auto, not static.
15037 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
15038 (scanner_last_string_free): Remove; not used.
15039 (percent_percent_count): Move decl to just before use.
15040 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
15041 not the (never otherwised-used) CHARACTER.
15042
93724f13
AD
150432002-11-07 Akim Demaille <akim@epita.fr>
15044
15045 Let yyerror always receive the msg as last argument, so that
15046 yyerror can be variadic.
15047
15048 * data/yacc.c (b4_yyerror_args): New.
15049 Use it when calling yyerror.
15050 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
15051 Use it when calling yyerror.
15052 * doc/bison.texinfo (Error Reporting): Adjust.
15053 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
15054 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
15055
6e40b4eb
AD
150562002-11-06 Akim Demaille <akim@epita.fr>
15057
15058 #line should have quoted strings.
15059 Ideally, this should be done by m4_quotearg.
15060
15061 * src/scan-skel.l: Include quotearg.h.
15062 Quote __ofile__.
15063 * src/output.c (symbol_printers_output)
15064 (symbol_destructors_output): Quote the file name.
15065
2dfbfc12
AD
150662002-11-06 Akim Demaille <akim@epita.fr>
15067
15068 * tests/regression.at (Invalid inputs): Adjust to the recent
15069 messages.
15070
437c2d80
AD
150712002-11-06 Akim Demaille <akim@epita.fr>
15072
15073 Restore --no-lines.
15074 Reported by Jim Kent.
15075
15076 * data/c.m4 (b4_syncline): New.
15077 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
15078 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
15079 * src/output.c (user_actions_output): Likewise.
15080 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 15081 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 15082
900c5db5
AD
150832002-11-06 Akim Demaille <akim@epita.fr>
15084
15085 * src/main.c (main): Free `infile'.
15086 * src/scan-gram.l (handle_syncline): New.
15087 Recognize `#line'.
15088 * src/output.c (user_actions_output, symbol_destructors_output)
15089 (symbol_printers_output): Use the location's file name, not
15090 infile.
15091 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15092
e183b123 150932002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 15094
e183b123 15095 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 15096 either has GLR conflict entries.
e183b123 15097
193eb6b7
PE
150982002-11-05 Paul Eggert <eggert@twinsun.com>
15099
e183b123
PE
15100 * src/scan-gram.l: Use more accurate diagnostics, e.g.
15101 "integer out of range" rather than "invalid value".
15102 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
15103 accordingly.
15104
193eb6b7
PE
15105 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
15106 Also, remove one static variable in the scanner.
15107
15108 * src/scan-gram.l (braces_level): Now auto, not static.
15109 Initialize to zero if the compiler is being picky.
15110 (INITIAL): Clear braces_level instead of incrementing it.
15111 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
15112 as POSIX 1003.1-2001 requires.
15113 * src/system.h (IF_LINT): New macro, taken from coreutils.
15114 * configure.ac: Define "lint" if --enable-gcc-warnings.
15115
29c01725
AD
151162002-11-05 Akim Demaille <akim@epita.fr>
15117
15118 * src/scan-gram.l: When it starts with `%', complain about the
15119 whole directive, not just that `invalid character: %'.
15120
8aeac3ca
AD
151212002-11-04 Akim Demaille <akim@epita.fr>
15122
15123 * Makefile.maint: Update from Autoconf.
15124 (update, cvs-update, po-update, do-po-update): New.
15125
793a58bb
AD
151262002-11-04 Akim Demaille <akim@epita.fr>
15127
15128 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
15129 and yyerror.
15130 Have yyerror `use' its arguments.
15131 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
15132 returns true when location & yacc & pure & parse-param.
15133 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
15134
c4d720cd
AD
151352002-11-04 Akim Demaille <akim@epita.fr>
15136
15137 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
15138 clashes.
15139 * src/scan-gram.l: Use [\'] instead of ['] to pacify
15140 font-lock-mode.
15141 Use complain_at.
15142 Use quote, not quote_n since LOCATION_PRINT no longer uses the
15143 slot 0.
15144
613a0dc5
PE
151452002-11-03 Paul Eggert <eggert@twinsun.com>
15146
15147 * src/reader.c (get_merge_function, grammar_current_rule_check):
15148 Use consistent diagnostics for reporting type name clashes.
15149 Quote the types with <>, for consistency with Yacc.
15150 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
15151
2a8d363a
AD
151522002-11-03 Akim Demaille <akim@epita.fr>
15153
15154 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
15155 New.
15156 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
15157 (b4_parse_param): Remove.
15158 Use b4_identification.
15159 Propagate b4_pure_args where needed to pass them to yyerror.
15160 * data/glr.m4 (b4_parse_param): Remove.
15161 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
15162 (b4_lpure_formals): New.
15163 Use b4_identification.
15164 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
15165 b4_user_formals and b4_user_args.
15166 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
15167 (yyreportAmbiguity): When using a pure parser, also need
15168 the location, and the parse-params.
15169 Adjust callers.
15170 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
15171 When using a pure parser, also need the parse-params.
15172 Adjust callers.
15173 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
15174 (%pure-parser + %parse-param) LALR and GLR parsers.
15175 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
15176 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
15177 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
15178 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
15179 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
15180 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
15181 * doc/bison.texinfo: Untabify the whole file.
15182 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
15183 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
15184 (Error Reporting): Adjust to these new directives.
15185 Document %error-verbose, deprecate YYERROR_VERBOSE.
15186
9e32add8
AD
151872002-11-03 Akim Demaille <akim@epita.fr>
15188
15189 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
15190 AT_CHECK_CALC_GLR invocations to use % directives, instead of
15191 command line options.
15192 * tests/cxx-type.at: Formatting changes.
15193
b02d90a5
PE
151942002-11-03 Paul Eggert <eggert@twinsun.com>
15195
15196 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
15197 to count columns correctly, and to check for invalid inputs.
9e32add8 15198
b02d90a5
PE
15199 Use mbsnwidth to count columns correctly. Account for tabs, too.
15200 Include mbswidth.h.
15201 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
15202 (extend_location): New function.
15203 (YY_LINES): Remove.
15204
15205 Handle CRLF in C code rather than in Lex code.
15206 (YY_INPUT): New macro.
15207 (no_cr_read): New function.
15208
15209 Scan UCNs, even though we don't fully handle them yet.
15210 (convert_ucn_to_byte): New function.
15211
15212 Handle backslash-newline correctly in C code.
15213 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
15214 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
15215 all uses changed.
15216 (tag, splice): New EREs. Do not allow NUL or newline in tags.
15217 Use {splice} wherever C allows backslash-newline.
15218 YY_STEP after space, newline, vertical-tab.
15219 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 15220
b02d90a5
PE
15221 (letter, id): Don't assume ASCII; e.g., spell out a-z.
15222
15223 ({int}, handle_action_dollar, handle_action_at): Check for integer
15224 overflow.
9e32add8 15225
b02d90a5
PE
15226 (YY_STEP): Omit trailing semicolon, so that it's more like C.
15227
15228 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
15229 as well as \000. Check for UCHAR_MAX, not 255.
15230 Allow \x with an arbitrary positive number of digits, as in C.
15231 Check for overflow here.
15232 Allow \? and UCNs, for compatibility with C.
15233
15234 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
15235 with quote slot used by complain_at.
15236
15237 * tests/input.at: Add tests for backslash-newline, m4 quotes
15238 in symbols, long literals, and funny escapes in strings.
15239
15240 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
15241 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
15242 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
15243 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
15244 * m4/mbswidth.m4: New file, from GNU coreutils.
15245
15246 * doc/bison.texinfo (Grammar Outline): Document // comments.
15247 (Symbols): Document that trigraphs have no special meaning in Bison,
15248 nor is backslash-newline allowed.
15249 (Actions): Document that trigraphs have no special meaning.
15250
15251 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
15252 no longer used.
15253
152542002-11-02 Paul Eggert <eggert@twinsun.com>
15255
15256 * src/reader.c: Don't include quote.h; not needed.
15257 (get_merge_function): Reword warning to be consistent with
15258 type clash diagnostic in grammar_current_rule_check.
15259
15260 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
15261 bug in trigraph handling.
15262
15263 * src/output.c (prepare_symbols): When printing token names,
15264 escape "[" as "@<:@" and likewise for "]".
15265
15266 * src/system.h (errno): Remove declaration, as we are now
15267 assuming C89 or better, and C89 guarantees errno.
15268
762b212b
PE
152692002-10-30 Paul Eggert <eggert@twinsun.com>
15270
15271 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
15272 Check for close failures.
15273 * src/files.h (xfclose): Return void, not int, since it always
15274 returned zero.
15275 * src/files.c (xfclose): Likewise. Report I/O error if ferror
15276 indicates one.
15277 * src/output.c (output_skeleton): Use xfclose rather than fclose
15278 and ferror. xfclose now checks ferror.
15279
15280 * data/glr.c (YYLEFTMOST_STATE): Remove.
15281 (yyreportTree): Use a stack-based leftmost state. This avoids
15282 our continuing battles with bogus warnings about initializers.
15283
56100c60
AD
152842002-10-30 Akim Demaille <akim@epita.fr>
15285
15286 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
15287 #if.
15288
51b4a04c
PH
152892002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15290
15291 * tests/glr-regr1.at: New test for reported regressions.
15292 * tests/testsuite.at: Add glr-regr1.at test.
15293 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 15294
bf1ebda2
PE
152952002-10-24 Paul Eggert <eggert@twinsun.com>
15296
5c16c6b1
PE
15297 Version 1.75a.
15298
bf1ebda2
PE
15299 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
15300 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
15301 we use malloc. Don't assume 'A' through 'Z' are contiguous.
15302 Don't assume strdup exists; POSIX says its an XSI extension.
15303 Check for buffer overflow on input.
15304
b526ee61
AD
153052002-10-24 Akim Demaille <akim@epita.fr>
15306
15307 * src/output.c (output_skeleton): Don't disable M4sugar comments
15308 too soon: it results in comments being expanded.
15309 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
15310 first output.
15311
f1886bb2
AD
153122002-10-24 Akim Demaille <akim@epita.fr>
15313
15314 * data/yacc.c (m4_int_type): New.
15315 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
15316 char' as only yacc.c wants K&R portability.
15317 * data/glr.c (yysigned_char): Remove.
15318 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15319 Reported by Quoc Peyrot.
15320
c5576256
PE
153212002-10-23 Paul Eggert <eggert@twinsun.com>
15322
15323 * src/main.c (main): With --trace=time, report times even if a
15324 non-fatal error occurs. Formerly, the times were reported in some
15325 such cases but not in others.
15326 * src/reader.c (reader): Just return if a complaint has been issued,
15327 instead of exiting, so that 'main' can report times.
15328
27b0ffea
AD
153292002-10-22 Akim Demaille <akim@epita.fr>
15330
15331 * src/system.h: Include sys/types.
15332 Reported by Bert Deknuydt.
15333
223a7883
PE
153342002-10-23 Paul Eggert <eggert@twinsun.com>
15335
15336 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15337 Suggested by Art Haas.
15338
153392002-10-22 Paul Eggert <eggert@twinsun.com>
15340
15341 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15342 decl; not needed any more.
15343 * src/main.c (main): Use return to exit, undoing yesterday's change.
15344 The last OS that we could find where this wouldn't work is
15345 SunOS 3.5, and that's too old to worry about now.
15346
15347 * data/glr.c (struct yyltype): Define members even when not
15348 doing locations. This is more consistent with yacc.c, and it
15349 works around the following bug reports:
161a71f3
PE
15350 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15351 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 15352
223a7883
PE
15353 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15354 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15355 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15356
8b76775a
AD
153572002-10-22 Akim Demaille <akim@epita.fr>
15358
15359 * data/README: New.
15360
6db10d14
PE
153612002-10-21 Paul Eggert <eggert@twinsun.com>
15362
15363 Be consistent about 'bool'; the old code used an enum in one
15364 module and an int in another, and this violates the C standard.
15365 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15366 * configure.ac (AC_HEADER_STDBOOL): Add.
15367 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15368 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15369 * src/symtab.c (hash_compare_symbol_t): Likewise.
15370 * src/system.h (bool, false, true): Use a definition consistent
15371 with ../lib/hash.c. All uses changed.
15372
15373 * src/complain.c (warning_issued): Renamed from warn_message_count,
15374 so that we needn't worry about integer overflow (!).
15375 Now of type bool. All uses changed.
15376 (complaint_issued): Renamed from complain_message_count; likewise.
15377
15378 * src/main.c (main): Use exit to exit with failure.
27b0ffea 15379
6db10d14
PE
15380 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15381 rather than 1 and 0.
15382 * src/main.c (main): Likewise.
15383 * src/getargs.c (getargs): Likewise.
15384 * src/reader.c (reader): Likewise.
15385
15386 * src/getarg.c (getargs): Remove duplicate code for
15387 "Try `bison --help'".
15388
15389 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15390 What was that "2" for?
15391
15392 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15393 * src/getargs.c (usage): Likewise.
15394
15395 * src/getargs.c (getargs): When there are too few operands, report
15396 the last one. When there are too many, report the first extra
15397 one. This is how diffutils does it.
15398
92a060fd
PE
153992002-10-20 Paul Eggert <eggert@twinsun.com>
15400
15401 Remove K&R vestiges.
15402 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
15403 * src/complain.c (VA_START): Remove. Assume prototypes.
15404 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
15405 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
15406 fatal): Assume prototypes.
15407 * src/complain.h: Assume prototypes.
15408 * src/system.h (PARAMS): Remove.
15409 Include <limits.h> unconditionally, since it's guaranteeed even
15410 for a freestanding C89 compiler.
15411 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
15412 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 15413
e7cb57c0
AD
154142002-10-20 Akim Demaille <akim@epita.fr>
15415
15416 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
15417 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
15418 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
15419 (yyresolveStates, yyresolveAction, yyresolveStack)
15420 (yyprocessOneStack): Use them.
15421 (yy_reduce_print): New.
15422 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
15423
0245f82d
AD
154242002-10-20 Akim Demaille <akim@epita.fr>
15425
15426 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
15427 arguments and output `void'.
15428 (b4_c_function): Rename as...
15429 (b4_c_function_def): this.
15430 (b4_c_function_decl, b4_c_ansi_function_def)
15431 (b4_c_ansi_function_decl): New.
15432 Change the interpretation of the arguments: before `int, foo', now
15433 `int foo, foo'.
15434 * data/yacc.c (yyparse): Prototype and define thanks to these.
15435 Adjust b4_c_function_def uses.
15436 * data/glr.c (yyparse): Likewise, but ANSI only.
15437
39912f52
AD
154382002-10-20 Akim Demaille <akim@epita.fr>
15439
15440 * src/output.c (prepare): Move the definition of `tokens_number',
15441 `nterms_number', `undef_token_number', `user_token_number_max'
15442 to...
15443 (prepare_tokens): Here.
15444 (prepare_tokens): Rename as...
15445 (prepare_symbols): this.
15446 (prepare): Move the definition of `rules_number' to...
15447 (prepare_rules): here.
15448 (prepare): Move the definition of `last', `final_state_number',
15449 `states_number' to...
15450 (prepare_states): here.
15451 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
15452
20c1e2ad
AD
154532002-10-20 Akim Demaille <akim@epita.fr>
15454
15455 * src/tables.h, src/tables.c, src/output.c: Comment changes.
15456
21964f43
AD
154572002-10-20 Akim Demaille <akim@epita.fr>
15458
15459 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
15460 * data/c.m4: here.
15461
66d30cd4
AD
154622002-10-20 Akim Demaille <akim@epita.fr>
15463
15464 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
15465 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
15466 `pair'.
15467 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
15468 `name' to...
15469 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
15470 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
15471 These.
15472
95f2c9fe
PE
154732002-10-19 Paul Eggert <eggert@twinsun.com>
15474
15475 Do not create a temporary file, as that involves security and
15476 cleanup headaches. Instead, use a pair of pipes.
15477 Derived from a suggestion by Florian Krohm.
15478 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
15479 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
15480 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
15481 (BISON_PREREQ_SUBPIPE): Add.
15482 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
15483 Add subpipe.h, subpipe.c.
15484 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
15485 * po/POTFILES.in: Add lib/subpipe.c.
15486 * src/output.c: Include "subpipe.h".
15487 (m4_invoke): Remove decl.
15488 (scan_skel): New decl.
15489 (output_skeleton): Use pipe rather than temporary file for m4 input.
15490 Check that m4sugar.m4 is readable, to avoid deadlock.
15491 Check for pipe I/O error.
15492 * src/scan-skel.l (readpipe): Remove decl.
15493 (scan_skel): New function, to be used in place of m4_invoke.
15494 Read from stream rather than file.
66d30cd4 15495
95f2c9fe
PE
15496 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
15497 float, as this generates a warning on Solaris 8 + GCC 3.2 with
15498 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
15499 this generates a more-accurate value anyway.
15500
15501 * lib/timevar.c (timervar_accumulate): Rename locals to
15502 avoid confusion with similarly-named more-global.
15503 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
15504
15505 * src/output.c (prepare): Use xstrdup to convert char const *
15506 to char *, to avoid GCC warning.
15507
c19988b7
AD
155082002-10-19 Akim Demaille <akim@epita.fr>
15509
15510 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
15511 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
15512 Use them to have `calc.y' ready for %pure-parser.
15513 * data/yacc.c (YYLEX): Pass a yylex return type to
15514 b4_c_function_call.
15515
ae7453f2
AD
155162002-10-19 Akim Demaille <akim@epita.fr>
15517
15518 Prototype support of %lex-param and %parse-param.
15519
15520 * src/parse-gram.y: Add the definition of the %lex-param and
15521 %parse-param tokens, plus their rules.
15522 Drop the `_' version of %glr-parser.
15523 Add the "," token.
15524 * src/scan-gram.l (INITIAL): Scan them.
15525 * src/muscle_tab.c: Comment changes.
15526 (muscle_insert, muscle_find): Rename `pair' as `probe'.
15527 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
15528 (muscle_entry_s): The `value' member is no longer const.
15529 Adjust all dependencies.
15530 * src/muscle_tab.c (muscle_init): Adjust: use
15531 MUSCLE_INSERT_STRING.
15532 Initialize the obstack earlier.
15533 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
15534 (muscle_pair_list_grow): New.
15535 * data/c.m4 (b4_c_function_call, b4_c_args): New.
15536 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
15537 * tests/calc.at: Use %locations, not --locations.
15538 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
15539
0e575721
AD
155402002-10-19 Akim Demaille <akim@epita.fr>
15541
15542 * src/getargs.c (usage): Take status as argument and exit
15543 accordingly.
15544 Report the traditional `Try ... --help' message when status != 0.
15545 (usage, version): Don't take a FILE * as arg, it is pointless.
15546 (getargs): When there is an incorrect number of arguments, make it
15547 an error, and report it GNUlically thanks to `usage ()'.
15548
724ce7f5
PE
155492002-10-18 Paul Eggert <eggert@twinsun.com>
15550
3a781eb2
PE
15551 * data/glr.c (yyreportParseError): Don't assume that sprintf
15552 yields the length of the printed string, as this is not true
15553 on SunOS 4.1.4. Reported by Peter Klein.
15554
724ce7f5
PE
15555 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15556 * tests/conflicts.at (%nonassoc and eof): Likewise.
15557 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15558
473d0a75
AD
155592002-10-17 Akim Demaille <akim@epita.fr>
15560
15561 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15562 * src/getargs.c (trace_types, trace_args): Adjust.
15563 * src/reader.c (grammar_current_rule_prec_set)
15564 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15565 Standardize error messages.
15566 And s/@prec/%prec/!
15567 (reader): Use trace_flag to enable scanner/parser debugging,
15568 instead of an adhoc scheme.
15569 * src/scan-gram.l: Remove trailing debugging code.
15570
e76d2469
PE
155712002-10-16 Paul Eggert <eggert@twinsun.com>
15572
93e2236a
PE
15573 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15574 MUSCLE_TAB_H.
15575
e76d2469
PE
15576 * NEWS: Officially drop support for building Bison with K&R C,
15577 since it didn't work anyway and it's not worth worrying about.
15578 * Makefile.maint (wget_files): Remove ansi2knr.c.
15579 (ansi2knr.c-url_prefix): Remove.
15580 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15581 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15582 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15583
5bd1c419
PE
155842002-10-15 Paul Eggert <eggert@twinsun.com>
15585
15586 Stop using the "enum_" trick for K&R-style function definitions;
15587 it confused me, and I was the author! Instead, assume that people
15588 who want to use K&R C compilers (when using these modules in GCC,
15589 perhaps?) will run ansi2knr.
15590
15591 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15592 All uses of "enum_" changed to "enum ".
15593 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15594 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 15595
5bd1c419
PE
15596 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15597 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15598 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15599 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15600 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15601 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15602 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15603 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15604 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15605 Use function prototypes; this removes the need for declaring
15606 static functions simply to provide their prototypes.
15607 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15608 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15609 bitset_count_, bitset_create, bitset_dump, bitset_first,
15610 bitset_free, bitset_init, bitset_last, bitset_next,
15611 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15612 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15613 bitset_print, bitset_release_memory, bitset_toggle_,
15614 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15615 debug_bitset): Likewise.
15616 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15617 * lib/bitset_stats.c (bitset_log_histogram_print,
15618 bitset_percent_histogram_print, bitset_stats_and,
15619 bitset_stats_and_cmp, bitset_stats_and_or,
15620 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15621 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15622 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15623 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15624 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15625 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15626 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15627 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15628 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15629 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15630 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15631 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15632 bitset_stats_zero): Likewise.
15633 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15634 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15635 bitsetv_dump, debug_bitsetv): Likewise.
15636 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15637 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15638 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15639 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15640 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15641 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15642 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15643 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15644 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15645 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15646 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15647 Likewise.
15648 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15649 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15650 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15651 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15652 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15653 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15654 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15655 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15656 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15657 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15658 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 15659
ae26e1f0
AD
156602002-10-14 Akim Demaille <akim@epita.fr>
15661
15662 Version 1.75.
15663
d43baf71
AD
156642002-10-14 Akim Demaille <akim@epita.fr>
15665
15666 * tests/Makefile.am (maintainer-check-posix): New.
15667
7ebc83e3
AD
156682002-10-14 Akim Demaille <akim@epita.fr>
15669
15670 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15671 member.
15672
05846dae
AD
156732002-10-14 Akim Demaille <akim@epita.fr>
15674
15675 * src/tables.c (table_ninf_remap): base -> tab.
15676 Reported by Matt Rosing.
15677
1318e37d
PE
156782002-10-14 Paul Eggert <eggert@twinsun.com>
15679
447fbb17
PE
15680 * tests/action.at, tests/calc.at, tests/conflicts.at,
15681 tests/cxx-type.at, tests/headers.at, tests/input.at,
15682 tests/regression.at, tests/synclines.at, tests/torture.at:
15683 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15684 so that the tests still work even if POSIXLY_CORRECT is set.
15685 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 15686
1318e37d
PE
15687 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15688 for portability to K&R hosts. Fix typo: signed char is guaranteed
15689 only to 127, not to 128.
15690 * data/glr.c (yysigned_char): New type.
15691 * data/yacc.c (yysigned_char): Likewise.
15692 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15693
cc0f0794
PE
156942002-10-13 Paul Eggert <eggert@twinsun.com>
15695
5038f418
PE
15696 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15697 true due to limited range of data type" warning from GCC.
15698
cc0f0794
PE
15699 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15700 by wrapping enum yytokentype's definition inside #ifndef
15701 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15702
6fed0802
AD
157032002-10-13 Akim Demaille <akim@epita.fr>
15704
15705 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15706 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15707
32f0598d
AD
157082002-10-13 Akim Demaille <akim@epita.fr>
15709
15710 * Makefile.maint: Update from Autoconf 2.54.
15711 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15712
7ea9a33f
AD
157132002-10-13 Akim Demaille <akim@epita.fr>
15714
15715 * src/print.c (print_state): Separate the list of solved conflicts
15716 from the other items.
15717 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15718
ea99527d
AD
157192002-10-13 Akim Demaille <akim@epita.fr>
15720
15721 Let nondeterministic skeletons be usable with deterministic
15722 tables.
15723
15724 With the patch, GAWK compiled by GCC without -O2 passes its test
15725 suite using a GLR parser driven by LALR tables. It fails with -O2
15726 because `struct stat' gives two different answers on my machine:
15727 88 (definition of an auto var) and later 96 (memset on this var).
15728 Hence the stack is badly corrumpted. The headers inclusion is to
15729 blame: if I move the awk.h inclusion before GLR's system header
15730 inclusion, the two struct stat have the same size.
15731
15732 * src/tables.c (pack_table): Always create conflict_table.
15733 (token_actions): Always create conflict_list.
15734 * data/glr.c (YYFLAG): Remove, unused.
15735
f377f69f
AD
157362002-10-13 Akim Demaille <akim@epita.fr>
15737
15738 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15739 (O0FLAGS): New.
15740 (VALGRIND, GXX): New.
15741 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15742 * tests/bison.in: Run $PREBISON a pre-command.
15743 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15744 (maintainer-check-g++): New.
15745 * Makefile.am (maintainer-check): New.
15746
2a1fe6ed
AD
157472002-10-13 Akim Demaille <akim@epita.fr>
15748
15749 * data/glr.c: Formatting changes.
15750 Tweak some trace messages to match yacc.c's.
15751
f50adbbd
AD
157522002-10-13 Akim Demaille <akim@epita.fr>
15753
15754 GLR parsers sometimes raise parse errors instead of performing the
15755 default reduction.
15756 Reported by Charles-Henry de Boysson.
15757
15758 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 15759 check the length of the traces when %glr.
f50adbbd
AD
15760 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15761 GLR's traces.
15762 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15763 Test GLR parsers.
15764 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15765 (yyltype): Remove the yy prefix from the member names.
15766 (yytable): Complete its comment.
15767 (yygetLRActions): Map error action number from YYTABLE from
15768 YYTABLE_NINF to 0.
15769 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15770 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15771 not satisfying as we could compare an YYACTION computed from
15772 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15773 only value for error actions.
15774 (yyreportParseError): In verbose parse error messages, don't issue
15775 `error' in the list of expected tokens.
15776 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15777 next action to perform to match glr.c's decoding.
15778 (yytable): Complete its comment.
15779
bcbad5b9
PE
157802002-10-13 Paul Eggert <eggert@twinsun.com>
15781
15782 Fix problem reported by Henrik Grubbstroem in
161a71f3 15783 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
15784 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15785 because the Bison parser reads the second action before reducing
15786 the first one.
15787 * src/scan-gram.l (rule_length): New static var.
15788 Use it to keep track of the rule length in the scanner, since
15789 we can't expect the parser to be in lock-step sync with the scanner.
15790 (handle_action_dollar, handle_action_at): Use this var.
15791 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 15792
14904b89
PE
157932002-10-12 Paul Eggert <eggert@twinsun.com>
15794
1fe611e5
PE
15795 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15796 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15797 Include <sys/time.h> when checking for clock_t and struct tms.
15798 Use same include order as source.
15799 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 15800 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 15801
1fe611e5
PE
15802 * lib/timevar.c: Update copyright date and clarify comments.
15803 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 15804
1fe611e5
PE
15805 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15806 GCC version as of today, then merge Bison's changes.
15807 Change "GCC" to "Bison" in copyright notice. timevar.def's
15808 author is Akim, so change that too.
15809
98194095
PE
15810 * src/reader.c (grammar_current_rule_check):
15811 Don't worry about the default action if $$ is untyped.
15812 Prevents bogus warnings reported by Jim Gifford in
161a71f3 15813 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 15814
14904b89
PE
15815 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15816 * data/glr.c, data/lalr1.cc, data/yacc.c:
15817 Output token definitions before the first part of user declarations.
15818 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 15819 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 15820
ff6dca18
PE
158212002-10-11 Paul Eggert <eggert@twinsun.com>
15822
15823 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15824 (yyparse): here. This undoes some of the 2002-07-25 change.
15825 Compatibility problem reported by Ralf S. Engelschall with
15826 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15827
eb714592
AD
158282002-10-11 Akim Demaille <akim@epita.fr>
15829
15830 * tests/regression.at Characters Escapes): New.
15831 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15832 characters.
15833 Reported by Jan Nieuwenhuizen.
15834
b7195100
AD
158352002-10-11 Akim Demaille <akim@epita.fr>
15836
15837 * po/id.po: New.
15838
f28a0f2d
PE
158392002-10-10 Paul Eggert <eggert@twinsun.com>
15840
15841 Portability fixes for bitsets; this also avoids several GCC
15842 warnings.
15843
15844 * lib/abitset.c: Include <stddef.h>, for offsetof.
15845 * lib/lbitset.c: Likewise.
15846
15847 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15848 properly for vectors of objects. Do not assume that adding a
15849 header size to a multiple of a word size yields a value that is
15850 properly aligned for the whole union.
15851 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15852
15853 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15854 unique names for structures.
15855 * lib/ebitset.c (ebitset_bytes): Likewise.
15856 * lib/lbitset.c (lbitset_bytes): Likewise.
15857
15858 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15859 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15860 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15861 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15862 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15863 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15864 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15865 to improve the type-checking that GCC can do.
15866 * lib/bitset.c (bitset_op4_cmp): Likewise.
15867 * lib/bitset_stats.c (bitset_stats_count,
15868 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15869 bitset_stats_copy, bitset_stats_disjoint_p,
15870 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15871 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15872 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15873 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15874 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15875 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15876 bitset_stats_or_and_cmp): Likewise.
15877 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15878 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15879 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15880 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15881
15882 * lib/abitset.h: Include bitset.h, not bbitset.h.
15883 * lib/ebitset.h: Likewise.
15884 * lib/lbitset.h: Likewise.
15885
15886 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15887 All instances of parameters of type enum bitset_opts are now of
15888 type enum_bitset_opts, to conform to the C Standard, and similarly
15889 for enum_bitset_type.
15890 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15891 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15892
15893 Do not use "struct bitset_struct" to mean different things in
15894 different modules. Not only is this confusing, it violates
15895 the C Standard, which requires that structure types in different
15896 modules must be compatible if one is to be passed to the other.
15897 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
15898 All instances of "struct bitset_struct *" replaced with "bitset".
15899 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
15900 (union bitset_union, struct abitset_struct, struct ebitset_struct,
15901 struct lbitset_struct, struct bitset_stats_struct): New types.
15902 All uses of struct bitset_struct changed to union bitset_union,
15903 etc.
ba0fe3c7 15904 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
15905 struct bitset_struct): Remove.
15906 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
15907 struct bitset_struct): Remove.
15908 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
15909 bitset_struct): Remove.
15910 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
15911 Likewise.
15912
15913 Do not call a function of type T using a call that assumes the
15914 function is of a different type U. Standard C requires that a
15915 function must be called with a type that is compatible with its
15916 definition.
15917 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15918 New decls.
15919 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
15920 New functions.
15921 * lib/ebitset.c (PFV): Remove.
15922 * lib/lbitset.c (PFV): Likewise.
15923 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
15924 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
15925 decls.
15926 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
15927 (ebitset_vtable): Use them.
15928 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
15929 lbitset_xor): New functions.
15930 (lbitset_vtable): Use them.
15931
15932 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
15933 Declare.
15934
15935 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
15936 GCC warning.
15937 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
15938 Use offsetof, for simplicity.
15939
6fbe4984
PE
159402002-10-06 Paul Eggert <eggert@twinsun.com>
15941
15942 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
15943 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 15944 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
15945 which was inadvertently undone by the 2002-09-30 patch.
15946 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
15947 the same width as int.
15948
420f93c8
PE
159492002-10-04 Paul Eggert <eggert@twinsun.com>
15950
15951 Version 1.50.
15952
15953 * configure.ac (AC_INIT), NEWS: Increment version number.
15954
15955 * doc/bison.texinfo: Minor spelling, grammar, and white space
15956 fixes.
15957 (Symbols): Mention that any negative value returned from yylex
15958 signifies end-of-input. Warn about negative chars. Mention
15959 the portable Standard C character set.
15960
15961 The GNU coding standard says CFLAGS and YFLAGS are reserved
15962 for the installer to set.
15963 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
15964 * src/Makefile.am (AM_CFLAGS): Likewise.
15965 (AM_YFLAGS): Renamed from YFLAGS.
15966
15967 Fix some MAX and MIN problems.
15968 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
15969 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
15970 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
15971 * src/reader.c (reader): Use it.
15972
15973 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
15974 POSIX 1003.1-2001 has removed fgrep.
15975
159762002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
15977
15978 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
15979 interpreted as signed.
15980 * lib/ebitset.c (ebitset_list): Fix bug.
15981
ff68026d
PE
159822002-10-01 Paul Eggert <eggert@twinsun.com>
15983
15984 More fixes for 64-bit hosts and large bitsets.
15985
15986 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
15987 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
15988 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
15989 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
15990 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
15991 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
15992 bitset_count_): Likewise.
15993 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
15994 bitset_first, bitset_last): Likewise.
15995 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
15996 bitset_stats_list_reverse, bitset_stats_size,
15997 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
15998 Likewise.
15999 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16000 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16001 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16002 bitsetv_reflexive_transitive_closure): Likewise.
16003 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16004 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16005 Likewise.
16006 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16007 Likewise.
420f93c8 16008
ff68026d
PE
16009 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16010 Use size_t, not unsigned int, to count bytes.
16011 * lib/abitset.h (abitset_bytes): Likewise.
16012 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
16013 Likewise.
16014 * lib/bitset.h (bitset_bytes): Likewise.
16015 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
16016 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
16017 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16018 * lib/ebitset.c (ebitset_bytes): Likewise.
16019 * lib/ebitset.h (ebitset_bytes): Likewise.
16020 * lib/lbitset.c (lbitset_bytes): Likewise.
16021 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 16022
ff68026d
PE
16023 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
16024 abitset_subset_p, abitset_disjoint_p, abitset_and,
16025 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
16026 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
16027 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
16028 abitset_or_and, abitset_or_and_cmp):
16029 Use bitset_windex instead of unsigned int.
16030 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16031 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
16032 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
16033 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
16034 Likewise.
16035 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 16036
ff68026d
PE
16037 * lib/bitset.c (bitset_print):
16038 Use proper printf formats for widths of integer types.
16039 * lib/bitset_stats.c (bitset_percent_histogram_print,
16040 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
16041 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16042 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16043 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 16044
ff68026d
PE
16045 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
16046 BITSET_SIZE_MAX): New macros.
16047 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
16048 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
16049 to BITSET_WINDEX_MAX.
16050
16051 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
16052 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
16053 since we now return the bitset_bindex type (not int).
16054
16055 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
16056 when computing sizes.
16057 * lib/ebitset.c (ebitset_elts_grow): Likewise.
16058
16059 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
16060 and avoid cast to unsigned.
16061
6aa452a6
AD
160622002-09-30 Akim Demaille <akim@epita.fr>
16063
16064 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
16065 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
16066 Updates from Michael Hayes.
16067
927f7817
AD
160682002-09-30 Art Haas <ahaas@neosoft.com>
16069
16070 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
16071 invocations.
16072 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
16073 defined.
16074
9738f41e
AD
160752002-09-27 Akim Demaille <akim@epita.fr>
16076
16077 Version 1.49c.
16078
a5c75d7f
AD
160792002-09-27 Akim Demaille <akim@epita.fr>
16080
16081 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
16082 (Because of AC_LIBSOURCE).
16083
8280e179
AD
160842002-09-27 Akim Demaille <akim@epita.fr>
16085
16086 Playing with Autoscan.
16087
16088 * configure.ac: Remove the old LIBOBJ tweaks.
16089 (AC_REPLACE_FUNCS): Add strrchr and strtol.
16090 * lib/strrchr.c: New.
16091 * lib/strtol.c: New, from the Coreutils 4.5.1.
16092
ae64af35
AD
160932002-09-27 Akim Demaille <akim@epita.fr>
16094
16095 Playing with Autoscan.
16096
16097 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
16098 * lib/Makefile.am (libbison_a_SOURCES): No longer include
16099 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
16100 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
16101 Coreutils 4.5.1.
16102
d1a1114f
AD
161032002-09-24 Akim Demaille <akim@epita.fr>
16104
16105 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
16106 (Frequently Asked Questions, Parser Stack Overflow): New.
16107
b906441c
AD
161082002-09-13 Akim Demaille <akim@epita.fr>
16109
16110 Playing with autoscan.
16111
16112 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
16113 * src/files.c (skeleton_find): Remove, unused.
16114 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
16115 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
16116
bd701811
AD
161172002-09-13 Akim Demaille <akim@epita.fr>
16118
16119 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
16120 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
16121
e0a13e7b
AD
161222002-09-13 Akim Demaille <akim@epita.fr>
16123
16124 * configure.ac: Require 2.54.
16125 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
16126 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
16127 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
16128 Remove, provided by Autoconf macros.
16129
c97011bf
AD
161302002-09-12 Akim Demaille <akim@epita.fr>
16131
16132 * m4/prereq.m4: Update, from Coreutils 4.5.1.
16133
d862b1be
AD
161342002-09-12 Akim Demaille <akim@epita.fr>
16135
16136 * m4/prereq.m4: Update, from Fileutils 4.1.5.
16137 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
16138 Reported by Martin Mokrejs.
16139
3d38c03a
AD
161402002-09-10 Akim Demaille <akim@epita.fr>
16141
16142 * src/parse-gram.y: Associate a human readable string to each
16143 token type.
16144 * tests/regression.at (Invalid inputs): Adjust.
16145
b6347355
AD
161462002-09-10 Gary V. Vaughan <gary@gnu.org>
16147
16148 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
16149 with an Autoconf-2.5x style configure.ac.
16150
09ba4ab2
PE
161512002-09-06 Paul Eggert <eggert@twinsun.com>
16152
16153 * doc/bison.texinfo (Conditions): Make explicit that the GPL
16154 exception applies only to yacc.c. This is a modification of a
16155 patch originally suggested by Akim Demaille.
16156
21846f69
AD
161572002-09-06 Akim Demaille <akim@epita.fr>
16158
09ba4ab2
PE
16159 * data/c.m4 (b4_copyright): Move the GPL exception comment from
16160 here to...
16161 * data/yacc.c: here.
16162
21846f69
AD
16163 * data/lalr1.cc (struct yyltype): Don't define it, since we use
16164 LocationType.
16165 (b4_ltype): Default to yy::Location from location.hh.
16166
c0ad8bf3
AD
161672002-09-04 Jim Meyering <jim@meyering.net>
16168
16169 * data/yacc.c: Guard the declaration of yytoknum also with
16170 `#ifdef YYPRINT', so it is declared only when used.
16171
3a93251e
AD
161722002-09-04 Akim Demaille <akim@epita.fr>
16173
16174 * configure.in: Rename as...
16175 * configure.ac: this.
16176 Bump to 1.49c.
16177
427c0dda
AD
161782002-09-04 Akim Demaille <akim@epita.fr>
16179
16180 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
16181 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
16182 translate maintainer only messages.
16183
6a254321
PE
161842002-08-12 Paul Eggert <eggert@twinsun.com>
16185
645e30d1
PE
16186 Version 1.49b.
16187
6a254321
PE
16188 * Makefile.am (SUBDIRS): Remove intl.
16189 (DISTCLEANFILES): Remove.
16190 * NEWS: Mention that GNU M4 is now required. Clarify what is
16191 meant by "larger grammars". Mention the pt_BR translation.
16192 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
16193 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
16194 Bump version from 0.11.2 to 0.11.5.
16195 (BISON_PREREQ_STAGE): Remove.
16196 (AM_GNU_GETTEXT): Use external gettext.
16197 (AC_OUTPUT): Remove intl/Makefile.
16198
16199 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
16200
16201 * data/glr.c: Include string.h, for strlen.
16202 (yyreportParseError): Use size_t for yysize.
16203 (yy_yypstack): No longer nested inside yypstates, as nested
16204 functions are not portable. Do not assume size_t is the
16205 same width as int.
16206 (yypstates): Do not assume that ptrdiff_t is the same width
16207 as int, and similarly for yyposn and YYINDEX.
16208
16209 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
16210
16211 * lib/Makefile.am (INCLUDES): Do not include from the intl
16212 directory, which has been removed.
16213 * src/Makefile.am (INCLUDES): Likewise.
16214
16215 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
16216 (bitsets_sources, additional_bitsets_sources, timevars_sources):
16217 New vars.
16218
16219 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
16220 * tests/Makefile.am (EXTRA_DIST): Likewise.
16221
16222 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
16223 Do not assume that bitset_windex is the same width as unsigned.
16224
16225 * lib/abitset.c (abitset_unused_clear): Do not assume that
16226 bitset_word is the same width as int.
16227 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
16228 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
16229 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
16230 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
16231 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
16232
16233 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
16234 portability to one's complement hosts!).
16235 * lib/ebitset.c (ebitset_op1): Likewise.
16236 * lib/lbitset.c (lbitset_op1): Likewise.
16237
16238 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
16239 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
16240 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
16241 Sync with fileutils.
16242 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
16243 lib/gettext.h: Sync with diffutils.
16244
16245 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
16246 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
16247
16248 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
16249 PROTOTYPES to check for prototypes, and "defined __STDC__" to
16250 check for void *.
16251
16252 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
16253 size_t; the old version tried to do this but casted improperly.
16254 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
16255 (bitset_test): Now returns int, not unsigned long.
16256
16257 * lib/bitset_stats.c: Include "gettext.h".
16258 (_): New macro.
16259 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
16260 name locals "index", as it generates unnecessary warnings on some
16261 hosts that have an "index" function.
16262
16263 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
16264 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
16265 they need translation.
16266 * src/LR0.c (state_list_append, new_itemsets, get_state,
16267 append_states, generate_states): Likewise.
16268 * src/assoc.c (assoc_to_string): Likewise.
16269 * src/closure.c (print_closure, set_firsts, closure): Likewise.
16270 * src/gram.c (grammar_dump): Likewise.
16271 * src/injections.c (injections_compute): Likewise.
16272 * src/lalr.c (lookaheads_print): Likewise.
16273 * src/relation.c (relation_transpose): Likewise.
16274 * src/scan-gram.l: Likewise.
16275 * src/tables.c (table_grow, pack_vector): Likewise.
16276
16277 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
16278 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
16279 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
16280 * m4/mbstate_t.m4: Sync with fileutils.
16281 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
16282
16283 * po/LINGUAS: Add pt_BR.
16284 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
16285 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
16286 lib/timevar.c.
16287 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
16288 manual recommends.
16289 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
16290
16291 * src/complain.c (strerror_r): Remove decl; not needed.
16292 (strerror): Use same pattern as ../lib/error.c.
16293
16294 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
16295
16296 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
16297
16298 * src/main.c (main): Cast result of bindtextdomain and textdomain
16299 to void, to avoid a GCC warning when --disable-nls is in effect.
16300
16301 * src/scan-gram.l: Use strings rather than escapes when possible,
16302 to minimize the number of warnings from xgettext.
16303 (handle_action_dollar, handle_action_at): Don't use isdigit,
16304 as it mishandles negative chars and it may not work as expected
16305 outside the C locale.
16306
16307 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
16308 this is a GCC extension and is not portable to other compilers.
16309
16310 * src/system.h (alloca): Use same pattern as ../lib/error.c.
16311 Do not include <ctype.h>; no longer needed.
16312 Do not include <malloc.h>; no longer needed (and generates
16313 warnings on OpenBSD 3.0).
16314
16315 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
16316 it's not portable.
16317
16318 * tests/regression.at: Do not use 'cc -c input.c -o input';
16319 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16320
16321 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16322 exit status as failure, not just exit status 1. Sun C exits
16323 with status 2 sometimes.
16324
16325 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16326 Use it for the two large tests.
16327
c8f002c7
AD
163282002-08-02 Akim Demaille <akim@epita.fr>
16329
16330 * src/conflicts.c (conflicts_output): Don't output rules never
16331 reduced here, since anyway that computation doesn't work.
16332 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16333 (rule_useless_p, rule_never_reduced_p): New.
16334 (grammar_rules_partial_print): Use a filter instead of a range.
16335 Display the title only if needed.
16336 (grammar_rules_print): Adjust.
16337 (grammar_rules_never_reduced_report): New.
16338 * src/tables.c (action_row): Move the computation of rules never
16339 reduced to...
16340 (token_actions): here.
16341 * src/main.c (main): Make the parser before making the report, so
16342 that rules never reduced are computed.
16343 Call grammar_rules_never_reduced_report.
16344 * src/print.c (print_results): Report rules never reduced.
16345 * tests/conflicts.at, tests/reduce.at: Adjust.
16346
cd08e51e
AD
163472002-08-01 Akim Demaille <akim@epita.fr>
16348
16349 Instead of attaching lookaheads and duplicating the rules being
16350 reduced by a state, attach the lookaheads to the reductions.
16351
16352 * src/state.h (state_t): Remove the `lookaheads',
16353 `lookaheads_rule' member.
16354 (reductions_t): Add a `lookaheads' member.
16355 Use a regular array for the `rules'.
16356 * src/state.c (reductions_new): Initialize the lookaheads member
16357 to 0.
16358 (state_rule_lookaheads_print): Adjust.
16359 * src/state.h, src/state.c (state_reductions_find): New.
16360 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16361 (count_rr_conflicts): Adjust.
16362 * src/lalr.c (LArule): Remove.
16363 (add_lookback_edge): Adjust.
16364 (state_lookaheads_count): New.
16365 (states_lookaheads_initialize): Merge into...
16366 (initialize_LA): this.
16367 (lalr_free): Adjust.
16368 * src/main.c (main): Don't free nullable and derives too early: it
16369 is used by --verbose.
16370 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16371
bb0027a9
AD
163722002-08-01 Akim Demaille <akim@epita.fr>
16373
16374 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16375 `rule_number_t**'.
16376 (set_derives, free_derives): Rename as...
16377 (derives_compute, derives_free): this.
16378 Adjust all dependencies.
16379 * src/nullable.c (set_nullable, free_nullable): Rename as...
16380 (nullable_compute, nullable_free): these.
16381 (rule_list_t): Store rule_t *, not rule_number_t.
16382 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16383 pointers, instead of their numbers.
16384 * src/main.c (main): Call nullable_free, and derives_free earlier,
16385 as they were lo longer used.
16386
3325ddc4
AD
163872002-08-01 Akim Demaille <akim@epita.fr>
16388
16389 * lib/timevar.c (get_time): Include children time.
16390 * src/lalr.h (LA, LArule): Don't export them: used with the
16391 state_t.
16392 * src/lalr.c (LA, LArule): Static.
16393 * src/lalr.h, src/lalr.c (lalr_free): New.
16394 * src/main.c (main): Call it.
16395 * src/tables.c (pack_vector): Check whether loc is >= to the
16396 table_size, not >.
16397 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16398 (tables_generate): do it, since that's also it which allocates
16399 them.
16400 Don't free LA and LArule, main does.
16401
c6f1a33c
AD
164022002-07-31 Akim Demaille <akim@epita.fr>
16403
16404 Separate parser tables computation and output.
16405
16406 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
16407 (conflict_list, conflict_list_cnt, table, check, table_ninf)
16408 (yydefgoto, yydefact, high): Move to...
16409 * src/tables.h, src/tables.c: here.
16410 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16411 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16412 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
16413 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
16414 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
16415 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
16416 (action_row, save_row, token_actions, save_column, default_goto)
16417 (goto_actions, sort_actions, matching_state, pack_vector)
16418 (table_ninf_remap, pack_table, prepare_actions): Move to...
16419 * src/tables.c: here.
16420 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
16421 * src/output.c (token_actions, output_base, output_conflicts)
16422 (output_check): Merge into...
16423 (prepare_actions): this.
16424 (actions_output): Rename as...
16425 (user_actions_output): this.
16426 * src/main.c (main): Call tables_generate and tables_free.
16427
1509d42f
AD
164282002-07-31 Akim Demaille <akim@epita.fr>
16429
16430 Steal GCC's --time-report support.
16431
16432 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
16433 stolen/adjusted from GCC.
16434 * m4/stage.m4: Remove time related checks.
16435 * m4/timevar.m4: New.
16436 * configure.in: Adjust.
16437 * src/system.h: Adjust to using timevar.h.
16438 * src/getargs.h, src/getargs.c: Support trace_time for
16439 --trace=time.
16440 * src/main.c (stage): Remove.
16441 (main): Replace `stage' invocations with timevar calls.
16442 * src/output.c: Insert pertinent timevar calls.
16443
273a74fa
AD
164442002-07-31 Akim Demaille <akim@epita.fr>
16445
16446 Let --trace have arguments.
16447
16448 * src/getargs.h (enum trace_e): New.
16449 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
16450 (long_options, short_options): --trace/-T takes an optional
16451 argument.
16452 Change all the uses of trace_flag to reflect the new flags.
16453 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
16454
16455 Strengthen `stage' portability.
16456
16457 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
16458 * configure.in: Use it.
16459 Don't check for malloc.h and sys/times.h.
16460 * src/system.h: Include them when appropriate.
16461 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
16462 times and struct tms are available.
16463
217598da
AD
164642002-07-30 Akim Demaille <akim@epita.fr>
16465
16466 In verbose parse error message, don't report `error' as an
16467 expected token.
16468 * tests/actions.at (Printers and Destructors): Adjust.
16469 * tests/calc.at (Calculator $1): Adjust.
16470 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
16471 error message, do not report the parser accepts the error token in
16472 that state.
16473
52489d44
AD
164742002-07-30 Akim Demaille <akim@epita.fr>
16475
16476 Normalize conflict related messages.
16477
16478 * src/complain.h, src/complain.c (warn, complain): New.
16479 * src/conflicts.c (conflicts_print): Use them.
16480 (conflict_report_yacc): New, extracted from...
16481 (conflicts_print): here.
16482 * tests/conflicts.at, tests/existing.at: Adjust.
16483
e8832397
AD
164842002-07-30 Akim Demaille <akim@epita.fr>
16485
16486 Report rules which are never reduced by the parser: those hidden
16487 by conflicts.
16488
16489 * src/LR0.c (save_reductions): Don't make the final state too
16490 different: save its reduction (accept) instead of having a state
16491 without any action (no shift or goto, no reduce).
16492 Note: the final state is now a ``regular'' state, i.e., the
16493 parsers now contain `reduce 0' as default reduction.
16494 Nevertheless, since they decide to `accept' when yystate =
16495 final_state, they still will not reduce rule 0.
16496 * src/print.c (print_actions, print_reduction): Adjust.
16497 * src/output.c (action_row): Track reduced rules.
16498 (token_actions): Report rules never reduced.
16499 * tests/conflicts.at, tests/regression.at: Adjust.
16500
caf23d24
AD
165012002-07-30 Akim Demaille <akim@epita.fr>
16502
16503 `stage' was accidently included in a previous patch.
16504 Initiate its autoconfiscation.
16505
16506 * configure.in: Look for malloc.h and sys/times.h.
16507 * src/main.c (stage): Adjust.
16508 Report only when trace_flag.
16509
640748ee
AD
165102002-07-29 Akim Demaille <akim@epita.fr>
16511
16512 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
16513 state_number_t.
16514 (errs_t): symbol_t*, not symbol_number_t.
16515 (reductions_t): rule_t*, not rule_number_t.
16516 (FOR_EACH_SHIFT): New.
16517 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
16518 * src/print.c, src/print_graph.c: Adjust.
16519
88bce5a2
AD
165202002-07-29 Akim Demaille <akim@epita.fr>
16521
16522 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
16523
16524 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
16525 (endtoken, accept): these.
16526 * src/reader.c (reader): Set endtoken's default tag to "$end".
16527 Set undeftoken's tag to "$undefined" instead of "$undefined.".
16528 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
16529 Adjust.
16530
1bfb97db
AD
165312002-07-29 Akim Demaille <akim@epita.fr>
16532
16533 * src/reduce.c (reduce_grammar): When the language is empty,
16534 complain about the start symbol, not the axiom.
16535 Use its location.
16536 * tests/reduce.at (Empty Language): New.
16537
fc5734fe
AD
165382002-07-26 Akim Demaille <akim@epita.fr>
16539
16540 * src/reader.h, src/reader.c (gram_error): ... can't get
16541 yycontrol without making too strong assumptions on the parser
16542 itself.
16543 * src/output.c (prepare_tokens): Use the real 0th value of
16544 token_translations instead of `0'.
16545 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
16546 visible here.
16547 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
16548 for the time being: %locations ought to provide it to yyerror.
16549
3650b4b8
AD
165502002-07-25 Akim Demaille <akim@epita.fr>
16551
16552 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16553 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16554 * tests/regression.at (Web2c Actions): Adjust.
16555
4b3d3a8e
AD
165562002-07-25 Akim Demaille <akim@epita.fr>
16557
16558 Stop storing rules from 1 to nrules + 1.
16559
16560 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16561 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16562 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16563 Iterate from 0 to nrules.
16564 Use rule_number_as_item_number and item_number_as_rule_number.
16565 Adjust to `derive' now containing possibly 0.
16566 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16567 Handle the `- 1' part in rule numbers from/to item numbers.
16568 * src/conflicts.c (log_resolution): Fix the message which reversed
16569 shift and reduce.
16570 * src/output.c (action_row): Initialize default_rule to -1.
16571 (token_actions): Adjust.
16572 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16573 expected output.
16574 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16575
4a2a22f4
AD
165762002-07-25 Akim Demaille <akim@epita.fr>
16577
16578 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16579 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16580 (b4_c_knr_arg_decl): New.
16581 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16582 yyreport_parse_error.
16583
b8df3223
AD
165842002-07-25 Akim Demaille <akim@epita.fr>
16585
16586 * data/yacc.c (yyreport_parse_error): New, extracted from...
16587 (yyparse): here.
16588 (yydestruct, yysymprint): Move above yyparse.
16589 Be K&R compliant.
16590
a762e609
AD
165912002-07-25 Akim Demaille <akim@epita.fr>
16592
16593 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16594 replace...
16595 (b4_sint_type, b4_uint_type): these.
16596 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16597 * tests/regression.at (Web2c Actions): Adjust.
16598
12b0043a
AD
165992002-07-25 Akim Demaille <akim@epita.fr>
16600
16601 * src/gram.h (TIEM_NUMBER_MAX): New.
16602 (item_number_of_rule_number, rule_number_of_item_number): Rename
16603 as...
16604 (rule_number_as_item_number, item_number_as_rule_number): these.
16605 Adjust dependencies.
16606 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16607 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16608 (symbol_number_to_vector_number): New.
16609 (order): Of vector_number_t* type.
16610 (base_t, BASE_MAX, BASE_MIN): New.
16611 (froms, tos, width, pos, check): Of base_t type.
16612 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16613 (actrow): Of action_number_t type.
16614 (conflrow): Of unsigned int type.
16615 (table_ninf, base_ninf): New.
16616 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16617 (muscle_insert_int_table, muscle_insert_base_table)
16618 (muscle_insert_rule_number_table): New.
16619 (prepare_tokens): Output `toknum' as int_table.
16620 (action_row): Returns a rule_number_t.
16621 Use ACTION_MIN, not SHRT_MIN.
16622 (token_actions): yydefact is rule_number_t*.
16623 (table_ninf_remap): New.
16624 (pack_table): Use it for `base' and `table'.
16625 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16626 replaced with...
16627 (YYPACT_NINF, YYTABLE_NINF): these.
16628 (yypact, yytable): Compute their types instead of hard-coded
16629 `short'.
16630 * tests/regression.at (Web2c Actions): Adjust.
16631
5dde258a
AD
166322002-07-19 Akim Demaille <akim@epita.fr>
16633
16634 * src/scan-gram.l (id): Can start with an underscore.
16635
a945ec39
AD
166362002-07-16 Akim Demaille <akim@epita.fr>
16637
16638 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16639 Adjust all former `associativity' dependencies.
16640 * src/symtab.c (symbol_new): Default associativity is `undef', not
16641 `right'.
16642 (symbol_check_alias_consistence): Adjust.
16643
fae437e8
AD
166442002-07-09 Akim Demaille <akim@epita.fr>
16645
16646 * doc/bison.texinfo: Properly set the ``header'' part.
16647 Use @dircategory ``GNU programming tools'' as per Texinfo's
16648 documentation.
16649 Use @copying.
16650
1a715ef2
AD
166512002-07-09 Akim Demaille <akim@epita.fr>
16652
16653 * lib/quotearg.h: Protect against multiple inclusions.
16654 * src/location.h (location_t): Add a `file' member.
16655 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16656 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16657 `error_one_per_line' support.
16658
a5d50994
AD
166592002-07-09 Akim Demaille <akim@epita.fr>
16660
16661 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16662 * src/reader.c (lineno): Remove.
16663 Adjust all dependencies.
16664 (get_merge_function): Take a location and use complain_at.
16665 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16666 * tests/regression.at (Invalid inputs, Mixing %token styles):
16667 Adjust.
16668
b275314e
AD
166692002-07-09 Akim Demaille <akim@epita.fr>
16670
16671 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16672 recovery rule, and forbid extensions when --yacc.
16673 (gram_error): Use complain_at.
16674 * src/reader.c (reader): Exit if there were parse errors.
16675
865b9df1
AD
166762002-07-09 Akim Demaille <akim@epita.fr>
16677
16678 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16679 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16680 Reported by R Blake <blakers@mac.com>.
16681
c76e14da
AD
166822002-07-09 Akim Demaille <akim@epita.fr>
16683
16684 * data/yacc.c: Output the copyright notive in the header.
16685
7db2ed2d
AD
166862002-07-03 Akim Demaille <akim@epita.fr>
16687
16688 * src/output.c (froms, tos): Are state_number_t.
16689 (save_column): sp, sp1, and sp2 are state_number_t.
16690 (prepare): Rename `final' as `final_state_number', `nnts' as
16691 `nterms_number', `nrules' as `rules_number', `nstates' as
16692 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16693 unused.
16694 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16695 * data/lalr1.cc (nsym_): Remove, unused.
16696
e68e0410
AD
166972002-07-03 Akim Demaille <akim@epita.fr>
16698
16699 * src/lalr.h, src/lalr.c (goto_number_t): New.
16700 * src/lalr.c (goto_list_t): New.
16701 Propagate them.
16702 * src/nullable.c (rule_list_t): New.
16703 Propagate.
16704 * src/types.h: Remove.
16705
e1a4f3a4
AD
167062002-07-03 Akim Demaille <akim@epita.fr>
16707
16708 * src/closure.c (print_fderives): Use rule_rhs_print.
16709 * src/derives.c (print_derives): Use rule_rhs_print.
16710 (rule_list_t): New, replaces `shorts'.
16711 (set_derives): Add comments.
16712 * tests/sets.at (Nullable, Firsts): Adjust.
16713
536545f3
AD
167142002-07-03 Akim Demaille <akim@epita.fr>
16715
16716 * src/output.c (prepare_actions): Free `tally' and `width'.
16717 (prepare_actions): Allocate and free `order'.
16718 * src/symtab.c (symbols_free): Free `symbols'.
16719 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16720 * src/output.c (m4_invoke): Move to...
16721 * src/scan-skel.l: here.
16722 (<<EOF>>): Close yyout, and free its name.
16723
8b752b00
AD
167242002-07-03 Akim Demaille <akim@epita.fr>
16725
16726 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16727
16728 * src/LR0.c (new_state): Merge into...
16729 (state_list_append): this.
16730 (new_states): Merge into...
16731 (generate_states): here.
16732 (set_states): Don't ensure a proper `errs' state member here, do it...
16733 * src/conflicts.c (conflicts_solve): here.
16734 * src/state.h, src/state.c: Comment changes.
16735 (state_t): Rename member `shifts' as `transitions'.
16736 Adjust all dependencies.
16737 (errs_new): For consistency, also take the values as argument.
16738 (errs_dup): Remove.
16739 (state_errs_set): New.
16740 (state_reductions_set, state_transitions_set): Assert that no
16741 previous value was assigned.
16742 (state_free): New.
16743 (states_free): Use it.
16744 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16745 temporary storage: use `errs' and `nerrs' as elsewhere.
16746 (set_conflicts): Allocate and free this `errs'.
16747
613f5e1a
AD
167482002-07-02 Akim Demaille <akim@epita.fr>
16749
16750 * lib/libiberty.h: New.
16751 * lib: Update the bitset implementation from upstream.
16752 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16753 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16754 * src/main.c: Adjust bitset stats calls.
16755
26e0cadc
PE
167562002-07-01 Paul Eggert <eggert@twinsun.com>
16757
16758 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16759 char, so that negative chars don't collide with $.
16760
1154cced
AD
167612002-06-30 Akim Demaille <akim@epita.fr>
16762
16763 Have the GLR tests be `warning' checked, and fix the warnings.
16764
16765 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16766 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16767 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16768 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16769 (yyaddDeferredAction): static.
16770 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16771 (yyreportParseError): yyprefix is const.
16772 yytokenp is used only when verbose.
16773 (yy__GNUC__): Replace with __GNUC__.
16774 (yypdumpstack): yyi is size_t.
16775 (yypreference): Un-yy local variables and arguments, to avoid
16776 clashes with `yyr1'. Anyway, we are not in the user name space.
16777 (yytname_size): be an int, as is compared with ints.
16778 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16779 Use them.
16780 * tests/cxx-gram.at: Use quotation to protect $1.
16781 Use AT_COMPILE to enable warnings hunts.
16782 Prototype yylex and yyerror.
16783 `Use' argc.
16784 Include `string.h', not `strings.h'.
16785 Produce and prototype stmtMerge only when used.
16786 yylex takes a location.
16787
97650f4e
AD
167882002-06-30 Akim Demaille <akim@epita.fr>
16789
16790 We spend a lot of time in quotearg, in particular when --verbose.
16791
16792 * src/symtab.c (symbol_get): Store a quoted version of the key.
16793 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16794 Adjust all callers.
16795
d2576365
AD
167962002-06-30 Akim Demaille <akim@epita.fr>
16797
16798 * src/state.h (reductions_t): Rename member `nreds' as num.
16799 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16800 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16801
ccaf65bc
AD
168022002-06-30 Akim Demaille <akim@epita.fr>
16803
16804 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16805 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16806 (shifts_to): Rename as...
16807 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16808 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16809 (TRANSITION_IS_DISABLED, transitions_to): these.
16810
87675353
AD
168112002-06-30 Akim Demaille <akim@epita.fr>
16812
16813 * src/print.c (print_shifts, print_gotos): Merge into...
16814 (print_transitions): this.
16815 (print_transitions, print_errs, print_reductions): Align the
16816 lookaheads columns.
16817 (print_core, print_transitions, print_errs, print_state,
16818 print_grammar): Output empty lines separator before, not after.
16819 (state_default_rule_compute): Rename as...
16820 (state_default_rule): this.
16821 * tests/conflicts.at (Defaulted Conflicted Reduction),
16822 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16823 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16824
ce4ccb4b
AD
168252002-06-30 Akim Demaille <akim@epita.fr>
16826
16827 Display items as we display rules.
16828
16829 * src/gram.h, src/gram.c (rule_lhs_print): New.
16830 * src/gram.c (grammar_rules_partial_print): Use it.
16831 * src/print.c (print_core): Likewise.
16832 * tests/conflicts.at (Defaulted Conflicted Reduction),
16833 (Unresolved SR Conflicts): Adjust.
16834 (Unresolved SR Conflicts): Adjust and rename as...
16835 (Resolved SR Conflicts): this, as was meant.
16836 * tests/regression.at (Web2c Report): Adjust.
16837
bc933ef1
AD
168382002-06-30 Akim Demaille <akim@epita.fr>
16839
16840 * src/print.c (state_default_rule_compute): New, extracted from...
16841 (print_reductions): here.
16842 Pessimize, but clarify the code.
16843 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16844
53d4308d
AD
168452002-06-30 Akim Demaille <akim@epita.fr>
16846
16847 * src/output.c (action_row): Let default_rule be always a rule
16848 number.
16849
574fb2d5
AD
168502002-06-30 Akim Demaille <akim@epita.fr>
16851
16852 * src/closure.c (print_firsts, print_fderives, closure):
16853 Use BITSET_EXECUTE.
16854 * src/lalr.c (lookaheads_print): Likewise.
16855 * src/state.c (state_rule_lookaheads_print): Likewise.
16856 * src/print_graph.c (print_core): Likewise.
16857 * src/print.c (print_reductions): Likewise.
16858 * src/output.c (action_row): Likewise.
16859 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16860
05811fd7
AD
168612002-06-30 Akim Demaille <akim@epita.fr>
16862
16863 * src/print_graph.c: Use report_flag.
16864
0e4d5753
AD
168652002-06-30 Akim Demaille <akim@epita.fr>
16866
16867 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16868 to...
16869 * src/relation.h, src/relation.c (traverse, relation_digraph)
16870 (relation_print, relation_transpose): New.
16871
24c7d800
AD
168722002-06-30 Akim Demaille <akim@epita.fr>
16873
16874 * src/state.h, src/state.c (shifts_to): New.
16875 * src/lalr.c (build_relations): Use it.
16876
9222837b
AD
168772002-06-30 Akim Demaille <akim@epita.fr>
16878
16879 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16880 (item_number_of_rule_number, rule_number_of_item_number): New.
16881 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16882 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16883 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16884 Propagate their use.
16885 Much remains to be done, in particular wrt `shorts' from types.h.
16886
260008e5
AD
168872002-06-30 Akim Demaille <akim@epita.fr>
16888
16889 * src/symtab.c (symbol_new): Initialize the `printer' member.
16890
8a731ca8
AD
168912002-06-30 Akim Demaille <akim@epita.fr>
16892
16893 * src/LR0.c (save_reductions): Remove, replaced by...
16894 * src/state.h, src/state.c (state_reductions_set): New.
16895 (reductions, errs): Rename as...
16896 (reductions_t, errs_t): these.
16897 Adjust all dependencies.
16898
32e1e0a4
AD
168992002-06-30 Akim Demaille <akim@epita.fr>
16900
16901 * src/LR0.c (state_list_t, state_list_append): New.
16902 (first_state, last_state): Now symbol_list_t.
16903 (this_state): Remove.
16904 (new_itemsets, append_states, save_reductions): Take a state_t as
16905 argument.
16906 (set_states, generate_states): Adjust.
16907 (save_shifts): Remove, replaced by...
16908 * src/state.h, src/state.c (state_shifts_set): New.
16909 (shifts): Rename as...
16910 (shifts_t): this.
16911 Adjust all dependencies.
16912 * src/state.h (state_t): Remove the `next' member.
16913
e5fb6710
AD
169142002-06-30 Akim Demaille <akim@epita.fr>
16915
16916 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
16917 escaped in slot 0.
16918
c7ca99d4
AD
169192002-06-30 Akim Demaille <akim@epita.fr>
16920
16921 Use hash.h for the state hash table.
16922
16923 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
16924 (allocate_storage): Use state_hash_new.
16925 (free_storage): Use state_hash_free.
16926 (new_state, get_state): Adjust.
16927 * src/lalr.h, src/lalr.c (states): Move to...
16928 * src/states.h (state_t): Remove the `link' member, no longer
16929 used.
16930 * src/states.h, src/states.c: here.
16931 (state_hash_new, state_hash_free, state_hash_lookup)
16932 (state_hash_insert, states_free): New.
16933 * src/states.c (state_table, state_compare, state_hash): New.
16934 * src/output.c (output_actions): Do not free states now, since we
16935 still need to know the final_state number in `prepare', called
16936 afterwards. Do it...
16937 * src/main.c (main): here: call states_free after `output'.
16938
df0e7316
AD
169392002-06-30 Akim Demaille <akim@epita.fr>
16940
16941 * src/state.h, src/state.c (state_new): New, extracted from...
16942 * src/LR0.c (new_state): here.
16943 * src/state.h (STATE_ALLOC): Move to...
16944 * src/state.c: here.
16945 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
16946 * src/state.h, src/state.c: here.
16947
39f41916
AD
169482002-06-30 Akim Demaille <akim@epita.fr>
16949
16950 * src/reader.c (gensym): Rename as...
16951 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
16952 (getsym): Rename as...
16953 (symbol_get): this.
16954
d57650a5
AD
169552002-06-30 Akim Demaille <akim@epita.fr>
16956
16957 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
16958 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
16959 * src/output.c, src/print.c, src/print_graph.c: Propagate.
16960 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
16961
5a08f1ce
AD
169622002-06-30 Akim Demaille <akim@epita.fr>
16963
16964 Make the test suite pass with warnings checked.
16965
16966 * tests/actions.at (Printers and Destructors): Improve.
16967 Avoid unsigned vs. signed issues.
16968 * tests/calc.at: Don't exercise the scanner here, do it...
16969 * tests/input.at (Torturing the Scanner): here.
16970
720623af
PH
169712002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16972
88e7e941 16973 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
16974 reorganize first lines parallel to yacc.c.
16975
fb8135fa
AD
169762002-06-28 Akim Demaille <akim@epita.fr>
16977
16978 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
16979 (b4_token_enum, b4_token_defines): New, factored from...
16980 * data/lalr1.cc, data/yacc.c, glr.c: here.
16981
41442480
AD
169822002-06-28 Akim Demaille <akim@epita.fr>
16983
16984 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
16985 unused variables.
16986 * src/output.c (merger_output): static.
16987
e0e5bf84
AD
169882002-06-28 Akim Demaille <akim@epita.fr>
16989
ba0fe3c7 16990 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
16991 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
16992 pacify GCC.
16993 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 16994
676385e2
PH
169952002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
16996
16997 Accumulated changelog for new GLR parsing features.
16998
6a254321 16999 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
17000 conflicts_total_count.
17001 * src/conflicts.h: Ditto.
17002 * src/output.c (token_actions): Use the new name.
17003 (output_conflicts): Change conflp => conflict_list_heads, and
17004 confl => conflict_list for better readability.
17005 * data/glr.c: Use the new names.
17006 * NEWS: Add self to GLR announcement.
e0e5bf84 17007
676385e2
PH
17008 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17009
17010 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17011 Akim Demaille.
17012
17013 * data/bison.glr: Change name to glr.c
17014 * data/glr.c: Renamed from bison.glr.
17015 * data/Makefile.am: Add glr.c
e0e5bf84
AD
17016
17017 * src/getargs.c:
17018
676385e2 17019 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 17020 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 17021
676385e2
PH
17022 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17023
17024 * data/bison.glr: Be sure to restore the
17025 current #line when returning to the skeleton contents after having
17026 exposed the input file's #line.
17027
17028 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17029
17030 * data/bison.glr: Bring up to date with changes to bison.simple.
17031
17032 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17033
17034 * data/bison.glr: Correct definitions that use b4_prefix.
17035 Various reformatting.
17036 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
17037 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
17038 yytokenp argument; now part of stack.
17039 (yychar): Define to behave as documented.
17040 (yyclearin): Ditto.
e0e5bf84 17041
676385e2
PH
17042 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17043
17044 * src/reader.h: Add declaration for free_merger_functions.
17045
17046 * src/reader.c (merge_functions): New variable.
17047 (get_merge_function): New function.
17048 (free_merger_functions): New function.
17049 (readgram): Check for %prec that is not followed by a symbol.
17050 Handle %dprec and %merge declarations.
17051 (packgram): Initialize dprec and merger fields in rules array.
17052
17053 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
17054 conflict_list_cnt, conflict_list_free): New variables.
17055 (table_grow): Also grow conflict_table.
e0e5bf84 17056 (prepare_rules): Output dprec and merger tables.
676385e2 17057 (conflict_row): New function.
e0e5bf84 17058 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
17059 default reduction in conflicted states for GLR parser so that there
17060 are spaces for the conflict lists.
17061 (save_row): Also save conflict information.
17062 (token_actions): Allocate conflict list.
17063 (merger_output): New function.
17064 (pack_vector): Pack conflict table, too.
17065 (output_conflicts): New function to output yyconflp and yyconfl.
17066 (output_check): Allocate conflict_tos.
17067 (output_actions): Output conflict tables, also.
17068 (output_skeleton): Output b4_mergers definition.
17069 (prepare): Output b4_max_rhs_length definition.
17070 Use 'bison.glr' as default skeleton for GLR parsers.
17071
17072 * src/gram.c (glr_parser): New flag.
17073 (grammar_free): Call free_merger_functions.
17074
17075 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
17076 all pairs of conflicting reductions, rather than just all tokens
17077 causing conflicts. Needed to size conflict tables.
e0e5bf84 17078 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
17079 interface.
17080 (conflicts_print): Ditto.
17081 (count_total_conflicts): New function.
17082
17083 * src/reader.h (merger_list): New type.
17084 (merge_functions): New variable.
17085
17086 * src/lex.h (tok_dprec, tok_merge): New token types.
17087
17088 * src/gram.h (rule_s): Add dprec and merger fields.
17089 (glr_parser): New flag.
17090
17091 * src/conflicts.h (count_total_conflicts): New function.
17092
17093 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
17094
17095 * doc/bison.texinfo (Generalized LR Parsing): New section.
17096 (GLR Parsers): New section.
17097 (Language and Grammar): Mention GLR parsing.
17098 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
17099 Correct typo ("tge" -> "the").
17100
17101 * data/bison.glr: New skeleton for GLR parsing.
17102
17103 * tests/cxx-gram.at: New tests for GLR parsing.
17104
17105 * tests/testsuite.at: Include cxx-gram.at.
17106
17107 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 17108
676385e2
PH
17109 * src/parse-gram.y:
17110
17111 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
17112
17113 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 17114
b5480d74 171152002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
17116
17117 * src/options.h, src/options.c: Remove.
17118 * src/getargs.c (short_options, long_options): New.
17119
60491a94
AD
171202002-06-27 Akim Demaille <akim@epita.fr>
17121
17122 * data/bison.simple, data/bison.c++: Rename as...
17123 * data/yacc.c, data/lalr1.cc: these.
17124 * doc/bison.texinfo (Environment Variables): Remove.
17125
9be0c25b
AD
171262002-06-25 Raja R Harinath <harinath@cs.umn.edu>
17127
17128 * src/getargs.c (report_argmatch): Initialize strtok().
17129
1ae72863
AD
171302002-06-20 Akim Demaille <akim@epita.fr>
17131
17132 * data/bison.simple (b4_symbol_actions): New, replaces...
17133 (b4_symbol_destructor, b4_symbol_printer): these.
17134 (yysymprint): Be sure to call YYPRINT only for tokens, and using
17135 user token numbers.
17136
87542d29
AD
171372002-06-20 Akim Demaille <akim@epita.fr>
17138
17139 * data/bison.simple (yydestructor): Rename as...
17140 (yydestruct): this.
17141
1a31ed21
AD
171422002-06-20 Akim Demaille <akim@epita.fr>
17143
17144 * src/symtab.h, src/symtab.c (symbol_type_set)
17145 (symbol_destructor_set, symbol_precedence_set): The location is
17146 the last argument.
17147 Adjust all callers.
17148
e776192e
AD
171492002-06-20 Akim Demaille <akim@epita.fr>
17150
17151 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
17152 internals.
17153 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
17154 Takes a location.
17155 * src/symtab.h, src/symtab.c (symbol_class_set)
17156 (symbol_user_token_number_set): Likewise.
17157 Adjust all callers.
17158 Promote complain_at.
17159 * tests/input.at (Type Clashes): Adjust.
17160
5c1180b3
AD
171612002-06-20 Akim Demaille <akim@epita.fr>
17162
17163 * data/bison.simple (YYLEX): Fix the declaration when
17164 %pure-parser.
17165
e3170060
AD
171662002-06-20 Akim Demaille <akim@epita.fr>
17167
17168 * data/bison.simple (yysymprint): Don't print the token number,
17169 just its name.
17170 * tests/actions.at (Destructors): Rename as...
17171 (Printers and Destructors): this.
17172 Also exercise %printer.
17173
253862fd
AD
171742002-06-20 Akim Demaille <akim@epita.fr>
17175
17176 * data/bison.simple (YYDSYMPRINT): New.
17177 Use it to remove many of the #if YYDEBUG/if (yydebug).
17178
366eea36
AD
171792002-06-20 Akim Demaille <akim@epita.fr>
17180
17181 * src/symtab.h, src/symtab.c (symbol_t): printer and
17182 printer_location are new members.
17183 (symbol_printer_set): New.
17184 * src/parse-gram.y (PERCENT_PRINTER): New token.
17185 Handle its associated rule.
17186 * src/scan-gram.l: Adjust.
17187 (handle_destructor_at, handle_destructor_dollar): Rename as...
17188 (handle_symbol_code_at, handle_symbol_code_dollar): these.
17189 * src/output.c (symbol_printers_output): New.
17190 (output_skeleton): Call it.
17191 * data/bison.simple (yysymprint): New. Cannot be named yyprint
17192 since there are already many grammar files with a user `yyprint'.
17193 Replace the calls to YYPRINT to calls to yysymprint.
17194 * tests/calc.at: Adjust.
17195 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
17196 taking advantage of parser very internal details (stack size!).
17197
4f25ebb0
AD
171982002-06-20 Akim Demaille <akim@epita.fr>
17199
17200 * src/scan-gram.l: Complete the scanner with the missing patterns
17201 to pacify Flex.
17202 Use `quote' and `symbol_tag_get' where appropriate.
17203
93b68a0e
AD
172042002-06-19 Akim Demaille <akim@epita.fr>
17205
17206 * tests/actions.at (Destructors): Augment to test locations.
17207 * data/bison.simple (yydestructor): Pass it the current location
17208 if locations are enabled.
17209 Prototype only when __STDC__ or C++.
17210 Change the argument names to move into the yy name space: there is
17211 user code here.
17212
58612f1d
AD
172132002-06-19 Akim Demaille <akim@epita.fr>
17214
74310291
AD
17215 * data/bison.simple (b4_pure_if): New.
17216 Use it instead of #ifdef YYPURE.
17217
172182002-06-19 Akim Demaille <akim@epita.fr>
17219
17220 * data/bison.simple (b4_location_if): New.
58612f1d
AD
17221 Use it instead of #ifdef YYLSP_NEEDED.
17222
f25bfb75
AD
172232002-06-19 Akim Demaille <akim@epita.fr>
17224
17225 Prepare @$ in %destructor, but currently don't bind it in the
17226 skeleton, as %location use is not cleaned up yet.
17227
17228 * src/scan-gram.l (handle_dollar, handle_destructor_at)
17229 (handle_action_at): New.
17230 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
17231 a braced_code_t and a location as additional arguments.
17232 (handle_destructor_dollar): Instead of requiring `b4_eval', just
17233 unquote one when outputting `b4_dollar_dollar'.
17234 Adjust callers.
17235 * data/bison.simple (b4_eval): Remove.
17236 (b4_symbol_destructor): Adjust.
17237 * tests/input.at (Invalid @n): Adjust.
17238
c732d2c6
AD
172392002-06-19 Zack Weinberg <zack@codesourcery.com>
17240
17241 * doc/bison.texinfo: Document ability to have multiple
17242 prologue sections.
17243
8c165d89
AD
172442002-06-18 Akim Demaille <akim@epita.fr>
17245
17246 * src/files.c (compute_base_names): When computing the output file
17247 names from the input file name, strip the directory part.
17248
ca98bf57
AD
172492002-06-18 Akim Demaille <akim@epita.fr>
17250
17251 * data/bison.simple.new: Comment changes.
17252 Reported by Andreas Schwab.
17253
0bfb02ff
AD
172542002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
17255
17256 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
17257 there are no `label `yyoverflowlab' defined but not used' warnings
17258 when yyoverflow is defined.
17259
24c0aad7
AD
172602002-06-18 Akim Demaille <akim@epita.fr>
17261
17262 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
17263 new member.
17264 (symbol_destructor_set): Adjust.
17265 * src/output.c (symbol_destructors_output): Output the destructor
17266 locations.
17267 Output the symbol name.
17268 * data/bison.simple (b4_symbol_destructor): Adjust.
17269
5719c109
AD
172702002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
17271 and Akim Demaille <akim@epita.fr>
17272
17273 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
17274 what's left on the stack when the error recovery hits EOF.
17275 * tests/actions.at (Destructors): Complete to exercise this case.
17276
9280d3ef
AD
172772002-06-17 Akim Demaille <akim@epita.fr>
17278
17279 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
17280 arguments is really empty, not only equal to `[]'.
17281 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
17282 member.
17283 (symbol_destructor_set): New.
17284 * src/output.c (symbol_destructors_output): New.
17285 * src/reader.h (brace_code_t, current_braced_code): New.
17286 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
17287 (handle_dollar): Rename as...
17288 (handle_action_dollar): this.
17289 (handle_destructor_dollar): New.
17290 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
17291 (grammar_declaration): Use it.
17292 * data/bison.simple (yystos): Is always defined.
17293 (yydestructor): New.
17294 * tests/actions.at (Destructors): New.
17295 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
17296
dafdc66f
AD
172972002-06-17 Akim Demaille <akim@epita.fr>
17298
17299 * src/symlist.h, src/symlist.c (symbol_list_length): New.
17300 * src/scan-gram.l (handle_dollar, handle_at): Compute the
17301 rule_length only when needed.
17302 * src/output.c (actions_output, token_definitions_output): Output
17303 the full M4 block.
17304 * src/symtab.c: Don't access directly to the symbol tag, use
17305 symbol_tag_get.
17306 * src/parse-gram.y: Use symbol_list_free.
17307
56c47203
AD
173082002-06-17 Akim Demaille <akim@epita.fr>
17309
17310 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
17311 (symbol_list_prepend, get_type_name): Move to...
17312 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
17313 (symbol_list_prepend, symbol_list_n_type_name_get): here.
17314 Adjust all callers.
17315 (symbol_list_free): New.
17316 * src/scan-gram.l (handle_dollar): Takes a location.
17317 * tests/input.at (Invalid $n): Adjust.
17318
1e0bab92
AD
173192002-06-17 Akim Demaille <akim@epita.fr>
17320
17321 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17322 (symbol_list_prepend): New.
17323 * src/parse-gram.y (%union): `list' is a new member.
17324 (symbols.1): New, replaces...
17325 (terms_to_prec.1, nterms_to_type.1): these.
17326 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17327 Take a location as additional argument.
17328 Adjust all callers.
17329
04e60654
AD
173302002-06-15 Akim Demaille <akim@epita.fr>
17331
17332 * src/parse-gram.y: Move %token in the declaration section so that
17333 we don't depend upon CVS Bison.
17334
10e5b8bd
AD
173352002-06-15 Akim Demaille <akim@epita.fr>
17336
17337 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17338 * src/print.c (print_core): Use it.
17339
9801d40c
AD
173402002-06-15 Akim Demaille <akim@epita.fr>
17341
17342 * src/conflicts.c (log_resolution): Accept the rule involved in
17343 the sr conflicts instead of the lookahead number that points to
17344 that rule.
17345 (flush_reduce): Accept the current lookahead vector as argument,
17346 instead of the index in LA.
17347 (resolve_sr_conflict): Accept the current number of lookahead
17348 bitset to consider for the STATE, instead of the index in LA.
17349 (set_conflicts): Adjust.
17350 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17351
c0263492
AD
173522002-06-15 Akim Demaille <akim@epita.fr>
17353
17354 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17355 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17356 Adjust all dependencies.
17357 * src/lalr.c (initialize_lookaheads): Split into...
17358 (states_lookaheads_count, states_lookaheads_initialize): these.
17359 (lalr): Adjust.
17360
9757c359
AD
173612002-06-15 Akim Demaille <akim@epita.fr>
17362
17363 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17364 out of...
17365 (grammar_rules_print): here.
17366 * src/reduce.c (reduce_output): Use it.
17367 * tests/reduce.at (Useless Rules, Reduced Automaton)
17368 (Underivable Rules): Adjust.
17369
6b98e4b5
AD
173702002-06-15 Akim Demaille <akim@epita.fr>
17371
17372 Copy BYacc's nice way to report the grammar.
17373
17374 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17375 New.
17376 Don't print the rules' location, it is confusing and useless.
17377 (rule_print): Use grammar_rhs_print.
17378 * src/print.c (print_grammar): Use grammar_rules_print.
17379
6b98e4b5
AD
173802002-06-15 Akim Demaille <akim@epita.fr>
17381
17382 Complete and rationalize `useless thing' warnings.
17383
17384 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17385 (symbol_tag_print): New.
17386 Use them everywhere in place of accessing directly the tag member.
17387 * src/gram.h, src/gram.c (rule_print): New.
17388 Use it where a rule used to be printed `by hand'.
17389 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17390 (reduce_grammar_tables): Report the useless rules.
17391 (reduce_print): Useless things are a warning, not an error.
17392 Report it as such.
17393 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17394 (Reduced Automaton, Underivable Rules): Adjust.
17395 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17396 * tests/conflicts.at (Unresolved SR Conflicts)
17397 (Solved SR Conflicts): Adjust.
17398
ee000ba4
AD
173992002-06-15 Akim Demaille <akim@epita.fr>
17400
17401 Let symbols have a location.
17402
17403 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
17404 (getsym): Adjust.
17405 Adjust all callers.
17406 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
17407 Use location_t, not int.
17408 * src/symtab.c (symbol_check_defined): Take advantage of the
17409 location.
17410 * tests/regression.at (Invalid inputs): Adjust.
17411
8efe435c
AD
174122002-06-15 Akim Demaille <akim@epita.fr>
17413
17414 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
17415 (input): Don't try to initialize yylloc here, do it in the
17416 scanner.
17417 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
17418 * src/gram.h (rule_t): Change line and action_line into location
17419 and action_location, of location_t type.
17420 Adjust all dependencies.
17421 * src/location.h, src/location.c (empty_location): New.
17422 * src/reader.h, src/reader.c (grammar_start_symbol_set)
17423 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
17424 (grammar_current_rule_symbol_append)
17425 (grammar_current_rule_action_append): Expect a location as argument.
17426 * src/reader.c (grammar_midrule_action): Adjust to attach an
17427 action's location as dummy symbol location.
17428 * src/symtab.h, src/symtab.c (startsymbol_location): New.
17429 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
17430 the line numbers.
17431
1921f1d7
AD
174322002-06-14 Akim Demaille <akim@epita.fr>
17433
17434 Grammar declarations may be found in the grammar section.
17435
17436 * src/parse-gram.y (rules_or_grammar_declaration): New.
17437 (declarations): Each declaration may end with a semicolon, not
17438 just...
17439 (grammar_declaration): `"%union"'.
17440 (grammar): Branch to rules_or_grammar_declaration.
17441
4515534c
AD
174422002-06-14 Akim Demaille <akim@epita.fr>
17443
17444 * src/main.c (main): Invoke scanner_free.
17445
f958596b
AD
174462002-06-14 Akim Demaille <akim@epita.fr>
17447
17448 * src/output.c (m4_invoke): Extracted from...
17449 (output_skeleton): here.
17450 Free tempfile.
17451
2c569025
AD
174522002-06-14 Akim Demaille <akim@epita.fr>
17453
17454 * src/parse-gram.y (directives, directive, gram)
17455 (grammar_directives, precedence_directives, precedence_directive):
17456 Rename as...
17457 (declarations, declaration, grammar, grammar_declaration)
17458 (precedence_declaration, precedence_declarator): these.
17459 (symbol_declaration): New.
17460
592e8d4d
AD
174612002-06-14 Akim Demaille <akim@epita.fr>
17462
17463 * src/files.c (action_obstack): Remove, unused.
17464 (output_obstack): Remove it, and all its dependencies, as it is no
17465 longer needed.
17466 * src/reader.c (epilogue_set): Build the epilogue in the
17467 muscle_obstack.
17468 * src/output.h, src/output.c (muscle_obstack): Move to...
17469 * src/muscle_tab.h, src/muscle_tab.h: here.
17470 (muscle_init): Initialize muscle_obstack.
17471 (muscle_free): New.
17472 * src/main.c (main): Call it.
17473
0c15323d
AD
174742002-06-14 Akim Demaille <akim@epita.fr>
17475
17476 * src/location.h: New, extracted from...
17477 * src/reader.h: here.
17478 * src/Makefile.am (noinst_HEADERS): Merge into
17479 (bison_SOURCES): this.
17480 Add location.h.
17481 * src/parse-gram.y: Use location_t instead of Bison's.
17482 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
17483 Use location_t instead of ints.
17484
e96c9728
AD
174852002-06-14 Akim Demaille <akim@epita.fr>
17486
17487 * data/bison.simple, data/bison.c++: Be sure to restore the
17488 current #line when returning to the skeleton contents after having
17489 exposed the input file's #line.
17490
75d1fe16
AD
174912002-06-12 Akim Demaille <akim@epita.fr>
17492
17493 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
17494 eager.
17495 * tests/actions.at (Exotic Dollars): New.
17496
6c35d22c
AD
174972002-06-12 Akim Demaille <akim@epita.fr>
17498
17499 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
17500 ['"/] too eagerly.
17501 * tests/input.at (Torturing the Scanner): New.
17502
1d6412ad
AD
175032002-06-11 Akim Demaille <akim@epita.fr>
17504
17505 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
17506 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
17507 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
17508 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
17509 * src/reader.c (reader): Use it.
17510
4cdb01db
AD
175112002-06-11 Akim Demaille <akim@epita.fr>
17512
17513 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
17514 Adjust all callers.
17515 (scanner_last_string_free): New.
17516
44995b2e
AD
175172002-06-11 Akim Demaille <akim@epita.fr>
17518
17519 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
17520 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
17521 (last_string, YY_OBS_FREE): New.
17522 Use them when returning an ID.
17523
e9955c83
AD
175242002-06-11 Akim Demaille <akim@epita.fr>
17525
17526 Have Bison grammars parsed by a Bison grammar.
17527
17528 * src/reader.c, src/reader.h (prologue_augment): New.
17529 * src/reader.c (copy_definition): Remove.
17530
17531 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
17532 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
17533 (grammar_current_rule_prec_set, grammar_current_rule_check)
17534 (grammar_current_rule_symbol_append)
17535 (grammar_current_rule_action_append): Export.
17536 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
17537 (symbol_list_action_append): Remove.
17538 Hook the routines from reader.
17539 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17540 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
17541
17542 * src/reader.c (read_declarations): Remove, unused.
17543
17544 * src/parse-gram.y: Handle the epilogue.
17545 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
17546 (grammar_start_symbol_set): this.
17547 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
17548 * src/reader.c (readgram): Remove, unused.
17549 (reader): Adjust to insert eoftoken and axiom where appropriate.
17550
17551 * src/reader.c (copy_dollar): Replace with...
17552 * src/scan-gram.h (handle_dollar): this.
17553 * src/parse-gram.y: Remove `%thong'.
17554
17555 * src/reader.c (copy_at): Replace with...
17556 * src/scan-gram.h (handle_at): this.
17557
17558 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17559 New.
17560
17561 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17562 time being.
17563
17564 * src/reader.h, src/reader.c (grammar_rule_end): New.
17565
17566 * src/parse.y (current_type, current_class): New.
17567 Implement `%nterm', `%token' support.
17568 Merge `%term' into `%token'.
17569 (string_as_id): New.
17570 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17571 type name.
17572
17573 * src/parse-gram.y: Be sure to handle properly the beginning of
17574 rules.
17575
17576 * src/parse-gram.y: Handle %type.
17577 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17578
17579 * src/parse-gram.y: More directives support.
17580 * src/options.c: No longer handle source directives.
17581
17582 * src/parse-gram.y: Fix %output.
17583
17584 * src/parse-gram.y: Handle %union.
17585 Use the prologue locations.
17586 * src/reader.c (parse_union_decl): Remove.
17587
17588 * src/reader.h, src/reader.c (epilogue_set): New.
17589 * src/parse-gram.y: Use it.
17590
17591 * data/bison.simple, data/bison.c++: b4_stype is now either not
17592 defined, then default to int, or to the contents of %union,
17593 without `union' itself.
17594 Adjust.
17595 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17596
17597 * src/output.c (actions_output): Don't output braces, as they are
17598 already handled by the scanner.
17599
17600 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17601 characters to themselves.
17602
17603 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17604 that the epilogue has a proper #line.
17605
17606 * src/parse-gram.y: Handle precedence/associativity.
17607
17608 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17609 a terminal.
17610 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17611 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17612 at all to define terminals that cannot be emitted.
17613
17614 * src/scan-gram.l: Escape M4 characters.
17615
17616 * src/scan-gram.l: Working properly with escapes in user
17617 strings/characters.
17618
17619 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17620 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17621 grammar.
17622 Use more modest sizes, as for the time being the parser does not
17623 release memory, and therefore the process swallows a huge amount
17624 of memory.
17625
17626 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17627 stricter %token grammar.
17628
17629 * src/symtab.h (associativity): Add `undef_assoc'.
17630 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17631 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17632
17633 * tests/regression.at (Invalid %directive): Remove, as it is now
17634 meaningless.
17635 (Invalid inputs): Adjust to the new error messages.
17636 (Token definitions): The new grammar doesn't allow too many
17637 eccentricities.
17638
17639 * src/lex.h, src/lex.c: Remove.
17640 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17641 (copy_character, copy_string2, copy_string, copy_identifier)
17642 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17643 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17644 (parse_action): Remove.
17645 * po/POTFILES.in: Adjust.
17646
2e047461
AD
176472002-06-11 Akim Demaille <akim@epita.fr>
17648
cd05d13c 17649 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
17650 rule's action member: return the action as a string.
17651 Don't require `rule_length' as an argument: compute it.
17652 (grammar_current_rule_symbol_append)
17653 (grammar_current_rule_action_append): New, eved out from
17654 (readgram): here.
17655 Remove `action_flag', `rulelength', unused now.
17656
9af3fbce
AD
176572002-06-11 Akim Demaille <akim@epita.fr>
17658
17659 * src/reader.c (grammar_current_rule_prec_set).
17660 (grammar_current_rule_check): New, eved out from...
17661 (readgram): here.
17662 Remove `xaction', `first_rhs': useless.
17663 * tests/input.at (Type clashes): New.
17664 * tests/existing.at (GNU Cim Grammar): Adjust.
17665
1485e106
AD
176662002-06-11 Akim Demaille <akim@epita.fr>
17667
17668 * src/reader.c (grammar_midrule_action): New, Eved out from
17669 (readgram): here.
17670
da4160c3
AD
176712002-06-11 Akim Demaille <akim@epita.fr>
17672
17673 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17674 New.
17675 (readgram): Use them as replacement of inlined code, crule and
17676 crule1.
17677
f6d0f937
AD
176782002-06-11 Akim Demaille <akim@epita.fr>
17679
17680 * src/reader.c (grammar_end, grammar_symbol_append): New.
17681 (readgram): Use them.
17682 Make the use of `p' as local as possible.
17683
69078d4b
AD
176842002-06-10 Akim Demaille <akim@epita.fr>
17685
17686 GCJ's parser requires the tokens to be defined before the prologue.
17687
17688 * data/bison.simple: Output the token definition before the user's
17689 prologue.
17690 * tests/regression.at (Braces parsing, Duplicate string)
17691 (Mixing %token styles): Check the output from bison.
17692 (Early token definitions): New.
17693
5e424082
AD
176942002-06-10 Akim Demaille <akim@epita.fr>
17695
17696 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17697 assigning twice the same user number to a token, so that we can
17698 use it in...
17699 * src/lex.c (lex): here.
17700 Also use `symbol_class_set' instead of hand written code.
17701 * src/reader.c (parse_assoc_decl): Likewise.
17702
44536b35
AD
177032002-06-10 Akim Demaille <akim@epita.fr>
17704
17705 * src/symtab.c, src/symtab.c (symbol_class_set)
17706 (symbol_user_token_number_set): New.
17707 * src/reader.c (parse_token_decl): Use them.
17708 Use a switch instead of ifs.
17709 Use a single argument.
17710
8b9f2372
AD
177112002-06-10 Akim Demaille <akim@epita.fr>
17712
17713 Remove `%thong' support as it is undocumented, unused, duplicates
17714 `%token's job, and creates useless e-mail traffic with people who
17715 want to know what it is, why it is undocumented, unused, and
17716 duplicates `%token's job.
17717
17718 * src/reader.c (parse_thong_decl): Remove.
17719 * src/options.c (option_table): Remove "thong".
17720 * src/lex.h (tok_thong): Remove.
17721
3ae2b51f
AD
177222002-06-10 Akim Demaille <akim@epita.fr>
17723
17724 * src/symtab.c, src/symtab.c (symbol_type_set)
17725 (symbol_precedence_set): New.
17726 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17727 (value_components_used): Remove, unused.
17728
2f1afb73
AD
177292002-06-09 Akim Demaille <akim@epita.fr>
17730
17731 Move symbols handling code out of the reader.
17732
17733 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17734 (axiom): Move to...
17735 * src/symtab.h, src/symtab.c: here.
17736
17737 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17738 * src/reader.c (startval): Rename as...
17739 * src/symtab.h, src/symtab.c (startsymbol): this.
17740 * src/reader.c: Adjust.
17741
17742 * src/reader.c (symbol_check_defined, symbol_make_alias)
17743 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17744 (token_translations_init)
17745 Move to...
17746 * src/symtab.c: here.
17747 * src/reader.c (packsymbols): Move to...
17748 * src/symtab.h, src/symtab.c (symbols_pack): here.
17749 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17750 argument.
17751
e9bca3ad
AD
177522002-06-03 Akim Demaille <akim@epita.fr>
17753
17754 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17755 then statements.
17756
86eff183
AD
177572002-06-03 Akim Demaille <akim@epita.fr>
17758
17759 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17760 structs with non literals.
17761 * src/scan-skel.l: never-interactive.
17762 * src/conflicts.c (enum conflict_resolution_e): No trailing
17763 comma.
17764 * src/getargs.c (usage): Split long literal strings.
17765 Reported by Hans Aberg.
17766
717be197
AD
177672002-05-28 Akim Demaille <akim@epita.fr>
17768
17769 * data/bison.c++: Use C++ ostreams.
17770 (cdebug_): New member.
17771
670ddffd
AD
177722002-05-28 Akim Demaille <akim@epita.fr>
17773
17774 * src/output.c (output_skeleton): Be sure to allocate enough room
17775 for `/' _and_ for `\0' in full_skeleton.
17776
769b430f
AD
177772002-05-28 Akim Demaille <akim@epita.fr>
17778
17779 * data/bison.c++: Catch up with bison.simple:
17780 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17781 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17782 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17783 and popping traces.
17784
7067cb36
PH
177852002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17786
17787 * src/output.c (output_skeleton): Put an explicit path in front of
17788 the skeleton file name, rather than relying on the -I directory,
17789 to partially alleviate effects of having a skeleton file lying around
17790 in the current directory.
769b430f 17791
4a713ec2
PH
177922002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17793
769b430f 17794 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
17795 obstack_printf should be obstack_fgrow1.
17796
b408954b
AD
177972002-05-26 Akim Demaille <akim@epita.fr>
17798
17799 * src/state.h (state_t): `solved_conflicts' is a new member.
17800 * src/LR0.c (new_state): Set it to 0.
17801 * src/conflicts.h, src/conflicts.c (print_conflicts)
17802 (free_conflicts, solve_conflicts): Rename as...
17803 (conflicts_print, conflicts_free, conflicts_solve): these.
17804 Adjust callers.
17805 * src/conflicts.c (enum conflict_resolution_e)
17806 (solved_conflicts_obstack): New, used by...
17807 (log_resolution): this.
17808 Adjust to attach the conflict resolution to each state.
17809 Complete the description with the precedence/associativity
17810 information.
17811 (resolve_sr_conflict): Adjust.
17812 * src/print.c (print_state): Output its solved_conflicts.
17813 * tests/conflicts.at (Unresolved SR Conflicts)
17814 (Solved SR Conflicts): Exercise --report=all.
17815
a49aecd5
AD
178162002-05-26 Akim Demaille <akim@epita.fr>
17817
17818 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17819 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17820 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17821 (token_number_t, item_number_as_token_number)
17822 (token_number_as_item_number, muscle_insert_token_number_table):
17823 Rename as...
17824 (symbol_number_t, item_number_as_symbol_number)
17825 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17826 these, since it is more appropriate.
17827
5504898e
AD
178282002-05-26 Akim Demaille <akim@epita.fr>
17829
17830 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17831 `Error:' lines.
17832 * data/bison.simple (yystos) [YYDEBUG]: New.
17833 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17834 error recovery.
17835 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17836
ec3bc396
AD
178372002-05-25 Akim Demaille <akim@epita.fr>
17838
17839 * doc/bison.texinfo (Debugging): Split into...
17840 (Tracing): this new section, its former contents, and...
17841 (Understanding): this new section.
17842 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17843 by...
17844 (report_flag): this.
17845 Adjust all dependencies.
17846 (report_args, report_types, report_argmatch): New.
17847 (usage, getargs): Report/support -r, --report.
17848 * src/options.h
17849 (struct option_table_struct): Rename as..,
17850 (struct option_table_s): this.
17851 Rename the `set_flag' member to `flag' to match with getopt_long's
17852 struct.
17853 * src/options.c (option_table): Split verbose into an entry for
17854 %verbose, and another for --verbose.
17855 Support --report/-r, so remove -r from the obsolete --raw.
17856 * src/print.c: Attach full item sets and lookaheads reports to
17857 report_flag instead of trace_flag.
17858 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17859
78df8250
PE
178602002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17861 and Paul Eggert <eggert@twinsun.com>
769b430f 17862
78df8250
PE
17863 * data/bison.simple (yyparse): Correct error handling to conform to
17864 POSIX and yacc. Specifically, after syntax error is discovered,
17865 do not reduce further before shifting the error token.
17866 Clean up the code a bit by removing the labels yyerrdefault,
17867 yyerrhandle, yyerrpop.
17868 * NEWS: Document the above.
17869
c0c9ea05
PH
178702002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17871
17872 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17873 type; it isn't always big enough, since it doesn't necessarily
17874 include non-terminals.
769b430f 17875 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
17876 the latter can be removed.
17877 (yy_token_number_type): Remove, only one use.
17878 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17879 don't use TokenNumberType as element type.
769b430f 17880
c0c9ea05
PH
17881 * tests/regression.at: Modify expected output to agree with change
17882 to yyr1 and yytranslate.
769b430f 17883
6390a83f
FK
178842002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17885
17886 * src/reader.c (parse_action): Use copy_character instead of
17887 obstack_1grow.
17888
db7c8e9a
AD
178892002-05-13 Akim Demaille <akim@epita.fr>
17890
17891 * tests/regression.at (Token definitions): Prototype yylex and
17892 yyerror.
17893
fcc61800
PH
178942002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17895
158c687b 17896 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
17897 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
17898 32-bit arithmetic.
17899 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
17900
5683e9b2
AD
179012002-05-07 Akim Demaille <akim@epita.fr>
17902
17903 * tests/synclines.at: Be sure to prototype yylex and yyerror to
17904 avoid GCC warnings.
17905
0c2d3f4c
AD
179062002-05-07 Akim Demaille <akim@epita.fr>
17907
17908 Kill GCC warnings.
17909
17910 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
17911 over the RHS of each rule.
17912 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
17913 * src/state.h (state_t): Member `nitems' is unsigned short.
17914 * src/LR0.c (get_state): Adjust.
17915 * src/reader.c (packgram): Likewise.
17916 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
17917 `Type'.
17918 (muscle_insert_int_table): Remove, unused.
17919 (prepare_rules): Remove `max'.
17920
1565b720
AD
179212002-05-06 Akim Demaille <akim@epita.fr>
17922
17923 * src/closure.c (print_firsts): Display of the symbol tags.
17924 (bitmatrix_print): Move to...
17925 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
17926 here.
17927 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
17928
cfaee611
AD
179292002-05-06 Akim Demaille <akim@epita.fr>
17930
17931 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
17932 hash_do_for_each.
17933
458be8e0
AD
179342002-05-06 Akim Demaille <akim@epita.fr>
17935
17936 * src/LR0.c (new_state, get_state): Instead of using the global
17937 `kernel_size' and `kernel_base', have two new arguments:
17938 `core_size' and `core'.
17939 Adjust callers.
17940
a900a624
AD
179412002-05-06 Akim Demaille <akim@epita.fr>
17942
17943 * src/reader.c (packgram): No longer end `ritem' with a 0
17944 sentinel: it is not used.
17945
d4e7d3a1
AD
179462002-05-05 Akim Demaille <akim@epita.fr>
17947
17948 New experimental feature: display the lookaheads in the report and
17949 graph.
17950
17951 * src/print (print_core): When --trace-flag, display the rules
17952 lookaheads.
17953 * src/print_graph.c (print_core): Likewise.
17954 Swap the arguments.
17955 Adjust caller.
17956
39ceb25b
AD
179572002-05-05 Akim Demaille <akim@epita.fr>
17958
17959 * tests/torture.at (Many lookaheads): New test.
17960
5372019f
AD
179612002-05-05 Akim Demaille <akim@epita.fr>
17962
17963 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
17964 (GENERATE_MUSCLE_INSERT_TABLE): this.
17965 (output_int_table, output_unsigned_int_table, output_short_table)
17966 (output_token_number_table, output_item_number_table): Replace with...
17967 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
17968 (muscle_insert_short_table, muscle_insert_token_number_table)
17969 (muscle_insert_item_number_table): these.
17970 Adjust all callers.
17971 (prepare_tokens): Don't free `translations', since...
17972 * src/reader.h, src/reader.c (grammar_free): do it.
17973 Move to...
17974 * src/gram.h, src/gram.c (grammar_free): here.
17975 * data/bison.simple, data/bison.c++: b4_token_number_max is now
17976 b4_translate_max.
17977
5df5f6d5
AD
179782002-05-05 Akim Demaille <akim@epita.fr>
17979
17980 * src/output.c (output_unsigned_int_table): New.
17981 (prepare_rules): `i' is unsigned.
17982 `prhs', `rline', `r2' are unsigned int.
17983 Rename muscle `rhs_number_max' as `rhs_max'.
17984 Output muscles `prhs_max', `rline_max', and `r2_max'.
17985 Free rline and r1.
17986 * data/bison.simple, data/bison.c++: Adjust to use these muscles
17987 to compute types instead of constant types.
17988 * tests/regression.at (Web2c Actions): Adjust.
17989
b87f8b21
AD
179902002-05-04 Akim Demaille <akim@epita.fr>
17991
17992 * src/symtab.h (SALIAS, SUNDEF): Rename as...
17993 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
17994 Adjust dependencies.
17995 * src/output.c (token_definitions_output): Be sure not to output a
17996 `#define 'a'' when fed with `%token 'a' "a"'.
17997 * tests/regression.at (Token definitions): New.
17998
8bb936e4
PE
179992002-05-03 Paul Eggert <eggert@twinsun.com>
18000
18001 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18002 for K&R C.
18003
180042002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18005
18006 * Makefile.am (SUBDIRS): Remove intl.
18007 (EXTRA_DIST): Add config/config.rpath.
18008
53c71a12
AD
180092002-05-03 Akim Demaille <akim@epita.fr>
18010
18011 * data/bison.simple (m4_if): Don't output empty enums.
18012 And actually, output valid enum definitions :(.
18013
289dd0cf
AD
180142002-05-03 Akim Demaille <akim@epita.fr>
18015
18016 * configure.bat: Remove, completely obsolete.
18017 * Makefile.am (EXTRA_DIST): Adjust.
18018 Don't distribute config.rpath...
18019 * config/Makefile.am (EXTRA_DIST): Do it.
18020
db85e524
AD
180212002-05-03 Akim Demaille <akim@epita.fr>
18022
18023 * configure.in (GETTEXT_VERSION): New.
18024 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
18025
83ccf991
AD
180262002-05-03 Akim Demaille <akim@epita.fr>
18027
18028 * data/bison.simple (b4_token_enum): New.
18029 (b4_token_defines): Use it to output tokens both as #define and
18030 enums.
18031 Suggested by Paul Eggert.
18032 * src/output.c (token_definitions_output): Don't output spurious
18033 white spaces.
18034
1f418995
AD
180352002-05-03 Akim Demaille <akim@epita.fr>
18036
18037 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18038
45119f04
RA
180392002-05-02 Robert Anisko <robert@lrde.epita.fr>
18040
18041 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
18042 Update the stack class, give a try to deque as the default container.
18043
b2d52318
AD
180442002-05-02 Akim Demaille <akim@epita.fr>
18045
18046 * data/bison.simple (yyparse): Do not implement @$ = @1.
18047 (YYLLOC_DEFAULT): Adjust to do it.
18048 * doc/bison.texinfo (Location Default Action): Fix.
18049
3a8b4109
AD
180502002-05-02 Akim Demaille <akim@epita.fr>
18051
18052 * src/reader.c (parse_braces): Merge into...
18053 (parse_action): this.
18054
84614e13
AD
180552002-05-02 Akim Demaille <akim@epita.fr>
18056
18057 * configure.in (ALL_LINGUAS): Remove.
18058 * po/LINGUAS, hr.po: New.
18059
fdbcd8e2
AD
180602002-05-02 Akim Demaille <akim@epita.fr>
18061
18062 Remove the so called hairy (semantic) parsers.
18063
18064 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
18065 * src/gram.h, src/gram.c (semantic_parser): Remove.
18066 (rule_t): Remove the guard and guard_line members.
18067 * src/lex.h (token_t): remove tok_guard.
18068 * src/options.c (option_table): Remove %guard and %semantic_parser
18069 support.
18070 * src/output.c, src/output.h (guards_output): Remove.
18071 (prepare): Adjust.
18072 (token_definitions_output): Don't output the `T'
18073 tokens (???).
18074 (output_skeleton): Don't output the guards.
18075 * src/files.c, src/files.c (attrsfile): Remove.
18076 * src/reader.c (symbol_list): Remove the guard and guard_line
18077 members.
18078 Adjust dependencies.
18079 (parse_guard): Remove.
18080 * data/bison.hairy: Remove.
18081 * doc/bison.texinfo (Environment Variables): Remove occurrences of
18082 BISON_HAIRY.
18083
82b6cb3f
AD
180842002-05-02 Akim Demaille <akim@epita.fr>
18085
18086 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
18087 (parse_guard): Rename the formal argument `stack_offset' as
18088 `rule_length', which is more readable.
18089 Adjust callers.
18090 (copy_at, copy_dollar): Instead of outputting the hard coded
18091 values of $$, $n and so forth, output invocation to b4_lhs_value,
18092 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
18093 Note: this patch partially drops `semantic-parser' support: it
18094 always does `rule_length - n', where semantic parsers ought to
18095 always use `-n'.
82b6cb3f
AD
18096 * data/bison.simple, data/bison.c++ (b4_lhs_value)
18097 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
18098
6cbfbcc5
AD
180992002-05-02 Akim Demaille <akim@epita.fr>
18100
18101 * configure.in (AC_INIT): Bump to 1.49b.
18102 (AM_INIT_AUTOMAKE): Short invocation.
18103
b8548114
AD
181042002-05-02 Akim Demaille <akim@epita.fr>
18105
18106 Version 1.49a.
18107
c20cd1fa
AD
181082002-05-01 Akim Demaille <akim@epita.fr>
18109
18110 * src/skeleton.h: Remove.
18111
8a9566d4
AD
181122002-05-01 Akim Demaille <akim@epita.fr>
18113
18114 * src/skeleton.h: Fix the #endif.
18115 Reported by Magnus Fromreide.
18116
8c6d399a
PE
181172002-04-26 Paul Eggert <eggert@twinsun.com>
18118
18119 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
18120 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 18121 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 18122
2b7ed18a
RA
181232002-04-25 Robert Anisko <robert@lrde.epita.fr>
18124
18125 * src/scan-skel.l: Postprocess quadrigraphs.
18126
18127 * src/reader.c (copy_character): New function, used to output
18128 single characters while replacing `[' and `]' with quadrigraphs, to
18129 avoid troubles with M4 quotes.
18130 (copy_comment): Output characters with copy_character.
18131 (read_additionnal_code): Likewise.
18132 (copy_string2): Likewise.
18133 (copy_definition): Likewise.
18134
18135 * tests/calc.at: Exercise M4 quoting.
18136
34a89c50
AD
181372002-04-25 Akim Demaille <akim@epita.fr>
18138
18139 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
18140 between `!' and the command.
18141 Reported by Paul Eggert.
18142
0dd1580a
RA
181432002-04-24 Robert Anisko <robert@lrde.epita.fr>
18144
18145 * tests/calc.at: Exercise prologue splitting.
18146
18147 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
18148 `b4_post_prologue' instead of `b4_prologue'.
18149
18150 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
18151 muscles.
18152 (output): Free pre_prologue_obstack and post_prologue_obstack.
18153 * src/files.h, src/files.c (attrs_obstack): Remove.
18154 (pre_prologue_obstack, post_prologue_obstack): New.
18155 * src/reader.c (copy_definition): Add a parameter to specify the
18156 obstack to fill, instead of using attrs_obstack unconditionally.
18157 (read_declarations): Pass pre_prologue_obstack to copy_definition if
18158 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
18159
83c1796f
PE
181602002-04-23 Paul Eggert <eggert@twinsun.com>
18161
18162 * data/bison.simple: Remove unnecessary commentary and white
18163 space differences from 1_29-branch.
18164 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
18165
18166 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
18167 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
18168 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
18169 constructors or destructors.
18170
18171 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
18172
1207eeac
AD
181732002-04-23 Akim Demaille <akim@epita.fr>
18174
18175 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
18176 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
18177 location with columns.
18178 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
18179 All reported by Paul Eggert.
18180
78ab8f67
AD
181812002-04-22 Akim Demaille <akim@epita.fr>
18182
18183 * src/reduce.c (dump_grammar): Move to...
18184 * src/gram.h, src/gram.c (grammar_dump): here.
18185 Be sure to separate long item numbers.
18186 Don't read the members of a rule's prec if its nil.
18187
133c20e2
AD
181882002-04-22 Akim Demaille <akim@epita.fr>
18189
18190 * src/output.c (table_size, table_grow): New.
18191 (MAXTABLE): Remove, replace uses with table_size.
18192 (pack_vector): Instead of dying when the table is too big, grow it.
18193
9515e8a7
AD
181942002-04-22 Akim Demaille <akim@epita.fr>
18195
18196 * data/bison.simple (yyr1): Its type is that of a token number.
18197 * data/bison.c++ (r1_): Likewise.
18198 * tests/regression.at (Web2c Actions): Adjust.
18199
23c5a174
AD
182002002-04-22 Akim Demaille <akim@epita.fr>
18201
18202 * src/reader.c (token_translations_init): 256 is now the default
18203 value for the error token, i.e., it will be assigned another
18204 number if the user assigned 256 to one of her tokens.
18205 (reader): Don't force 256 to error.
18206 * doc/bison.texinfo (Symbols): Adjust.
18207 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
18208 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
18209 etc. instead of 10, 20, 30 (which was used to `jump' over error
18210 (256) and undefined (2)).
18211
5fbb0954
AD
182122002-04-22 Akim Demaille <akim@epita.fr>
18213
18214 Propagate more token_number_t.
18215
18216 * src/gram.h (token_number_as_item_number)
18217 (item_number_as_token_number): New.
18218 * src/output.c (GENERATE_OUTPUT_TABLE): New.
18219 Use it to create output_item_number_table and
18220 output_token_number_table.
18221 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18222 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
18223 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
18224 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
18225
4f940944
AD
182262002-04-22 Akim Demaille <akim@epita.fr>
18227
18228 * src/output.h, src/output.c (get_lines_number): Remove.
18229
3ded9a63
AD
182302002-04-19 Akim Demaille <akim@epita.fr>
18231
18232 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
18233 as Lex/Flex'.
18234 (Debugging): More details about enabling the debugging features.
18235 (Table of Symbols): Describe $$, $n, @$, and @n.
18236 Suggested by Tim Josling.
18237
e0c471a9
AD
182382002-04-19 Akim Demaille <akim@epita.fr>
18239
18240 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
18241
fecc10cd
AD
182422002-04-10 Akim Demaille <akim@epita.fr>
18243
18244 * src/system.h: Rely on HAVE_LIMITS_H.
18245 Suggested by Paul Eggert.
18246
51dec47b
AD
182472002-04-09 Akim Demaille <akim@epita.fr>
18248
18249 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
18250 full stderr, and strip it according to the bison options, instead
18251 of composing the error message from different bits.
18252 This makes it easier to check for several error messages.
18253 Adjust all the invocations.
18254 Add an invocation exercising the error token.
18255 Add an invocation demonstrating a stupid error message.
18256 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
18257 Adjust the tests.
18258 Error message are for stderr, not stdout.
18259
007a50a4
AD
182602002-04-09 Akim Demaille <akim@epita.fr>
18261
18262 * src/gram.h, src/gram.c (error_token_number): Remove, use
18263 errtoken->number.
18264 * src/reader.c (reader): Don't specify the user token number (2)
18265 for $undefined, as it uselessly prevents using it.
18266 * src/gram.h (token_number_t): Move to...
18267 * src/symtab.h: here.
18268 (state_t.number): Is a token_number_t.
18269 * src/print.c, src/reader.c: Use undeftoken->number instead of
18270 hard coded 2.
18271 (Even though this 2 is not the same as above: the number of the
18272 undeftoken remains being 2, it is its user token number which
18273 might not be 2).
18274 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
18275 `user_token_number_max'.
18276 Output `undef_token_number'.
18277 * data/bison.simple, data/bison.c++: Use them.
18278 Be sure to map invalid yylex return values to
18279 `undef_token_number'. This saves us from gratuitous SEGV.
18280
18281 * tests/conflicts.at (Solved SR Conflicts)
18282 (Unresolved SR Conflicts): Adjust.
18283 * tests/regression.at (Web2c Actions): Adjust.
18284
06446ccf
AD
182852002-04-08 Akim Demaille <akim@epita.fr>
18286
18287 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
18288 Adding #line.
18289 Remove the duplicate `typedefs'.
18290 (RhsNumberType): Fix the declaration and various other typos.
18291 Use __ofile__.
18292 * data/bison.simple: Use __ofile__.
18293 * src/scan-skel.l: Handle __ofile__.
18294
62a3e4f0
AD
182952002-04-08 Akim Demaille <akim@epita.fr>
18296
18297 * src/gram.h (item_number_t): New, the type of item numbers in
18298 RITEM. Note that it must be able to code symbol numbers as
18299 positive number, and the negation of rule numbers as negative
18300 numbers.
18301 Adjust all dependencies (pretty many).
18302 * src/reduce.c (rule): Remove this `short *' pointer: use
18303 item_number_t.
18304 * src/system.h (MINSHORT, MAXSHORT): Remove.
18305 Include `limits.h'.
18306 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
18307 (shortcpy): Remove.
18308 (MAXTABLE): Move to...
18309 * src/output.c (MAXTABLE): here.
18310 (prepare_rules): Use output_int_table to output rhs.
18311 * data/bison.simple, data/bison.c++: Adjust.
18312 * tests/torture.at (Big triangle): Move the limit from 254 to
18313 500.
18314 * tests/regression.at (Web2c Actions): Ajust.
18315
18316 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
18317 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18318 passes, but produces negative #line number, once fixed, GCC is
18319 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18320 C), it passes.
18321 * src/state.h (state_h): Code input lines on ints, not shorts.
18322
bb88b0fc
AD
183232002-04-08 Akim Demaille <akim@epita.fr>
18324
18325 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18326 and then the grammar.
18327
9a636f47
AD
183282002-04-08 Akim Demaille <akim@epita.fr>
18329
18330 * src/system.h: No longer using strndup.
18331
680e8701
AD
183322002-04-07 Akim Demaille <akim@epita.fr>
18333
18334 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18335 * src/output.c (output_table_data): Return the longest number.
18336 (prepare_tokens): Output `token_number_max').
18337 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18338 New.
18339 Use them to define yy_token_number_type/TokenNumberType.
18340 Use this type for yytranslate.
18341 * tests/torture.at (Big triangle): Push the limit from 124 to
18342 253.
18343 * tests/regression.at (Web2c Actions): Adjust.
18344
817e9f41
AD
183452002-04-07 Akim Demaille <akim@epita.fr>
18346
18347 * tests/torture.at (Big triangle): New.
18348 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18349 * tests/existing.at: here.
18350
5123689b
AD
183512002-04-07 Akim Demaille <akim@epita.fr>
18352
18353 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18354 nritems.
18355 Adjust dependencies.
18356
f3849179
AD
183572002-04-07 Akim Demaille <akim@epita.fr>
18358
18359 * src/reader.c: Normalize increments to prefix form.
18360
bd02036a
AD
183612002-04-07 Akim Demaille <akim@epita.fr>
18362
18363 * src/reader.c, symtab.c: Remove debugging code.
18364
db8837cb
AD
183652002-04-07 Akim Demaille <akim@epita.fr>
18366
18367 Rename all the `bucket's as `symbol_t'.
18368
18369 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18370 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18371 * src/symtab.c, src/symtab.h (bucket): Rename as...
18372 (symbol_t): this.
18373 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18374 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18375 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18376 (buckets_new, buckets_free, buckets_do): Rename as...
18377 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18378 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18379 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18380 (symbols_new, symbols_free, symbols_do): these.
18381
72a23c97
AD
183822002-04-07 Akim Demaille <akim@epita.fr>
18383
18384 Use lib/hash for the symbol table.
18385
18386 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18387 EOF.
18388 * src/lex.c (lex): Set the `number' member of new terminals.
18389 * src/reader.c (bucket_check_defined, bucket_make_alias)
18390 (bucket_check_alias_consistence, bucket_translation): New.
18391 (reader, grammar_free, readgram, token_translations_init)
18392 (packsymbols): Adjust.
18393 (reader): Number the predefined tokens.
18394 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18395 for predefined tokens.
18396 * src/symtab.h (bucket): Remove all the hash table related
18397 members.
18398 * src/symtab.c (symtab): Replace by...
18399 (bucket_table): this.
18400 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18401 (buckets_new, buckets_do): New.
18402
280a38c3
AD
184032002-04-07 Akim Demaille <akim@epita.fr>
18404
18405 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
18406 (start_symbol, max_user_token_number, semantic_parser)
18407 (error_token_number): Initialize.
18408 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
18409 Initialize.
18410 (reader): Don't.
18411 (errtoken, eoftoken, undeftoken, axiom): Extern.
18412
03b31c0c
AD
184132002-04-07 Akim Demaille <akim@epita.fr>
18414
18415 * src/gram.h (rule_s): prec and precsym are now pointers
18416 to the bucket giving the priority/associativity.
18417 Member `associativity' removed: useless.
18418 * src/reduce.c, src/conflicts.c: Adjust.
18419
8b3df748
AD
184202002-04-07 Akim Demaille <akim@epita.fr>
18421
18422 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
18423 Properly escape the symbols' TAG when outputting them.
18424
e601aa1d
AD
184252002-04-07 Akim Demaille <akim@epita.fr>
18426
18427 * src/lalr.h (LA): Is a bitsetv, not bitset*.
18428
b0299a2e
AD
184292002-04-07 Akim Demaille <akim@epita.fr>
18430
18431 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
18432 (LArule): this, which is an array to rule_t*.
18433 * src/print.c, src/conflicts.c: Adjust.
18434
d7e1f00c
AD
184352002-04-07 Akim Demaille <akim@epita.fr>
18436
18437 * src/gram.h (rule_t): Rename `number' as `user_number'.
18438 `number' is a new member.
18439 Adjust dependencies.
18440 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
18441
cc9305dd
AD
184422002-04-07 Akim Demaille <akim@epita.fr>
18443
18444 As a result of the previous patch, it is no longer needed
18445 to reorder ritem itself.
18446
18447 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
18448
b0940840
AD
184492002-04-07 Akim Demaille <akim@epita.fr>
18450
18451 Be sure never to walk through RITEMS, but use only data related to
18452 the rules themselves. RITEMS should be banished.
18453
18454 * src/output.c (output_token_translations): Rename as...
18455 (prepare_tokens): this.
18456 In addition to `translate', prepare the muscles `tname' and
18457 `toknum', which were handled by...
18458 (output_rule_data): this.
18459 Remove, and move the remainder of its outputs into...
18460 (prepare_rules): this new routines, which also merges content from
18461 (output_gram): this.
18462 (prepare_rules): Be sure never to walk through RITEMS.
18463 (output_stos): Rename as...
18464 (prepare_stos): this.
18465 (output): Always invoke prepare_states, after all, just don't use it
18466 in the output if you don't need it.
18467
643a5994
AD
184682002-04-07 Akim Demaille <akim@epita.fr>
18469
18470 * src/LR0.c (new_state): Display `nstates' as the name of the
18471 newly created state.
18472 Adjust to initialize first_state and last_state if needed.
18473 Be sure to distinguish the initial from the final state.
18474 (new_states): Create the itemset of the initial state, and use
18475 new_state.
18476 * src/closure.c (closure): Now that the initial state has its
18477 items properly set, there is no need for a special case when
18478 creating `ruleset'.
18479
18480 As a result, now the rule 0, reducing to $axiom, is visible in the
18481 outputs. Adjust the test suite.
18482
18483 * tests/conflicts.at (Solved SR Conflicts)
18484 (Unresolved SR Conflicts): Adjust.
18485 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
18486 * tests/conflicts.at (S/R in initial): New.
18487
b4c4ccc2
AD
184882002-04-07 Akim Demaille <akim@epita.fr>
18489
18490 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
18491 the RHS of the rules.
18492 * src/output.c (output_gram): Likewise.
18493
bba97eb2
AD
184942002-04-07 Akim Demaille <akim@epita.fr>
18495
18496 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
18497 bucket.
18498 Adjust all dependencies.
18499 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
18500 `number' of the buckets too.
18501 * src/gram.h: Include `symtab.h'.
18502 (associativity): Move to...
18503 * src/symtab.h: here.
18504 No longer include `gram.h'.
18505
c3b407f4
AD
185062002-04-07 Akim Demaille <akim@epita.fr>
18507
18508 * src/gram.h, src/gram.c (rules_rhs_length): New.
18509 (ritem_longest_rhs): Use it.
18510 * src/gram.h (rule_t): `number' is a new member.
18511 * src/reader.c (packgram): Set it.
18512 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
18513 the end of `rules', and count them out of `nrules'.
18514 (reduce_output, dump_grammar): Adjust.
18515 * src/print.c (print_grammar): It is no longer needed to check for
18516 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
18517 * tests/reduce.at (Reduced Automaton): New test.
18518
11652ab3
AD
185192002-04-07 Akim Demaille <akim@epita.fr>
18520
18521 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
18522 lacking `+ 1' to nrules, Bison reported as useless a token if it
18523 was used solely to set the precedence of the last rule...
18524
26b23c1a
AD
185252002-04-07 Akim Demaille <akim@epita.fr>
18526
18527 * data/bison.c++, data/bison.simple: Don't output the current file
18528 name in #line, to avoid useless diffs between two identical
18529 outputs under different names.
18530
18bcecb0
AD
185312002-04-07 Akim Demaille <akim@epita.fr>
18532
18533 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
18534 Normalize loops to using `< nrules + 1', not `<= nrules'.
18535
fa770c86
AD
185362002-04-07 Akim Demaille <akim@epita.fr>
18537
18538 * TODO: Update.
18539
d9b739c3
AD
185402002-04-07 Akim Demaille <akim@epita.fr>
18541
18542 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
18543 bucket.value as bucket.number.
18544
99013900
AD
185452002-04-07 Akim Demaille <akim@epita.fr>
18546
18547 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
18548 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18549 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
18550 RHS, instead of being an index in RITEMS.
18551
e966383b
PE
185522002-04-04 Paul Eggert <eggert@twinsun.com>
18553
18554 * doc/bison.texinfo: Update copyright date.
18555 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18556 (Symbols): Warn about running Bison in one character set,
18557 but compiling and/or running in an incompatible one.
18558 Warn about character code 256, too.
18559
185602002-04-03 Paul Eggert <eggert@twinsun.com>
18561
18562 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18563 YYERROR_VERBOSE is nonzero, not whether it is defined.
18564
18565 Merge changes from bison-1_29-branch.
c307773e 18566
8d6c48b9
PE
185672002-03-20 Paul Eggert <eggert@twinsun.com>
18568
18569 Merge fixes from Debian bison_1.34-1.diff.
18570
18571 * configure.in (AC_PREREQ): 2.53.
18572
e53c6322
AD
185732002-03-20 Akim Demaille <akim@epita.fr>
18574
18575 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18576
9ffbeca7
PE
185772002-03-19 Paul Eggert <eggert@twinsun.com>
18578
21db0b2a
PE
18579 * src/bison.simple (YYCOPY): New macro.
18580 (YYSTACK_RELOCATE): Use it.
18581 Remove Type arg; no longer needed. All callers changed.
18582 (yymemcpy): Remove; no longer needed.
18583
9ffbeca7
PE
18584 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18585 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18586
642cb8f8
AD
185872002-03-19 Akim Demaille <akim@epita.fr>
18588
18589 Test and fix the #line outputs.
18590
18591 * tests/atlocal.at (GCC): New.
18592 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 18593 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
18594 (Action synch line, Epilogue synch line): New tests.
18595 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18596 * data/bison.simple, data/bison.c++: Use it.
18597
3c31a486
AD
185982002-03-19 Akim Demaille <akim@epita.fr>
18599
18600 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18601 (Solved SR Conflicts, %expect not enough, %expect right)
18602 (%expect too much): Move to...
18603 * tests/conflicts.at: this new file.
18604
0d8bed56
AD
186052002-03-19 Akim Demaille <akim@epita.fr>
18606
18607 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18608 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18609 that we can move to enums for instance.
18610 * src/output.c (token_definitions_output): Output a list of
18611 `token-name, token-number' instead of the #define.
18612 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18613
9208d17f
AD
186142002-03-14 Akim Demaille <akim@epita.fr>
18615
18616 Use Gettext 0.11.1.
18617
af27eacb
RA
186182002-03-09 Robert Anisko <robert@lrde.epita.fr>
18619
18620 * data/bison.c++: Make the user able to add members to the generated
18621 parser by subclassing.
18622
9101a310
RA
186232002-03-05 Robert Anisko <robert@lrde.epita.fr>
18624
18625 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18626 a character.
18627 Reported by Nicolas Tisserand and Nicolas Burrus.
18628
fff9bf0b
RA
186292002-03-04 Robert Anisko <robert@lrde.epita.fr>
18630
18631 * src/reader.c: Warn about lacking semi-colons, do not complain.
18632
64dba31e
RA
186332002-03-04 Robert Anisko <robert@lrde.epita.fr>
18634
18635 * data/bison.c++: Remove a debug line.
18636
374f5a14
RA
186372002-03-04 Robert Anisko <robert@lrde.epita.fr>
18638
18639 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18640 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18641 provide a default implementation.
18642
bfcf1f3a
AD
186432002-03-04 Akim Demaille <akim@epita.fr>
18644
18645 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18646 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18647 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18648 * tests/semantic.at (Parsing Guards): Similarly.
18649 * src/reader.at (readgram): Complain if the last rule is not ended
18650 with a semi-colon.
18651
65ccf9fc
AD
186522002-03-04 Akim Demaille <akim@epita.fr>
18653
18654 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18655 * src/closure.c: here.
18656 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18657 RTC.
18658 * src/warshall.h, src/warshall.c: Remove.
18659 * tests/sets.at (Broken Closure): Adjust.
18660
d0039cbc
AD
186612002-03-04 Akim Demaille <akim@epita.fr>
18662
18663 * src/output.c (output_skeleton): tempdir is const.
18664 bytes_read is unused.
18665
345cea78
AD
186662002-03-04 Akim Demaille <akim@epita.fr>
18667
18668 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18669 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18670 Update.
18671 From Michael Hayes.
18672
564801f7
AD
186732002-03-04 Akim Demaille <akim@epita.fr>
18674
18675 * src/closure.c (closure): `r' is unused.
18676
e5352bc7
AD
186772002-03-04 Akim Demaille <akim@epita.fr>
18678
18679 * tests/sets.at (Broken Closure): Add the ending `;'.
18680 * src/reader.at (readgram): Complain if a rule is not ended with a
18681 semi-colon.
18682
914feea9
AD
186832002-03-04 Akim Demaille <akim@epita.fr>
18684
18685 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18686 (count_sr_conflicts): Use bitset_count.
18687 * src/reduce.c (inaccessable_symbols): Ditto.
18688 (bits_size): Remove.
18689 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18690
f0250de6
AD
186912002-03-04 Akim Demaille <akim@epita.fr>
18692
18693 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18694 * src/reduce.c: Remove the `bitset_zero's following the
18695 `bitset_create's, as now it is performed by the latter.
18696
ef017502
AD
186972002-03-04 Akim Demaille <akim@epita.fr>
18698
18699 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18700 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18701 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18702 latest sources from Michael.
18703
76514394
AD
187042002-03-04 Akim Demaille <akim@epita.fr>
18705
18706 * src/output.c (output): Don't free the grammar.
18707 * src/reader.c (grammar_free): New.
18708 * src/main.c (main): Call it and don't free symtab here.
18709
55024580
AD
187102002-03-04 Akim Demaille <akim@epita.fr>
18711
18712 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18713 before returning.
18714 Reported by Benoit Perrot.
18715
f9abaa2c
AD
187162002-03-04 Akim Demaille <akim@epita.fr>
18717
18718 Use bitset operations when possible, not loops over bits.
18719
18720 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18721 bitset_or.
18722 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18723 * src/reduce.c (useless_nonterminals): Formatting changes.
18724 * src/warshall.c (TC): Use bitset_or.
18725
0e721e75
AD
187262002-03-04 Akim Demaille <akim@epita.fr>
18727
18728 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18729 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18730 Ditto.
18731
0fb1ffb1
AD
187322002-03-04 Akim Demaille <akim@epita.fr>
18733
18734 * src/lalr.c (F): Now a bitset*.
18735 Adjust all dependencies.
18736
b86796bf
AD
187372002-03-04 Akim Demaille <akim@epita.fr>
18738
18739 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18740 Adjust all dependencies.
18741
602bbf31
AD
187422002-03-04 Akim Demaille <akim@epita.fr>
18743
18744 * src/L0.c, src/LR0.h (nstates): Be size_t.
18745 Adjust comparisons (signed vs unsigned).
18746 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18747 bitset*.
18748 Adjust all dependencies.
18749
d8a0245c
AD
187502002-03-04 Akim Demaille <akim@epita.fr>
18751
18752 * src/closure.c (firsts): Now, also a bitset.
18753 Adjust all dependencies.
18754 (varsetsize): Remove, now unused.
18755 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18756
34ba9743
AD
187572002-03-04 Akim Demaille <akim@epita.fr>
18758
18759 * src/print.c: Convert to use bitset.h, not hand coded iterations
18760 over ints.
18761
ed86e78c
AD
187622002-03-04 Akim Demaille <akim@epita.fr>
18763
18764 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18765
dfdb1797
AD
187662002-03-04 Akim Demaille <akim@epita.fr>
18767
18768 * src/closure.c (ruleset): Be a bitset.
18769 (rulesetsize): Remove.
18770
7086e707
AD
187712002-03-04 Akim Demaille <akim@epita.fr>
18772
18773 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18774 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18775 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18776 * src/closure.c (fderives): Be an array of bitsets.
18777
98254360
RA
187782002-02-28 Robert Anisko <robert@lrde.epita.fr>
18779
18780 * data/bison.c++: Merge the two generated headers. Insert a copyright
18781 notice in each output file.
18782
a75c057f
AD
187832002-02-28 Akim Demaille <akim@epita.fr>
18784
18785 * data/bison.c++: Copy the prologue of bison.simple to fetch
18786 useful M4 definitions, such as b4_header_guard.
18787
06b00abc
AD
187882002-02-25 Akim Demaille <akim@epita.fr>
18789
18790 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
18791 translator friendly scheme for the bgr
18792 copyright notice.
06b00abc 18793
70e7d534
AD
187942002-02-25 Akim Demaille <akim@epita.fr>
18795
18796 * src/output.c (header_output): Remove, now handled completely via
18797 M4.
18798
abe017f6
AD
187992002-02-25 Akim Demaille <akim@epita.fr>
18800
18801 * m4/m4.m4: New, from CVS Autoconf.
18802 * configure.in: Invoke it.
18803 * src/output.c (output_skeleton): Use its result instead of the
18804 hard coded name.
18805
381fb12e
AD
188062002-02-25 Akim Demaille <akim@epita.fr>
18807
18808 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18809 Fileutils 4.1.5.
18810 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18811 * src/output.c (output_skeleton): Use mkstemp to create a real
18812 temporary file.
18813 Move the filling of `skeleton' and its muscle to...
18814 (prepare): here.
18815 (output): Move the definition of the prologue muscle to...
18816 (prepare): here.
18817 * src/system.h (DEFAULT_TMPDIR): New.
18818
6f38107f
PE
188192002-02-14 Paul Eggert <eggert@twinsun.com>
18820
18821 Remove the support for C++ namespace cleanliness; it was
18822 causing more problems than it was curing, since it didn't work
18823 properly on some nonstandard C++ compilers. This can wait
18824 for a proper C++ parser.
18825
18826 * NEWS: Document this.
18827 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18828 of C++, as it's treated like C now.
18829 * src/bison.simple (YYSTD): Remove.
18830 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18831 Treat C++ just like Standard C instead of trying to support
18832 namespace cleanliness.
18833
80cce3da
AD
188342002-02-14 Akim Demaille <akim@epita.fr>
18835
18836 * tests/regression.at (else): Adjust to Andreas' change.
18837
842e8679
AD
188382002-02-14 Akim Demaille <akim@epita.fr>
18839
18840 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18841
4bda3f10
AD
188422002-02-13 Andreas Schwab <schwab@suse.de>
18843
18844 * src/output.c (output_rule_data): Don't output NULL, it might
18845 not be defined yet.
18846
4162fa07 188472002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 18848
4162fa07
RA
18849 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18850 (Copyright notice): Update.
b418ecd8 18851
bd16a5dc
AD
188522002-02-11 Akim Demaille <akim@epita.fr>
18853
18854 * tests/regression.at (%nonassoc and eof): Don't include
18855 nonportable headers.
18856
8d69a1a3
RA
188572002-02-08 Robert Anisko <robert@lrde.epita.fr>
18858
18859 * data/bison.c++: Correct error recovery. Make the user able to
18860 initialize the starting location.
18861
9b2d0677
AD
188622002-02-07 Akim Demaille <akim@epita.fr>
18863
18864 * tests/input.at: New.
18865
69e2658b
RA
188662002-02-07 Robert Anisko <robert@lrde.epita.fr>
18867
18868 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 18869 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
18870 directives around tables only needed for debugging.
18871
4aacc3a7
RA
188722002-02-07 Robert Anisko <robert@lrde.epita.fr>
18873
18874 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18875 C++ parsers.
18876 (yy::b4_name::parse): Use print_.
18877
762a801e
RA
188782002-02-07 Robert Anisko <robert@lrde.epita.fr>
18879
18880 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18881
4bb2bc3f
RA
188822002-02-07 Robert Anisko <robert@lrde.epita.fr>
18883
18884 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18885 C++ parsers.
18886 (yy::b4_name::parse): Build verbose error messages, and use error_.
18887
6b45a3ca
RA
188882002-02-06 Robert Anisko <robert@lrde.epita.fr>
18889
18890 * data/bison.c++: Fix m4 quoting in comments.
18891
50997c6e
RA
188922002-02-06 Robert Anisko <robert@lrde.epita.fr>
18893
18894 * data/bison.c++: Adjust the parser code. Fix some muscles that were
18895 not expanded by m4.
18896
3f3eed27
AD
188972002-02-05 Akim Demaille <akim@epita.fr>
18898
18899 * data/bison.c++: Adjust to the M4 back end.
18900 More is certainly needed.
18901
be2a1a68
AD
189022002-02-05 Akim Demaille <akim@epita.fr>
18903
18904 Give a try to M4 as a back end.
18905
18906 * lib/readpipe.c: New, from wdiff.
18907 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
18908 BISON_HAIRY.
18909 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
18910 specific values. Now it is m4 that performs the lookup.
18911 * src/parse-skel.y: Remove.
18912 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
18913 * src/output.c (actions_output, guards_output)
18914 (token_definitions_output): No longer keeps track of the output
18915 line number, hence remove the second argument.
18916 (guards_output): Check against the guard member of a rule, not the
18917 action member.
18918 Adjust callers.
18919 (output_skeleton): Don't look for the skeleton location, let m4 do
18920 that.
18921 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
18922 file will be used.
18923 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
18924 (prepare): Given that for the time being changesyntax is not
18925 usable in M4, rename the muscles using `-' to `_'.
18926 Define `defines_flag', `output_parser_name' and `output_header_name'.
18927 * src/output.h (actions_output, guards_output)
18928 (token_definitions_output): Adjust prototypes.
18929 * src/scan-skel.l: Instead of scanning the skeletons, it now
18930 processes the output of m4: `__oline__' and `#output'.
18931 * data/bison.simple: Adjust to be used by M4(sugar).
18932 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
18933 to date.
18934 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
18935 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
18936 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
18937 shamelessly stolen from CVS Autoconf.
18938
beda758b
AD
189392002-02-05 Akim Demaille <akim@epita.fr>
18940
18941 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
18942 * configure.in: Check for the declarations of free and malloc.
18943 * src/muscle_tab.c: Adjust.
18944
5ece6d43
AD
189452002-02-05 Akim Demaille <akim@epita.fr>
18946
18947 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
18948 which have no values.
18949
5bb18f9a
AD
189502002-02-05 Akim Demaille <akim@epita.fr>
18951
18952 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
18953 * data/: here.
18954
894dd62e
PE
189552002-01-29 Paul Eggert <eggert@twinsun.com>
18956
18957 * src/bison.simple (YYSIZE_T): Do not define merely because
18958 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
18959 On some platforms, <alloca.h> does not declare YYSTD (size_t).
18960
82841af7
AD
189612002-01-27 Akim Demaille <akim@epita.fr>
18962
18963 Fix `%nonassoc and eof'.
18964
18965 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
18966 which were not properly copied! Replace
18967 memcpy (res->errs, src->errs, src->nerrs);
18968 with
18969 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
18970 !!!
18971 * tests/regression.at (%nonassoc and eof): Adjust to newest
18972 Autotest: `.' is not in the PATH.
18973
318b76e9
AD
189742002-01-27 Akim Demaille <akim@epita.fr>
18975
18976 * tests/sets.at (AT_EXTRACT_SETS): New.
18977 (Nullable): Use it.
18978 (Firsts): New.
18979
30d2f3d5
AD
189802002-01-26 Akim Demaille <akim@epita.fr>
18981
18982 * tests/actions.at, tests/calc.at, tests/headers.at,
18983 * tests/torture.at: Adjust to the newest Autotest which no longer
18984 forces `.' in the PATH.
18985
30f8c395
AD
189862002-01-25 Akim Demaille <akim@epita.fr>
18987
18988 * tests/regression.at (%nonassoc and eof): New.
18989 Suggested by Robert Anisko.
18990
29ae55f1
AD
189912002-01-24 Akim Demaille <akim@epita.fr>
18992
18993 Bison dumps core when trying to complain about broken input files.
18994 Reported by Cris van Pelt.
18995
18996 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
18997 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
18998 into...
18999 (Invalid inputs): Strengthen: exercise parse_percent_token.
19000
2b548aa6
RA
190012002-01-24 Robert Anisko <robert.anisko@epita.fr>
19002
19003 * src/Makefile.am: Add bison.c++.
19004 * src/bison.c++: New skeleton.
19005
bb0146c2
AD
190062002-01-21 Paolo Bonzini <bonzini@gnu.org>
19007
19008 * po/it.po: New.
19009
bec30531
AD
190102002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19011
19012 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
19013
fc6edc45
MA
190142002-01-20 Marc Autret <marc@gnu.org>
19015
19016 * src/files.c (compute_output_file_names): Fix
19017
5e5d5415
MA
190182002-01-20 Marc Autret <marc@gnu.org>
19019
19020 * tests/output.at: New test.
19021 * src/files.c (compute_base_names): Don't map extensions when
19022 the YACC flag is set, use defaults.
19023 Reported by Evgeny Stambulchik.
19024
44ea3fbd
MA
190252002-01-20 Marc Autret <marc@gnu.org>
19026
ba0fe3c7
PE
19027 * src/system.h: Need to define __attribute__ away for non-GCC
19028 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
19029 Suggested by Albert Chin-A-Young.
19030
338963d1
TVH
190312002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
19032
19033 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
19034 canonical definition.
19035 * src/system.h: Use the canonical definition for PARAMS (avoids
19036 a conflict with the macro from lib/hash.h).
19037
c57b2479
AD
190382002-01-11 Akim Demaille <akim@epita.fr>
19039
19040 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 19041 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 19042
b85810ae
AD
190432002-01-09 Akim Demaille <akim@epita.fr>
19044
19045 * src/files.c, src/files.h (output_infix): New.
19046 (tab_extension): Remove.
19047 (compute_base_names): Compute the former, drop the latter.
19048 * src/output.c (prepare): Insert the muscles `output-infix', and
19049 `output-suffix'.
19050 * src/parse-skel.y (string, string.1): New.
19051 (section.header): Use it.
19052 (section.yacc): Remove.
19053 (prefix): Remove too.
19054 * src/scan-skel.l: Adjust.
19055 * src/bison.simple, src/bison.hairy: Adjust.
19056
cae60122
AD
190572002-01-09 Akim Demaille <akim@epita.fr>
19058
19059 * configure.in (WERROR_CFLAGS): Compute it.
19060 * src/Makefile.am (CFLAGS): Pass it.
19061 * tests/atlocal.in (CFLAGS): Idem.
19062 * src/files.c: Fix a few warnings.
19063 (get_extension_index): Remove, unused.
19064
ae404801
AD
190652002-01-08 Akim Demaille <akim@epita.fr>
19066
19067 * src/getargs.c (AS_FILE_NAME): New.
19068 (getargs): Use it to convert DOSish file names.
19069 * src/files.c (base_name): Rename as full_base_name to avoid
19070 clashes with `base_name ()'.
19071 (filename_split): New.
19072 (compute_base_names): N-th rewrite, using filename_split.
19073
22312b71
AD
190742002-01-08 Akim Demaille <akim@epita.fr>
19075
19076 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
19077 New, stolen from the Fileutils 4.1.
19078 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19079 * configure.in: Check for the presence of memrchr, and of its
19080 prototype.
19081
a67cef01
TVH
190822002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
19083
19084 * lib/hash.h (__P): Added definition for this macro.
19085 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
19086 BUILT_SOURCES, to ensure they are generated first.
19087 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
19088 %error-verbose to allow bootstrapping with bison 1.30x.
19089
2b25d624
AD
190902002-01-06 Akim Demaille <akim@epita.fr>
19091
19092 * src/reader.c (parse_braces): Don't fetch the next char, the
19093 convention is to fetch on entry.
19094 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
19095 'switch' without a following semicolon.
19096 * tests/regression.at (braces parsing): New.
19097
3460813b
AD
190982002-01-06 Akim Demaille <akim@epita.fr>
19099
19100 Bison is dead wrong in its RR conflict reports.
19101
19102 * tests/torture.at (GNU Cim Grammar): New.
19103 * src/conflicts.c (count_rr_conflicts): Fix.
19104
73784c64
AD
191052002-01-06 Akim Demaille <akim@epita.fr>
19106
19107 Creating package.m4 from configure.ac causes too many problems.
19108
19109 * tests/Makefile.am (package.m4): Create it by hand,
19110 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
19111
25d81090
AD
191122002-01-06 Akim Demaille <akim@epita.fr>
19113
19114 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
19115 skeleton.h.
19116
a9b8959e
PE
191172002-01-04 Paul Eggert <eggert@twinsun.com>
19118
19119 * doc/bison.texinfo (Debugging):
19120 Remove YYSTDERR; it's no longer defined or used.
19121 Also, s/cstdio.h/cstdio/.
19122
25d81090
AD
191232002-01-03 Akim Demaille <akim@epita.fr>
19124
19125 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
19126
1109455c
AD
191272002-01-03 Akim Demaille <akim@epita.fr>
19128
19129 * src/parse-skel.y (process_skeleton): Don't bind the parser's
19130 tracing code to --trace, wait for a better --trace option, with
19131 args.
19132
7ea5e977
AD
191332002-01-03 Akim Demaille <akim@epita.fr>
19134
19135 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
19136 The ISO C++ standard is extremely clear about it: stderr is
19137 considered a macro, not a regular symbol (see table 94 `Header
19138 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
19139 Therefore std:: does not apply to it. It still does with fprintf.
19140 Also, s/cstdio.h/cstdio/.
19141
fab5b110
AD
191422002-01-03 Akim Demaille <akim@epita.fr>
19143
19144 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
19145 for non system headers.
19146
aed7fd9b
AD
191472002-01-02 Akim Demaille <akim@epita.fr>
19148
19149 Equip the skeleton chain with location tracking, runtime trace,
19150 pure parser and scanner.
19151
19152 * src/parse-skel.y: Request a pure parser, locations, and prefix
19153 renaming.
19154 (%union): Having several members with the same type does not help
19155 type mismatches, simplify.
19156 (YYPRINT, yyprint): New.
19157 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
19158 (skel_error): this.
19159 Handle locations.
19160 * src/scan-skel.l: Adjust to these changes.
19161 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
19162 (LOCATION_PRINT, skel_control_t): New.
19163
24fad99e
AD
191642001-12-30 Akim Demaille <akim@epita.fr>
19165
19166 * src/parse-skel.y: Get rid of the shift/reduce conflict:
19167 replace `gb' with BLANKS.
19168 * src/scan-skel.l: Adjust.
19169
a4b36db4
AD
191702001-12-30 Akim Demaille <akim@epita.fr>
19171
19172 * src/system.h: We don't need nor want bcopy.
19173 Throw away MS-DOS crap: we don't need getpid.
19174 * configure.in: We don't need strndup. It was even causing
19175 problems: because Flex includes the headers *before* us,
19176 _GNU_SOURCE is not defined by config.h, and therefore strndup was
19177 not visible.
19178 * lib/xstrndup.c: New.
19179 * src/scan-skel.l: Use it.
19180 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
19181 * src/parse-skel.y: Use %directives instead of #defines.
19182
1239777d
AD
191832001-12-30 Akim Demaille <akim@epita.fr>
19184
19185 * src/skeleton.h: New.
19186 * src/output.c (output_parser, output_master_parser): Remove, dead
19187 code.
19188 * src/output.h (get_lines_number, actions_output, guards_output)
19189 (token_definitions_output): Prototype them.
19190 * src/parse-skel.y: Add the license notice.
19191 Include output.h and skeleton.h.
19192 (process_skeleton): Returns void, and takes a single parameter.
19193 * src/scan-skel.l: Add the license notice.
19194 Include skeleton.h.
19195 Don't use %option yylineno: it seems that then Flex imagines
19196 REJECT has been used, and therefore it won't reallocate its
19197 buffers (which makes no other sense to me than a bug). It results
19198 in warnings for `unused: yy_flex_realloc'.
19199
9b3add5b
RA
192002001-12-30 Robert Anisko <robert.anisko@epita.fr>
19201
19202 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19203 (MUSCLE_INSERT_PREFIX): ...to there.
19204 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19205 (MUSCLE_INSERT_PREFIX): Move from here...
19206
19207 * src/bison.hairy: Add a section directive. Put braces around muscle
19208 names. This parser skeleton is still broken, but Bison should not
19209 choke on a bad muscle 'syntax'.
19210 * src/bison.simple: Add a section directive. Put braces around muscle
19211 names.
19212
19213 * src/files.h (strsuffix, stringappend): Add declarations.
19214 (tab_extension): Add declaration.
19215 (short_base_name): Add declaration.
19216
19217 * src/files.c (strsuffix, stringappend): No longer static. These
19218 functions are used in the skeleton parser.
19219 (tab_extension): New.
19220 (compute_base_names): Use the computations done in this function
fab5b110 19221 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
19222 names.
19223 (short_base_name): No longer static.
19224
19225 * src/output.c (output_skeleton): New.
19226 (output): Disable call to output_master_parser, and give a try to
19227 a new skeleton handling system.
19228 (guards_output, actions_output): No longer static.
19229 (token_definitions_output, get_lines_number): No longer static.
19230
19231 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
19232
fab5b110 19233 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
19234 parse-skel.y.
19235
19236 * src/parse-skel.y: New file.
19237 * src/scan-skel.l: New file.
19238
b5b61c61
AD
192392001-12-29 Akim Demaille <akim@epita.fr>
19240
19241 %name-prefix is broken.
19242
19243 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
19244 Adjust all dependencies.
19245 * tests/headers.at (export YYLTYPE): Strengthen this test: use
19246 %name-prefix.
19247
19248 Renaming yylval but not yylloc is not consistent. Now we do.
19249
19250 * src/bison.simple: Prefix yylloc if used.
19251 * doc/bison.texinfo (Decl Summary): Document that.
19252
8c9a50be
AD
192532001-12-29 Akim Demaille <akim@epita.fr>
19254
19255 * doc/bison.texinfo: Promote `%long-directive' over
19256 `%long_directive'.
19257 Remove all references to fixed-output-files, yacc is enough.
19258
d99361e6
AD
192592001-12-29 Akim Demaille <akim@epita.fr>
19260
19261 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
19262 user prologue. These are defaults.
19263 * tests/actions.at (Mid-rule actions): Make sure the user can
19264 define YYDEBUG and YYERROR_VERBOSE.
19265
b9cecb91
AD
192662001-12-29 Akim Demaille <akim@epita.fr>
19267
19268 * src/output.c (header_output): Don't forget to export YYLTYPE and
19269 yylloc.
19270 * tests/headers.at (export YYLTYPE): New, make sure it does.
19271 * tests/regression.at (%union and --defines, Invalid CPP headers):
19272 Move to...
19273 * tests/headers.at: here.
19274
aea13e97
AD
192752001-12-29 Akim Demaille <akim@epita.fr>
19276
19277 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
19278
931394cb
AD
192792001-12-29 Akim Demaille <akim@epita.fr>
19280
19281 * tests/actions.at (Mid-rule actions): Output on a single line
19282 instead of several.
19283
704a47c4
AD
192842001-12-29 Akim Demaille <akim@epita.fr>
19285
19286 * doc/bison.texinfo: Formatting changes.
19287
091e20bb
AD
192882001-12-29 Akim Demaille <akim@epita.fr>
19289
19290 Don't store the token defs in a muscle, just be ready to output it
19291 on command. Now possible via `symbols'. Fixes a memory leak.
19292
19293 * src/output.c (token_definitions_output): New.
19294 (output_parser, header_output): Use it.
19295 * src/reader.c (symbols_save): Remove.
19296
cce71710
AD
192972001-12-29 Akim Demaille <akim@epita.fr>
19298
19299 * src/bison.simple: Do not provide a default for YYSTYPE and
19300 YYLTYPE before the user's prologue. Otherwise it's hardly... a
19301 default.
19302
82c035a8
AD
193032001-12-29 Akim Demaille <akim@epita.fr>
19304
19305 Mid-rule actions are simply... ignored!
19306
19307 * src/reader.c (readgram): Be sure to attach mid-rule actions to
19308 the empty-rule associated to the dummy symbol, not to the host
19309 rule.
19310 * tests/actions.at (Mid-rule actions): New.
19311
8419d367
AD
193122001-12-29 Akim Demaille <akim@epita.fr>
19313
19314 Memory leak.
19315
19316 * src/reader.c (reader): Free grammar.
19317
375d5806
AD
193182001-12-29 Akim Demaille <akim@epita.fr>
19319
19320 Memory leak.
19321
19322 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19323 since it allocates it for each state, although only one is needed.
19324 (allocate_storage): Do it here.
19325
f51cb8ff
AD
193262001-12-29 Akim Demaille <akim@epita.fr>
19327
19328 * src/options.h, src/options.c (create_long_option_table): Rename
19329 as...
19330 (long_option_table_new): this, with a clearer prototype.
19331 (percent_table): Remove, unused,
19332 * src/getargs.c (getargs): Adjust.
19333
29e88316
AD
193342001-12-29 Akim Demaille <akim@epita.fr>
19335
19336 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19337 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19338 as states.
19339
b9f71f19
AD
193402001-12-29 Akim Demaille <akim@epita.fr>
19341
19342 * src/lalr.c (build_relations): Rename `states' as `states1'.
19343 Sorry, I don't understand exactly what it is, no better name...
19344
1a2b5d37
AD
193452001-12-29 Akim Demaille <akim@epita.fr>
19346
19347 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19348 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19349 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19350 as rules.
19351
1cca533e
AD
193522001-12-29 Akim Demaille <akim@epita.fr>
19353
19354 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19355 ago.
19356
c03ae966
AD
193572001-12-29 Akim Demaille <akim@epita.fr>
19358
19359 * src/reader.c, src/reader.h (user_toknums): Remove.
19360 Adjust all users to use symbols[i]->user_token_number.
19361
5a670b1e
AD
193622001-12-29 Akim Demaille <akim@epita.fr>
19363
19364 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19365 Adjust all users to use symbols[i]->prec or ->assoc.
19366
ad949da9
AD
193672001-12-29 Akim Demaille <akim@epita.fr>
19368
19369 * src/reader.c, src/reader.h (tags): Remove.
19370 Adjust all users to use symbols[i]->tag.
19371
0e78e603
AD
193722001-12-29 Akim Demaille <akim@epita.fr>
19373
19374 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19375 and rule_table.
19376 * src/reader.c (packsymbols): Fill this table.
19377 Drop sprec.
19378 * src/conflicts.c (resolve_sr_conflict): Adjust.
19379 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19380 single table.
19381 Use symbols[i]->tag instead of tags[i].
19382
213e640e
AD
193832001-12-29 Akim Demaille <akim@epita.fr>
19384
19385 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19386 In addition, put a comment in there, to replace...
19387 * tests/regression.at (%union and C comments): Remove.
19388
e7b8bef1
AD
193892001-12-29 Akim Demaille <akim@epita.fr>
19390
19391 * tests/regression.at (Web2c Actions): Blindly move the actual
19392 output as expected output. The contents *seem* right to me, but I
19393 can't pretend reading perfectly parser tables... Nonetheless, all
19394 the other tests pass correctly, the table look OK, even though the
19395 presence of `$axiom' is to be noted: AFAICS it is useless (but
19396 harmless).
19397
b68e7744
AD
193982001-12-29 Akim Demaille <akim@epita.fr>
19399
19400 * src/reader.c (readgram): Don't add the rule 0 if there were no
19401 rules read. In other words, add it _after_ having performed
19402 grammar sanity checks.
19403 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
19404
78d5bae9
AD
194052001-12-29 Akim Demaille <akim@epita.fr>
19406
19407 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
19408 visible, and some states have now a different number.
19409
ff442794
AD
194102001-12-29 Akim Demaille <akim@epita.fr>
19411
19412 * src/reader.c (readgram): Bind the initial rule's lineno to that
19413 of the first rule.
19414 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
19415 (Solved SR Conflicts): Adjust rule 0's line number.
19416
610ab194
AD
194172001-12-29 Akim Demaille <akim@epita.fr>
19418
19419 Fix the `GAWK Grammar' failure.
19420
19421 * src/LR0.c (final_state): Initialize to -1 so that we do compute
19422 the reductions of the first state which was mistakenly confused
19423 with the final state because precisely final_state was initialized
19424 to 0.
19425 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
19426 now noticed by Bison.
19427 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
19428 have a reduction on $default.
19429
29d29c8f
AD
194302001-12-29 Akim Demaille <akim@epita.fr>
19431
19432 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
19433 rule line numbers.
19434 * src/closure.c (print_closure): Likewise.
19435 * src/derives.c (print_derives): Likewise.
19436 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
19437 now.
19438
7c6b64d0
AD
194392001-12-29 Akim Demaille <akim@epita.fr>
19440
19441 * src/lalr.c (lookaheads_print): New.
19442 (lalr): Call it when --trace-flag.
19443 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
19444 are dumped.
19445
3d4daee3
AD
194462001-12-29 Akim Demaille <akim@epita.fr>
19447
19448 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
19449 when walking through ritem, even via rule->rhs.
19450 * src/reduce.c (dump_grammar, useful_production, reduce_output)
19451 (useful_production, useless_nonterminals): Likewise.
19452 (reduce_grammar_tables): Likewise, plus update nritems.
19453 * src/nullable.c (set_nullable): Likewise.
19454 * src/lalr.c (build_relations): Likewise.
19455 * tests/sets.at (Nullable): Adjust.
19456 Fortunately, now, the $axiom is no longer nullable.
19457
9e7f6bbd
AD
194582001-12-29 Akim Demaille <akim@epita.fr>
19459
19460 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
19461 the 0-sentinel.
19462 * src/gram.c (ritem_longest_rhs): Likewise.
19463 * src/reduce.c (nonterminals_reduce): Likewise.
19464 * src/print_graph.c (print_graph): Likewise.
19465 * src/output.c (output_rule_data): Likewise.
19466 * src/nullable.c (set_nullable): Likewise.
19467
255ef638
AD
194682001-12-29 Akim Demaille <akim@epita.fr>
19469
19470 * src/output.c: Comment changes.
19471
0d8a7363
AD
194722001-12-27 Paul Eggert <eggert@twinsun.com>
19473
19474 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
19475 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
19476 Sparc, as they were causing more porting problems than the
19477 (minor) performance improvement was worth.
19478
19479 Also, catch up with 1.31's YYSTD.
19480
3db472b9
AD
194812001-12-27 Akim Demaille <akim@epita.fr>
19482
19483 * src/output.c (output_gram): Rely on nritems, not the
19484 0-sentinel. See below.
19485 Use -1 as separator, not 0.
19486 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
19487 Rely on -1 as separator in yyrhs, instead of 0.
19488 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
19489 twice `Now at end of input', therefore there are two lines less to
19490 expect.
19491
b365aa05
AD
194922001-12-27 Akim Demaille <akim@epita.fr>
19493
19494 * tests/regression.at (Unresolved SR Conflicts):
19495 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
19496 below.
19497
30171f79
AD
194982001-12-27 Akim Demaille <akim@epita.fr>
19499
19500 * src/LR0.c (new_state): Recognize the final state by the fact it
19501 is reached by eoftoken.
19502 (insert_start_shifting_state, insert_eof_shifting_state)
19503 (insert_accepting_state, augment_automaton): Remove, since now
19504 these states are automatically computed from the initial state.
19505 (generate_states): Adjust.
19506 * src/print.c: When reporting a rule number to the user, substract
19507 1, so that the axiom rule is rule 0, and the first user rule is 1.
19508 * src/reduce.c: Likewise.
19509 * src/print_graph.c (print_core): For the time being, just as for
19510 the report, depend upon --trace-flags to dump the full set of
19511 items.
19512 * src/reader.c (readgram): Once the grammar read, insert the rule
19513 0: `$axiom: START-SYMBOL $'.
19514 * tests/set.at: Adjust: rule 0 is now displayed, and since the
19515 number of the states has changed (the final state is no longer
19516 necessarily the last), catch up.
19517
75142d45
AD
195182001-12-27 Akim Demaille <akim@epita.fr>
19519
19520 Try to make the use of the eoftoken valid. Given that its value
19521 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
19522 is used instead of > 0 where appropriate, (ii), depend upon nritems
19523 instead of the 0-sentinel.
19524
19525 * src/gram.h, src/gram.c (nritems): New.
19526 Expected to be duplication of nitems, but for the time being...
19527 * src/reader.c (packgram): Assert nritems and nitems are equal.
19528 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
19529 * src/closure.c (print_closure, print_fderives): Likewise.
19530 * src/gram.c (ritem_print): Likewise.
19531 * src/print.c (print_core, print_grammar): Likewise.
19532 * src/print_graph.c: Likewise.
19533
b7c49edf
AD
195342001-12-27 Akim Demaille <akim@epita.fr>
19535
19536 * src/main.c (main): If there are complains after grammar
19537 reductions, then output the report anyway if requested, then die.
19538 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
19539 * src/reader.c (eoftoken): New.
19540 (parse_token_decl): If the token being defined has value `0', it
19541 is the eoftoken.
19542 (packsymbols): No longer hack `tags' to insert `$' by hand.
19543 Be sure to preserve the value of the eoftoken.
19544 (reader): Make sure eoftoken is defined.
19545 Initialize nsyms to 0: now eoftoken is created just like the others.
19546 * src/print.c (print_grammar): Don't special case the eof token.
19547 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
19548 lie anyway, albeit pleasant.
19549 * tests/calc.at: Exercise error messages with eoftoken.
19550 Change the grammar so that empty input is invalid.
19551 Adjust expectations.
19552 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19553
ec2da99f
AD
195542001-12-27 Akim Demaille <akim@epita.fr>
19555
19556 * configure.in: Check the protos of strchr ans strspn.
19557 Replace strchr if needed.
19558 * src/system.h: Provide the protos of strchr, strspn and memchr if
19559 missing.
19560 * lib/strchr.c: New.
19561 * src/reader.c (symbols_save): Use strchr.
19562
8adfa272
AD
195632001-12-27 Akim Demaille <akim@epita.fr>
19564
19565 * src/print.c, src/print_graph.c (escape): New.
19566 Use it to quote the TAGS outputs.
19567 * src/print_graph.c (print_state): Now errors are in red, and
19568 reductions in green.
19569 Prefer high to wide: output the state number on a line of its own.
19570
80dac38c
AD
195712001-12-27 Akim Demaille <akim@epita.fr>
19572
19573 * src/state.h, src/state.c (reductions_new): New.
19574 * src/LR0.c (set_state_table): Let all the states have a
19575 `reductions', even if reduced to 0.
19576 (save_reductions): Adjust.
19577 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19578 * src/print.c (print_reductions, print_actions): Adjust.
19579 * src/output.c (action_row): Adjust.
19580
2cec70b9
AD
195812001-12-27 Akim Demaille <akim@epita.fr>
19582
19583 * src/state.h, src/state.c (errs_new, errs_dup): New.
19584 * src/LR0.c (set_state_table): Let all the states have an errs,
19585 even if reduced to 0.
19586 * src/print.c (print_errs, print_reductions): Adjust.
19587 * src/output.c (output_actions, action_row): Adjust.
19588 * src/conflicts.c (resolve_sr_conflict): Adjust.
19589
13ca549a
AD
195902001-12-27 Akim Demaille <akim@epita.fr>
19591
19592 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19593
5092aba5
AD
195942001-12-27 Akim Demaille <akim@epita.fr>
19595
19596 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19597 * src/print.c: here.
19598 (lookaheadset, shiftset): New, used as additional storage by
19599 print_reductions.
19600 (print_results): Adjust.
19601 (print_shifts, print_gotos, print_errs): New, extracted from...
19602 (print_actions): here.
19603 * src/print_graph.c (print_actions): Remove dead code.
19604
11e2beca
AD
196052001-12-27 Akim Demaille <akim@epita.fr>
19606
19607 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19608 `$n' and `@n'.
19609
dac3c910
AD
196102001-12-27 Akim Demaille <akim@epita.fr>
19611
19612 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19613 (build_relations): Adjust.
19614
d0b0fefa
AD
196152001-12-27 Akim Demaille <akim@epita.fr>
19616
19617 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19618 duplication.
19619
adc8c848
AD
196202001-12-27 Akim Demaille <akim@epita.fr>
19621
19622 * src/reader.c (packgram): Catch nitems overflows.
19623
14d293ac
AD
196242001-12-27 Akim Demaille <akim@epita.fr>
19625
19626 * src/files.c, src/files.h (guard_obstack): Remove.
19627 * src/output.c (output): Adjust.
19628 * src/reader.c (parse_braces): New, factoring...
19629 (copy_action, copy_guard): these two which are renamed as...
19630 (parse_action, parse_guard): these.
19631 As a voluntary consequence, using braces around guards is now
19632 mandatory.
19633
f499b062
AD
196342001-12-27 Akim Demaille <akim@epita.fr>
19635
19636 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19637 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19638 members.
19639 (symbol_list_new): Adjust.
19640 (copy_action): action_line is the first line, not the last.
19641 (copy_guard): Just as for actions, store the `action' only, not
19642 the switch/case/break flesh.
19643 Don't parse the user action that might follow the guard, let...
19644 (readgram): do it, i.e., now, there can be an action after a
19645 guard.
19646 In other words the guard is just explicitly optional.
19647 (packgram): Adjust.
19648 * src/output.c (guards_output): New.
19649 (output_parser): Call it when needed.
19650 (output): Also free the guard and attrs obstacks.
19651 * src/files.c, src/files.h (obstack_save): Remove.
19652 (output_files): Remove.
19653 As a result, if one needs the former `.act' file, using an
19654 appropriate skeleton which requires actions and guards is now
19655 required.
19656 * src/main.c (main): Adjust.
19657 * tests/semantic.at: New.
19658 * tests/regression.at: Use `input.y' as input file name.
19659 Avoid 8+3 problems by requiring input.c when the test needs the
19660 parser.
19661
d945f5cd
AD
196622001-12-27 Akim Demaille <akim@epita.fr>
19663
19664 * src/reader.c (symbol_list_new): Be sure to initialize all the
19665 fields.
19666
d200e455
AD
196672001-12-27 Akim Demaille <akim@epita.fr>
19668
19669 All the hacks using a final pseudo state are now useless.
19670
19671 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19672 * src/lalr.c (nLA): New.
19673 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19674 instead of lookaheadsp from the pseudo state (nstate + 1).
19675
f9507c28
AD
196762001-12-27 Akim Demaille <akim@epita.fr>
19677
19678 * src/output.c (action_row, token_actions): Use a state_t instead
19679 of a integer, and nlookaheads instead of the following state's
19680 lookaheadsp.
19681
065fbd27
AD
196822001-12-27 Akim Demaille <akim@epita.fr>
19683
19684 * src/conflicts.c (log_resolution, flush_shift)
19685 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19686 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19687 (conflicts_print, print_reductions): Use a state_t instead of an
19688 integer when referring to a state.
19689 As much as possible, depend upon nlookaheads, instead of the
19690 `lookaheadsp' member of the following state (since lookaheads of
19691 successive states are successive, the difference between state n + 1
19692 and n served as the number of lookaheads for state n).
19693 * src/lalr.c (add_lookback_edge): Likewise.
19694 * src/print.c (print_core, print_actions, print_state)
19695 (print_results): Likewise.
19696 * src/print_graph.c (print_core, print_actions, print_state)
19697 (print_graph): Likewise.
19698 * src/conflicts.h: Adjust.
19699
1b177bd7
AD
197002001-12-27 Akim Demaille <akim@epita.fr>
19701
19702 * src/bison.hairy: Formatting/comment changes.
19703 ANSIfy.
19704 Remove `register' indications.
19705 Add plenty of `static'.
19706
7742ddeb
AD
197072001-12-27 Akim Demaille <akim@epita.fr>
19708
19709 * src/output.c (prepare): Drop the muscle `ntbase' which
19710 duplicates ntokens.
19711 * src/bison.simple: Formatting/comment changes.
19712 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19713 is an undocumented synonym.
19714
1fa14068
AD
197152001-12-22 Akim Demaille <akim@epita.fr>
19716
19717 * src/output.c (output_table_data): Change the prototype to use
19718 `int' for array ranges: some invocations do pass an int, not a
19719 short.
19720 Reported by Wayne Green.
19721
b9752825
AD
197222001-12-22 Akim Demaille <akim@epita.fr>
19723
19724 Some actions of web2c.y are improperly triggered.
19725 Reported by Mike Castle.
19726
19727 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19728 * tests/regression.at (Web2c): Rename as...
19729 (Web2c Report): this.
19730 (Web2c Actions): New.
19731
776209d6
AD
197322001-12-22 Akim Demaille <akim@epita.fr>
19733
19734 Reductions in web2c.y are improperly reported.
19735 Reported by Mike Castle.
19736
19737 * src/conflicts.c (print_reductions): Fix.
19738 * tests/regression.at (Web2c): New.
19739
275fc3ad
AD
197402001-12-18 Akim Demaille <akim@epita.fr>
19741
19742 Some host fail on `assert (!"foo")', which expands to
19743 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19744 Reported by Nelson Beebee.
19745
19746 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19747 `#define it_succeeded 0' and `assert (it_succeeded)'.
19748
897668ee
MA
197492001-12-17 Marc Autret <autret_m@epita.fr>
19750
19751 * src/bison.simple: Don't hard code the skeleton line and filename.
19752 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19753 New line counter 'skeleton_line' (skeleton-line muscle).
19754
ab3399e0
PE
197552001-12-17 Paul Eggert <eggert@twinsun.com>
19756
19757 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19758 YYDEBUG must be defined to a nonzero value.
19759
19760 * src/bison.simple (yytname): Do not assume that the user defines
19761 YYDEBUG to a properly parenthesized expression.
19762
3877f72b
AD
197632001-12-17 Akim Demaille <akim@epita.fr>
19764
19765 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19766 nlookaheads is a new member.
19767 Adjust all users.
19768 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19769 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19770 state.
776209d6 19771
331dbc1b
AD
197722001-12-17 Akim Demaille <akim@epita.fr>
19773
19774 * src/files.h, src/files.c (open_files, close_files): Remove.
19775 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19776 let...
19777 * src/reader.c (reader): Do it.
776209d6 19778
be750e4c
AD
197792001-12-17 Akim Demaille <akim@epita.fr>
19780
19781 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 19782
709ae8c6
AD
197832001-12-17 Akim Demaille <akim@epita.fr>
19784
19785 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19786 (flush_reduce): New.
19787 (resolve_sr_conflict): Adjust.
776209d6 19788
f87685c3
AD
197892001-12-17 Akim Demaille <akim@epita.fr>
19790
19791 * src/output.c (output_obstack): Be static and rename as...
19792 (format_obstack): this, to avoid any confusion with files.c's
19793 output_obstack.
19794 * src/reader.h (muscle_obstack): Move to...
19795 * src/output.h: here, since it's defined in output.c.
19796
837491d8
AD
197972001-12-17 Akim Demaille <akim@epita.fr>
19798
19799 * src/output.c (action_row, save_column, default_goto)
19800 (sort_actions, matching_state, pack_vector): Better variable
19801 locality.
19802
796d61fb
AD
198032001-12-17 Akim Demaille <akim@epita.fr>
19804
19805 * src/output.c: Various formatting changes.
776209d6 19806
64d15509
AD
198072001-12-17 Akim Demaille <akim@epita.fr>
19808
19809 * src/files.c (output_files): Free the output_obstack.
19810 * src/main.c (main): Call print and print_graph conditionally.
19811 * src/print.c (print): Work unconditionally.
19812 * src/print_graph.c (print_graph): Work unconditionally.
19813 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19814
fbc8ecb7
MA
198152001-12-16 Marc Autret <autret_m@epita.fr>
19816
19817 * src/output.c (actions_output): Fix. When we use %no-lines,
19818 there is one less line per action.
19819
f0440388
MA
198202001-12-16 Marc Autret <autret_m@epita.fr>
19821
19822 * src/bison.simple: Remove a useless #line directive.
19823 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19824 * src/output.c (get_lines_number): New.
776209d6 19825 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
19826 output muscles.
19827 Fix line numbering.
19828 (actions_output): Computes the number of lines taken by actions.
19829 (output_master_parser): Insert new skeleton which is the name of
19830 the output parser file name.
19831
a79986b8
MA
198322001-12-15 Marc Autret <autret_m@epita.fr>
19833
19834 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19835
4ec8e00f
MA
198362001-12-15 Marc Autret <autret_m@epita.fr>
19837
19838 * src/output.c (output_gram): Keep track of the hairy one.
19839
1a4648ff
AD
198402001-12-15 Akim Demaille <akim@epita.fr>
19841
19842 Make `make distcheck' work.
19843
19844 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19845 system.h which uses libgettext.h.
19846
9c2c67e6
AD
198472001-12-15 Akim Demaille <akim@epita.fr>
19848
19849 * src/nullable.c (set_nullable): Useless rules must be skipped,
19850 otherwise, since we range over their symbols, we might look at a
19851 nonterminal which no longer ``exists'', i.e., it is not counted in
19852 `nvars', hence we overflow our arrays.
19853
93ede233
AD
198542001-12-15 Akim Demaille <akim@epita.fr>
19855
19856 The header can also be produced directly, without any obstack!
19857 Yahoo!
19858
19859 * src/files.c, src/files.h (defines_obstack): Remove.
19860 (compute_header_macro): Global.
19861 (defines_obstack_save): Remove.
19862 * src/reader.c (parse_union_decl): No longer output to
19863 defines_obstack: its content can be found in the `stype' muscle
19864 anyway.
19865 (output_token_translations): Merge into...
19866 (symbols_output): this.
19867 Rename as...
19868 (symbols_save): this.
19869 (reader): Adjust.
19870 * src/output.c (header_output): New.
19871 (output): Call it.
19872
2666f928
AD
198732001-12-15 Akim Demaille <akim@epita.fr>
19874
19875 * src/reader.c (parse_union_decl): Instead of handling two obstack
19876 simultaneously, use one to define the `stype' muscle, and use the
19877 value of the latter to fill defines_obstack.
19878 (copy_comment): Remove.
19879 (copy_comment2): Work for a single obstack.
19880 Rename as...
19881 (copy_comment): this.
19882
428046f8
AD
198832001-12-15 Akim Demaille <akim@epita.fr>
19884
19885 * src/lex.c, src/lex.h (xgetc): No longer static.
19886 * src/reader.c (parse_union_decl): Revamp.
19887
ea52d706
AD
198882001-12-15 Akim Demaille <akim@epita.fr>
19889
19890 Still making progress in separating Bison into (i) input, (ii)
19891 process, (iii) output: now we can directly output the parser file
19892 without using table_obstack at all.
19893
19894 * src/files.c, src/files.h (table_obstack): Bye bye.
19895 (parser_file_name): New.
19896 * src/files.c (compute_output_file_names): Compute it.
19897 * src/output.c (actions_output, output_parser)
19898 (output_master_parser): To a file instead of an obstack.
19899
3f96f4dc
AD
199002001-12-15 Akim Demaille <akim@epita.fr>
19901
19902 Attach actions to rules, instead of pre-outputting them to
19903 actions_obstack.
19904
19905 * src/gram.h (rule_t): action and action_line are new members.
19906 * src/reader.c (symbol_list): Likewise.
19907 (copy_action): Save the actions within the rule.
19908 (packgram): Save them in rule_table.
19909 * src/output.c (actions_output): New.
19910 (output_parser): Use it on `%%actions'.
19911 (output_rule_data): Don't free rule_table.
19912 (output): Do it.
19913 (prepare): Don't save the `action' muscle.
19914 * src/bison.simple: s/%%action/%%actions/.
19915
51576fb3
AD
199162001-12-15 Akim Demaille <akim@epita.fr>
19917
19918 * src/reader.c (copy_action): When --yacc, don't append a `;'
19919 to the user action: let it fail if lacking.
dee049eb 19920 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 19921
2648a72d
AD
199222001-12-14 Akim Demaille <akim@epita.fr>
19923
19924 * src/lex.c (literalchar): Simply return the char you decoded, non
19925 longer mess around with obstacks and int pointers.
19926 Adjust all callers.
19927
92790e5b
AD
199282001-12-14 Akim Demaille <akim@epita.fr>
19929
19930 * src/lex.c (literalchar): Don't escape the special characters,
19931 just decode them, and keep them as char (before, eol was output as
19932 the 2 char string `\n' etc.).
19933 * src/output.c (output_rule_data): Use quotearg to output the
19934 token strings.
19935
927c1557
PE
199362001-12-13 Paul Eggert <eggert@twinsun.com>
19937
19938 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
19939 Do not infringe on the global user namespace when using C++.
19940 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
19941 All uses of `fprintf' and `stderr' changed.
19942
19943 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
19944
ed8e1f68
AD
199452001-12-13 Akim Demaille <akim@epita.fr>
19946
19947 The computation of nullable is broken: it doesn't handle empty
19948 RHS's properly.
19949
19950 * tests/torture.at (GNU AWK Grammar): New.
19951 * tests/sets.at (Nullable): New.
19952 * src/nullable.c (set_nullable): Instead of blindly looping over
19953 `ritems', loop over the rules, and then over their rhs's.
19954
19955 Work around Autotest bugs.
19956
19957 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
19958 frame, because Autotest understand lines starting with a `+' as
19959 traces from the shell. Then, they are not processed properly.
19960 Admittedly an Autotest bug, but we don't have time to wait for
19961 Autotest to catch up.
19962 * tests/regression.at (Broken Closure): Adjust to the new table
19963 frames.
19964 Move to...
19965 * tests/sets.at: here.
19966
cb581495
AD
199672001-12-13 Akim Demaille <akim@epita.fr>
19968
19969 * src/closure.c (closure): Use nrules instead of playing tricks
19970 with BITS_PER_WORD.
19971
2e729273
AD
199722001-12-13 Akim Demaille <akim@epita.fr>
19973
19974 * src/print.c (print_actions): Output the handling of `$' as the
19975 traces do: shifting the token EOF. Before EOF was treated as a
19976 nonterminal.
19977 * tests/regression.at: Adjust some tests.
19978 * src/print_graph.c (print_core): Complete the set of items via
19979 closure. The next-to-final and final states are still unsatisfying,
19980 but that's to be addressed elsewhere.
19981 No longer output the rule numbers, but do output the state number.
19982 A single loop for the shifts + gotos is enough, but picked a
19983 distinct color for each.
19984 (print_graph): Initialize and finalize closure.
19985
107f7dfb
AD
199862001-12-13 Akim Demaille <akim@epita.fr>
19987
19988 * src/reader.c (readgram): Remove dead code, an strip useless
19989 braces.
19990 (get_type): Remove, unused.
19991
9b53a24f
AD
199922001-12-12 Akim Demaille <akim@epita.fr>
19993
19994 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
19995 on that of lib/error.c.
19996
dbfb6dcd
AD
199972001-12-12 Akim Demaille <akim@epita.fr>
19998
19999 Some hosts don't like `/' in includes.
20000
20001 * src/system.h: Include libgettext.h without qualifying the path.
20002 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20003 $(top_srcdir).
20004
c25fb648
MA
200052001-12-11 Marc Autret <autret_m@epita.fr>
20006
20007 * src/output.c (output_parser): Remove useless muscle.
20008
710ddc4f
MA
200092001-12-11 Marc Autret <autret_m@epita.fr>
20010
20011 * src/bison.simple: Remove #line just before %%epilogue. It
20012 is now handled in ...
20013 * src/reader.c (read_additionnal_code): Add the output of a
20014 #line for the epilogue.
20015
e83d80b8
MA
200162001-12-10 Marc Autret <autret_m@epita.fr>
20017
927c1557 20018 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
20019 replace precedent remove.
20020 * src/bison.simple: Remove #line before %%prologue because
20021 %%input-line is wrong at this time.
20022
971d5158
MA
200232001-12-10 Marc Autret <autret_m@epita.fr>
20024
20025 * src/reader.c (symbols_output): Clean up.
927c1557 20026 * src/output.c (output_gram, output): Clean up.
971d5158 20027
5edafffd
AD
200282001-12-10 Akim Demaille <akim@epita.fr>
20029
20030 * src/lalr.c (initialize_lookaheads): New. Extracted from...
20031 * src/LR0.c (set_state_table): here.
20032 * src/lalr.c (lalr): Call it.
20033
0279f8e9
AD
200342001-12-10 Akim Demaille <akim@epita.fr>
20035
20036 * src/state.h (shifts): Remove the `number' member: shifts are
20037 attached to state, hence no longer need to be labelled with a
20038 state number.
20039
190c4f5f
AD
200402001-12-10 Akim Demaille <akim@epita.fr>
20041
20042 Now that states have a complete set of members, the linked list of
20043 shifts is useless: just fill directly the state's shifts member.
20044
20045 * src/state.h (shifts): Remove the `next' member.
20046 * src/LR0.c (first_state, last_state): Remove.
20047 Adjust the callers.
20048 (augment_automaton): Don't look for the shifts that must be added
20049 a shift on EOF: it is those of the state we looked for! But now,
20050 since shifts are attached, it is no longer needed to looking
20051 merely by its id: its number.
20052
2a73b93d
AD
200532001-12-10 Akim Demaille <akim@epita.fr>
20054
20055 * src/LR0.c (augment_automaton): Better variable locality.
20056 Remove an impossible branch: if there is a state corresponding to
20057 the start symbol being shifted, then there is shift for the start
20058 symbol from the initial state.
20059
74392f6a
AD
200602001-12-10 Akim Demaille <akim@epita.fr>
20061
20062 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
20063 only when appropriate: when insert_start_shifting_state' is not
20064 invoked.
20065 * tests/regression.at (Rule Line Numbers): Adjust.
20066
37c82725
AD
200672001-12-10 Akim Demaille <akim@epita.fr>
20068
20069 * src/LR0.c (augment_automaton): Now that all states have shifts,
20070 merge the two cases addition shifts to the initial state.
20071
6a164e0c
AD
200722001-12-10 Akim Demaille <akim@epita.fr>
20073
20074 * src/lalr.c (set_state_table): Move to...
20075 * src/LR0.c: here.
20076 * src/lalr.c (lalr): Don't call it...
20077 * src/LR0.c (generate_states): do it.
20078 * src/LR0.h (first_state): Remove, only the table is used.
20079
7215de24
AD
200802001-12-10 Akim Demaille <akim@epita.fr>
20081
20082 * src/LR0.h (first_shift, first_reduction): Remove.
20083 * src/lalr.c: Don't use first_shift: find shifts through the
20084 states.
20085
80e25d4d
AD
200862001-12-10 Akim Demaille <akim@epita.fr>
20087
20088 * src/LR0.c: Attach shifts to states as soon as they are
20089 computed.
20090 * src/lalr.c (set_state_table): Instead of assigning shifts to
20091 state, just assert that the mapping was properly done.
20092
0ab3728b
AD
200932001-12-10 Akim Demaille <akim@epita.fr>
20094
20095 * src/LR0.c (insert_start_shift): Rename as...
20096 (insert_start_shifting_state): this.
20097 (insert_eof_shifting_state, insert_accepting_state): New.
20098 (augment_automaton): Adjust.
20099 Better locality of the variables.
20100 When looking if the start_symbol is shifted from the initial
20101 state, using `while (... symbol != start_symbol ...)' sounds
20102 better than `while (... symbol < start_symbol ...)': If fail
20103 to see how the order between symbols could be relevant!
20104
78af9bbc
AD
201052001-12-10 Akim Demaille <akim@epita.fr>
20106
20107 * src/getargs.h: Don't declare `spec_name_prefix' and
20108 `spec_file_prefix', declared by src/files.h.
20109 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
20110 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
20111 * src/output.c (prepare): Adjust.
20112 * src/reader.c (symbols_output): Likewise.
20113 * src/vmsgetargs.c: Vaguely adjust, but who cares?
20114
bdef2a41
AD
201152001-12-10 Akim Demaille <akim@epita.fr>
20116
20117 * src/muscle_tab.c (muscle_init): NULL is a better default than
20118 `"0"'.
20119
3735969c
AD
201202001-12-10 Akim Demaille <akim@epita.fr>
20121
20122 * src/reader.c (reader): Calling symbols_output once is enough.
20123
49701457
AD
201242001-12-10 Akim Demaille <akim@epita.fr>
20125
20126 Now that states have a complete set of members, the linked list of
20127 reductions is useless: just fill directly the state's reductions
20128 member.
20129
20130 * src/state.h (struct reductions): Remove member `number' and
20131 `next'.
20132 * src/LR0.c (first_reduction, last_reduction): Remove.
20133 (save_reductions): Don't link the new reductions, store them in
20134 this_state.
20135 * src/lalr.c (set_state_table): No need to attach reductions to
20136 states, it's already done.
20137 * src/output.c (output_actions): No longer free the shifts, then
20138 the reductions, then the states: free all the states and their
20139 members.
20140
0edad749
AD
201412001-12-10 Akim Demaille <akim@epita.fr>
20142
20143 * src/options.c (OPTN, DRTV, BOTH): New.
20144 (option_table): Use them.
20145
0edad749
AD
20146 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
20147 the job of system.h.
20148 * src/options.c: Don't include stdio.h and xalloc.h for the same
20149 reasons.
20150
5449dd0f
AD
201512001-12-10 Akim Demaille <akim@epita.fr>
20152
20153 * src/output.c (output, prepare): Make sure the values of the
20154 muscles `action' and `prologue' are 0-terminated.
20155
a870c567
AD
201562001-12-10 Akim Demaille <akim@epita.fr>
20157
20158 Clean up GCC warnings.
20159
20160 * src/reader.c (copy_action): `buf' is not used.
20161 (parse_skel_decl): Be static.
20162 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
20163 * src/options.h (create_long_option_table): Have a real prototype.
20164 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
20165 (hash_delete_at): Return const void *.
20166 Adjust casts to preserve the const.
20167
80df8768
AD
201682001-12-10 Akim Demaille <akim@epita.fr>
20169
20170 * configure.in: Require 2.52g.
20171 M4 is not needed, but AUTOM4TE is.
20172 * m4/m4.m4: Remove.
20173 * tests/Makefile.am: Adjust.
20174
f693ad14
AD
201752001-12-10 Akim Demaille <akim@epita.fr>
20176
20177 One structure for states is enough, even though theoretically
20178 there are LR(0) states and LALR(1) states.
20179
20180 * src/lalr.h (state_t): Remove.
20181 (state_table): Be state_t **, not state_t *.
20182 * src/state.h (core, CORE_ALLOC): Rename as...
20183 (state_t, STATE_ALLOC): this.
20184 Add the LALR(1) members: shifts, reductions, errs.
20185 * src/LR0.c (state_table): Rename as...
20186 (state_hash): this, to avoid name clashes with the global
20187 `state_table'.
20188 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
20189 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
20190
74ffbcb6
AD
201912001-12-10 Akim Demaille <akim@epita.fr>
20192
20193 Bison dumps core on bash.y.
20194 Reported by Pascal Bart.
20195
20196 * src/warshall.c (bitmatrix_print): New.
20197 (TC): Use it.
ba0fe3c7 20198 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
20199 j must be the outer loop.
20200 * tests/regression.at (Broken Closure): New.
20201
07708e19
AD
202022001-12-05 Akim Demaille <akim@epita.fr>
20203
20204 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
20205 its argument.
ba1ecc07 20206 Reported by Peter Hamorsky.
07708e19 20207
92b16366
AD
202082001-12-05 Akim Demaille <akim@epita.fr>
20209
20210 * src/conflicts.c (err_table): Remove.
20211 (resolve_sr_conflict): Adjust.
20212 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
20213 Rename as...
20214 (state_t.reductions, state_t.shifts): this.
20215
076ab033
AD
202162001-12-05 Akim Demaille <akim@epita.fr>
20217
20218 * src/reduce.c (reduce_grammar_tables): No longer disable the
20219 removal of useless rules via CPP but via `if (0)', so that the
20220 compiler still check the code is valid.
20221 For instance, it should have noticed `rline' no longer exists: use
20222 the `line' member of rule_t.
20223 * src/gram.c (dummy, rline): Remove, unused.
20224
3843c413
AD
202252001-12-05 Akim Demaille <akim@epita.fr>
20226
20227 * src/output.c (pack_vector): Use assert, not berror.
20228 * src/main.c (berror): Remove, unused.
20229
43168960
AD
202302001-12-05 Akim Demaille <akim@epita.fr>
20231
20232 New experimental feature: if --verbose --trace output all the
20233 items of a state, not only its kernel.
20234
20235 * src/print.c (print_core): If `trace_flag', then invoke closure
20236 before outputting the items of the state (print_core is no longer
20237 a correct name them).
20238 (print_results): Invoke new_closure/free_closure if needed.
20239
b2872512
AD
202402001-12-05 Akim Demaille <akim@epita.fr>
20241
20242 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
20243 * src/closure.c, src/closure.h (itemsetsize): Rename as...
20244 (nitemset): for consistency with the rest of the project.
20245
23cbcc6c
AD
202462001-12-05 Akim Demaille <akim@epita.fr>
20247
20248 * src/closure.c (print_closure): Improve.
20249 (closure): Use it for printing input and output.
20250
03ec521c
AD
202512001-12-05 Akim Demaille <akim@epita.fr>
20252
20253 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
20254 indexed by nonterminals.
20255
3a7456dd
AD
202562001-12-05 Akim Demaille <akim@epita.fr>
20257
20258 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
20259 what it was!).
20260 * src/warshall.h: Remove accidental duplication of the content.
20261
1cbcf2e7
AD
202622001-12-05 Akim Demaille <akim@epita.fr>
20263
20264 * src/closure.c (set_fderives): De-obfuscate.
20265
84182270
AD
202662001-12-05 Akim Demaille <akim@epita.fr>
20267
20268 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
20269
3f6f053c
AD
202702001-12-05 Akim Demaille <akim@epita.fr>
20271
20272 * src/closure.c (set_firsts): De-obfuscate.
20273
7a5350ba
AD
202742001-12-05 Akim Demaille <akim@epita.fr>
20275
20276 * src/output.c (action_row): De-obfuscate
20277 using the good o' techniques: arrays not pointers, variable
20278 locality, BITISSET, RESETBIT etc.
20279
d954473d
AD
202802001-12-05 Akim Demaille <akim@epita.fr>
20281
20282 Pessimize the code to simplify it: from now on, all the states
20283 have a valid SHIFTS, which NSHIFTS is possibly 0.
20284
20285 * src/LR0.c (shifts_new): Be global and move to..
20286 * src/state.c, src/state.h: here.
20287 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
20288 * src/print_graph: Adjust.
20289
9839bbe5
AD
202902001-12-05 Akim Demaille <akim@epita.fr>
20291
20292 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
20293 * src/conflicts.c: Use it.
20294 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
20295 incorrectly ``simplified''.
20296
9f136c07
AD
202972001-12-05 Akim Demaille <akim@epita.fr>
20298
20299 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
20300 using the good o' techniques: arrays not pointers, variable
20301 locality, BITISSET, RESETBIT etc.
20302
b608206e
AD
203032001-12-05 Akim Demaille <akim@epita.fr>
20304
20305 * src/state.h (SHIFT_SYMBOL): New.
20306 * src/conflicts.c: Use it to deobfuscate.
20307
52afa962
AD
203082001-12-05 Akim Demaille <akim@epita.fr>
20309
20310 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
20311 (print_reductions): De-obfuscate using the good o' techniques:
20312 arrays not pointers, variable locality, BITISSET.
20313
e74dc321
AD
203142001-12-05 Akim Demaille <akim@epita.fr>
20315
20316 * src/conflicts.c (print_reductions): Arrays, not pointers.
20317 Use BITISSET.
20318
768fca83
AD
203192001-12-05 Akim Demaille <akim@epita.fr>
20320
20321 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20322
a17e599f
AD
203232001-12-05 Akim Demaille <akim@epita.fr>
20324
20325 * src/conflicts.c (print_reductions): Improve variable locality.
20326
a04bc341
AD
203272001-12-05 Akim Demaille <akim@epita.fr>
20328
20329 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20330
c8ea038e
AD
203312001-12-05 Akim Demaille <akim@epita.fr>
20332
20333 * src/conflicts.c (print_reductions): Improve variable locality.
20334
aa2aab3c
AD
203352001-12-05 Akim Demaille <akim@epita.fr>
20336
20337 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20338 * src/lalr.c: Use them.
20339
b178c8cc
AD
203402001-12-05 Akim Demaille <akim@epita.fr>
20341
20342 * src/LR0.c (augment_automaton): Formatting changes.
20343 Better variable locality.
20344
f67d13aa
AD
203452001-12-05 Akim Demaille <akim@epita.fr>
20346
20347 * src/lalr.c (matrix_print): New.
20348 (transpose): Use it.
20349 Use arrays instead of pointers.
20350
c2713865
AD
203512001-12-05 Akim Demaille <akim@epita.fr>
20352
20353 * src/lalr.c (maxrhs): Move to...
20354 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20355 * src/lalr.c (build_relations): Adjust.
20356
9887c18a
AD
203572001-12-05 Akim Demaille <akim@epita.fr>
20358
20359 * src/lalr.c (transpose): Free the memory allocated to the
20360 argument, as it is replaced by the results by the unique caller.
20361 (build_relations): Merely invoke transpose: it handles the memory
20362 deallocation.
20363 Improve variable locality.
20364 Avoid variables used as mere abbreviations.
20365 (compute_lookaheads): Use arrays instead of pointers.
20366
4d4f699c
AD
203672001-12-05 Akim Demaille <akim@epita.fr>
20368
20369 * src/lalr.c (initialize_F): Improve variable locality.
20370 Avoid variables used as mere abbreviations.
20371
80a69750
AD
203722001-12-05 Akim Demaille <akim@epita.fr>
20373
20374 * src/derives.c (print_derives): Display the ruleno.
20375 * src/lalr.c (initialize_F, transpose): Better variable locality
20376 to improve readability.
20377 Avoid variables used as mere abbreviations.
20378
fe961097
AD
203792001-12-05 Akim Demaille <akim@epita.fr>
20380
20381 * src/lalr.c (traverse): Use arrays instead of pointers.
20382
e3e4e814
AD
203832001-12-05 Akim Demaille <akim@epita.fr>
20384
20385 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20386 the handling of squeue.
20387 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20388
630e182b
AD
203892001-12-05 Akim Demaille <akim@epita.fr>
20390
20391 Because useless nonterminals are now kept alive (instead of being
20392 `destroyed'), we now sometimes examine them, and store information
20393 related to them. Hence we need to know their number, and adjust
20394 memory allocations.
20395
20396 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20397 static.
20398 * src/LR0.c (allocate_itemsets): The memory allocated to
20399 `symbol_count' was used for two different purpose: once to count
20400 the number of occurrences of each symbol, and later reassigned to
20401 `shift_symbol', containing the symbol that can be shifted from a
20402 given state.
20403 Deobfuscate, i.e., allocate, use and free `symbol_count' here
20404 only, and...
20405 (new_itemsets): Allocate `shift_symbol' here.
20406 (allocate_itemsets): symbol_count includes useless nonterminals.
20407 Make room for them.
20408 (free_storage): Use `free', not `XFREE', for pointers that cannot
20409 be null.
20410
81b51460
AD
204112001-12-05 Akim Demaille <akim@epita.fr>
20412
20413 * src/nullable.c (set_nullable): Deobfuscate the handling of
20414 ritem.
20415 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20416
3067fbef
AD
204172001-12-05 Akim Demaille <akim@epita.fr>
20418
20419 * src/gram.c, src/gram.h (ritem_print): New.
20420 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
20421 (This useless function was defined only to work around VMS linkers
20422 that can't handle compilation units with variables only).
20423 * src/reduce.c (dump_grammar): Use it to trace the construction of
20424 ritem.
20425
c2bea5f9
PE
204262001-12-04 Paul Eggert <eggert@twinsun.com>
20427
7d27c823
PE
20428 * src/bison.simple (union yyalloc): Change member names
20429 to be the same as the stack names.
20430 (yyparse): yyptr is now union yyalloc *, not char *.
20431 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
20432 and may generate better code on some machines.
c2bea5f9
PE
20433 (yystpcpy): Use prototype if __STDC__ is defined, not just
20434 if __cplusplus is defined.
35687a9d 20435
2c8a9dfa
AD
204362001-11-30 Akim Demaille <akim@epita.fr>
20437
20438 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
20439 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
20440 Gettext doesn't compile cleanly, and dies with -Werror.
20441 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
20442 Include WARNING_CFLAGS here.
20443 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
20444 before being defined.
20445
f4e421e6
AD
204462001-11-27 Paul Eggert <eggert@twinsun.com>
20447
20448 * lib/quotearg.h (quotearg_n, quotearg_n_style):
20449 First arg is int, not unsigned.
20450 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
20451 (SIZE_MAX, UINT_MAX): New macros.
20452 (quotearg_n_options): Abort if N is negative.
20453 Avoid overflow check on hosts where size_t is 64 bits and int
20454 is 32 bits, as overflow is impossible there.
20455 Fix off-by-one typo that caused unnecessary reallocation.
20456
7093d0f5
AD
204572001-11-29 Paul Eggert <eggert@twinsun.com>
20458
20459 Name space cleanup in generated parser.
20460
20461 * doc/bison.texinfo (Bison Parser): Discuss system headers
20462 and their effect on the user name space.
20463
20464 * src/bison.simple:
20465 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
20466 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
20467 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
20468
20469 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
20470 on user names when possible.
20471
20472 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
20473 Simplify test for whather <alloca.h> exists.
20474
20475 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
20476
20477 (<stdio.h>): Include if YYDEBUG.
20478
20479 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
20480 ! defined (yyoverflow) && ! defined (yymemcpy).
20481
20482 (yymemcpy, yyparse): Rename local variables as needed so that
20483 they all begin with 'yy'.
20484
20485 (yystrlen, yystpcpy): New functions.
20486
20487 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
20488 All uses changed.
20489
20490 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
20491 instead of relying on string.h functions. Use YYSTACK_ALLOC
20492 and YYSTACK_FREE instead of malloc and free.
20493
fd51e5ff
AD
204942001-11-30 Akim Demaille <akim@epita.fr>
20495
20496 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
20497 before their first uses.
20498 (YYBISON, YYPURE): Move to the top of the output.
20499
7d13ff5f
AD
205002001-11-30 Akim Demaille <akim@epita.fr>
20501
20502 * tests/reduce.at (Useless Nonterminals): Fix.
20503
892a3995
AD
205042001-11-30 Akim Demaille <akim@epita.fr>
20505
20506 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
20507 if body instead of `;' to pacify GCC's warnings.
20508
68f1e3ed
AD
205092001-11-30 Akim Demaille <akim@epita.fr>
20510
20511 Instead of mapping the LHS of unused rules to -1, keep the LHS
20512 valid, but flag the rules as invalid.
20513
20514 * src/gram.h (rule_t): `useful' is a new member.
20515 * src/print.c (print_grammar): Adjust.
20516 * src/derives.c (set_derives): Likewise.
20517 * src/reader.c (packgram, reduce_output): Likewise.
20518 * src/reduce.c (reduce_grammar_tables): Likewise.
20519 * tests/reduce.at (Underivable Rules, Useless Rules): New.
20520
d2d1b42b
AD
205212001-11-30 Akim Demaille <akim@epita.fr>
20522
20523 * src/reduce.c (reduce_output): Formatting changes.
20524 * src/print.c (print_results, print_grammar): Likewise.
20525 * tests/regression.at (Rule Line Numbers)
20526 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
20527
760b53a8
AD
205282001-11-30 Akim Demaille <akim@epita.fr>
20529
20530 * src/reduce.c (nonterminals_reduce): Instead of throwing away
20531 useless nonterminals, move them at the end of the symbol arrays.
20532 (reduce_output): Adjust.
20533 * tests/reduce.at (Useless Nonterminals): Adjust.
20534
00238958
AD
205352001-11-30 Akim Demaille <akim@epita.fr>
20536
20537 * src/reduce.c: Various comment/formatting changes.
20538 (nonterminals_reduce): New, extracted from...
20539 (reduce_grammar_tables): here.
20540 (reduce_grammar): Call nonterminals_reduce.
20541
396452de
PE
205422001-11-29 Paul Eggert <eggert@twinsun.com>
20543
20544 * src/bison.simple (YYSTACK_REALLOC): Remove.
20545 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
20546 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
20547 New macros.
20548 (union yyalloc): New type.
20549 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
20550 an arbitrary restriction on hosts where size_t is wider than int.
20551
20552 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20553 a parser stack overflow. Allocate just one block of memory for all
20554 three stacks, instead of allocating three blocks; this typically is
20555 faster and reduces fragmentation.
20556
20557 Do not limit the number of items in the stack to a value that fits
20558 in 'int', as this is an arbitrary limit on hosts with 64-bit
20559 size_t and 32-bit int.
20560
147e184c
MA
205612001-11-29 Marc Autret <autret_m@epita.fr>
20562
20563 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20564 of defining YYERROR_VERBOSE.
20565 [AT_DATA]: $4 is now out of C declarations in the prologue.
20566
426cf563
MA
205672001-11-28 Marc Autret <autret_m@epita.fr>
20568
20569 * src/reader.c (parse_dquoted_param): New.
20570 (parse_skel_decl): Use it.
20571 * src/lex.h: Add its prototype.
20572 * src/lex.c (literalchar): Become not static.
20573
c7925b99
MA
205742001-11-28 Marc Autret <autret_m@epita.fr>
20575
20576 * src/output.h: And put its extern declaration here.
20577 * src/output.c (error_verbose): Define here.
20578 (prepare): Echo name modification.
20579 * src/getargs.h: Clean its extern declaration.
20580 * src/getargs.c (error_verbose_flag): Remove.
20581 (getargs): Remove case 'e'.
20582 * src/options.c (option_table): 'error-verbose' is now seen as simple
20583 percent option.
20584 Include output.h.
20585
20586 * src/reader.c (read_declarations): Remove case tok_include.
20587 (parse_include_decl): Remove.
20588 * src/lex.h (token_t): Remove tok_include.
20589 * src/options.c (option_table): 'include' is now a simple command line
20590 option.
20591
5b5d1929
MA
205922001-11-28 Marc Autret <autret_m@epita.fr>
20593
20594 * src/bison.simple: Adjust muscle names.
20595 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20596 * src/output.c (prepare): s/_/-/ for the muscles names.
20597 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20598
8850be4b
MA
205992001-11-28 Marc Autret <autret_m@epita.fr>
20600
20601 * src/bison.simple: Fix debug.
20602 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20603
4a38e613
AD
206042001-11-28 Akim Demaille <akim@epita.fr>
20605
20606 * src/LR0.c (shifts_new): New.
20607 (save_shifts, insert_start_shift, augment_automaton): Use it.
20608
4b35e1c1
AD
206092001-11-28 Akim Demaille <akim@epita.fr>
20610
20611 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20612 keep ruleno only.
20613
d2b04478
AD
206142001-11-28 Akim Demaille <akim@epita.fr>
20615
20616 * src/closure.c (closure): Instead of looping over word in array
20617 then bits in words, loop over bits in array.
20618
2c4c30aa
AD
206192001-11-28 Akim Demaille <akim@epita.fr>
20620
20621 * src/closure.c (closure): No longer optimize the special case
20622 where all the bits of `ruleset[r]' are set to 0, to make the code
20623 clearer.
20624
576890b7
AD
206252001-11-28 Akim Demaille <akim@epita.fr>
20626
20627 * src/closure.c (closure): `r' and `c' are new variables, used to
20628 de-obfuscate accesses to RULESET and CORE.
20629
cb487d7d
AD
206302001-11-28 Akim Demaille <akim@epita.fr>
20631
20632 * src/reduce.c (reduce_print): Use ngettext.
20633 (dump_grammar): Improve the trace accuracy.
20634
6013d43f
AD
206352001-11-28 Akim Demaille <akim@epita.fr>
20636
20637 * src/reduce.c (dump_grammar): Don't translate trace messages.
20638
cb4956ee
AD
206392001-11-28 Akim Demaille <akim@epita.fr>
20640
20641 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20642 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20643 as all tags are free'ed afterwards.
20644 From Enrico Scholz.
20645
648185ab
PE
206462001-11-27 Paul Eggert <eggert@twinsun.com>
20647
20648 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20649 use alloca when we didn't want to, and vice versa.
20650
68254a03
MA
206512001-11-27 Marc Autret <autret_m@epita.fr>
20652
9113b58f
AD
20653 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20654 initialization.
68254a03
MA
20655 * src/output.c (prepare): Remove its update.
20656
04d843a2
MA
206572001-11-27 Marc Autret <autret_m@epita.fr>
20658
20659 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20660 Use %error-verbose.
20661
d2079671 206622001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
20663
20664 * src/bison.simple: Remove YYERROR_VERBOSE using.
20665 Use %%error_verbose.
20666 (yyparse): Likewise.
20667 * src/output.c (prepare): Give its final value.
20668 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20669 * src/getargs.h: Add its extern declaration.
20670 * src/getargs.c (error_verbose_flag): New int.
20671 (getargs): Update to catch new case.
20672 * src/options.c (option_table): 'error-verbose' is a new option.
20673 (shortopts): Update.
20674
e0327bc8
AD
206752001-11-27 Akim Demaille <akim@epita.fr>
20676
20677 * src/system.h: Use intl/libgettext.h.
20678 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20679
000f1a3c
AD
206802001-11-27 Akim Demaille <akim@epita.fr>
20681
20682 * tests/torture.at (Exploding the Stack Size with Malloc):
20683 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20684
26cfe0be
AD
206852001-11-27 Akim Demaille <akim@epita.fr>
20686
20687 * src/files.c: Include error.h.
20688 Reported by Hans Aberg.
20689
f6bd5427
MA
206902001-11-26 Marc Autret <autret_m@epita.fr>
20691
d2079671 20692 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
20693 (read_declarations): Add case tok_include.
20694 * src/getargs.h (include): Add its extern definition.
20695 * src/getargs.c (include): New const char *.
20696 (getargs): Add case '-I'.
20697 * src/options.c (option_table): Add include as command line and
20698 percent option.
20699 * src/lex.h (token_t): Add tok_include.
20700
2ca209c1
AD
207012001-11-26 Akim Demaille <akim@epita.fr>
20702
20703 * src/reader.c (readgram): Make sure rules for mid-rule actions
20704 have a lineno equal to that of their host rule.
20705 Reported by Hans Aberg.
20706 * tests/regression.at (Rule Line Numbers): New.
20707
0e41b407
AD
207082001-11-26 Akim Demaille <akim@epita.fr>
20709
20710 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20711 size_ts.
20712
207132001-11-26 Akim Demaille <akim@epita.fr>
20714
20715 * src/complain.c, src/complain.h (error): Remove, provided by
20716 lib/error.[ch].
20717
e0c40012
AD
207182001-11-26 Akim Demaille <akim@epita.fr>
20719
20720 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20721 issue an error message.
20722 * tests/regression.at (Invalid %directive): New.
20723 Reported by Hans Aberg.
20724
5e147124
AD
207252001-11-26 Akim Demaille <akim@epita.fr>
20726
20727 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20728 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20729
a034c8b8
AD
207302001-11-26 Akim Demaille <akim@epita.fr>
20731
20732 * src/conflicts.c (conflicts_print): Don't complain at all when
20733 there are no reduce/reduce conflicts, and as many shift/reduce
20734 conflicts as expected.
20735 * tests/regression.at (%expect right): Adjust.
20736
c64a20f3
AD
207372001-11-23 Akim Demaille <akim@epita.fr>
20738
20739 * lib/alloca.c: Update, from fileutils.
20740
5b0d29bb
AD
207412001-11-23 Akim Demaille <akim@epita.fr>
20742
20743 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20744
722c4bfe
AD
207452001-11-23 Akim Demaille <akim@epita.fr>
20746
20747 * src/system.h: Include alloca.h.
20748 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20749
6255b435
AD
207502001-11-23 Akim Demaille <akim@epita.fr>
20751
20752 * src/print_graph.c (print_actions): Remove `rule', unused.
20753 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20754 pacify GCC's signed < unsigned warnings.
20755 * src/closure.c (itemsetsize): Likewise.
20756 * src/reader.c (symbol_list_new): Static.
20757
b29b2ed5
AD
207582001-11-23 Akim Demaille <akim@epita.fr>
20759
20760 Attaching lineno to buckets is stupid, since only one copy of each
20761 symbol is kept, only the line of the first occurrence is kept too.
20762
20763 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20764 * src/reader.c (rline_allocated): Remove, unused.
20765 (symbol_list): Have a `line' member.
20766 (symbol_list_new): New.
20767 (readgram): Use it.
20768 * src/print.c (print_grammar): Output the rule line numbers.
20769 * tests/regression.at (Solved SR Conflicts)
20770 (Unresolved SR Conflicts): Adjust.
20771 Reported by Hans Aberg.
20772
a81b1d4a
MA
207732001-11-22 Marc Autret <autret_m@epita.fr>
20774
20775 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20776
c1ecb3c1
MA
207772001-11-22 Marc Autret <autret_m@epita.fr>
20778
20779 * src/muscle_tab.c (muscle_init): Remove initialization of
20780 skeleton muscle.
20781 * src/output.c (output_master_parser): Do it here.
20782
fbe01355
AD
207832001-11-20 Akim Demaille <akim@epita.fr>
20784
20785 * po/sv.po: New.
20786 * configure.in (ALL_LINGUAS): Adjust.
20787 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20788 longer contains strings to translate.
20789
81e895c0
AD
207902001-11-19 Akim Demaille <akim@epita.fr>
20791
20792 * src/conflicts.c (conflicts_print): Add a missing \n.
20793
6bb1878b
AD
207942001-11-19 Akim Demaille <akim@epita.fr>
20795
20796 * src/nullable.c (nullable_print): New.
20797 (set_nullable): Call it when tracing.
20798 Better locality of variables.
20799
d9ec2d07
AD
208002001-11-19 Akim Demaille <akim@epita.fr>
20801
20802 * src/print.c (print_actions): Better locality of variables.
20803
720e5c1b
AD
208042001-11-19 Akim Demaille <akim@epita.fr>
20805
20806 * src/derives.c (print_derives): Fix and enrich.
20807 * src/closure.c (print_fderives): Likewise.
20808
fb908786
AD
208092001-11-19 Akim Demaille <akim@epita.fr>
20810
20811 * src/closure.c (itemsetend): Remove, replaced with...
20812 (itemsetsize): new.
20813
125ecb56
AD
208142001-11-19 Akim Demaille <akim@epita.fr>
20815
20816 * src/LR0.c (kernel_end): Remove, replaced with...
20817 (kernel_size): new.
20818
d8cf039f
AD
208192001-11-19 Akim Demaille <akim@epita.fr>
20820
20821 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20822 to clarify.
20823
7bec0760
AD
208242001-11-19 Akim Demaille <akim@epita.fr>
20825
20826 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20827
c87d4863
AD
208282001-11-19 Akim Demaille <akim@epita.fr>
20829
20830 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20831 trace messages.
20832 * src/LR0.c: Likewise.
20833 (allocate_itemsets): Use arrays instead of pointers to clarify.
20834
9bfe901c
AD
208352001-11-19 Akim Demaille <akim@epita.fr>
20836
20837 * src/getargs.c (statistics_flag): Replace with...
20838 (trace_flag): New.
20839 (longopts): Accept --trace instead of --statistics.
20840 * src/getargs.h, src/options.c: Adjust.
20841 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20842 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20843
97db7bd4
AD
208442001-11-19 Akim Demaille <akim@epita.fr>
20845
cc72668c 20846 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
20847 pointers to clarify the code.
20848 (save_reductions, save_shifts): Factor common parts of alternatives.
20849
2c5f66ed
AD
208502001-11-19 Akim Demaille <akim@epita.fr>
20851
20852 * src/LR0.c (new_state, get_state): Complete TRACE code.
20853 * src/closure.c: Include `reader.h' to get `tags', needed by the
20854 trace code.
20855 Rename the conditional DEBUG as TRACE.
20856 Output consistently TRACEs to stderr, not stdout.
20857 * src/derives.c: Likewise.
20858 * src/reduce.c: (inaccessable_symbols): Using if is better style
20859 than goto.
20860 Use `#if TRACE' instead of `#if 0' for tracing code.
20861
300f275f
AD
208622001-11-19 Akim Demaille <akim@epita.fr>
20863
20864 * src/system.h (LIST_FREE, shortcpy): New.
20865 * src/LR0.c: Use them.
20866 * src/output.c (free_itemsets, free_reductions, free_shifts):
20867 Remove, replaced by LIST_FREE.
20868
f59c437a
AD
208692001-11-19 Akim Demaille <akim@epita.fr>
20870
20871 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20872 (REDUCTIONS_ALLOC): New.
20873 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20874 allocation.
20875
6986fd9e
AD
208762001-11-19 Akim Demaille <akim@epita.fr>
20877
20878 * src/LR0.c (new_state): Complete trace code.
20879 * src/nullable.c (set_nullable): Don't translate traces.
20880
4bc30f78
AD
208812001-11-19 Akim Demaille <akim@epita.fr>
20882
20883 * src/print_graph.c (print_core): Better locality of variables.
20884 * src/print.c (print_core): Likewise.
20885
08a946e0
AD
208862001-11-19 Akim Demaille <akim@epita.fr>
20887
20888 * src/vcg.c: You do the output, so you are responsible of the
20889 handling of VCG syntax, in particular: use quotearg.
20890 * src/print_graph.c: Don't.
20891 (print_actions): Don't output the actions as part of the nodes,
20892 since that's the job of the edges.
20893 (print_state): Don't output by hand: fill the node description,
9bfe901c 20894 and ask for its output.
08a946e0 20895
f0473484
AD
208962001-11-19 Akim Demaille <akim@epita.fr>
20897
cc72668c
AD
20898 * src/bison.simple (yyparse): When verbosely reporting an error,
20899 no longer put additional quotes around token names.
f0473484
AD
20900 * tests/calc.at: Adjust.
20901
e41dc700
AD
209022001-11-19 Akim Demaille <akim@epita.fr>
20903
20904 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
20905 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
20906 * src/output.c: Adjust.
20907
652a871c
AD
209082001-11-19 Akim Demaille <akim@epita.fr>
20909
20910 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
20911 (rule_t): this.
20912 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
20913
b2ed6e58
AD
209142001-11-19 Akim Demaille <akim@epita.fr>
20915
20916 * src/gram.h (rule_t): New.
20917 (rule_table): New.
20918 (rrhs, rlhs): Remove, part of state_t.
20919 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
20920 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
20921 * src/reader.c, src/reduce.c: Adjust.
20922
edad7067
AD
209232001-11-19 Akim Demaille <akim@epita.fr>
20924
20925 * src/reader.c (symbols_output): New, extracted from...
20926 (packsymbols): Here.
20927 (reader): Call it.
20928
3feec034
AD
209292001-11-19 Akim Demaille <akim@epita.fr>
20930
20931 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
20932 (maxrhs): this new function.
20933
ddcd5fdf
AD
209342001-11-19 Akim Demaille <akim@epita.fr>
20935
cc72668c 20936 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
20937 Adjust.
20938
bb527fc2
AD
209392001-11-19 Akim Demaille <akim@epita.fr>
20940
cc72668c 20941 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
20942 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20943 * src/lalr.c: Adjust.
20944
a845a697
AD
209452001-11-19 Akim Demaille <akim@epita.fr>
20946
20947 * src/lalr.c (initialize_LA): Only initialize LA. Let...
20948 (set_state_table): handle the `lookaheads' members.
20949
f004bf6a
AD
209502001-11-19 Akim Demaille <akim@epita.fr>
20951
cc72668c
AD
20952 * src/lalr.h (lookaheads): Removed array, whose contents is now
20953 a member of...
f004bf6a
AD
20954 (state_t): this structure.
20955 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20956 Adjust.
20957
de326cc0
AD
209582001-11-19 Akim Demaille <akim@epita.fr>
20959
cc72668c
AD
20960 * src/lalr.h (consistent): Removed array, whose contents is now
20961 a member of...
de326cc0
AD
20962 (state_t): this structure.
20963 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20964 Adjust.
20965
90b4416b
AD
209662001-11-19 Akim Demaille <akim@epita.fr>
20967
cc72668c
AD
20968 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
20969 contents are now members of...
90b4416b
AD
20970 (state_t): this structure.
20971 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
20972 Adjust.
20973
9703cc49
AD
209742001-11-19 Akim Demaille <akim@epita.fr>
20975
20976 * src/lalr.h (state_t): New.
20977 (state_table): Be a state_t * instead of a core **.
20978 (accessing_symbol): Remove, part of state_t.
20979 * src/lalr.c: Adjust.
20980 (set_accessing_symbol): Merge into...
20981 (set_state_table): this.
20982 * src/print_graph.c, src/conflicts.c: Adjust.
20983
d803322e
AD
209842001-11-14 Akim Demaille <akim@epita.fr>
20985
20986 * tests/calc.at, tests/output.at, tests/regression.at,
20987 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
20988 now the tests are run in private dirs, therefore AC_CLEANUP and
20989 family can be simplified to 0-ary.
20990 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
20991 use abs. path to find config.h.
20992 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
20993 stderr, there can be way too much random noise.
20994 Instead pass -Werror to GCC and rely on the exit status.
20995 Reported by Wolfram Wagner.
20996
3d76b07d
AD
209972001-11-14 Akim Demaille <akim@epita.fr>
20998
20999 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21000 defined only if yyoverflow is defined, to avoid `warning: unused
21001 variable `yyvs1''.
21002 Reported by The Test Suite.
21003
09b503c8
AD
210042001-11-14 Akim Demaille <akim@epita.fr>
21005
21006 * src/print.c: Include reduce.h.
21007 Reported by Hans Aberg.
21008
210092001-11-14 Akim Demaille <akim@epita.fr>
21010
21011 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21012 Revert a previous patch: these are really const.
21013 * src/conflicts.c (conflict_report): Additional useless pair of
21014 braces to pacify GCC's warnings for `if () if () {} else {}'.
21015 * src/lex.c (parse_percent_token): Replace equal_offset with
21016 arg_offset.
21017 arg is const.
21018 Be sure to strdup `arg' when used, since there is no reason for
21019 token_buffer not to change.
21020
0f37a994
AD
210212001-11-14 Akim Demaille <akim@epita.fr>
21022
21023 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
21024 definition.
21025 * src/main.c (main): Use them.
21026 Suggested by Hans Aberg.
21027
d39d93b8
AD
210282001-11-12 Akim Demaille <akim@epita.fr>
21029
21030 * src/system.h (ngettext): Now that we use ngettext, be sure to
21031 provide a default definition when NLS are not used.
21032
9edcd895
AD
210332001-11-12 Akim Demaille <akim@epita.fr>
21034
21035 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
21036 Use @kbd to denote user input.
21037 (Language and Grammar): ANSIfy the example.
21038 Adjust its layout for info/notinfo.
21039 (Location Tracking Calc): Output error messages to stderr.
21040 Output locations in a more GNUtically correct way.
21041 Fix a couple of Englishos.
21042 Adjust @group/@end group pairs.
21043
7da99ede
AD
210442001-11-12 Akim Demaille <akim@epita.fr>
21045
e3aa65c5 21046 %expect was not functioning at all.
7da99ede
AD
21047
21048 * src/conflicts.c (expected_conflicts): Set to -1.
21049 (conflict_report): Use ngettext.
21050 (conflicts_print): Check %expect and make its violation an error.
21051 * doc/bison.texinfo (Expect Decl): Adjust.
21052 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
21053 * tests/regression.at (%expect not enough, %expect right)
21054 (%expect too much): New.
21055
ba9dda1a
AD
210562001-11-12 Akim Demaille <akim@epita.fr>
21057
21058 * tests/regression.at (Conflicts): Rename as...
21059 (Unresolved SR Conflicts): this.
21060 (Solved SR Conflicts): New.
21061
337c5bd1
AD
210622001-11-12 Akim Demaille <akim@epita.fr>
21063
21064 * src/reduce.c (print_results): Rename as...
21065 (reduce_output): This.
21066 Output to OUT, passed as argument, instead of output_obstack.
21067 (dump_grammar): Likewise.
21068 (reduce_free): New.
21069 Also free V1.
21070 (reduce_grammar): No longer call reduce_output, since...
21071 * src/print.c (print_results): do it.
21072 * src/main.c (main): Call reduce_free;
21073
c73a41af
AD
210742001-11-12 Akim Demaille <akim@epita.fr>
21075
21076 * src/conflicts.c (print_reductions): Accept OUT as argument.
21077 Output to it, not to output_obstack.
21078 * src/print.c (print_actions): Adjust.
21079
0df87bb6
AD
210802001-11-12 Akim Demaille <akim@epita.fr>
21081
21082 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
21083 the result instead of using...
21084 (src_total, rrc_total, src_count, rrc_count): Remove.
21085 (any_conflicts): Remove.
21086 (print_conflicts): Split into...
21087 (conflicts_print, conflicts_output): New.
21088 * src/conflicts.h: Adjust.
21089 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 21090 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
21091 * tests/regression.at (Conflicts): New.
21092 Reported by Tom Lane.
21093
e4d3d4de
AD
210942001-11-12 Akim Demaille <akim@epita.fr>
21095
21096 * tests/regression.at (Invalid input): Remove, duplicate with
21097 ``Invalid input: 1''.
21098
6d7d248e
AD
210992001-11-12 Akim Demaille <akim@epita.fr>
21100
21101 * tests/torture.at (AT_DATA_STACK_TORTURE)
21102 (Exploding the Stack Size with Alloca)
21103 (Exploding the Stack Size with Malloc): New.
21104
e9e4c321
AD
211052001-11-12 Akim Demaille <akim@epita.fr>
21106
21107 * src/bison.simple (YYSTACK_REALLOC): New.
21108 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 21109 Reported by Per Allansson.
e9e4c321 21110
5f7e0832
AD
211112001-11-12 Pascal Bart <pascal.bart@epita.fr>
21112
21113 * src/bison.simple: Define type yystype instead of YYSTYPE, and
21114 define CPP macro, which substitute YYSTYPE by yystype.
21115 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
21116 with yyltype/YYLTYPE. This allows inclusion of the generated
21117 header within the parser if the compiler, such as GGC, accepts
21118 multiple equivalent #defines.
21119 From Akim.
21120
e3f1699f
AD
211212001-11-05 Akim Demaille <akim@epita.fr>
21122
21123 * src/reader.c (symbols_output): New, extracted from...
21124 (packsymbols): here.
21125 (reader): Adjust.
21126
65be0866
AD
211272001-11-05 Akim Demaille <akim@epita.fr>
21128
21129 * src/lex.c (parse_percent_token): s/quotearg/quote/.
21130
e4d910bf
AD
211312001-11-05 Akim Demaille <akim@epita.fr>
21132
21133 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
21134 pattern.
21135
951366c1
AD
211362001-11-05 Akim Demaille <akim@epita.fr>
21137
21138 * src/options.h (struct option_table_struct): set_flags is void*.
21139 * src/options.c (longopts): Support `--output' and `%output'.
21140 (usage): Adjust.
21141 * src/lex.h (tok_setopt): Remove, replaced with...
21142 (tok_intopt, tok_stropt): these new guys.
21143 * src/lex.c (getopt.h): Not needed.
21144 (token_buffer, unlexed_token_buffer): Not const.
21145 (percent_table): Promote `-' over `_' in directive names.
21146 Active `%name-prefix', `file-prefix', and `output'.
21147 (parse_percent_token): Accept possible arguments to directives.
21148 Promote `-' over `_' in directive names.
21149
d8988b2f
AD
211502001-11-04 Akim Demaille <akim@epita.fr>
21151
21152 * doc/bison.texinfo (Decl Summary): Split the list into
21153 `directives for grammars' and `directives for bison'.
21154 Sort'em.
21155 Add description of `%name-prefix', `file-prefix', and `output'.
21156 Promote `-' over `_' in directive names.
21157 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
21158 Simplify the description of `--name-prefix'.
21159 Promote `-' over `_' in directive names.
21160 Promote `--output' over `--output-file'.
21161 Fix the description of `--defines'.
21162 * tests/output.at: Exercise %file-prefix and %output.
21163
6468d18e
AD
211642001-11-02 Akim Demaille <akim@epita.fr>
21165
21166 * doc/refcard.tex: Update.
21167
6b7e85b9
AD
211682001-11-02 Akim Demaille <akim@epita.fr>
21169
21170 * src/symtab.h (SUNDEF): New.
21171 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
21172 stand for `uninitialized', instead of 0.
21173 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
21174 * src/lex.c (lex): Adjust.
21175
21176 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
21177 Number it 0.
21178 Let yylex return it instead of a plain 0.
21179 Reported by Dick Streefland.
21180
cd5aafcf
AD
211812001-11-02 Akim Demaille <akim@epita.fr>
21182
21183 * tests/regression.at (Mixing %token styles): New test.
21184
037ca2f1
AD
211852001-11-02 Akim Demaille <akim@epita.fr>
21186
21187 * src/reader.c (parse_thong_decl): Formatting changes.
21188 (token_translations_init): New, extracted from...
21189 (packsymbols): Here.
21190 Adjust.
21191
270a173c
AD
211922001-11-01 Akim Demaille <akim@epita.fr>
21193
21194 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
21195 Check that `9foo.y' produces correct cpp guards.
21196 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
21197 guards.
21198 Reported by Wwp.
21199
561f9a30
AD
212002001-11-01 Akim Demaille <akim@epita.fr>
21201
21202 * tests/regression.at (Invalid input: 2): New.
21203 * src/lex.c (unlexed_token_buffer): New.
21204 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
21205 too.
21206 Reported by Wwp.
21207
f987e9d2
AD
212082001-11-01 Akim Demaille <akim@epita.fr>
21209
21210 * tests/calc.at: Catch up with 1.30.
21211 * configure.in: Bump to 1.49a.
21212 Adjust to newer Autotest.
21213
0846f581
PB
212142001-10-19 Pascal Bart <pascal.bart@epita.fr>
21215
21216 * src/conflicts.c: Move global variables rrc_total and src_total ...
21217 (print_conflicts): here.
21218 * src/output.c (output): Free global variable user_toknums.
21219 * src/lex.c (token_obstack): Become static.
21220
3c1a79b3
AD
212212001-10-18 Akim Demaille <akim@epita.fr>
21222
21223 * tests/atlocal.in (GCC): Add.
21224 * tests/calc.at: s/m4_match/m4_bmatch/.
21225 s/m4_patsubst/m4_bpatsubst/.
21226 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
21227 * configure.in: AC_SUBST(GCC).
21228
5d52e7d0
MA
212292001-10-14 Marc Autret <autret_m@epita.fr>
21230
21231 * src/options.c (create_long_option_table): Fix.
21232
631aa1d3
AD
212332001-10-10 Akim Demaille <akim@epita.fr>
21234
21235 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
21236
f6ec6d13
AD
212372001-10-04 Akim Demaille <akim@epita.fr>
21238
21239 * src/reader.c (parse_union_decl): Push the caracters in
21240 union_obstack, not attrs_obstack.
21241
342b8b6e
AD
212422001-10-04 Akim Demaille <akim@epita.fr>
21243
21244 Merge in the branch 1.29.
21245
21246 * src/reader.c (packsymbols): Use a temporary obstack for
21247 `%%tokendef', since output_stack is already used elsewhere.
21248
21249 2001-10-02 Akim Demaille <akim@epita.fr>
21250
21251 Bump 1.29d.
21252
21253 2001-10-02 Akim Demaille <akim@epita.fr>
21254
21255 Version 1.29c.
21256
21257 2001-10-02 Akim Demaille <akim@epita.fr>
21258
21259 * tests/regression.at (Invalid CPP headers): New.
21260 From Alexander Belopolsky.
21261 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
21262
21263 2001-10-02 Akim Demaille <akim@epita.fr>
21264
21265 * tests/regression.at (Invalid input): New.
21266 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
21267 Reported by Shura.
21268
21269 2001-10-02 Akim Demaille <akim@epita.fr>
21270
21271 * tests/calc.at: Now that --debug works, the tests must be adjusted.
21272
21273 2001-10-02 Akim Demaille <akim@epita.fr>
21274
21275 * src/output.c (output_parser): Assert `skeleton'.
21276 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
21277 systems.
21278 From Shura.
21279
21280 2001-10-01 Marc Autret <autret_m@epita.fr>
21281
21282 * src/lex.h: Echo modifications.
21283 * src/lex.c (unlex): Parameter is now token_t.
21284 From Hans Aberg.
21285
21286 2001-10-01 Marc Autret <autret_m@epita.fr>
21287
21288 * src/main.c: Include lex.h.
21289 From Hans Aberg.
21290
21291 2001-09-29 Akim Demaille <akim@epita.fr>
21292
21293 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
21294
21295 2001-09-28 Akim Demaille <akim@epita.fr>
21296
21297 * tests/testsuite.at: Update to newer Autotest.
21298 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
21299
21300 2001-09-27 Akim Demaille <akim@epita.fr>
21301
21302 Position independent wrapper.
21303
21304 * tests/bison: Remove.
21305 * tests/bison.in: New.
21306 * configure.in: Adjust.
21307
21308 2001-09-27 Paul Eggert <eggert@twinsun.com>
21309
21310 Port quotearg fixes from tar 1.13.24.
21311
21312 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
21313 tm to be declared.
21314 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
21315 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
21316
21317 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21318 * m4/mbrtowc.m4: New file.
21319 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21320 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21321
21322 2001-09-27 Akim Demaille <akim@epita.fr>
21323
21324 Bump to 1.29c.
21325
21326 2001-09-27 Akim Demaille <akim@epita.fr>
21327
21328 Version 1.29b.
21329
21330 2001-09-25 Akim Demaille <akim@epita.fr>
21331
21332 * src/system.h: Include `xalloc.h'.
21333 Remove it from the C files.
21334 * src/files.c (output_files): Free the obstacks.
21335 * src/lex.c (init_lex): Rename as...
21336 (lex_init): this.
21337 (lex_free): New.
21338 * src/main.c (main): Use it.
21339
21340 2001-09-24 Marc Autret <autret_m@epita.fr>
21341
21342 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21343 to output informations in fout (FILE*).
21344 (open_graph, close_graph): Likewise.
21345 (output_graph, output_edge, output_node): Likewise.
21346 * src/vcg.h: Update function prototypes.
21347 * src/print_graph.c (print_graph): Open output graph file.
21348 (print_actions): Adjust.
21349 * src/files.h: Remove extern declaration.
21350 * src/files.c: Remove graph_obstack declaration.
21351 (open_files): Remove graph_obstack initialization.
21352 (output_files): Remove graph_obstack saving.
21353
21354 2001-09-24 Marc Autret <autret_m@epita.fr>
21355
21356 * src/files.c (compute_output_file_names): Fix.
21357
21358 2001-09-24 Marc Autret <autret_m@epita.fr>,
21359 Akim Demaille <akim@epita.fr>
21360
21361 * src/reader.c (reader): Remove call to free_symtab ().
21362 * src/main.c (main): Call it here.
21363 Include symtab.h.
21364 * src/conflicts.c (initialize_conflicts): Rename as...
21365 (solve_conflicts): this.
21366 * src/print.c (print_core, print_actions, print_state)
21367 (print_grammar): Dump to a file instead a `output_obstack'.
21368 (print_results): Dump `output_obstack', and then proceed with the
21369 FILE *.
21370 * src/files.c (compute_output_file_names, close_files): New.
21371 (output_files): Adjust.
21372 * src/main.c (main): Adjust.
21373
21374 2001-09-23 Marc Autret <autret_m@epita.fr>
21375
21376 * src/files.c (compute_header_macro): Computes header macro name
21377 from spec_defines_file when given.
21378
21379 2001-09-23 Marc Autret <autret_m@epita.fr>
21380
21381 * src/files.c (output_files): Add default extensions.
21382
21383 2001-09-22 Akim Demaille <akim@epita.fr>
21384
21385 * src/conflicts.c (finalize_conflicts): Rename as...
21386 (free_conflicts): this.
21387
21388 2001-09-22 Akim Demaille <akim@epita.fr>
21389
21390 * src/gram.c (gram_free): Rename back as...
21391 (dummy): this.
21392 (output_token_translations): Free `token_translations'.
21393 * src/symtab.c (free_symtab): Free the tag field.
21394
21395 2001-09-22 Akim Demaille <akim@epita.fr>
21396
21397 Remove `translations' as it is always set to true.
21398
21399 * src/gram.h: Adjust.
21400 * src/reader.c (packsymbols, parse_token_decl): Adjust
21401 * src/print.c (print_grammar): Adjust.
21402 * src/output.c (output_token_translations): Adjust.
21403 * src/lex.c (lex): Adjust.
21404 * src/gram.c: Be sure the set pointers to NULL.
21405 (dummy): Rename as...
21406 (gram_free): this.
21407
21408 2001-09-22 Akim Demaille <akim@epita.fr>
21409
21410 * configure.in: Invoke AM_LIB_DMALLOC.
21411 * src/system.h: Use dmalloc.
21412 * src/LR0.c: Be sure to have pointers initialized to NULL.
21413 (allocate_itemsets): Allocate kernel_items only if needed.
21414
21415 2001-09-22 Akim Demaille <akim@epita.fr>
21416
21417 * configure.in: Bump to 1.29b.
21418 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
21419 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
21420 need xmalloc.c in calc.y.
21421 From Pascal Bart.
21422
21423 2001-09-21 Akim Demaille <akim@epita.fr>
21424
21425 Version 1.29a.
21426 * Makefile.maint, config/config.guess, config/config.sub,
21427 * config/missing: Update from masters.
21428 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
21429 upon package.m4.
21430 * configure.in (ALL_LINGUAS): Add `tr'.
21431
21432 2001-09-21 Akim Demaille <akim@epita.fr>
21433
21434 * tests/Makefile.am (package.m4): Move to...
21435 ($(srcdir)/$(TESTSUITE)): here.
21436
21437 2001-09-20 Akim Demaille <akim@epita.fr>
21438
21439 * src/complain.c: No longer try to be standalone: use system.h.
21440 Don't assume __STDC__ is defined to 1. Just test if it is defined.
21441 * src/complain.h: Likewise.
21442 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
21443 Remove the unused variable `n'.
21444 From Albert Chin-A-Young.
21445
21446 2001-09-18 Marc Autret <autret_m@epita.fr>
21447
21448 * doc/bison.1: Update.
21449 * doc/bison.texinfo (Bison Options): Update --defines and --graph
21450 descriptions.
21451 (Option Cross Key): Update.
21452 Add --graph.
21453
21454 2001-09-18 Marc Autret <autret_m@epita.fr>
21455
21456 * tests/regression.at: New test (comment in %union).
21457
21458 2001-09-18 Marc Autret <autret_m@epita.fr>
21459
21460 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
21461 do that.
21462 Reported by Keith Browne.
21463
21464 2001-09-18 Marc Autret <autret_m@epita.fr>
21465
21466 * tests/output.at: Add tests for --defines and --graph.
21467
21468 2001-09-18 Marc Autret <autret_m@epita.fr>
21469
21470 * tests/output.at: Removes tests of %{header,src}_extension features.
21471
21472 2001-09-18 Akim Demaille <akim@epita.fr>
21473
21474 * tests/Makefile.am (package.m4): New.
21475 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
21476 (_AT_CHECK_CALC_ERROR): Likewise.
21477 Factor the `, ' part of verbose error messages.
21478
21479 2001-09-18 Marc Autret <autret_m@epita.fr>
21480
21481 * src/getargs.c (longopts): Declare --defines and --graph as options
21482 with optional arguments.
21483 * src/files.h: Add extern declarations.
21484 * src/files.c (spec_graph_file, spec_defines_file): New.
21485 (output_files): Update.
21486 Remove CPP-outed code.
21487
21488 2001-09-18 Marc Autret <autret_m@epita.fr>
21489
21490 Turn off %{source,header}_extension feature.
21491
21492 * src/files.c (compute_exts_from_gf): Update.
21493 (compute_exts_from_src): Update.
21494 (output_files): CPP-out useless code.
21495 * src/files.h: Remove {header,source}_extension extern declarations.
21496 * src/reader.c (parse_dquoted_param): CPP-out.
21497 (parse_header_extension_decl): Remove.
21498 (parse_source_extension_decl): Remove.
21499 (read_declarations): Remove cases tok_{hdrext,srcext}.
21500 * src/lex.c (percent_table): Remove {header,source}_extension entries.
21501 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
21502
21503 2001-09-10 Akim Demaille <akim@epita.fr>
21504
21505 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
21506 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
21507 (AT_CHECK_OUTPUT): this.
21508 Merely check ls' exit status, its output is useless.
21509
21510 2001-09-10 Akim Demaille <akim@epita.fr>
21511
21512 * tests/calc.at: Use m4_match.
21513 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
21514
21515 2001-09-10 Marc Autret <autret_m@epita.fr>,
21516 Akim Demaille <akim@epita.fr>
21517
21518 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
21519 enum color_e.
21520 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
21521 to `normal'.
21522 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
21523 * src/lex.h: Adjust prototype.
21524 (token_t): Add `tok_undef'.
21525 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
21526 (parse_percent_token): Now returns token_t.
21527 Add default statement in switch.
21528 (lex): Separate `c' as an input variable, from the token_t result
21529 part.
21530 (unlexed): Is a token_t.
21531
21532 2001-09-10 Akim Demaille <akim@epita.fr>
21533
21534 * configure.in: Bump to 1.29a.
21535
21536 2001-09-07 Akim Demaille <akim@epita.fr>
21537
21538 Version 1.29.
21539
21540 2001-08-30 Akim Demaille <akim@epita.fr>
21541
21542 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
21543 * m4/atconfig.m4: Remove.
21544 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
21545 * tests/bison: New.
21546 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
21547 m4_if, m4_patsubst, and m4_regexp.
21548 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
21549 `input' file instead of echo.
21550
21551 2001-08-29 Akim Demaille <akim@epita.fr>
21552
21553 Bump to 1.28e.
21554
21555 2001-08-29 Akim Demaille <akim@epita.fr>
21556
21557 Version 1.28d.
21558
21559 2001-08-29 Paul Eggert <eggert@twinsun.com>
21560
21561 * src/bison.simple (yyparse): Don't take the address of an
21562 item before the start of an array, as that doesn't conform to
21563 the C Standard.
21564
21565 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21566
21567 * doc/bison.texinfo (Location Tracking Calc): New node.
21568
21569 2001-08-29 Paul Eggert <eggert@twinsun.com>
21570
21571 * src/output.c (output): Do not define const, as this now
21572 causes more problems than it cures.
21573
21574 2001-08-29 Akim Demaille <akim@epita.fr>
21575
21576 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21577 the nodes.
21578 Be sure to tag the `detailmenu'.
21579
21580 2001-08-29 Akim Demaille <akim@epita.fr>
21581
21582 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21583 download in a tmp dir.
21584
21585 2001-08-28 Marc Autret <autret_m@epita.fr>
21586
21587 * config/depcomp: New file.
21588
21589 2001-08-28 Marc Autret <autret_m@epita.fr>
21590
21591 * doc/bison.1 (mandoc): Adjust.
21592 From Juan Manuel Guerrero.
21593
21594 2001-08-28 Marc Autret <autret_m@epita.fr>
21595
21596 * src/print_graph.c (print_state): Fix.
21597
21598 2001-08-27 Marc Autret <autret_m@epita.fr>
21599
21600 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21601 char * members.
21602 Echo modifications to the functions prototypes.
21603 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21604
21605 2001-08-27 Marc Autret <autret_m@epita.fr>
21606
21607 * src/vcg.c: Include `xalloc.h'.
21608 (add_colorentry): New.
21609 (add_classname): New.
21610 (add_infoname): New.
21611 * src/vcg.h: Add new prototypes.
21612
21613 2001-08-27 Akim Demaille <akim@epita.fr>
21614
21615 * Makefile.maint: Sync. again with CVS Autoconf.
21616
21617 2001-08-27 Akim Demaille <akim@epita.fr>
21618
21619 * Makefile.maint: Formatting changes.
21620 (po-update, cvs-update, update): New targets.
21621 (AMTAR): Remove.
21622
21623 2001-08-27 Akim Demaille <akim@epita.fr>
21624
21625 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21626 * Makefile.maint: Sync. with CVS Autoconf.
21627
21628 2001-08-27 Marc Autret <autret_m@epita.fr>
21629
21630 * src/vcg.h (struct infoname_s): New.
21631 (struct colorentry_s): New.
21632 (graph_s): New fields {vertical,horizontal}_order in structure.
21633 Add `infoname' field.
21634 Add `colorentry' field;
21635 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21636 (G_HORIZONTAL_ORDER): New.
21637 (G_INFONAME): New.
21638 (G_COLORENTRY): New.
21639 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21640 Add output of `infoname'.
21641 Add output of `colorentry'.
21642
21643 2001-08-27 Marc Autret <autret_m@epita.fr>
21644
21645 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21646 This one shadowed a global parameter.
21647
21648 2001-08-24 Marc Autret <autret_m@epita.fr>
21649
21650 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21651 instead of `unsigned'.
21652 (print_state): Do not call obstack_object_size () in obstack_grow ()
21653 to avoid macro variables shadowing.
21654
21655 2001-08-23 Marc Autret <autret_m@epita.fr>
21656
21657 * src/lex.c (percent_table): Typo: s/naem/name/.
21658 Add graph option.
21659 Normalize new options declarations.
21660
21661 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21662
21663 * tests/suite.at: Exercise %header_extension and %source_extension.
21664
21665 2001-08-16 Marc Autret <autret_m@epita.fr>
21666
21667 * src/reader.c (parse_dquoted_param): New.
21668 (parse_header_extension_decl): Use it.
21669 (parse_source_extension_decl): Likewise.
21670
21671 2001-08-16 Marc Autret <autret_m@epita.fr>
21672
21673 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21674 (get_xxxx_str): Use assert () instead of complain ().
21675 Remove return invokations in default cases.
21676 (get_decision_str): Modify default behaviour. Remove second argument.
21677 Echo modifications on calls.
21678 (output_graph): Fix.
21679
21680 2001-08-16 Marc Autret <autret_m@epita.fr>
21681
21682 * src/getargs.c (usage): Update with ``-g, --graph''.
21683
21684 2001-08-16 Marc Autret <autret_m@epita.fr>
21685
21686 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21687 (Option Cross Key): Likewise.
21688 * doc/bison.1: Update.
21689
1c8c2190
PB
216902001-09-25 Pascal Bart <pascal.bart@epita.fr>
21691
21692 * src/output.c (output_master_parser): Don't finish action_obstack.
21693 (output_parser): Don't care about the muscle action, here.
21694 (prepare): Copy the action_obstack in the action muscle.
21695 (output): Free action_obstack.
21696
180d45ba
PB
216972001-09-23 Pascal Bart <pascal.bart@epita.fr>
21698
21699 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21700 will contain `%union' declaration.
21701 (parse_union_decl): Delete #line directive output.
21702 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21703 informations about %union.
21704 (parse_union_decl): Copy the union_obstack in the muscle stype.
21705 * src/bison.simple: Add new #line directive.
21706 Add typdef %%stype YYSTYPE.
21707
c51d1a19
PB
217082001-09-23 Pascal Bart <pascal.bart@epita.fr>
21709
21710 * src/bison.simple: Add new `#line' directive.
21711
6f9344da
PB
217122001-09-22 Pascal Bart <pascal.bart@epita.fr>
21713
21714 * src/bison.simple: New `#line' directive.
21715 * src/output.c (output_parser): Support new dynamic muscle input_line.
21716
652def80
MA
217172001-09-22 Marc Autret <autret_m@epita.fr>
21718
21719 * src/output.c (output_master_parser): New.
21720 (output_parser): Be more re-entrant.
21721
25b222fa
MA
217222001-09-21 Marc Autret <autret_m@epita.fr>
21723
21724 * src/reader.c (copy_definition, parse_union_decl): Update and use
21725 `linef' muscle.
21726 (copy_action): Likewise.
21727 Use obstack_1grow ().
21728 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21729
6bc35ae5
MA
217302001-09-21 Marc Autret <autret_m@epita.fr>
21731
21732 * src/options.c (option_table): Adjust.
21733 * src/lex.c (parse_percent_token): Fix.
21734
c0629aa1
PB
217352001-09-20 Pascal Bart <pascal.bart@epita.fr>
21736
21737 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 21738
82b6d266
PB
217392001-09-20 Pascal Bart <pascal.bart@epita.fr>
21740
21741 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21742 is now an option_table_struct*.
21743 (option_strcmp): New function option_strcmp.
21744 (parse_percent_token): Call option_strcmp.
21745 * src/getargs.c (xalloc.h, options.h): Include it.
21746 (getargs): Call create_long_option_table.
21747 (getargs): Free longopts at the end of the function.
21748 (shortopts): Move in options.c.
21749 * src/options.c (create_long_option_table): New function. Convert
21750 information from option_table to option structure.
21751 * src/reader.c (options.h): Include it.
21752
21753 * src/Makefile.am: Adjust.
21754 * src/options.c (option_table): Create from longopts and percent_table.
21755 * src/getargs.c (longopts): Delete.
21756 * src/lex.c (struct percent_table_struct): Delete.
21757 (percent_table): Delete.
21758 (options.h): Include it.
21759 * src/options.c: Create.
21760 * src/options.h: Create.
21761 Declare enum opt_access_e.
21762 Define struct option_table_struct.
21763
75f5aaea
MA
217642001-09-20 Marc Autret <autret_m@epita.fr>
21765
21766 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21767 sections of Bison.
21768
f508cb0a
PB
217692001-09-19 Pascal Bart <pascal.bart@epita.fr>
21770
21771 * src/bison.simple: s/%%filename/%%skeleton.
21772 * src/muscle_tab.c (getargs.h): Include it.
21773 (muscle_init): Insert new muscle skeleton.
21774
13105fc1
PB
217752001-09-18 Pascal Bart <pascal.bart@epita.fr>
21776
21777 * src/output.c (output_parser): Delete unused variable actions_dumped.
21778
b0c4483e
PB
217792001-09-07 Pascal Bart <pascal.bart@epita.fr>
21780
21781 * src/output.c (output): Delete call to reader_output_yylsp.
21782 * src/reader.c (reader): Likewise.
ba0fe3c7 21783 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 21784
11d82f03
MA
217852001-09-02 Marc Autret <autret_m@epita.fr>
21786
21787 * src/reader.c: Include muscle_tab.h.
21788 (parse_union_decl): Update.
21789 (parse_macro_decl): Rename parse_muscle_decl.
21790 Update to use renamed functions and variable.
21791 (read_declarations, copy_action, read_additionnal_code, : Updated
21792 with correct variables and functions names.
21793 (packsymbols, reader): Likewise.
342b8b6e 21794
11d82f03 21795 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 21796
11d82f03
MA
21797 * src/output.c: Include muscle_tab.h
21798 In all functions using macro_insert, change by using muscle_insert ().
21799 (macro_obstack): Rename muscle_obstack.
21800 Echo modifications in the whole file.
21801 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21802 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21803 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21804
21805 * src/muscle_tab.h: Update double inclusion macros.
21806 (macro_entry_s): Rename muscle_entry_s.
21807 Update prototypes.
342b8b6e 21808
11d82f03
MA
21809 * src/muscle_tab.c: Include muscle_tab.h.
21810 Rename macro_tabble to muscle_table.
21811 (mhash1, mhash2, mcmp): Use muscle_entry.
21812 (macro_init): Rename muscle_init. Update.
21813 (macro_insert): Rename muscle_insert. Update.
21814 (macro_find): Rename muscle_find. Update.
21815
21816 * src/main.c: Include muscle_tab.h.
21817 (main): Call muscle_init ().
21818 * src/Makefile.am (bison_SOURCES): Echo modifications.
21819
93a37297
MA
218202001-09-02 Marc Autret <autret_m@epita.fr>
21821
f753cd62 21822 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 21823
f753cd62
MA
21824 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21825
218262001-09-02 Marc Autret <autret_m@epita.fr>
21827
21828 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 21829
682d48cd
PB
218302001-09-01 Pascal Bart <pascal.bart@epita.fr>
21831
342b8b6e 21832 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
21833 filename.
21834
087c8fda
MA
218352001-09-01 Marc Autret <autret_m@epita.fr>
21836
21837 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21838 to an explicit value to activate the feature. We do it here.
21839
dda680cb
PB
218402001-08-31 Pascal Bart <pascal.bart@epita.fr>
21841
21842 * src/output.c (prepare): Delete the `filename' muscule insertion.
21843 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21844 (parse_union_decl): Likewise.
21845 * src/macrotab.c (macro_init): Initialize filename by infile.
21846
9e644e64
MA
218472001-08-31 Marc Autret <autret_m@epita.fr>
21848
21849 * src/bison.simple (YYLSP_NEEDED): New definition.
21850 * src/output.c (prepare): Add macro insertion of `locations_flag'
21851
17da6427
PB
218522001-08-31 Pascal Bart <pascal.bart@epita.fr>
21853
21854 * src/output.c (prepare): Delete insertion of previous muscles,
21855 and insert the `prefix' muscles.
21856 * src/macrotab.c (macro_init): Likewise.
21857 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 21858 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
21859 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21860 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 21861 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
21862 name_prefix.
21863
e8cb70b9
PB
218642001-08-31 Pascal Bart <pascal.bart@epita.fr>
21865
21866 * src/main.c (main): Standardize.
21867 * src/output.c (output_table_data, output_parser): Likewise.
21868 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21869
63c2d5de
MA
218702001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21871
342b8b6e 21872 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
21873 %%epilogue.
21874 * src/output.c (output): Rename %%declarations to %%prologue.
21875 * src/bison.simple: Echo modifications.
342b8b6e 21876
d8cb5183
MA
218772001-08-31 Marc Autret <autret_m@epita.fr>
21878
21879 * src/reader.c (readgram): CleanUp.
21880 (output_token_defines): Likewise.
21881 (packsymbols): Likewise.
21882 (reader): Likewise.
21883 * src/output.c (output): CPP-out useless code.
21884
6c686258
PB
218852001-08-31 Pascal Bart <pascal.bart@epita.fr>
21886
342b8b6e 21887 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
21888 output_trailers and output_headers.
21889 * src/output.h: Remove obsolete functions prototypes of output_headers
21890 and output_trailers.
21891
8f451ef7
PB
218922001-08-30 Pascal Bart <pascal.bart@epita.fr>
21893
21894 * src/main.c: Include macrotab.h.
342b8b6e 21895 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
21896 Adjust functions prototypes.
21897 * src/macrotab.c (macro_insert): Constify key and value.
21898 (macro_find): Constify key.
21899 (macro_insert): Include 'xalloc.h'
21900 (macro_insert): Use XMALLOC.
21901 (macro_find): Constify return value.
21902 * src/output.c (output_table_data): Rename table to table_data.
21903 (output_parser): Constify macro_key, macro_value.
21904
997b6fd0 219052001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
21906
21907 * src/reader.c (parse_skel_decl): New.
342b8b6e 21908 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
21909 * src/lex.h (token_t): New token `tok_skel'.
21910 * src/lex.c (percent_table): Add skeleton option entry.
21911 Standardize.
21912
ff48177d
MA
219132001-08-29 Marc Autret <autret_m@epita.fr>
21914
21915 * src/bison.simple: Add %%user_code directive at the end.
21916 * src/reader.c (read_additionnal_code): New.
21917 (reader): Use it.
21918 * src/output.c (output_program): Remove.
21919 (output): Update.
21920
b33160bf
MA
219212001-08-28 Marc Autret <autret_m@epita.fr>
21922
21923 * src/output.c (output_actions): Clean up.
4e5caae2 21924 (output_gram): CPP-out useless code.
b33160bf
MA
21925 * src/reader.c (reader): Clean up, CPP-out useless code.
21926
d1a2daf7
PB
219272001-08-28 Pascal Bart <pascal.bart@epita.fr>
21928
342b8b6e 21929 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 21930 directive.
d1a2daf7
PB
21931 * src/bison.simple: Add `%%definitions'.
21932
2b763dfe
MA
219332001-08-28 Marc Autret <autret_m@epita.fr>
21934
21935 * config/depcomp: New file.
21936
f1a87ef6
PE
219372001-08-27 Paul Eggert <eggert@twinsun.com>
21938
21939 * src/bison.simple (yyparse): Don't take the address of an
21940 item before the start of an array, as that doesn't conform to
21941 the C Standard.
21942
82e236e2
RA
219432001-08-27 Robert Anisko <robert.anisko@epita.fr>
21944
f1a87ef6 21945 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
21946 obstack. It was done too late here.
21947
21948 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
21949 completely wrong.
21950 (reader): Initialize the macro obstack here, since we need it to grow
21951 '%define' directives.
21952
21953 * src/reader.h: Declare the macro obstack as extern.
21954
b0cfa28a
RA
219552001-08-27 Robert Anisko <robert.anisko@epita.fr>
21956
21957 * src/output.c (output_parser): Fix. Store single '%' characters in
21958 the output obstack instead of throwing them away.
21959
6fc74234
AD
219602001-08-27 Akim Demaille <akim@epita.fr>
21961
21962 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21963
9c76d118
RA
219642001-08-25 Robert Anisko <robert.anisko@epita.fr>
21965
21966 * lib/Makefile.am: Adjust.
21967
a8289c62
RA
219682001-08-25 Robert Anisko <robert.anisko@epita.fr>
21969
21970 * src/bison.simple: Update and add '%%' directives.
21971
b6610515
RA
219722001-08-25 Robert Anisko <robert.anisko@epita.fr>
21973
21974 * src/reader.c (reader): Remove calls to 'output_headers' and
21975 'output_trailers'. Remove some C output.
21976 (readgram): Disable a piece of code that was writing a default
21977 definition for 'YYSTYPE'.
21978 (reader_output_yylsp): Remove.
21979 (packsymbols): Output token defintions to a macro.
21980 (copy_definition): Disable C output.
6fc74234 21981
b6610515
RA
21982 * src/reader.c (parse_macro_decl): New function used to parse macro
21983 declarations.
21984 (copy_string2): Put the body of copy_string into this new function.
21985 Add a parameter to let the caller choose whether he wants to copy the
21986 string delimiters or not.
21987 (copy_string): Be a simple call to copy_string2 with the last argument
21988 bound to true.
21989 (read_declarations): Add case for macro definition.
21990 (copy_identifier): New.
6fc74234 21991 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
21992 rather than lex.
21993
26f609ff
RA
219942001-08-25 Robert Anisko <robert.anisko@epita.fr>
21995
21996 * src/output.c (prepare): Add prefixed names.
21997 (output_parser): Output semantic actions.
21998 (output_parser): Fix bug on '%%line' directives.
6fc74234 21999
26f609ff
RA
22000 * src/output.c (output_headers): Remove. The C code printed by this
22001 function should now be in the skeletons.
22002 (output_trailers): Remove.
22003 (output): Disable call to 'reader_output_yylsp'.
22004 (output_rule_data): Do not output tables to the table obstack.
22005
22006 * src/output.c: Remove some C dedicated output.
22007 Improve the use of macro and output obstacks.
22008 (output_defines): Remove.
6fc74234 22009
26f609ff
RA
22010 * src/output.c (output_token_translations): Associate 'translate'
22011 table with a macro. No output to the table obstack.
22012 (output_gram): Same for 'rhs' and 'prhs'.
22013 (output_stos): Same for 'stos'.
22014 (output_rule_data): Same for 'r1' and 'r2'.
22015 (token_actions): Same for 'defact'.
22016 (goto_actions): Same for 'defgoto'.
22017 (output_base): Same for 'pact' and 'pgoto'.
22018 (output_table): Same for 'table'.
22019 (output_check): Same for 'check'.
6fc74234 22020
26f609ff
RA
22021 * src/output.c (output_table_data): New function.
22022 (output_short_table): Remove.
22023 (output_short_or_char_table): Remove.
6fc74234 22024
26f609ff
RA
22025 * src/output.c (output_parser): Replace most of the skeleton copy code
22026 with something new. Skeletons are now processed character by character
22027 rather than line by line, and Bison looks for '%%' macros. This is the
22028 first step in making Bison's output process (a lot) more flexible.
22029 (output_parser): Use the macro table.
22030
6f43b113
RA
220312001-08-25 Robert Anisko <robert.anisko@epita.fr>
22032
22033 * src/main.c (main): Initialize the macro table.
22034
dd3127cf
RA
220352001-08-25 Robert Anisko <robert.anisko@epita.fr>
22036
22037 * src/lex.c (percent_table): Add tok_define.
22038 * src/lex.h: Add tok_define.
22039
aa321494
RA
220402001-08-25 Robert Anisko <robert.anisko@epita.fr>
22041
22042 * src/macrotab.c: New file.
22043 * src/macrotab.h: New file.
22044 * src/Makefile.am: Update.
22045
68bd3b6b
RA
220462001-08-25 Robert Anisko <robert.anisko@epita.fr>
22047
22048 * lib/hash.c: New file.
22049 * lib/hash.h: New file.
22050 * lib/Makefile.am: Update.
22051
45f8dd1e
AD
220522001-08-15 Akim Demaille <akim@epita.fr>
22053
22054 Version 1.28c.
22055
40a64a7a 220562001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
22057
22058 * src/reader.c (readgram): Indent output macro YYSTYPE.
22059 (packsymbols): Likewise.
22060 (output_token_defines): Likewise.
22061 * src/files.c: Standardize.
22062 (compute_header_macro): New.
22063 (defines_obstack_save): New. Use compute_header_macro.
22064 (output_files): Update. Use defines_obstack_save.
22065
f9a8293a
AD
220662001-08-15 Akim Demaille <akim@epita.fr>
22067
22068 * doc/bison.texinfo (Table of Symbols): Document
22069 YYSTACK_USE_ALLOCA.
22070
150ca7a7
AD
220712001-08-15 Akim Demaille <akim@epita.fr>
22072
22073 * missing: Update from CVS Automake.
22074 * config/config.guess, config/config.sub, config/texinfo.tex:
22075 Update from gnu.org.
22076
69b5cec4
AD
220772001-08-15 Akim Demaille <akim@epita.fr>
22078
22079 * Makefile.maint: Sync with CVS Autoconf.
22080
f2b5126e
PB
220812001-08-14 Pascal Bart <pascal.bart@epita.fr>
22082
69b5cec4 22083 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
22084 `fdl.texi'.
22085 * doc/fdl.texi: Add to package.
22086
4ecbf796
MA
220872001-08-14 Marc Autret <autret_m@epita.fr>
22088
22089 Turn on %{source,header}_extension features.
22090
69b5cec4 22091 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
22092 source_extension.
22093 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 22094 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
22095 between options.
22096
95fb5662
MA
220972001-08-14 Marc Autret <autret_m@epita.fr>
22098
22099 * src/files.c (compute_base_names): Add extensions computing when
22100 `--file-prefix' used.
22101 Standardize function calls.
22102
78d09da9
MA
221032001-08-13 Marc Autret <autret_m@epita.fr>
22104
69b5cec4 22105 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
22106 defining it (defined but null disables alloca).
22107
5a009f2c
MA
221082001-08-13 Marc Autret <autret_m@epita.fr>
22109
22110 * src/bison.simple (_yy_memcpy): CPP reformat.
22111
1e41465a
PB
221122001-08-13 Pascal Bart <pascal.bart@epita.fr>
22113
22114 * tests/atconfig.in (CPPFLAGS): Fix.
22115
c67a198d
PB
221162001-08-10 Pascal Bart <pascal.bart@epita.fr>
22117
79282c6c 22118 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
22119 `gpl.texi'.
22120 * doc/gpl.texi: Add to package.
22121
09a6de7e
MA
221222001-08-10 Marc Autret <autret_m@epita.fr>
22123
22124 * src/print_graph.h: Fix.
22125 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
22126
b77b9ee0
AD
221272001-08-10 Akim Demaille <akim@epita.fr>
22128
22129 * src/system.h: Provide default declarations for stpcpy, strndup,
22130 and strnlen.
22131
3e259915
MA
221322001-08-10 Robert Anisko <anisko_r@epita.fr>
22133
22134 * doc/bison.texinfo (Locations): Update @$ stuff.
22135
ca96bc2d
MA
221362001-08-09 Robert Anisko <anisko_r@epita.fr>
22137
22138 * src/bison.simple (YYLLOC_DEFAULT): Update.
22139 (yyparse): Adjust.
22140
fdc6758b
MA
221412001-08-08 Marc Autret <autret_m@epita.fr>
22142
b77b9ee0 22143 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
22144 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
22145 Reported by Fabrice Bauzac.
957d4dbf 22146
600cad3b
MA
221472001-08-08 Marc Autret <autret_m@epita.fr>
22148
22149 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
22150 * src/vcg.c (output_node): Fix.
22151 * src/vcg.h: Cleanup.
22152 * src/print_graph.c: Add comments.
b77b9ee0 22153 (node_output_size): New global variable. Simplify the formatting of
600cad3b 22154 the VCG graph output.
b77b9ee0 22155 (print_actions): Unused code is now used. It notifies the final state
600cad3b 22156 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 22157 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
22158 blue.
22159 Get the current node name and node_obstack by argument.
22160 (node_obstack): New variable.
22161 (print_state): Manage node_obstack.
22162 (print_core): Use node_obstack given by argument.
22163 A node is not only computed here but in print_actions also.
22164 (print_graph): CPP out useless code instead of commenting it.
22165
976e528f
AD
221662001-08-07 Pascal Bart <pascal.bart@epita.fr>
22167
22168 * tests/atconfig.in (CPPFLAGS): Fix.
22169
20e8e5ca
AD
221702001-08-07 Akim Demaille <akim@epita.fr>
22171
22172 * src/print_graph.c (quote): New.
22173 (print_core): Use it.
22174
957d4dbf 221752001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 22176
3e3da797
AD
22177 * src/vcg.c (complain.h): Include it.
22178 Unepitaize `return' invocations.
c4b66126 22179 [NDEBUG] (main): Remove.
79282c6c 22180 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
22181 * src/files.c (open_files): Initialize graph_obstack.
22182 * src/print_graph.c (print_actions): CPP out useless code.
22183 (print_core): Don't output the last `\n' in labels.
22184 Use `quote'.
22185 * src/files.c (output_files): Output the VCG file.
22186 * src/main.c (main): Invoke print_graph ();
3e3da797 22187
957d4dbf 221882001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
22189
22190 Automaton VCG graph output.
22191 Using option ``-g'' or long option ``--graph'', you can generate
22192 a gram_filename.vcg file containing a VCG description of the LALR (1)
22193 automaton of your grammar.
22194
22195 * src/main.c: Call to print_graph() function.
22196 * src/getargs.h: Update.
22197 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
22198 (graph_flag): New flag.
22199 (longopts): Update.
22200 (getargs): Add case `g'.
22201 * src/files.c (graph_obstack): New obstack struct.
22202 (open_files): Initialize new obstack.
22203 (output_files): Saves graph_obstack if required.
22204 * src/files.h (graph_obstack): New extern declaration.
22205 * src/Makefile.am: Add new source files.
22206
927c1557 222072001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
22208
22209 * src/print_graph.c, src/print_graph.h (graph): New.
22210 * src/vcg.h: New file.
22211 * src/vcg.c: New file, VCG graph handling.
22212
7333d403
AD
222132001-08-06 Marc Autret <autret_m@epita.fr>
22214
22215 Add of %source_extension and %header_extension which specify
22216 the source or/and the header output file extension.
22217
22218 * src/files.c (compute_base_names): Remove initialisation of
22219 src_extension and header_extension.
22220 (compute_exts_from_gf): Update.
22221 (compute_exts_from_src): Update.
22222 (output_files): Update.
22223 * src/reader.c (parse_header_extension_decl): New.
22224 (parse_source_extension_decl): New.
22225 (read_declarations): New case statements for the new tokens.
22226 * src/lex.c (percent_table): Add entries for %source_extension
22227 and %header_extension.
22228 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
22229
84163231
AD
222302001-08-06 Marc Autret <autret_m@epita.fr>
22231
22232 * configure.in: Bump to 1.28c.
22233 * doc/bison.texinfo: Texinfo thingies.
22234
8303fc42
AD
222352001-08-04 Pascal Bart <pascal.bart@epita.fr>
22236
22237 * tests/atconfig.in (CPPFLAGS): Add.
22238 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
22239
70a84437
AD
222402001-08-03 Akim Demaille <akim@epita.fr>
22241
22242 Version 1.28b.
22243
2ce10144
AD
222442001-08-03 Akim Demaille <akim@epita.fr>
22245
22246 * tests/Makefile.am (check-local): Ship testsuite.
22247 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
22248 Include `string.h'.
22249
1e3e4bc1
AD
222502001-08-03 Akim Demaille <akim@epita.fr>
22251
22252 * configure.in: Try using -Wformat when compiling.
22253
42b45b7f
AD
222542001-08-03 Akim Demaille <akim@epita.fr>
22255
22256 * configure.in: Bump to 1.28b.
22257
8f13fe33
AD
222582001-08-03 Akim Demaille <akim@epita.fr>
22259
22260 * src/complain.c: Adjust strerror_r portability issues.
22261
b37ba92c
AD
222622001-08-03 Akim Demaille <akim@epita.fr>
22263
22264 Version 1.28a.
22265
b0ce6046
AD
222662001-08-03 Akim Demaille <akim@epita.fr>
22267
22268 * src/getargs.c, src/getarg.h (skeleton)): Constify.
22269 * src/lex.c (literalchar): Avoid name clashes on `buf'.
22270 * src/getargs.c: Include complain.h.
22271 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
22272 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
22273
d01c415b
AD
222742001-08-03 Akim Demaille <akim@epita.fr>
22275
22276 * src/reader.c (readgram): Display hidden chars in error messages.
22277
459dd1a6
AD
222782001-08-03 Akim Demaille <akim@epita.fr>
22279
22280 Update to gettext 0.10.39.
22281
53b74c0c
AD
222822001-08-03 Akim Demaille <akim@epita.fr>
22283
22284 * lib/strspn.c: New.
22285
234a3be3
AD
222862001-08-01 Marc Autret <autret_m@epita.fr>
22287
22288 * doc/bison.texinfo: Update.
22289 * doc/bison.1 (mandoc): Update.
22290 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
22291 * src/files.c: Support output files extensions computing.
22292 (src_extension): New static variable.
22293 (header_extension): New static variable.
22294 (tr): New function.
22295 (get_extension_index): New function, gets the index of an extension
22296 filename in a string.
22297 (compute_exts_from_gf): New function, computes extensions from the
22298 grammar file extension.
22299 (compute_exts_from_src): New functions, computes extensions from the
22300 C source file extension, file given by ``-o'' option.
22301 (compute_base_names): Update.
22302 (output_files): Update.
22303
847bf1f5
AD
223042001-08-01 Robert Anisko <anisko_r@epita.fr>
22305
d995fee7 22306 * doc/bison.texi: Document @$.
847bf1f5
AD
22307 (Locations): New section.
22308
d074a105
AD
223092001-07-18 Akim Demaille <akim@epita.fr>
22310
22311 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
22312 * config/prev-version.txt, config/move-if-change: New.
22313 * Makefile.am: Adjust.
22314
3419715d
AD
223152001-07-08 Pascal Bart <pascal.bart@epita.fr>
22316
22317 * src/bison.simple (yyparse): Suppress warning `comparaison
22318 between signed and unsigned'.
22319
62ab6972
AD
223202001-07-05 Pascal Bart <pascal.bart@epita.fr>
22321
22322 * src/getargs.h (raw_flag): Remove.
22323 * src/getargs.c: Die on `-r'/`--raw'.
22324 * src/lex.c (parse_percent_token): Die on `%raw'.
22325 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22326 * tests/calc.at: Suppress test with option `--raw'.
22327
1e24cc5b
AD
223282001-07-14 Akim Demaille <akim@epita.fr>
22329
22330 * config/: New.
22331 * configure.in: Require Autoconf 2.50.
22332 Update to gettext 0.10.38.
22333
32dfccf8
AD
223342001-03-16 Akim Demaille <akim@epita.fr>
22335
22336 * doc/bison.texinfo: ANSIfy the examples.
22337
cd5bd6ac
AD
223382001-03-16 Akim Demaille <akim@epita.fr>
22339
22340 * getargs.c (skeleton): New variable.
22341 (longopts): --skeleton is a new option.
22342 (shortopts, getargs): -S is a new option.
22343 * getargs.h: Declare skeleton.
22344 * output.c (output_parser): Use it.
22345
5141b016
AD
223462001-03-16 Akim Demaille <akim@epita.fr>
22347
22348 * m4/strerror_r.m4: New.
22349 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22350 * lib/error.h, lib/error.c: Update.
22351
447992b9
AD
223522001-03-16 Akim Demaille <akim@epita.fr>
22353
22354 * src/getargs.c (longopts): Clean up.
22355
274d42ce
AD
223562001-02-21 Akim Demaille <akim@epita.fr>
22357
22358 * src/reader.c (gensym): `gensym_count' is your own.
22359 Use a static buf to create the symbol name, as token_buffer is no
22360 longer a buffer.
22361
22c821f3
AD
223622001-02-08 Akim Demaille <akim@epita.fr>
22363
22364 * src/conflicts.c (conflict_report): Be sure not to append to res
22365 between two calls, which could happen if both first sprintf were
22366 skipped, but not the first cp += strlen.
22367
18569462
AD
223682001-02-08 Akim Demaille <akim@epita.fr>
22369
22370 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22371 New, from fileutils 4.0.37.
22372 * configure.in: Require Autoconf 2.49c. I took some time before
22373 making this decision. This is the only way out for portability
22374 issues in Bison, it would mean way too much duplicate effort to
22375 import in Bison features implemented in 2.49c since 2.13.
22376 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22377
0d8f3c8a
AD
223782001-02-02 Akim Demaille <akim@epita.fr>
22379
22380 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 22381 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 22382
f17bcd1f
AD
223832001-01-19 Akim Demaille <akim@epita.fr>
22384
22385 Get rid of the ad hoc handling of token_buffer in the scanner: use
22386 the obstacks.
22387
22388 * src/lex.c (token_obstack): New.
22389 (init_lex): Initialize it. No longer call...
22390 (grow_token_buffer): this. Remove it.
22391 Adjust all the places which used it to use the obstack.
22392
511e79b3
AD
223932001-01-19 Akim Demaille <akim@epita.fr>
22394
22395 * src/lex.h: Rename all the tokens:
22396 s/\bENDFILE\b/tok_eof/g;
22397 s/\bIDENTIFIER\b/tok_identifier/g;
22398 etc.
22399 Let them be enums, not #define, to ease debugging.
22400 Adjust all the code.
22401
0d6508ef
AD
224022001-01-18 Akim Demaille <akim@epita.fr>
22403
22404 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
22405 * src/lex.c (maxtoken, grow_token_buffer): Static.
22406
6deb4447
AD
224072001-01-18 Akim Demaille <akim@epita.fr>
22408
22409 Since we now use obstacks, more % directives can be enabled.
22410
22411 * src/lex.c (percent_table): Also accept `%yacc',
22412 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
22413 `%debug'.
22414 Handle the actions for `%semantic_parser' and `%pure_parser' here,
22415 instead of returning a token.
22416 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
22417 * src/reader.c (read_declarations): Adjust.
22418 * src/files.c (open_files): Don't call `compute_base_names', don't
22419 compute `attrsfile' since they depend upon data which might be
22420 *in* the input file now.
22421 (output_files): Do it here.
22422 * src/output.c (output_headers): Document the fact that this patch
22423 introduces a guaranteed SEGV for semantic parsers.
22424 * doc/bison.texinfo: Document them.
22425 * tests/suite.at: Exercise these %options.
22426
ff4423cc
AD
224272000-12-20 Akim Demaille <akim@epita.fr>
22428
22429 Also handle the output file (--verbose) with obstacks.
22430
22431 * files.c (foutput): Remove.
22432 (output_obstack): New.
22433 Adjust all dependencies.
22434 * src/conflicts.c: Return a string.
22435 * src/system.h (obstack_grow_string): Rename as...
22436 (obstack_sgrow): this. Be ready to work with non literals.
22437 (obstack_fgrow4): New.
22438
956dba3a
AD
224392000-12-20 Akim Demaille <akim@epita.fr>
22440
22441 * src/files.c (open_files): Fix the computation of short_base_name
22442 in the case of `-o foo.tab.c'.
22443
337bab46
AD
224442000-12-20 Akim Demaille <akim@epita.fr>
22445
22446 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
22447 (copy_dollar): Now that everything uses obstacks, get rid of the
22448 FILE * parameters.
22449
5d3214b8
AD
224502000-12-20 Akim Demaille <akim@epita.fr>
22451
22452 * src/files.c (open_files): Actually the `.output' file is based
22453 on the short_base_name, not base_name.
22454 * tests/suite.at (Checking output file names): Adjust.
22455
29092a57
AD
224562000-12-20 Akim Demaille <akim@epita.fr>
22457
22458 * src/bison.s1: Remove, we now use directly...
22459 * src/bison.simple: this.
22460 * src/Makefile.am: Use pkgdata instead of data.
22461
ea5607fd
AD
224622000-12-20 Akim Demaille <akim@epita.fr>
22463
22464 * src/files.c (guard_obstack): New.
22465 (open_files): Initialize it.
22466 (output_files): Dump it...
22467 * src/files.h: Export it.
22468 * src/reader.c (copy_guard): Use it.
22469
27110317
AD
224702000-12-19 Akim Demaille <akim@epita.fr>
22471
22472 * src/files.c (outfile, defsfile, actfile): Removed as global
22473 vars.
22474 (open_files): Don't compute them.
22475 (output_files): Adjust.
22476 (base_name, short_base_name): Be global.
22477 Adjust dependencies.
22478
19c50364
AD
224792000-12-19 Akim Demaille <akim@epita.fr>
22480
22481 * src/files.c (strsuffix): New.
22482 (stringappend): Be just like strcat but allocate.
22483 (base_names): Eve out from open_files.
22484 Try to simplify the rather hairy computation of base_name and
22485 short_base_name.
22486 (open_files): Use it.
22487 * tests/suite.at (Checking output file names): New test.
22488
573c1d9f
AD
224892000-12-19 Akim Demaille <akim@epita.fr>
22490
22491 * src/system.h (obstack_grow_literal_string): Rename as...
22492 (obstack_grow_string): this.
22493 * src/output.c (output_parser): Recognize `%% actions' instead of
22494 `$'.
22495 * src/bison.s1: s/$/%% actions/.
22496 * src/bison.hairy: Likewise.
22497
ef7ddedd
AD
224982000-12-19 Akim Demaille <akim@epita.fr>
22499
22500 * src/output.c (output_parser): Compute the `#line' lines when
22501 there are.
22502 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
22503 Suggested by Hans Aberg.
22504
ff61dabd
AD
225052000-12-19 Akim Demaille <akim@epita.fr>
22506
22507 Let the handling of the skeleton files be local to the procedures
22508 that use it.
22509
22510 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
22511 longer static.
22512 (fparser, open_extra_files): Remove.
22513 (open_files, output_files): Don't take care of fparser.
22514 * src/files.h: Adjust.
22515 * src/output.c (output_parser): Open and close the file to the
22516 skeleton.
22517 * src/reader.c (read_declarations): When %semantic_parser, open
22518 fguard.
22519
55b96341
AD
225202000-12-19 Akim Demaille <akim@epita.fr>
22521
22522 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
22523 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
22524
358c15b7
AD
225252000-12-19 Akim Demaille <akim@epita.fr>
22526
22527 * src/files.c (open_files): Yipee! We no longer need all the code
22528 looking for `/tmp' since we have no tmp file.
22529
7de3329e
AD
225302000-12-19 Akim Demaille <akim@epita.fr>
22531
22532 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
22533 New macros.
22534 * src/files.c (open_files): Less dependency on MSDOS etc.
22535
3abcd459
AD
225362000-12-14 Akim Demaille <akim@epita.fr>
22537
22538 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
22539 Provide a default definition.
22540 Use it when executing the default @ action.
22541 * src/reader.c (reader_output_yylsp): No longer include
22542 `timestamp' and `text' in the default YYLTYPE.
22543
2a91a95e
AD
225442000-12-12 Akim Demaille <akim@epita.fr>
22545
22546 * src/reader.c (copy_definition, parse_union_decl, copy_action)
22547 (copy_guard): Quote the file names.
22548 Reported by Laurent Mascherpa.
22549
14d3eb9b
AD
225502000-12-12 Akim Demaille <akim@epita.fr>
22551
22552 * src/output.c (output_headers, output_program, output): Be sure
22553 to escape special characters when outputting filenames.
22554 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22555 (output_headers): Don't depend on them, Use ACTSTR.
22556
d7045ec6
AD
225572000-11-17 Akim Demaille <akim@epita.fr>
22558
22559 * lib/obstack.h: Formatting changes.
22560 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22561 prevents type checking.
22562 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22563 cast the value to (void *): assigning a `foo *' to a `void *'
22564 variable is valid.
22565 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22566 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22567 append characters.
22568
6fd54b73
AD
225692000-11-17 Akim Demaille <akim@epita.fr>
22570
22571 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22572 as...
22573 (suite.m4, regression.m4, calc.m4): these.
22574 * tests/atgeneral.m4: Update from CVS Autoconf.
22575
4c50eae6
AD
225762000-11-17 Akim Demaille <akim@epita.fr>
22577
22578 * tests/regression.m4 (%union and --defines): New test,
22579 demonstrating a current bug in the obstack implementation.
22580
a35f64ea
AD
225812000-11-17 Akim Demaille <akim@epita.fr>
22582
22583 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22584 macros.
22585 Use them to declare the variables which are global or local to
22586 `yyparse'.
22587
7de23534
AD
225882000-11-17 Akim Demaille <akim@epita.fr>
22589
22590 * acconfig.h: Remove, no longer used.
22591
aa7815f5
AD
225922000-11-07 Akim Demaille <akim@epita.fr>
22593
22594 * src: s/Copyright (C)/Copyright/g.
22595
5af1f549
AD
225962000-11-07 Akim Demaille <akim@epita.fr>
22597
22598 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22599 defining.
22600 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22601
553e2b22
AD
226022000-11-07 Akim Demaille <akim@epita.fr>
22603
22604 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22605 Merge in a single CPP if/else.
22606
8a4f41d6
AD
226072000-11-07 Akim Demaille <akim@epita.fr>
22608
22609 * src/output.c (output): Remove useless variables.
22610 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22611 argument `data' for consistency with the prototypes.
22612 Qualify it `const'.
22613 (obstack_copy, obstack_copy0): Rename the second argument as
22614 `address' for consistency. Qualify it `const'.
22615 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22616 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22617 `const' their input argument (`data' or `address').
22618 Adjust the corresponding macros to include `const' in casts.
22619
095a3fb5
AD
226202000-11-03 Akim Demaille <akim@epita.fr>
22621
22622 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22623 s/PFILE1/BISON_HAIRY/.
22624 Adjust dependencies.
22625
d1cdce7c
AD
226262000-11-03 Akim Demaille <akim@epita.fr>
22627
090c5ebf 22628 For some reason, this was not applied.
d1cdce7c
AD
22629
22630 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22631 `unlink': it's no longer used.
22632
9311529b
AD
226332000-11-03 Akim Demaille <akim@epita.fr>
22634
22635 * src/files.c (skeleton_find): New function, eved out of...
22636 (open_files, open_extra_files): here.
22637
d8880f69
AD
226382000-11-03 Akim Demaille <akim@epita.fr>
22639
22640 Don't use `atexit'.
22641
22642 * src/files.c (obstack_save): New function.
22643 (done): Rename as...
22644 (output_files): this.
22645 Use `obstack_save'.
22646 * src/main.c (main): Don't use `atexit' to register `done', since
22647 it no longer has to remove tmp files, just call `output_files'
22648 when there are no errors.
22649
0dbb648e
AD
226502000-11-02 Akim Demaille <akim@epita.fr>
22651
22652 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22653 `unlink': it's no longer used.
22654 * src/files.h: Formatting changes.
22655
896fe5c1
AD
226562000-11-02 Akim Demaille <akim@epita.fr>
22657
22658 Remove the last uses of mktemp and unlink/delete.
22659
22660 * src/files.c (fdefines, ftable): Removed.
22661 (defines_ostack, table_obstack): New.
22662 Adjust dependencies of the former into uses of the latter.
22663 * src/output.c (output_short_or_char_table, output_short_table):
22664 Convert to using obstacks.
22665 * src/reader.c (copy_comment2): Accept one FILE * and two
22666 obstacks.
22667 (output_token_defines, reader_output_yylsp): Use obstacks.
22668 * src/system.h (obstack_fgrow3): New.
1f65350a 22669 * po/POTFILES.in: Adjust.
896fe5c1 22670
dd60faec
AD
226712000-11-01 Akim Demaille <akim@epita.fr>
22672
22673 Change each use of `fattrs' into a use of `attrs_obstack'.
22674
22675 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22676 * src/files.c (fattrs): Remove.
22677 (attrs_obstack): New.
22678 Adjust all dependencies.
22679 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22680
8c7ebe49
AD
226812000-11-01 Akim Demaille <akim@epita.fr>
22682
22683 Introduce obstacks.
22684 Change each use of `faction' into a use of `action_obstack'.
22685
22686 * lib/obstack.h, lib/obstack.c: New files.
22687 * src/files.c (faction): Remove.
22688 (action_obstack): New.
22689 Adjust all dependencies.
22690
77aee789
AD
226912000-10-20 Akim Demaille <akim@epita.fr>
22692
22693 * lib/quote.h (PARAMS): New macro. Use it.
22694
43591cec
AD
226952000-10-16 Akim Demaille <akim@epita.fr>
22696
22697 * src/output.c (output_short_or_char_table): New function.
22698 (output_short_table, output_token_translations): Use it.
22699 (goto_actions): Use output_short_table.
22700
1e9798d5
AD
227012000-10-16 Akim Demaille <akim@epita.fr>
22702
22703 * src/symtab.c (bucket_new): New function.
22704 (getsym): Use it.
22705
22706 * src/output.c (output_short_table): New argument to display the
22707 comment associated with the table.
22708 Adjust dependencies.
22709 (output_gram): Use it.
22710 (output_rule_data): Nicer output layout for YYTNAME.
22711
f282676b
AD
227122000-10-16 Akim Demaille <akim@epita.fr>
22713
22714 * src/lex.c (read_typename): New function.
22715 (lex): Use it.
22716 * src/reader.c (copy_dollar): Likewise.
22717
550a72a3
AD
227182000-10-16 Akim Demaille <akim@epita.fr>
22719
22720 * src/reader.c (copy_comment2): Expect the input stream to be on
22721 the `/' which is suspected to open a comment, instead of being
22722 called after `//' or `/*' was read.
22723 (copy_comment, copy_definition, parse_union_decl, copy_action)
22724 (copy_guard): Adjust.
22725
131e2fef
AD
227262000-10-16 Akim Demaille <akim@epita.fr>
22727
22728 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22729 `read_signed_integer'.
22730
79282c5a
AD
227312000-10-16 Akim Demaille <akim@epita.fr>
22732
22733 * src/reader.c (copy_dollar): New function.
22734 (copy_guard, copy_action): Use it.
22735
ff4a34be
AD
227362000-10-16 Akim Demaille <akim@epita.fr>
22737
22738 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22739 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22740 New files, from Fileutils 4.0.27.
22741 * src/main.c (printable_version): Remove.
22742 * src/lex.c, src/reader.c: Use `quote'.
22743
227442000-10-04 Akim Demaille <akim@epita.fr>
22745
22746 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22747
14ded682
AD
227482000-10-04 Akim Demaille <akim@epita.fr>
22749
22750 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22751
8e03724b
AD
227522000-10-04 Akim Demaille <akim@epita.fr>
22753
22754 When a literal string is used to define two different tokens,
22755 `bison -v' segfaults.
22756 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22757
22758 * tests/regression.m4: New file.
22759 Include the core of the sample provided by Piotr Gackiewicz.
22760 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22761 properly.
22762
a9e64249
AD
227632000-10-04 Akim Demaille <akim@epita.fr>
22764
22765 * src/reader.c (parse_expect_decl): Keep `count' within the size
22766 of `buffer'.
22767 From Neil Booth.
22768
da9abf43
AD
227692000-10-02 Paul Eggert <eggert@twinsun.com>
22770
22771 * bison.s1 (yyparse): Assign the default value
22772 unconditionally, to avoid a GCC warning and make the parser a
22773 tad smaller.
22774
c33638bb
AD
227752000-10-02 Akim Demaille <akim@epita.fr>
22776
22777 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22778 options.
22779
444c570a
AD
227802000-10-02 Akim Demaille <akim@epita.fr>
22781
22782 * src/derives.c, src/print.c, src/reduce.c: To ease the
22783 translation, move some `\n' out of the translated strings.
22784
89cab50d
AD
227852000-10-02 Akim Demaille <akim@epita.fr>
22786
22787 The location tracking mechanism is precious for parse error
22788 messages. Nevertheless, it is enabled only when `@n' is used in
22789 the grammar, which is a different issue (you can use it in error
22790 message, but not in the grammar per se). Therefore, there should
22791 be another means to enable it.
22792
22793 * src/getargs.c (getargs): Support `--locations'.
22794 (usage): Report it.
22795 * src/getargs.h (locationsflag): Export it.
22796 * src/lex.c (percent_table): Support `%locations'.
22797 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22798 with `locationsflag'.
22799 * doc/bison.texinfo: Document `--locations' and `%locations'.
22800 Sort the options.
22801 * tests/calc.m4: Test it.
22802
22803 For regularity of the names, replace each
22804 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22805 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22806 In addition replace each `flag' with `_flag'.
22807
d6c2cba0
AD
228082000-10-02 Akim Demaille <akim@epita.fr>
22809
22810 Also test parse error messages, including with YYERROR_VERBOSE.
22811
22812 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22813 associative).
22814 Use it to check the computations.
22815 Use it to check `nonassoc' is honored.
22816 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22817 `--yyerror-verbose'.
22818 (_AT_CHECK_CALC): Adjust to this option.
22819 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22820
5a35a6cb
AD
228212000-10-02 Akim Demaille <akim@epita.fr>
22822
22823 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22824 the latter demonstrates a flaw in the handling of non debugging
22825 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22826 was used in order to simplify:
22827
22828 #if YYDEBUG
22829 if (yydebug)
22830 {
22831 ...
22832 }
22833 #endif
22834
22835 into
22836
22837 if (yydebug)
22838 {
22839 ...
22840 }
22841
22842 unfortunately this leads to a CPP conflict when
22843 `--name-prefix=foo' is used since it produces `#define yydebug
22844 foodebug'.
22845
22846 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22847 (YYDPRINTF): New macro.
22848 Spread its use.
22849 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22850 the bison options.
22851 Also test `--verbose', `--defines' and `--name-prefix'.
22852
71da9eea
AD
228532000-10-02 Akim Demaille <akim@epita.fr>
22854
22855 Improve the readability of the produced parsers.
22856
22857 * src/bison.s1: Formatting changes.
22858 Improve the comment related to the `$' mark.
22859 (yydefault): Don't fall through to `yyresume': `goto' there.
22860 * src/output.c (output_parser): When the `$' is met, skip the end
22861 of its line.
22862 New variable, `number_of_dollar_signs', to check there's exactly
22863 one `$' in the parser skeleton.
22864
95e36146
AD
228652000-10-02 Akim Demaille <akim@epita.fr>
22866
22867 * lib/xstrdup.c: New file, from the fileutils.
22868 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22869 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22870 instead of strlen + xmalloc + strcpy.
22871 * src/symtab.c (copys): Remove, use xstrdup instead.
22872
d7020c20
AD
228732000-10-02 Akim Demaille <akim@epita.fr>
22874
22875 * src/gram.h (associativity): New enum type which replaces the
22876 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22877 `right_assoc', `left_assoc' and `non_assoc'.
22878 Adjust all dependencies.
22879 * src/reader.c: Formatting changes.
22880 (LTYPESTR): Don't define it, use it as a literal in
22881 `reader_output_yylsp'.
22882 * src/symtab.h (symbol_class): New enum type which replaces the
22883 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22884 `sunknown', `stoken and `snterm'.
22885
1916f98e
AD
228862000-10-02 Akim Demaille <akim@epita.fr>
22887
22888 * src/getargs.c (fixed_outfiles): Rename as...
22889 (yaccflag): for consistency and accuracy.
22890 Adjust dependencies.
22891
d7913476
AD
228922000-10-02 Akim Demaille <akim@epita.fr>
22893
22894 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
22895 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
22896 difficult and introduced a lot of core dump. It turns out that
22897 Bison used an implementation of `xmalloc' based on `calloc', and
22898 at various places it does depend upon the initialization to 0. I
22899 have not tried to isolate the pertinent places, and all the former
22900 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
22901 someone should address this issue.
22902
22903 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
22904 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
22905 files.
22906 Adjust dependencies.
22907 * src/warshall.h: New file.
22908 Propagate.
22909
340ef489
AD
229102000-10-02 Akim Demaille <akim@epita.fr>
22911
22912 Various anti-`extern in *.c' changes.
22913
22914 * src/system.h: Include `assert.h'.
22915
b2ca4022
AD
229162000-10-02 Akim Demaille <akim@epita.fr>
22917
22918 * src/state.h (nstates, final_state, first_state, first_shift)
22919 (first_reduction): Move their exportation from here...
22920 * src/LR0.h: to here.
22921 Adjust dependencies.
22922 * src/getargs.c (statisticsflag): New variable.
22923 Add support for `--statistics'.
22924 Adjust dependencies.
22925
22926 Remove a lot of now useless `extern' statements in most files.
22927
403b315b
AD
229282000-10-02 Akim Demaille <akim@epita.fr>
22929
22930 * src/LR0.h: New file.
22931 Propagate its use.
22932
07a58c13
AD
229332000-10-02 Akim Demaille <akim@epita.fr>
22934
22935 * src/print.h: New file.
22936 Propagate its use.
22937 * src/print.c: Formatting and ordering changes.
22938 (verbose, terse): Replace with...
22939 (print_results): this new function.
22940 Adjust dependencies.
22941
0619caf0
AD
229422000-10-02 Akim Demaille <akim@epita.fr>
22943
22944 * src/conflicts.c (conflict_report): New function.
22945 (conflict_log, verbose_conflict_log): Replace with...
22946 (print_conflicts): this function.
22947 Adjust dependencies.
22948 * src/conflicts.h: New file.
22949 Propagate its inclusion.
22950
3519ec76
AD
229512000-10-02 Akim Demaille <akim@epita.fr>
22952
22953 * src/nullable.h: New file.
22954 Propagate its inclusion.
22955 * src/nullable.c: Formatting changes.
22956
015acc48
AD
229572000-10-02 Akim Demaille <akim@epita.fr>
22958
22959 * src/reduce.h: New file.
22960 Propagate its inclusion.
22961 * src/reduce.c: Topological sort and other formatting changes.
22962 (bool, TRUE, FALSE): Move their definition to...
22963 * src/system.h: here.
22964
8963a27b
AD
229652000-10-02 Akim Demaille <akim@epita.fr>
22966
22967 * src/files.c: Formatting changes.
22968 (tryopen, tryclose, openfiles): Rename as...
22969 (xfopen, xfclose, open_files): this.
22970 (stringappend): static.
22971 * src/files.h: Complete the list of exported symbols.
22972 Propagate its use.
22973
a70083a3
AD
229742000-10-02 Akim Demaille <akim@epita.fr>
22975
22976 * src/reader.h: New file.
22977 Propagate its use instead of tedious list of `extern' and
22978 prototypes.
22979 * src/reader.c: Formatting changes, topological sort,
22980 s/register//.
22981
abadc117
AD
229822000-10-02 Akim Demaille <akim@epita.fr>
22983
22984 * src/lex.h: Prototype `lex.c' exported functions.
22985 * src/reader.c: Adjust.
22986 * src/lex.c: Formatting changes.
22987 (safegetc): Rename as...
22988 (xgetc): this.
22989
720d742f
AD
229902000-10-02 Akim Demaille <akim@epita.fr>
22991
22992 * src/lalr.h: New file.
22993 Propagate its inclusion instead of prototypes and `extern'.
22994 * src/lalr.c: Formatting changes, topological sorting etc.
22995
f2acea59
AD
229962000-10-02 Akim Demaille <akim@epita.fr>
22997
22998 * src/output.c (token_actions): Introduce a temporary array,
22999 YYDEFACT, that makes it possible for this function to use
23000 output_short_table.
23001
d019d655
AD
230022000-10-02 Akim Demaille <akim@epita.fr>
23003
23004 `user_toknums' is output as a `short[]' in `output.c', while it is
23005 defined as a `int[]' in `reader.c'. For consistency with the
23006 other output tables, `user_toknums' is now defined as a table of
23007 shorts.
23008
23009 * src/reader.c (user_toknums): Be a short table instead of an int
23010 table.
23011 Adjust dependencies.
23012
23013 Factor the short table outputs.
23014
23015 * src/output.c (output_short_table): New function.
23016 * src/output.c (output_gram, output_stos, output_rule_data)
23017 (output_base, output_table, output_check): Use it.
23018
6c89f1c1
AD
230192000-10-02 Akim Demaille <akim@epita.fr>
23020
23021 * src/output.c (output): Topological sort of the functions, in
23022 order to get rid of the `static' prototypes.
23023 No longer use `register'.
23024 * src/output.h: New file.
23025 Propagate its inclusion in files explicitly prototyping functions
23026 from output.c.
23027
d9efd181
AD
230282000-09-21 Akim Demaille <akim@epita.fr>
23029
23030 * src/atgeneral.m4: Update from Autoconf.
23031
c29240e7 230322000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
23033
23034 * src/closure.h: New file.
23035 * src/closure.c: Formatting changes, topological sort over the
23036 functions, use of closure.h.
23037 (initialize_closure, finalize_closure): Rename as...
23038 (new_closure, free_closure): these. Adjust dependencies.
23039 * src/LR0.c: Formatting changes, topological sort, use of
23040 cloture.h.
23041 (initialize_states): Rename as...
23042 (new_states): this.
23043 * src/Makefile.am (noinst_HEADERS): Adjust.
23044
499daa50
AD
230452000-09-20 Akim Demaille <akim@epita.fr>
23046
23047 * src/acconfig.h: Don't protect config.h against multiple
23048 inclusion.
23049 Don't define PARAMS.
23050 * src/system.h: Define PARAMS.
23051 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
23052 purpose of config.h. system.h must not try to fix wrong
23053 definitions in config.h.
23054
cc84fd5d
AD
230552000-09-20 Akim Demaille <akim@epita.fr>
23056
23057 * src/derives.h: New file.
23058 * src/main.c, src/derives.h: Use it.
23059 Formatting changes.
23060 * src/Makefile.am (noinst_HEADERS): Adjust.
23061
db5b3a89
AD
230622000-09-20 Akim Demaille <akim@epita.fr>
23063
23064 * tests/atgeneral.m4: Update from Autoconf.
23065 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
23066 (AT_CHECK_CALC): New macros.
23067 Use these macros to test bison with options `', `--raw',
23068 `--debug', `--yacc', `--yacc --debug'.
23069
ceed8467
AD
230702000-09-19 Akim Demaille <akim@epita.fr>
23071
23072 * src/output.c: Formatting changes.
23073 * src/machine.h: Remove, leaving its contents in...
23074 * src/system.h: here.
23075 Include stdio.h.
23076 Adjust all dependencies on stdio.h and machine.h.
23077 * src/getargs.h: New file.
23078 Let all `extern' declarations about getargs.c be replaced with
23079 inclusion of `getargs.h'.
23080 * src/Makefile.am (noinst_HEADERS): Adjust.
23081
23082 * tests/calc.m4 (yyin): Be initialized in main, not on the global
23083 scope.
23084 (yyerror): Returns void, not int.
23085 * doc/bison.texinfo: Formatting changes.
23086
05a1d24b
AD
230872000-09-19 Akim Demaille <akim@epita.fr>
23088
23089 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
23090 portable.
23091
cbd25751
AD
230922000-09-18 Akim Demaille <akim@epita.fr>
23093
23094 * configure.in: Append WARNING_CFLAGS to CFLAGS.
23095 * src/Makefile.am (INCLUDES): Don't.
23096 Be ready to fetch headers in lib/.
23097
13863333
AD
230982000-09-18 Akim Demaille <akim@epita.fr>
23099
23100 * doc/bison.texinfo: Update the copyright.
23101 ANSIfy and GNUify the examples.
23102 Remove the old menu.
23103
0d533154
AD
231042000-09-18 Akim Demaille <akim@epita.fr>
23105
23106 First set of tests: use the `calc' example from the documentation.
23107
23108 * src/bison.s1 (yyparse): Condition the code using `yytname' which
23109 is defined only when YYDEBUG is.
23110 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
23111 * src/files.c (tryopen, tryclose): Formatting changes.
23112 Move to the top and be static.
23113 * src/reader.c (read_signed_integer): Likewise.
23114 * tests/calc.m4: New file.
23115 * Makefile.am, suite.m4: Adjust.
23116 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
23117
e79137ac
AD
231182000-09-18 Akim Demaille <akim@epita.fr>
23119
23120 Add support for an Autotest test suite for Bison.
23121
23122 * m4/m4.m4, m4/atconfig.m4: New files.
23123 * m4/Makefile.am (EXTRA_DIST): Adjust.
23124 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
23125 files.
23126 * src/getargs.c: Display a more standard --version message.
23127 * src/reader.c (reader): Formatting changes.
23128 No longer depend upon VERSION_STRING.
23129 * configure.in: No longer use `dnl'.
23130 Set up the test suite and the new directory `tests/.
23131 (VERSION_STRING): Remove.
23132
27821bff
AD
231332000-04-14 Akim Demaille <akim@epita.fr>
23134
23135 * src/reader.c (copy_comment2): New function, same as former
23136 `copy_comment', but outputs into two FILE *.
23137 (copy_comment): Use it.
23138 (parse_union_decl): Use it.
23139 (get_type, parse_start_decl): Use the same `invalid' message.
23140 (parse_start_decl, parse_union_decl): Use the same `multiple'
23141 message.
23142 (parse_union_decl, copy_guard, copy_action): Use the same
23143 `unmatched' message.
23144 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
23145
cfe5fbc0
AD
231462000-03-31 Akim Demaille <akim@epita.fr>
23147
23148 * src/files.c (tryopen, tryclose): Move to the top.
23149 Be static.
23150
cb7db13e
AD
231512000-03-31 Akim Demaille <akim@epita.fr>
23152
23153 * src/main.c (main): Don't call `done', exit does it.
23154
a0f6b076
AD
231552000-03-31 Akim Demaille <akim@epita.fr>
23156
36281465
AD
23157 * allocate.c: s/return (foo)/return foo/.
23158 * lalr.c: Likewise.
23159 * LR0.c: Likewise.
23160 * output.c: Likewise.
23161 * reader.c: Likewise.
23162 * symtab.c: Likewise.
23163 * vmsgetargs.c: Likewise.
23164
231652000-03-31 Akim Demaille <akim@epita.fr>
23166
23167 Clean up the error reporting functions.
a0f6b076
AD
23168
23169 * src/report.c: New file.
23170 * src/report.h: Likewise.
23171 * src/Makefile.am: Adjust.
23172 * m4/error.m4: New file.
23173 * m4/Makefile.am: Adjust.
23174 * configure.in (jm_PREREQ_ERROR): Call it.
23175 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
23176 Remove.
23177 (fatal, fatals): Remove. All callers use complain.c::fatal.
23178 (warn, warni, warns, warnss, warnss): Remove. All callers use
23179 complain.c::complain.
23180 (toomany): Remove, use fatal instead.
23181 * src/files.c (done): No argument, use complain_message_count.
23182 * src/main.c (main): Register `done' to `atexit'.
23183
23184 * src/getargs.c (usage): More `fputs', less `fprintf'.
23185
18539825
AD
231862000-03-28 Akim Demaille <akim@epita.fr>
23187
23188 * lib/: New directory.
23189 * Makefile.am (SUBDIRS): Adjust.
23190 * configure.in: Adjust.
23191 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
23192 useless.
23193 * src/alloca.c: Moved to lib/.
23194 * src/getopt.c: Likewise.
23195 * src/getopt1.c: Likewise.
23196 * src/getopt.h: Likewise.
23197 * src/ansi2knr.c: Likewise.
23198 * src/ansi2knr.1: Likewise.
23199 * src/Makefile.am: Adjust.
23200 * lib/Makefile.am: New file.
23201
9f306f2a
AD
232022000-03-28 Akim Demaille <akim@epita.fr>
23203
23204 * src/getargs.c (usage): Refresh the help message.
23205
0ba347b6
AD
232062000-03-17 Akim Demaille <akim@epita.fr>
23207
23208 * src/getopt1.c: Updated from textutils 2.0e
23209 * src/getopt.c: Likewise.
23210 * src/getopt.h: Likewise.
23211
dbe7f271
AD
232122000-03-17 Akim Demaille <akim@epita.fr>
23213
23214 * src/Makefile.am (bison.simple): Fix the awk program: quote only
23215 the file name, not the whole `#line LINE FILE'.
23216
75bbe78d
AD
232172000-03-17 Akim Demaille <akim@epita.fr>
23218
23219 On syntax errors, report the token on which we choked.
23220
aa5fd0ee
AD
23221 * src/bison.s1 (yyparse): In the label yyerrlab, when
23222 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 23223
7b306f52
AD
232242000-03-17 Akim Demaille <akim@epita.fr>
23225
aa5fd0ee 23226 * src/reader.c (copy_at): New function.
7b306f52
AD
23227 (copy_guard): Use it.
23228 (copy_action): Use it.
23229
e87b5700
AD
232302000-03-17 Akim Demaille <akim@epita.fr>
23231
23232 Be kind to translators, save some useless translations.
23233
aa5fd0ee 23234 * src/main.c (banner): New function.
e87b5700
AD
23235 (fatal_banner): Use it.
23236 (warn_banner): Use it.
23237
ae3c3164
AD
232382000-03-17 Akim Demaille <akim@epita.fr>
23239
aa5fd0ee
AD
23240 * src/reader.c (copy_definition): Use copy_string and
23241 copy_comment. Removed now unused `match', `ended',
23242 `cplus_comment'.
ae3c3164
AD
23243 (copy_comment, copy_string): Moved, to be visible from
23244 copy_definition.
23245
4dc58e7c
AD
232462000-03-17 Akim Demaille <akim@epita.fr>
23247
aa5fd0ee
AD
23248 * src/reader.c (copy_string): Declare `static inline'. No
23249 problems with inline, since it is checked by configure.
4dc58e7c
AD
23250 (copy_comment): Likewise.
23251
0a6384c4
AD
232522000-03-17 Akim Demaille <akim@epita.fr>
23253
aa5fd0ee 23254 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 23255
3cef001a
AD
232562000-03-17 Akim Demaille <akim@epita.fr>
23257
aa5fd0ee 23258 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
23259 (copy_action): Use it. Removed now unused `match', `ended',
23260 `cplus_comment'.
23261 (copy_guard): Likewise.
23262
ca36d2ef
AD
232632000-03-17 Akim Demaille <akim@epita.fr>
23264
aa5fd0ee 23265 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
23266 (copy_action): Use it.
23267 (copy_guard): Likewise.
23268
6666f98f
AD
232692000-03-17 Akim Demaille <akim@epita.fr>
23270
23271 Change the handling of @s so that they behave exactly like $s.
23272 There is now a pseudo variable @$ (readble and writable), location
23273 of the lhs of the rule (by default ranging from the location of
23274 the first symbol of the rhs, to the location of the last symbol,
23275 or, if the rhs is empty, YYLLOC).
23276
23277 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
23278 yyval.
23279 (yyparse): When providing a default semantic action, provide a
23280 default location action.
23281 (after the $): No longer change `*YYLSP', just stack YYLOC the
23282 same way you stack YYVAL.
23283 * src/reader.c (read_declarations): Use warns.
23284 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
23285 (copy_action, case '@'): Likewise.
23286 Use a standard error message, to save useless work from
23287 translators.
23288
41aca2e0
AD
232892000-03-17 Akim Demaille <akim@epita.fr>
23290
aa5fd0ee
AD
23291 * src/bison.s1: Formatting and cosmetics changes.
23292 * src/reader.c: Likewise.
41aca2e0
AD
23293 Update the Copyright notice.
23294
dc08c1d5
AD
232952000-03-17 Akim Demaille <akim@epita.fr>
23296
aa5fd0ee
AD
23297 * src/bison.s1 (#line): All set to `#line' only, since the
23298 Makefile now handles them.
dc08c1d5 23299
9ee3c97b
AD
233002000-03-16 Akim Demaille <akim@epita.fr>
23301
23302 * src/output.c (output_rule_data): Output the documentation of
23303 some of the tables.
23304 (Copyright notice): Update.
23305 Formatting changes.
23306
0de741ca
AD
233072000-03-16 Akim Demaille <akim@epita.fr>
23308
23309 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
23310 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
23311 One `#if YYDEBUG' remains, since it uses variables which are
23312 defined only if `YYDEBUG != 0'.
23313
bb10be54
AD
233142000-03-16 Akim Demaille <akim@epita.fr>
23315
23316 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
23317 and related variables so that the similarities are highlighted.
23318
b07b484a
AD
233192000-03-16 Akim Demaille <akim@epita.fr>
23320
23321 * src/bison.s1: Properly indent CPP directives.
23322
361f60b3
AD
233232000-03-16 Akim Demaille <akim@epita.fr>
23324
23325 * src/bison.s1: Properly indent the `alloca' CPP section.
23326
8c44d3ec
AD
233272000-03-16 Akim Demaille <akim@epita.fr>
23328
23329 Do not hard code values of directories in `configure.in'.
23330 Update the `configure' tool chain.
23331
23332 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23333 src/makefile.am.
23334 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23335 (AC_OUTPUT): Add m4/Makefile.
23336 Bump to bison 1.28a, 1.29 has never been released.
23337 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23338 handled via src/Makefile.am.
23339 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23340 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23341 autoheader.
23342 * Makefile.am (SUBDIRS): Add m4.
23343 (ACLOCAL_AM_FLAGS): New variable.
23344 (AUTOMAKE_OPTIONS): Add check-news.
23345 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23346 the proper line number and file name.
23347 (DEFS): Propagate the location of bison library files and of the
23348 locale files.
23349 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23350 builddir.
23351 * acinclude.m4: Remove, replaced by the directory m4.
23352 * m4/Makefile.am (EXTRA_DIST): New variable.
23353 * m4/gettext.m4: New file, from the fileutils.
23354 * m4/lcmessage.m4: Likewise
23355 * m4/progtest.m4: Likewise.
23356 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23357
f95997e7
AD
233582000-03-10 Akim Demaille <akim@epita.fr>
23359
23360 * src/closure.c:
23361 Formatting changes of various comments.
23362 Respect the GNU coding standards at various places.
23363 Don't use `_()' when no translation is needed.
23364
233651999-12-13 Jesse Thilo <jthilo@gnu.org>
23366
23367 * src/files.c:
23368 OS/2 honors TMPDIR environment variable.
23369
233701999-12-13 Jesse Thilo <jthilo@gnu.org>
23371
23372 * doc/bison.texinfo: Tweaked spelling and grammar.
23373 Updated ISBN.
23374 Removed reference to price of printed copy.
23375 Mention BISON_SIMPLE and BISON_HAIRY.
23376
233771999-12-13 Jesse Thilo <jthilo@gnu.org>
23378
23379 * configure.in, NEWS:
23380 Bison 1.29 released.
23381
233821999-10-27 Jesse Thilo <jthilo@gnu.org>
23383
23384 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23385 Added reference card.
23386
233871999-07-26 Jesse Thilo <jthilo@gnu.org>
23388
23389 * po/ru.po: Added Russian translation.
23390
233911999-07-26 Jesse Thilo <jthilo@gnu.org>
23392
23393 * configure.in: Added Russian translation.
23394
233951999-07-06 Jesse Thilo <jthilo@gnu.org>
23396
23397 * configure.in, NEWS, README:
23398 Released version 1.28.
23399
234001999-06-14 Jesse Thilo <jthilo@gnu.org>
23401
23402 * src/system.h:
23403 Squashed redefinition warning on some systems.
23404
23405 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
23406 Have configure build version string instead of relying on ANSI string
23407 concatentation.
23408
234091999-06-14 Jesse Thilo <jthilo@gnu.org>
23410
23411 * po/POTFILES.in: Got rid of version.c.
23412
234131999-06-14 Jesse Thilo <jthilo@gnu.org>
23414
23415 * acconfig.h, configure.in:
23416 Have configure build version string instead of relying on ANSI string
23417 concatentation.
23418
234191999-06-08 Jesse Thilo <jthilo@gnu.org>
23420
23421 * doc/bison.1:
23422 Dropped mention of `+' for long-named options.
23423
234241999-05-30 Jesse Thilo <jthilo@gnu.org>
23425
23426 * src/files.c: Added <unistd.h> for unlink().
23427
23428 * src/Makefile.am, src/system.h:
23429 I18n fixes.
23430
234311999-05-30 Jesse Thilo <jthilo@gnu.org>
23432
23433 * README: Added a FAQ list.
23434
23435 * configure.in, acconfig.h:
23436 I18n fixes.
23437
234381999-05-30 Jesse Thilo <jthilo@gnu.org>
23439
23440 * doc/FAQ, doc/Makefile.am:
23441 Added a FAQ list.
23442
234431999-05-19 Jesse Thilo <jthilo@gnu.org>
23444
23445 * src/alloc.h, src/symtab.h, src/version.c:
23446 Protected inclusion of "config.h" with HAVE_CONFIG_H.
23447
234481999-04-18 Jesse Thilo <jthilo@gnu.org>
23449
23450 * src/.cvsignore, src/Makefile.am:
23451 Reorganized: sources in `src', documentation in `doc'.
23452
23453 * src/lex.c (literalchar):
23454 fixed the code for escaping double quotes (thanks
23455 Jonathan Czisny.)
23456
234571999-04-18 Jesse Thilo <jthilo@gnu.org>
23458
23459 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
23460 Adjusted paths to reflect directory reorganization.
23461
234621999-04-18 Jesse Thilo <jthilo@gnu.org>
23463
23464 * doc/.cvsignore, doc/Makefile.am:
23465 Reorganized: sources in `src', documentation in `doc'.
23466
234671999-04-18 Jesse Thilo <jthilo@gnu.org>
23468
23469 * configure.in:
23470 Updated AC_INIT file to reflect directory reorganization.
23471
23472 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
23473 Reorganized: sources in `src', documentation in `doc'.
23474
234751999-04-13 Jesse Thilo <jthilo@gnu.org>
23476
23477 * src/allocate.c:
23478 Don't declare calloc() and realloc() if not necessary.
23479
234801999-04-13 Jesse Thilo <jthilo@gnu.org>
23481
23482 * configure.in, acconfig.h, acinclude.m4:
23483 Don't declare calloc() and realloc() if not necessary.
23484
234851999-03-23 Jesse Thilo <jthilo@gnu.org>
23486
23487 * po/.cvsignore: Added i18n support.
23488
234891999-03-23 Jesse Thilo <jthilo@gnu.org>
23490
23491 * acconfig.h, configure.in, Makefile.am:
23492 Added i18n support.
23493
234941999-03-22 Jesse Thilo <jthilo@gnu.org>
23495
23496 * src/bison.s1: Fixed #line numbers.
23497
234981999-03-15 Jesse Thilo <jthilo@gnu.org>
23499
23500 * po/es.po, po/fr.po, po/nl.po, po/de.po:
23501 Added PO files from Translation Project.
23502
235031999-03-03 Jesse Thilo <jthilo@gnu.org>
23504
23505 * Makefile.am:
23506 Added support for non-ANSI compilers (ansi2knr).
23507
235081999-02-16 Jesse Thilo <jthilo@gnu.org>
23509
23510 * configure.in: Bumped version number to 1.27.
23511
23512 * Makefile.am:
23513 Added `bison.simple' to list of files removed by `make distclean'.
23514
235151999-02-12 Jesse Thilo <jthilo@gnu.org>
23516
23517 * src/files.c, src/files.h:
23518 Defined locations of parser files in config.h instead of Makefile.
23519
235201999-02-12 Jesse Thilo <jthilo@gnu.org>
23521
23522 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
23523 Defined locations of parser files in config.h instead of Makefile.
23524
235251999-02-09 Jesse Thilo <jthilo@gnu.org>
23526
23527 * Makefile.am:
23528 Removed inappropriate use of $< macro.
23529
235301999-02-05 Jesse Thilo <jthilo@gnu.org>
23531
23532 * po/Makefile.in.in, po/POTFILES.in:
23533 Add `po' directory skeleton.
23534
235351999-01-27 Jesse Thilo <jthilo@gnu.org>
23536
23537 * README: Document help-bison list.
23538
23539 * configure.in: Add check for mkstemp().
23540
235411999-01-20 Jesse Thilo <jthilo@gnu.org>
23542
23543 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
23544 Hush a few compiler warnings.
23545
23546 * src/files.c:
23547 Add tryclose(), which verifies that fclose was successful.
23548 Hush a couple of compiler warnings.
23549
235501999-01-20 Jesse Thilo <jthilo@gnu.org>
23551
23552 * Makefile.am, OChangeLog:
23553 ChangeLog is now automatically generated. Include the old version as
23554 OChangeLog.
23555
235561999-01-14 Jesse Thilo <jthilo@gnu.org>
23557
23558 * 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:
23559 Update FSF address.
23560
235611999-01-14 Jesse Thilo <jthilo@gnu.org>
23562
23563 * doc/bison.texinfo: Fix formatting glitch.
23564
23565 * doc/bison.texinfo: Update FSF address.
23566
235671999-01-14 Jesse Thilo <jthilo@gnu.org>
23568
23569 * acconfig.h: Update FSF address.
23570
235711999-01-08 Jesse Thilo <jthilo@gnu.org>
23572
23573 * src/system.h:
23574 Don't define PACKAGE here, since config.h defines it.
23575
235761998-12-30 Jesse Thilo <jthilo@gnu.org>
23577
23578 * src/reader.c: Update copyright date.
23579
23580 * src/main.c:
23581 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23582 favor of output directly to stderr (avoids buffer overruns).
23583
23584 * src/reader.c: Some checks for premature EOF.
23585
23586 * 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:
23587 Use prototypes if the compiler understands them.
23588
23589 * src/files.c: Honor TMPDIR on Unix hosts.
23590 Use prototypes if the compiler understands them.
23591
23592 * src/reader.c:
23593 Fix a couple of buffer overrun bugs.
23594 Use prototypes if the compiler understands them.
23595
23596 * src/system.h: Include unistd.h and ctype.h.
23597 Use #ifdef instead of #if for NLS symbols.
23598
235991998-12-30 Jesse Thilo <jthilo@gnu.org>
23600
23601 * doc/bison.texinfo:
23602 Delete comment "consider using @set for edition number, etc..." since
23603 we now are doing so.
23604
236051998-12-30 Jesse Thilo <jthilo@gnu.org>
23606
23607 * configure.in:
23608 Use prototypes if the compiler understands them.
23609
23610 * NEWS: Document 1.26 highlights.
23611
23612 * Makefile.am: Require Automake 1.3 or later.
23613
23614 * acconfig.h:
23615 Use prototypes if the compiler understands them.
23616
236171998-12-29 Jesse Thilo <jthilo@gnu.org>
23618
23619 * src/version.c:
23620 Use VERSION symbol from automake for version number.
23621
236221998-12-29 Jesse Thilo <jthilo@gnu.org>
23623
23624 * acconfig.h, configure.in, version.cin:
23625 Use VERSION symbol from automake for version number.
23626
236271998-11-28 Jesse Thilo <jthilo@gnu.org>
23628
23629 * Makefile.am:
23630 Distribute original version of simple parser (bison.s1), not built
23631 version (bison.simple).
23632
236331998-11-28 Jesse Thilo <jthilo@gnu.org>
23634
23635 * doc/bison.texinfo: Add info dir entry.
23636
23637 * doc/bison.texinfo:
23638 Let automake put version number into documentation.
23639
236401998-11-26 Jesse Thilo <jthilo@gnu.org>
23641
23642 * src/bison.cld, src/build.com, src/vmshlp.mar:
23643 Add non-RCS files from /gd/gnu/bison.
23644
236451998-11-26 Jesse Thilo <jthilo@gnu.org>
23646
23647 * doc/bison.1:
23648 Document the BISON_HAIRY and BISON_SIMPLE variables.
23649
236501998-11-25 Jesse Thilo <jthilo@gnu.org>
23651
23652 * src/version.c: Build version.c automatically.
23653
23654 * src/reader.c:
23655 Fix token numbering (used to start at 258, not 257).
23656
23657 * src/system.h: Include config.h.
23658
23659 * src/getargs.c: Update bug report address.
23660
23661 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23662 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23663
236641998-11-25 Jesse Thilo <jthilo@gnu.org>
23665
23666 * Makefile.am:
23667 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23668
23669 * configure.in, version.cin:
23670 Build version.c automatically.
23671
23672 * AUTHORS: Add AUTHORS file.
23673
23674 * README: Update bug report address.
23675
23676 * bison.simple:
23677 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23678
23679 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23680 Add automake stuff.
23681
236821998-11-25 Jesse Thilo <jthilo@gnu.org>
23683
23684 * doc/bison.texinfo: Clean up some formatting.
23685
236861998-05-05 Richard Stallman <rms@gnu.org>
23687
23688 * doc/bison.texinfo:
23689 Explain better why to make a pure parser.
23690
236911998-01-05 Richard Stallman <rms@gnu.org>
23692
23693 * src/files.c (openfiles):
23694 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23695 find a temporary directory, if possible. Do not unlink files while
23696 they are open.
23697
236981997-08-25 Richard Stallman <rms@gnu.org>
23699
23700 * src/reader.c (stack_offset;):
23701 Change some warni to warns.
23702
23703 * src/lex.c (literalchar): Use warns, not warni.
23704
237051997-06-28 Richard Stallman <rms@gnu.org>
23706
23707 * src/bison.s1: Add a Bison version comment.
23708
23709 * src/main.c (fatal, warn, berror):
23710 Use program_name.
23711
237121997-06-28 Richard Stallman <rms@gnu.org>
23713
23714 * Makefile.in (bison_version): New variable.
23715 (dist): Use that variable.
23716 (bison.s1): Substitute the Bison version into bison.simple.
23717
23718 * bison.simple: Add a Bison version comment.
23719
237201997-06-18 Richard Stallman <rms@gnu.org>
23721
23722 * src/main.c (fatal, warn, berror):
23723 Make error messages standard.
23724 (toomany): Improve error message text.
23725
23726 * 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:
23727 new.h renamed to alloc.h.
23728
237291997-06-18 Richard Stallman <rms@gnu.org>
23730
23731 * Makefile.in: new.h renamed to alloc.h.
23732
237331997-05-24 Richard Stallman <rms@gnu.org>
23734
23735 * src/lex.c (literalchar):
23736 Fix the code for escaping \, " and '.
23737
23738 (lex): Avoid trouble when there are many chars
23739 to discard in a char literal with just several chars in it.
23740
237411997-05-17 Richard Stallman <rms@gnu.org>
23742
23743 * src/bison.s1:
23744 Use malloc, if using alloca is troublesome.
23745 (YYSTACK_USE_ALLOCA): New flag macro.
23746 Define it for some systems and compilers.
23747 (YYSTACK_ALLOC): New macro.
23748 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23749 If it was malloc'd, free it.
23750
237511997-05-17 Richard Stallman <rms@gnu.org>
23752
23753 * bison.simple:
23754 Use malloc, if using alloca is troublesome.
23755 (YYSTACK_USE_ALLOCA): New flag macro.
23756 Define it for some systems and compilers.
23757 (YYSTACK_ALLOC): New macro.
23758 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23759 If it was malloc'd, free it.
23760
237611997-04-23 Richard Stallman <rms@gnu.org>
23762
23763 * src/bison.s1:
23764 (alloca) [__hpux]: Always define as __builtin_alloca.
23765
237661997-04-23 Richard Stallman <rms@gnu.org>
23767
23768 * bison.simple:
23769 (alloca) [__hpux]: Always define as __builtin_alloca.
23770
237711997-04-22 Richard Stallman <rms@gnu.org>
23772
23773 * src/bison.s1:
23774 [__hpux]: Include alloca.h (right for HPUX 10)
23775 instead of declaring alloca (right for HPUX 9).
23776
23777 * src/bison.s1 (__yy_memcpy):
23778 Declare arg `count' as unsigned int.
23779 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23780
237811997-04-22 Richard Stallman <rms@gnu.org>
23782
23783 * bison.simple:
23784 [__hpux]: Include alloca.h (right for HPUX 10)
23785 instead of declaring alloca (right for HPUX 9).
23786
23787 * bison.simple (__yy_memcpy):
23788 Declare arg `count' as unsigned int.
23789 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23790
237911997-01-03 Richard Stallman <rms@gnu.org>
23792
23793 * src/allocate.c: [__STDC__ or _MSC_VER]:
23794 Declare calloc and realloc to return void *.
23795
237961997-01-02 Richard Stallman <rms@gnu.org>
23797
23798 * src/system.h:
23799 [_MSC_VER]: Include stdlib.h and process.h.
23800 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23801
23802 * src/main.c (main): Return FAILURE as a value.
23803 (printable_version): Declare arg as int, not char.
23804
238051997-01-02 Richard Stallman <rms@gnu.org>
23806
23807 * Makefile.in (dist):
23808 Explicitly check for symlinks, and copy them.
23809
238101996-12-19 Richard Stallman <rms@gnu.org>
23811
23812 * src/files.c:
23813 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23814
238151996-12-18 Paul Eggert <eggert@gnu.org>
23816
23817 * src/bison.s1 (yyparse):
23818 If __GNUC__ and YYPARSE_PARAM are both defined,
23819 declare yyparse to have a void * argument.
23820
238211996-12-18 Paul Eggert <eggert@gnu.org>
23822
23823 * bison.simple (yyparse):
23824 If __GNUC__ and YYPARSE_PARAM are both defined,
23825 declare yyparse to have a void * argument.
23826
238271996-12-17 Richard Stallman <rms@gnu.org>
23828
23829 * src/reduce.c (nbits): Add some casts.
23830
238311996-08-12 Richard Stallman <rms@gnu.org>
23832
23833 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23834
238351996-08-12 Richard Stallman <rms@gnu.org>
23836
23837 * bison.simple: Test _MSDOS as well as _MSDOS_.
23838
238391996-07-31 Richard Stallman <rms@gnu.org>
23840
23841 * src/bison.s1:
23842 [__sun && __i386]: Include alloca.h.
23843
238441996-07-31 Richard Stallman <rms@gnu.org>
23845
23846 * bison.simple:
23847 [__sun && __i386]: Include alloca.h.
23848
238491996-07-30 Richard Stallman <rms@gnu.org>
23850
23851 * src/bison.s1: Comment change.
23852
23853 * src/bison.s1: Test _MSDOS_, not MSDOS.
23854
238551996-07-30 Richard Stallman <rms@gnu.org>
23856
23857 * bison.simple: Comment change.
23858
23859 * bison.simple: Test _MSDOS_, not MSDOS.
23860
238611996-06-01 Richard Stallman <rms@gnu.org>
23862
23863 * 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:
23864 Insert `_' macro around many string constants.
23865
23866 * src/main.c:
23867 Insert `_' macro around many string constants.
23868
23869 (main): Call setlocale, bindtextdomain and textdomain.
23870
23871 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23872 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23873 [ENABLE_NLS]: Include libintl.h.
23874 [ENABLE_NLS] (gettext): Define.
23875 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23876 (N_, PACKAGE, LOCALEDIR): New macros.
23877
238781996-06-01 Richard Stallman <rms@gnu.org>
23879
23880 * POTFILES.in: New file.
23881
23882 * Makefile.in (allocate.o):
23883 Define target explicitly.
23884
23885 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23886 (LDFLAGS): Set to @LDFLAGS@.
23887 (configure): Run autoconf only if preceding `cd' succeeds.
23888 (bison.s1): Redirect output to temporary file then move the
23889 temporary to the target, rather than redirecting directly to bison.s1.
23890 (clean): Remove config.status and config.log.
23891 (distclean): Don't remove config.status here.
23892
238931996-05-12 Richard Stallman <rms@gnu.org>
23894
23895 * src/bison.s1:
23896 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23897
238981996-05-12 Richard Stallman <rms@gnu.org>
23899
23900 * bison.simple:
23901 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
23902
239031996-05-11 Richard Stallman <rms@gnu.org>
23904
23905 * src/bison.s1 (__yy_memcpy):
23906 Really reorder the args, as was supposedly done on Feb 14 1995.
23907 (yyparse): Calls changed accordingly.
23908
239091996-05-11 Richard Stallman <rms@gnu.org>
23910
23911 * Makefile.in (dist): Don't use $(srcdir).
23912
23913 * bison.simple (__yy_memcpy):
23914 Really reorder the args, as was supposedly done on Feb 14 1995.
23915 (yyparse): Calls changed accordingly.
23916
239171996-01-27 Richard Stallman <rms@gnu.org>
23918
23919 * src/output.c (output_rule_data):
23920 Test YYERROR_VERBOSE in the conditional
23921 around the definition of ttyname.
23922
239231995-12-29 Richard Stallman <rms@gnu.org>
23924
23925 * src/bison.s1:
23926 Fix line numbers in #line commands.
23927
239281995-12-29 Richard Stallman <rms@gnu.org>
23929
23930 * bison.simple:
23931 Fix line numbers in #line commands.
23932
239331995-12-27 Richard Stallman <rms@gnu.org>
23934
23935 * src/bison.s1 (YYPARSE_PARAM_DECL):
23936 In C++, make it always null.
23937 (YYPARSE_PARAM_ARG): New macro.
23938 (yyparse): Use YYPARSE_PARAM_ARG.
23939
239401995-12-27 Richard Stallman <rms@gnu.org>
23941
23942 * bison.simple (YYPARSE_PARAM_DECL):
23943 In C++, make it always null.
23944 (YYPARSE_PARAM_ARG): New macro.
23945 (yyparse): Use YYPARSE_PARAM_ARG.
23946
239471995-11-29 Richard Stallman <rms@gnu.org>
23948
23949 * doc/bison.texinfo:
23950 Describe literal string tokens, %raw, %no_lines, %token_table.
23951
239521995-11-29 Daniel Hagerty <hag@gnu.org>
23953
23954 * doc/bison.texinfo: Fixed update date
23955
239561995-10-16 Richard Stallman <rms@gnu.org>
23957
23958 * src/version.c: Version 1.25.
23959
239601995-10-16 Richard Stallman <rms@gnu.org>
23961
23962 * NEWS: *** empty log message ***
23963
239641995-10-16 Richard Stallman <rms@gnu.org>
23965
23966 * doc/bison.1, doc/bison.rnh:
23967 Add new options.
23968
239691995-10-15 Richard Stallman <rms@gnu.org>
23970
23971 * src/vmsgetargs.c, src/getargs.c:
23972 Added -n, -k, and -raw switches.
23973 (noparserflag, toknumflag, rawtoknumflag): New variables.
23974
23975 * src/symtab.h (SALIAS):
23976 New #define for adding aliases to %token.
23977 (struct bucket): Added `alias' field.
23978
23979 * src/reduce.c (reduce_grammar):
23980 Revise error message.
23981 (print_notices): Remove final `.' from error message.
23982
23983 * src/reader.c (reader_output_yylsp):
23984 New function.
23985 (readgram): Use `#if 0' around code that accepted %command
23986 inside grammar rules: The documentation doesn't allow it,
23987 and it will fail since the %command processors scan for the next %.
23988 (parse_token_decl): Extended the %token
23989 declaration to allow a multi-character symbol as an alias.
23990 (parse_thong_decl): New function.
23991 (read_declarations): Added %thong declarations.
23992 (read_declarations): Handle NOOP to deal with allowing
23993 % declarations as another means to specify the flags.
23994 (readgram): Allow %prec prior to semantics embedded in a rule.
23995 (skip_to_char, read_declarations, copy_definition)
23996 (parse_token_decl, parse_start_decl, parse_type_decl)
23997 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
23998 (get_type_name, copy_guard, copy_action, readgram)
23999 (get_type, packsymbols): Revised most error messages.
24000 Changed `fatal' to `warnxxx' to avoid aborting for error.
24001 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24002 (read_declarations): Improve the error message for
24003 an invalid character. Do not abort.
24004 (read_declarations, copy_guard, copy_action): Use
24005 printable_version to avoid unprintable characters in printed output.
24006 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24007 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24008 Allow the type of a non-terminal can be given
24009 more than once, as long as all specifications give the same type.
24010
24011 * src/output.c:
24012 (output_headers, output_trailers, output, output_gram)
24013 (output_rule_data): Implement noparserflag variable.
24014 Implement toknumflag variable.
24015 (output): Call reader_output_yylsp to output LTYPESTR.
24016
24017 * src/main.c (main):
24018 If reader sees an error, don't process the grammar.
24019 (fatals): Updated to not use VARARGS1.
24020 (printable_version, int_to_string, warn, warni, warns, warnss)
24021 (warnsss): New error reporting functions. Avoid abort for error.
24022
24023 * src/lex.h:
24024 Added THONG and NOOP for alias processing.
24025 Added SETOPT for the new code that allows setting options with %flags.
24026
24027 * src/lex.c:
24028 Include getopt.h. Add some extern decls.
24029 (safegetc): New function to deal with EOF gracefully.
24030 (literalchar); new function to deal with reading \ escapes.
24031 (lex): Use literalchar.
24032 (lex): Implemented "..." tokens.
24033 (literalchar, lex, parse_percent_token): Made tokenbuffer
24034 always contain the token. This includes growing the token
24035 buffer while reading an integer.
24036 (parse_percent_token): Replaced if-else statement with percent_table.
24037 (parse_percent_token): Added % declarations as another
24038 way to specify the flags -n, -l, and -r. Also added hooks for
24039 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
24040 major changes to files.c.
24041 (lex) Retain in the incoming stream a character following
24042 an incorrect '/'.
24043 (skip_white_space, lex): Revised most error messages
24044 and changed fatal to warn to avoid aborting.
24045 (percent_table): Added %thong declarations.
24046
24047 * src/gram.h: Comment changes.
24048
24049 * src/files.c (openfiles, open_extra_files, done):
24050 Add faction flag
24051 and actfile file. Handle noparserflag. Both for -n switch.
24052
24053 * src/conflicts.c (resolve_sr_conflict):
24054 Remove use of alloca.
24055
240561995-06-01 Jim Meyering <meyering@gnu.org>
24057
24058 * doc/bison.texinfo: *** empty log message ***
24059
240601995-05-06 Richard Stallman <rms@gnu.org>
24061
24062 * src/bison.s1: Comment change.
24063
240641995-05-06 Richard Stallman <rms@gnu.org>
24065
24066 * bison.simple: Comment change.
24067
240681995-05-03 Richard Stallman <rms@gnu.org>
24069
24070 * src/version.c: Version now 1.24.
24071
24072 * src/bison.s1: Change distribution terms.
24073
24074 * src/version.c: Version now 1.23.
24075
240761995-05-03 Richard Stallman <rms@gnu.org>
24077
24078 * doc/bison.texinfo:
24079 Rewrite "Conditions for Using Bison".
24080 Update version to 1.24.
24081
240821995-05-03 Richard Stallman <rms@gnu.org>
24083
24084 * bison.simple: Change distribution terms.
24085
240861995-02-23 Richard Stallman <rms@gnu.org>
24087
24088 * src/files.c: Test __VMS_POSIX as well as VMS.
24089
240901995-02-14 Jim Meyering <meyering@gnu.org>
24091
24092 * src/bison.s1 (__yy_memcpy):
24093 Renamed from __yy_bcopy to avoid
24094 confusion. Reverse FROM and TO arguments to be consistent with
24095 those of memcpy.
24096
240971995-02-14 Jim Meyering <meyering@gnu.org>
24098
24099 * bison.simple (__yy_memcpy):
24100 Renamed from __yy_bcopy to avoid
24101 confusion. Reverse FROM and TO arguments to be consistent with
24102 those of memcpy.
24103
241041994-11-10 David J. MacKenzie <djm@gnu.org>
24105
24106 * NEWS: reformat
24107
24108 * NEWS: New file.
24109
24110 * Makefile.in (DISTFILES): Include NEWS.
24111
24112 * Makefile.in (DISTFILES):
24113 Include install-sh, not install.sh.
24114
24115 * configure.in: Update to Autoconf v2 macro names.
24116
241171994-10-05 David J. MacKenzie <djm@gnu.org>
24118
24119 * Makefile.in: fix typo
24120
24121 * Makefile.in (prefix, exec_prefix):
24122 Let configure set them.
24123
241241994-09-28 David J. MacKenzie <djm@gnu.org>
24125
24126 * Makefile.in: Set datadir to $(prefix)/share.
24127
241281994-09-15 Richard Stallman <rms@gnu.org>
24129
24130 * src/bison.s1:
24131 Update copyright notice and GPL version.
24132
241331994-09-15 Richard Stallman <rms@gnu.org>
24134
24135 * bison.simple:
24136 Update copyright notice and GPL version.
24137
241381994-07-12 Richard Stallman <rms@gnu.org>
24139
24140 * src/reduce.c, src/reader.c:
24141 entered into RCS
24142
241431994-05-05 David J. MacKenzie <djm@gnu.org>
24144
24145 * Makefile.in: entered into RCS
24146
241471994-03-26 Richard Stallman <rms@gnu.org>
24148
24149 * src/bison.s1: entered into RCS
24150
241511994-03-26 Richard Stallman <rms@gnu.org>
24152
24153 * bison.simple: entered into RCS
24154
241551994-03-25 Richard Stallman <rms@gnu.org>
24156
24157 * src/main.c: entered into RCS
24158
241591994-03-24 Richard Stallman <rms@gnu.org>
24160
24161 * src/conflicts.c: entered into RCS
24162
241631994-01-02 Richard Stallman <rms@gnu.org>
24164
24165 * Makefile.in: *** empty log message ***
24166
241671993-11-21 Richard Stallman <rms@gnu.org>
24168
24169 * src/bison.s1: *** empty log message ***
24170
241711993-11-21 Richard Stallman <rms@gnu.org>
24172
24173 * doc/bison.texinfo: entered into RCS
24174
24175 * doc/bison.texinfo: *** empty log message ***
24176
241771993-11-21 Richard Stallman <rms@gnu.org>
24178
24179 * bison.simple: *** empty log message ***
24180
241811993-10-25 David J. MacKenzie <djm@gnu.org>
24182
24183 * doc/bison.texinfo: *** empty log message ***
24184
241851993-10-19 Richard Stallman <rms@gnu.org>
24186
24187 * src/bison.s1: *** empty log message ***
24188
241891993-10-19 Richard Stallman <rms@gnu.org>
24190
24191 * bison.simple: *** empty log message ***
24192
241931993-10-14 Richard Stallman <rms@gnu.org>
24194
24195 * src/bison.s1: *** empty log message ***
24196
241971993-10-14 Richard Stallman <rms@gnu.org>
24198
24199 * bison.simple: *** empty log message ***
24200
242011993-09-14 David J. MacKenzie <djm@gnu.org>
24202
24203 * doc/bison.texinfo: *** empty log message ***
24204
242051993-09-13 Noah Friedman <friedman@gnu.org>
24206
24207 * Makefile.in: *** empty log message ***
24208
242091993-09-10 Richard Stallman <rms@gnu.org>
24210
24211 * src/conflicts.c: *** empty log message ***
24212
24213 * src/system.h: entered into RCS
24214
242151993-09-10 Richard Stallman <rms@gnu.org>
24216
24217 * doc/bison.1: entered into RCS
24218
242191993-09-06 Noah Friedman <friedman@gnu.org>
24220
24221 * src/version.c: entered into RCS
24222
242231993-09-06 Noah Friedman <friedman@gnu.org>
24224
24225 * Makefile.in: *** empty log message ***
24226
242271993-07-30 David J. MacKenzie <djm@gnu.org>
24228
24229 * Makefile.in: *** empty log message ***
24230
242311993-07-24 Richard Stallman <rms@gnu.org>
24232
24233 * src/bison.s1: *** empty log message ***
24234
242351993-07-24 Richard Stallman <rms@gnu.org>
24236
24237 * bison.simple: *** empty log message ***
24238
242391993-07-08 David J. MacKenzie <djm@gnu.org>
24240
24241 * Makefile.in: *** empty log message ***
24242
242431993-07-04 Richard Stallman <rms@gnu.org>
24244
24245 * src/bison.s1: *** empty log message ***
24246
242471993-07-04 Richard Stallman <rms@gnu.org>
24248
24249 * bison.simple: *** empty log message ***
24250
242511993-06-26 David J. MacKenzie <djm@gnu.org>
24252
24253 * src/getargs.c: entered into RCS
24254
242551993-06-26 David J. MacKenzie <djm@gnu.org>
24256
24257 * doc/bison.texinfo: *** empty log message ***
24258
24259 * doc/bison.1: New file.
24260
242611993-06-25 Richard Stallman <rms@gnu.org>
24262
24263 * src/getargs.c: New file.
24264
242651993-06-16 Richard Stallman <rms@gnu.org>
24266
24267 * src/bison.s1: *** empty log message ***
24268
242691993-06-16 Richard Stallman <rms@gnu.org>
24270
24271 * bison.simple: *** empty log message ***
24272
242731993-06-03 Richard Stallman <rms@gnu.org>
24274
24275 * src/bison.s1: New file.
24276
242771993-06-03 Richard Stallman <rms@gnu.org>
24278
24279 * doc/bison.texinfo: *** empty log message ***
24280
242811993-06-03 Richard Stallman <rms@gnu.org>
24282
24283 * bison.simple: New file.
24284
242851993-05-19 Richard Stallman <rms@gnu.org>
24286
24287 * doc/bison.texinfo: New file.
24288
242891993-05-07 Noah Friedman <friedman@gnu.org>
24290
24291 * Makefile.in: *** empty log message ***
24292
242931993-04-28 Noah Friedman <friedman@gnu.org>
24294
24295 * src/reader.c: *** empty log message ***
24296
242971993-04-23 Noah Friedman <friedman@gnu.org>
24298
24299 * src/alloc.h: entered into RCS
24300
243011993-04-20 David J. MacKenzie <djm@gnu.org>
24302
24303 * src/version.c: *** empty log message ***
24304
24305 * src/files.c, src/allocate.c:
24306 entered into RCS
24307
24308 * src/reader.c: *** empty log message ***
24309
24310 * src/lex.c: entered into RCS
24311
24312 * src/conflicts.c: New file.
24313
24314 * src/symtab.c: entered into RCS
24315
24316 * src/alloc.h: New file.
24317
24318 * src/LR0.c: entered into RCS
24319
243201993-04-18 Noah Friedman <friedman@gnu.org>
24321
24322 * src/reader.c: New file.
24323
24324 * src/version.c: *** empty log message ***
24325
243261993-04-18 Noah Friedman <friedman@gnu.org>
24327
24328 * Makefile.in: *** empty log message ***
24329
243301993-04-17 Noah Friedman <friedman@gnu.org>
24331
24332 * Makefile.in: *** empty log message ***
24333
243341993-04-15 Richard Stallman <rms@gnu.org>
24335
24336 * src/main.c, src/files.c:
24337 New file.
24338
243391993-04-15 Noah Friedman <friedman@gnu.org>
24340
24341 * configure.in: entered into RCS
24342
24343 * configure.in: *** empty log message ***
24344
24345 * configure.in: New file.
24346
243471993-04-14 Richard Stallman <rms@gnu.org>
24348
24349 * Makefile.in: New file.
24350
243511993-04-13 Richard Stallman <rms@gnu.org>
24352
24353 * src/version.c: New file.
24354
243551993-03-25 Richard Stallman <rms@gnu.org>
24356
24357 * src/output.c: entered into RCS
24358
243591992-09-25 Richard Stallman <rms@gnu.org>
24360
24361 * configure.bat: entered into RCS
24362
243631992-06-22 Richard Stallman <rms@gnu.org>
24364
24365 * src/vmsgetargs.c: entered into RCS
24366
243671992-06-22 Richard Stallman <rms@gnu.org>
24368
24369 * doc/bison.rnh: entered into RCS
24370
243711992-04-20 David J. MacKenzie <djm@gnu.org>
24372
24373 * README: entered into RCS
24374
243751992-01-22 Richard Stallman <rms@gnu.org>
24376
24377 * src/machine.h: entered into RCS
24378
243791991-12-21 Richard Stallman <rms@gnu.org>
24380
24381 * src/lalr.c, src/closure.c:
24382 entered into RCS
24383
243841991-12-20 Richard Stallman <rms@gnu.org>
24385
24386 * src/state.h: entered into RCS
24387
243881991-12-18 Richard Stallman <rms@gnu.org>
24389
24390 * src/print.c, src/nullable.c, src/derives.c:
24391 entered into RCS
24392
243931991-11-03 David J. MacKenzie <djm@gnu.org>
24394
24395 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24396 entered into RCS
24397
243981988-09-09 Richard Stallman <rms@gnu.org>
24399
24400 * src/bison.hairy: entered into RCS
24401
244021987-12-16 Richard Stallman <rms@gnu.org>
24403
24404 * REFERENCES: entered into RCS
dc546b0f 24405
f294a2c2 24406
04098407 24407 -----
f294a2c2 24408
04098407 24409 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e021191b
JD
24410 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
24411 2008, 2009 Free Software Foundation, Inc.
f294a2c2 24412
04098407
PE
24413 Copying and distribution of this file, with or without
24414 modification, are permitted provided the copyright notice and this
24415 notice are preserved.