]> git.saurik.com Git - bison.git/blame - ChangeLog
tests: portability fix.
[bison.git] / ChangeLog
CommitLineData
3bed3a75
AD
12009-08-26 Akim Demaille <demaille@gostai.com>
2
3 tests: portability fix.
4 * tests/input.at (Bad escapes in literals): Don't expect "echo
5 '\0'" to output \ then 0.
6
aa0cb40d
JD
72009-08-26 Joel E. Denny <jdenny@clemson.edu>
8
9 Actually handle the yytable zero value correctly this time.
10 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
11 zero values in the YYTABLE comments.
12 * data/glr.c (yytable_value_is_error): Don't check for zero
13 value.
14 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
15 * data/yacc.c (yytable_value_is_error): Likewise.
16 * data/lalr1.java (yy_table_value_is_error_): Likewise.
17 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
18 * src/tables.h: In header comments, explain why it's useless to
19 check for a zero value in yytable.
20
f2b30bdf
JD
212009-08-25 Joel E. Denny <jdenny@clemson.edu>
22
23 More fixes related to last two patches.
24 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
25 comments: zero indicates syntax error not default action.
26 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
27 defined.
28 * data/glr.c (yyis_pact_ninf): Rename to...
29 (yypact_value_is_default): ... this.
30 (yyisDefaultedState): Update for rename.
31 (yyis_table_ninf): Rename to...
32 (yytable_value_is_error): ... this, and check for value zero
33 besides just YYTABLE_NINF.
34 (yygetLRActions): Check for default value from yypact. It
35 appears that this check is always performed before this function
36 is invoked, and so adding the check here is probably redundant.
37 However, the code may evolve after this subtlety is forgotten.
38 Also, update for rename to yytable_value_is_error. Because that
39 macro now checks for zero, a different but equivalent branch of
40 the if-then-else here is evaluated.
41 (yyreportSyntaxError): Update for rename to
42 yytable_value_is_error. The zero condition was mishandled
43 before.
44 (yyrecoverSyntaxError): Update for renames. No behavioral
45 changes.
46 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
47 New function.
48 (yy_table_value_is_error_): New function.
49 (parse): Use new functions where possible. No behavioral
50 changes.
51 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
52 The zero condition was mishandled before.
53 * data/yacc.c (yyis_pact_ninf): Rename to...
54 (yypact_value_is_default): ... this.
55 (yyis_table_ninf): Rename to...
56 (yytable_value_is_error): ... this, and check for value zero
57 besides just YYTABLE_NINF.
58 (yysyntax_error): Update for rename to yytable_value_is_error.
59 The zero condition was mishandled before.
60 (yyparse): Update for renames. No behavioral changes.
61 * src/tables.h: Improve comments about yypact, yytable, etc.
62 more. Most importantly, say yytable value of zero means syntax
63 error not default action.
64
53f036ce
JD
652009-08-25 Joel E. Denny <jdenny@clemson.edu>
66
67 Fix %error-verbose for conflicts resolved by %nonassoc.
68 * NEWS (2.5): Document.
69 * data/glr.c (yyreportSyntaxError): Fix this by checking
70 yyis_table_ninf.
71 * data/yacc.c (yysyntax_error): Likewise.
72 * data/lalr1.cc (yysyntax_error_): Fix this by checking
73 yytable_ninf_.
74 * data/lalr1.java (yysyntax_error): Likewise.
75 * tests/conflicts.at (%nonassoc and eof): Update expected output
76 and remove FIXME.
77
87412882
JD
782009-08-25 Joel E. Denny <jdenny@clemson.edu>
79
80 Some code and documentation improvements.
81 * data/c.m4 (b4_table_value_equals): New macro to capture
82 some repeated code.
83 * data/glr.c (yyis_pact_ninf): Use it here.
84 (yyis_table_ninf): Likewise.
85 (yyreportSyntaxError): Improve internal comments.
86 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
87 Use it everywhere possible.
88 (yyis_table_ninf): Likewise.
89 (yysyntax_error): Improve internal comments.
90 * data/lalr1.cc (yysyntax_error_): Likewise.
91 * data/lalr1.java (yysyntax_error): Likewise.
92 * src/tables.h: Improve comments about yypact, yytable, etc.
93
e6c849d8
JD
942009-08-21 Joel E. Denny <jdenny@clemson.edu>
95
96 Use locale when quoting.
97 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
98 quote rather than implementing quoting here.
99
d8911864
EB
1002009-08-20 Eric Blake <ebb9@byu.net>
101
b0778bdd
EB
102 Make previous patch more robust.
103 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
104 argmatch.h.
105 (output_skeleton): Use it.
106 Suggested by Akim Demaille.
107
d8911864
EB
108 Import latest m4/m4.m4.
109 * submodules/autoconf: Update to autoconf 2.64.
110 * configure.ac (M4_GNU_OPTION): New define.
111 * src/output.c (output_skeleton): Use it to resolve FIXME.
112 * NEWS: Mention this.
113
c2724603
JD
1142009-08-19 Joel E. Denny <jdenny@clemson.edu>
115
116 Fix complaints about escape sequences.
117 Discussed starting at
118 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
119 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
120 For a \0 and similar escape sequences meaning the null
121 character, report an invalid escape sequence instead of an
122 invalid null character because the latter does not actually
123 appear in the user's input.
124 In all escape sequence complaints, don't escape the initial
125 backslash, and don't quote when the sequence appears at the end
126 of the complaint line unless there's whitespace that quotearg
127 won't escape.
128 Consistently say "invalid" not "unrecognized".
129 Consistently prefer "empty character literal" over "extra
130 characters in character literal" warning for invalid escape
131 sequences; that is, consistently discard those sequences.
132 * tests/input.at (Bad escapes in literals): New.
133
17aed602
AD
1342009-08-19 Akim Demaille <demaille@gostai.com>
135
136 doc: fixes.
137 * doc/bison.texinfo: Fix minor Texinfo errors.
138
9142239a
AD
1392009-08-19 Akim Demaille <demaille@gostai.com>
140
141 tests: distcc compliance.
142 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
143 error messages from the output.
144
171ad99d
AD
1452009-08-19 Akim Demaille <demaille@gostai.com>
146
147 variables: simplify the upgrade of namespace into api.namespace.
148
149 This patch simplifies "variables: rename namespace as
150 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
151 Suggested by Joel E. Denny in
152 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
153
154 * src/muscle-tab.c (muscle_percent_variable_update): New.
155 (muscle_percent_define_insert): Use it in replacement of the
156 previous tr invocation.
157 Remove variable_tr, no longer needed.
158 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
159 Remove.
160 * data/c++.m4: No longer handle namespace -> api.namespace.
161 * tests/input.at (%define backward compatibility): Check that
162 namespace is treated as api.namespace.
163
d59e456d
AD
1642009-08-19 Akim Demaille <demaille@gostai.com>
165
166 doc: %initial-action to initialize yylloc.
167 Reported by Bill Allombert.
168 * doc/bison.texinfo: Set fill-column to 76.
169 (Location Type): Document the use of %initial-action to initialize
170 yylloc.
171
ceb8b8e6
AD
1722009-08-19 Akim Demaille <demaille@gostai.com>
173
174 lalr1.cc: use state_type.
175 * data/lalr1.cc (yysyntax_error_): Use state_type.
176 Move argument names into yy*.
177
7580c379
AD
1782009-08-19 Akim Demaille <demaille@gostai.com>
179
180 lalr1.cc: get rid of yyparse's yystate.
181 yystate and yystack_[0].state are equal, keep only the latter.
182 The former was also used as a temporary variable to compute the
183 post-reduction state. Move this computation into an auxiliary
184 function.
185
186 * data/glr.c (yyLRgotoState): Fuse variable definition and first
187 assignment.
188 * data/lalr1.cc (yy_lr_goto_state_): New.
189 (yyparse): Use it.
190 Replace remaining uses of yystate by yystate_[0].state.
191 Remove the former.
192
c4dc4c46
AD
1932009-08-19 Akim Demaille <demaille@gostai.com>
194
195 lalr1.cc: destroy $$ when YYERROR is called.
196 * data/lalr1.cc (yyreduce): Compute the resulting state before
197 running the user action so that yylhs is a valid symbol.
198 (yyerrorlab): Since yylhs is complete (it knows its type), we can
199 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
200 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
201
c67e466f
JD
2022009-08-18 Joel E. Denny <jdenny@clemson.edu>
203
204 maint: update for gnulib's recent update-copyright changes
205 * gnulib: Update.
206 * .x-update-copyright (COPYING): Add as it's no longer implied
207 when .x-update-copyright is present.
208 * cfg.mk (update-copyright-local): Remove, now ignored.
209 (update-copyright): Declare update-b4-copyright as a dependency.
210
af6d2358
AD
2112009-08-17 Akim Demaille <demaille@gostai.com>
212
213 build: require gettext 0.17.
214
215 Suggested by Bruno Haible.
216 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
217 * configure.ac: require gettext 0.17 to ensure compatibility with
218 gnulib.
219
91a2b9b1
AD
2202009-08-17 Akim Demaille <demaille@gostai.com>
221
222 build: lower gettext requirements.
223
224 Bison was uselessly requiring the formatstring macros from
225 gettext, which resulted in mo files not being installed on systems
226 that perfectly supported Bison mo files. Lower the requirement.
227 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
228
b0778bdd
EB
229 * configure.ac: Require need-ngettext instead of
230 need-formatstring-macros.
231 Reported by Martin Jabocs.
232 Suggested by Bruno Haible.
233 * INSTALL: Restructure.
234 (Internationalization): New.
91a2b9b1 235
585935e8
JD
2362009-08-14 Joel E. Denny <jdenny@clemson.edu>
237
238 maint: fix use of copyright year intervals.
239 * gnulib: Update.
240 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
241 as now recommended in gnulib/NEWS.
242 * build-aux/update-b4-copyright: Fix.
243 * cfg.mk (update-copyright-env): Configure update-copyright.
244
83b60c97
JD
2452009-08-13 Joel E. Denny <jdenny@clemson.edu>
246
247 Make it easier to write deterministic tests.
248 Continues Akim's work from his 2009-06-10 commits.
249 * src/reader.c (check_and_convert_grammar): Don't add any
250 symbols after the first symbols_do invocation.
251 * src/symtab.c (symbols_sorted): New static global.
252 (user_token_number_redeclaration): Update comments.
253 (symbol_from_uniqstr): If a new symbol is being created, assert
254 that symbols_sorted hasn't been allocated yet.
255 (symbols_free): Free symbols_sorted.
256 (symbols_cmp, symbols_cmp_qsort): New functions.
257 (symbols_do): Sort symbol_table into symbols_sorted on first
258 invocation.
259 * tests/input.at (Numbered tokens): Recombine tests now that the
260 output should be deterministic across multiple numbers.
261
28169bab
AD
2622009-08-12 Akim Demaille <demaille@gostai.com>
263
264 tests: GCC 4.5 compliance.
265 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
266 messages about #error.
267
9f14e187
AD
2682009-08-12 Akim Demaille <demaille@gostai.com>
269
270 build: fix the generation of the documentation.
271 Some of our targets use "bison --help", but they can't depend on
272 "bison" itself (to avoid additional requirements on the user), so
273 they used to call "make src/bison" in the commands. Then
274 concurrent builds may fail: one make might be aiming one of its
275 jobs at compiling src/bison, and another job at generating the man
276 page. If the latter is faster than the former, then we have two
277 makes that concurrently try to compile src/bison.
278
279 This might also be a more convincing explanation for the failure
280 described in the patch "build: fix paths".
281
282 * Makefile.am (SUFFIXES): Initialize.
283 * build-aux/move-if-change: New, symlink to gnulib's.
284 * build-aux/local.mk: Ship it.
285 * doc/common.x: Remove, merged into...
286 * doc/bison.x: here.
287 * doc/local.mk (doc/bison.help): New.
288 ($(CROSS_OPTIONS_TEXI)): Depend on it.
289 Use src/bison.
290 (.x.1): Replace with...
291 (doc/bison.1): this explicit, simpler, target.
292 (common_dep): Remove, inlined where appropriate.
293 (SUFFIXES, PREPATH): Remove, unused.
294
d1b55e81
AD
2952009-08-12 Akim Demaille <demaille@gostai.com>
296
297 gnulib: improve prefixing.
298 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
299 change the value of...
300 (gl_LIBOBJS): this.
301 Adjust more variables.
302 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
303 gl_LIBOBJS.
304 (prefix): Also transform rules whose targets have slashes.
305 Use $prefix liberally.
306 Map @MKDIR_P@ to $(MKDIR_P).
307 Prefix directories that are mkdir'd.
308
838205d5
AD
3092009-08-12 Akim Demaille <demaille@gostai.com>
310
311 build: fix paths.
312 When using $(top_builddir) inconsistently, Make (including GNU
313 Make) is sometimes confused. As a result it may want to build
314 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
315 file, different names) concurrently, which, amusingly enough,
316 might end with:
317
318 ranlib lib/libbison.a
319 ranlib lib/libbison.a
320 make[2]: *** [lib/libbison.a] Segmentation fault
321
322 on OS X.
323
324 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
325 needed.
326
67af7198
AD
3272009-08-12 Akim Demaille <demaille@gostai.com>
328
329 distcheck: fix.
330
b0778bdd 331 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
67af7198 332
c467dc42
JD
3332009-08-10 Joel E. Denny <jdenny@clemson.edu>
334
335 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
336
dfaa4860
JD
3372009-08-10 Joel E. Denny <jdenny@clemson.edu>
338
339 Miscellaneous code readability improvements.
340
341 * src/reader.c (reader): Move %define front-end variable
342 defaults and checking into...
343 (prepare_percent_define_front_end_variables): ... this new
344 function.
345
346 * src/scan-gram.l (INITIAL): For consistency with string
347 literals, don't store open quote on character literal. It's
348 discarded before returning anyway.
349 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
350 Make length test more readable, and make the character stored
351 for an empty literal more obvious while consistent with the
352 previous behavior.
353
354 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
355 USER_NUMBER_HAS_STRING_ALIAS throughout.
356 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
357 that is repeated in symtab.h. Improve argument names to make it
358 clear which side of the symbol-string alias pair is which.
359 (symbol_check_alias_consistency): Improve local variable names
360 for the same purpose.
361 * src/symtab.h (struct symbol): Make comments about aliases
362 clearer.
363 (symbol_make_alias): Improve comments and argument name.
364 * src/output.c (token_definitions_output): Update for rename to
365 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
366
ce268795
AR
3672009-08-08 Alex Rozenman <rozenman@gmail.com>
368
369 Convert "misleading reference" messages to warnings.
370 * src/scan-code.l: New function 'show_sub_messages', more
371 factoring.
372 * tests/named-ref.at: Adjust tests.
373
401b73af
JD
3742009-08-06 Joel E. Denny <jdenny@clemson.edu>
375
376 maint: run "make update-copyright"
377
a1a9422d
JD
3782009-08-06 Joel E. Denny <jdenny@clemson.edu>
379
380 maint: make update-b4-copyright easier to use
381 * build-aux/update-b4-copyright: In warnings, report line
382 numbers rather than character positions.
383 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
384 that update-copyright runs it.
385 * gnulib: Update.
386
0b61a8ec
JD
3872009-08-05 Joel E. Denny <jdenny@clemson.edu>
388
389 maint: clean up update-b4-copyright code
390 * build-aux/update-b4-copyright: Do not accept 2-digit
391 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
392 Don't accept a `[' in a b4_copyright argument.
393 Format code more consistently.
394 Don't assume b4*copyright never occurs.
395
269e222e
JD
3962009-08-04 Joel E. Denny <jdenny@clemson.edu>
397
398 maint: automate b4_copyright updates.
399 * Makefile.am (update-b4-copyright): New target rule.
400 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
401 * build-aux/update-b4-copyright: New.
402 * data/yacc.c: Remove stray characters around b4_copyright
403 invocations.
404
35905f2b
JD
4052009-08-04 Joel E. Denny <jdenny@clemson.edu>
406
407 maint: automate annual package-wide copyright-year update.
408 * .x-update-copyright: New.
409 * Makefile.am (EXTRA_DIST): Remove maint.mk.
410 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
411 update-copyright. Remove gnumakefile, which is implied by
412 maintainer-makefile.
413 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
414 * gnulib: Update.
415 * maint.mk: Remove, now copied from gnulib.
416 * examples/extexi: Add missing "(C)" in copyright statement so
417 update-copyright can recognize it.
418 * src/LR0.h: Likewise.
419 * src/print.h: Likewise.
420 * src/print_graph.h: Likewise.
421 * src/gram.c: Add missing comma in copyright statement.
422 * src/gram.h: Likewise.
423
b30e18dc
JD
4242009-08-04 Joel E. Denny <jdenny@clemson.edu>
425
426 Fix "make distcheck".
427 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
428 of just calc.stamp.
429
8d90395d
JD
4302009-08-01 Joel E. Denny <jdenny@clemson.edu>
431
432 Pacify "gcc -Wunused" for the input function from Flex.
433 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
434 and later.
435 * src/scan-code.l: Add "%option noinput", which I cannot find in
436 the Flex manual, but which Flex has supported since at least as
437 far back as 2.5.4. However, if any of our developers still use
438 Flex 2.5.4, they'll need to stop configuring with
439 --enable-gcc-warnings because "%option noinput" didn't work
440 correctly until Flex 2.5.6.
441 * src/scan-gram.l: Likewise.
442 * src/scan-skel.l: Likewise.
443
ba4184ec
AR
4442009-07-31 Alex Rozenman <rozenman@gmail.com>
445
446 Fix --enable-gcc-warnings problems.
447 * src/reader.c: Adjust variable names.
448 * src/scan-code.l: Fix prototypes and adjust names.
449 * src/named-ref.c: Remove redundant "if".
450
91a2af97
JD
4512009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
452
453 Fix a --enable-gcc-warnings problem.
454 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
455 variable.
456
3208e3f4
JD
4572009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
458
459 Warn about character literals not of length one.
460 * NEWS (2.5): Document.
461 * src/scan-gram.l (INITIAL): Remove comment that we don't check
462 the length.
463 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
464 * tests/input.at (Bad character literals): New test group.
465
5add20ab 4662009-07-24 Alex Rozenman <rozenman@gmail.com>
13cdf208
AR
467
468 Fix some memory leaks.
469 * src/named-ref.c: Add a pointer check (named_ref_free).
470 * src/scan-code.l: New function (variant_table_free). Called in
471 code_scanner_free.
472 * src/symlist.c: Call to named_ref_free (symbol_list_free).
473
e459fb0e
JD
4742009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
475
476 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
477
c4be5517
JD
4782009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
479
480 Some M4 cleanup in the testsuite.
481 Suggested by Eric Blake at
482 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
483 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
484 complicate the code by distinguishing between a missing value
485 and an empty string value for an optional argument. This fix is
486 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
487 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
488 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
489 arguments are not needed because of the following changes.
490 Fix stale comments.
491 Bison developers should use GNU M4 and should not use
492 POSIXLY_CORRECT when building the test suite, so do not
493 complicate the code by avoiding $10 and above.
494 Do not quote an empty string value for an optional argument, and
495 do not distinguish between a missing value and an empty string
496 value.
497
feeb56cd
JD
4982009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
499
500 Revert unnecessary column realignment in --help output.
501 Reported by Akim Demaille at
502 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
503 * src/getargs.c (usage): Here.
504
5add20ab 5052009-07-04 Alex Rozenman <rozenman@gmail.com>
629e4def
AR
506
507 Alphabetical order in src/local.mk.
508 * src/local.mk: Adjust.
509
5add20ab 5102009-07-04 Alex Rozenman <rozenman@gmail.com>
872b52bc
AR
511
512 Style changes and factoring.
513 * src/named-ref.h: Add comments.
514 * src/parse-gram.y: Readability and style changes.
515 * src/reader.c: Factoring: assign_named_ref function.
516 * src/scan-code.l: Factoring and style changes. Rename
517 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
518 Use "unsigned" type for variant index. Improve readablity.
519 * src/scan-gram.l: Change error messages and add comments.
520 * src/symlist.h: symbol_list_null: New function decl.
521 * src/symlist.c: symbol_list_null: Implement here.
522 * tests/named-refs.at: Adjust for new error messages.
523
83ea2423
EB
5242009-06-29 Eric Blake <ebb9@byu.net>
525
526 scan-code: avoid compiler warnings
527 * src/scan-code.l (parse_named_ref): Use correct specifiers.
528
5ece73ea
AD
5292009-06-29 Akim Demaille <demaille@gostai.com>
530
531 build: avoid concurrent extraction of calc++.
532 * examples/calc++/Makefile.am (calc.stamp): New.
533 Depend on it to create the sources of calc++ so that concurrent
534 builds don't launch several "extexi" in parallel.
535 Not only this is inefficient, this also builds incorrect sources
536 with several extractions mixed together.
537
ad597a78
AD
5382009-06-29 Akim Demaille <demaille@gostai.com>
539
540 parse.error: fix.
541 * data/bison.m4: Move code related to specific variables after the
542 definition of the variable-maintaining macros so that we don't
543 "invoke" b4_percent_define_check_values before it is defined.
544
31b850d2
AD
5452009-06-29 Akim Demaille <demaille@gostai.com>
546
547 variables: parse.error
548
549 Implement, document, and test the replacement of %error-verbose
550 by %define parse.error "verbose".
551 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
552 values of the parse.error variable.
553 Make "simple" its default value.
554 Check the valid values.
555 * src/parse-gram.y: Use %define parse.error.
556 (PERCENT_ERROR_VERBOSE): New token.
557 Support it.
558 * src/scan-gram.l: Support %error-verbose.
559
560 * doc/bison.texinfo (Decl Summary): Replace the documentation of
561 %define error-verbose by that of %define parse.error.
562 * NEWS: Document it.
563
564 * tests/actions.at, tests/calc.at: Use parse.error instead of
565 %error-verbose.
566
b9f1d9a4
AR
5672009-06-27 Alex Rozenman <rozenman@gmail.com>
568
569 Implement support for named symbol references.
570 * src/parse-gram.y: Add new syntax (named_ref.opt).
571 * src/reader.c: Store named refs in symbol lists.
572 * src/reader.h: New argument for symbol_append and
573 action_append functions.
574 * src/scan-code.h: Add new field (named_ref) into
575 code_props data structure. Keeps named ref of midrule
576 actions.
577 * src/scan-code.l: Support for named refs in semantic
578 action code. New function 'parse_named_ref'.
579 * src/scan-gram.l: Support bracketed id.
580 * src/symlist.c: Store named refs in symbol lists.
581 * src/symlist.h: New field in symbol list: named_ref.
582 * src/named-ref.h: New file, a struct for named_ref.
583 * src/named-ref.cp: New file, named_ref_new function.
584 * src/local.mk: Add two new files.
585 * tests/testsuite.at: Include new test group:
586 * tests/named-refs.at: this new file.
587
b5c212b6
AD
5882009-06-25 Akim Demaille <demaille@gostai.com>
589
590 hash: check insertion for memory exhaustion.
591 * src/uniqstr.c (uniqstr_new): New.
592
67501061
AD
5932009-06-24 Akim Demaille <demaille@gostai.com>
594
595 variables: rename namespace as api.namespace.
596 Discussed in
597 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
598
599 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
600 New.
601 (b4_percent_define_use): New.
602 Use it where applicable.
603 * data/c++.m4: Replace uses of the variable "namespace" by
604 "api.namespace".
605 Default the latter to the former.
606 * doc/bison.texinfo (Decl Summary): Document "namespace" as
607 obsolete.
608 Document api.namespace.
609 Use @samp to document %define uses, keep @code for identifiers.
610 * NEWS: Likewise.
611 * tests/c++.at, tests/input.at: Test api.namespace instead of
612 namespace. (The tests passed with namespace.)
613
41976786
AD
6142009-06-11 Akim Demaille <demaille@gostai.com>
615
616 style changes.
617 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
618 * src/print-xml.c: Style changes.
619 * tests/conflicts.at: Comment changes.
620
44bb9084
AD
6212009-06-11 Akim Demaille <demaille@gostai.com>
622
623 xml: beware of user strings used to give a %prec to rules.
624 * tests/conflicts.at (%prec with user strings): New.
625 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
626 XML output.
627
04d1e39d
AD
6282009-06-11 Akim Demaille <demaille@gostai.com>
629
630 hash: check insertion for memory exhaustion.
631 * src/muscle-tab.c (muscle_insert, muscle_grow)
632 * src/state.c (state_hash_insert): Check the return value of
633 hash_insert.
634
a8873669
AD
6352009-06-11 Akim Demaille <demaille@gostai.com>
636
637 tests: honor TESTSUITEFLAGS in every check target.
638 * tests/local.mk (RUN_TESTSUITE): New.
639 (check-local, installcheck-local, maintainer-check-g++)
640 (maintainer-check-posix, maintainer-check-valgrind): Use it.
641
8893145a
AD
6422009-06-10 Akim Demaille <demaille@gostai.com>
643
644 deterministic test suite.
645 Some consistency checks on symbols are performed after all the
646 symbols were read, by an iteration over the symbol table. This
647 traversal is nondeterministic, which can be a problem for test
648 cases.
649 Avoid this.
650 Addresses another form of nondeterminism reported by Joel E. Denny.
651 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
652
653 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
654 test in two.
655 Use different file names for the three tests to make the
656 maintenance easier.
657
92d7a23a
AD
6582009-06-10 Akim Demaille <demaille@gostai.com>
659
660 gnulib: update.
b0778bdd
EB
661 * gnulib: Update to latest.
662 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
663 * m4/.gitignore: Regen.
664 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
665 Call xalloc_die on hash_insert failures.
666 Requested by the new __warn_unused_result__ attribute of
667 hash_insert.
92d7a23a 668
12cf133f
AD
6692009-06-10 Akim Demaille <demaille@gostai.com>
670
671 deterministic user-token-number redeclaration errors.
672 Address nondeterminism reported by Joel E. Denny.
673 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
674
675 * src/uniqstr.h: Comment changes.
676 * src/location.h (boundary_cmp, location_cmp): New.
677 * src/symtab.c (user_token_number_redeclaration): New.
678 (symbol_translation): Use it.
679 * tests/input.at (Numbered tokens): Adjust the expected output.
680
796a2b0a
AD
6812009-05-25 Akim Demaille <demaille@gostai.com>
682
683 build: avoid ignored errors.
684 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
685 errors, they pollute the output.
686
0b6d43c5
JD
6872009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
688
689 Convert multiple variable definition warnings to complaints.
690 * NEWS (2.5): Add a new entry for that change.
691 * doc/bison.texinfo (Decl Summary): Update %define entry.
692 (Bison Options): Update -D/--define/-F/--force-define entry.
693 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
694 * src/muscle-tab.h (muscle_percent_define_insert): Update
695 comments.
696 * tests/input.at (`%define errors'): Update.
697 (`%define, --define, --force-define'): Update.
698
de5ab940
JD
6992009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
700
701 -F/--force-define and relative %define/-D/--define priorities.
702 * NEWS (2.5): Add documentation to -D/--define entry.
703 * build-aux/cross-options.pl: Hard-code association of
704 --force-define with %define.
705 * doc/bison.texinfo (Decl Summary): In %define entry,
706 cross-reference command-line options.
707 (Bison Options): Add documentation to -D/--define entry.
708 (Option Cross Key): Widen column for --force-define row.
709 * src/getargs.c (usage): Document -F/--force-define. Realign
710 options in output.
711 (short_options, long_options, getargs): Parse -F/--force-define,
712 and update muscle_percent_define_insert invocations.
713 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
714 (muscle_percent_define_insert): Add argument with that type.
715 * src/muscle-tab.c (muscle_percent_define_insert): Implement
716 -F/--force-define behavior and priorities.
717 (muscle_percent_define_ensure): Update
718 muscle_percent_define_insert invocation.
719 * src/parse-gram.y (prologue_declaration): Update
720 muscle_percent_define_insert invocations.
721 * tests/input.at (`%define, --define'): Rename to...
722 (`%define, --define, --force-define'): ... this and extend.
723
f8e7258f
JD
7242009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
725
726 Update some comments to make sense for -D.
727 * data/bison.m4 (b4_check_user_names): In header comments, say
728 "user occurrence" instead of "grammar occurrence".
729 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
730 (muscle_percent_code_grow): Likewise just for consistency.
731
b987342b
JD
7322009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
733
734 * data/c++.m4 (b4_namespace_close): Simplify slightly.
735
4977e0a7
JD
7362009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
737
738 Handle a trailing `:' in a user-supplied C++ namespace better.
739 * data/c++.m4 (b4_namespace_close): Don't let it be printed
740 among the closing braces here. This fix might make the
741 generated code easier to debug, but otherwise it should be
742 insignificant because a trailing `:' is a C++ error already.
743
9b04dad7
AD
7442009-05-19 Akim Demaille <demaille@gostai.com>
745
746 remove useless variable.
747 * src/getargs.c (skeleton_arg): Remove now useless variable.
748 Should help the compiler see that this printf-like call is sane.
749
4c6622c2
AD
7502009-05-15 Akim Demaille <demaille@gostai.com>
751
752 Rename token.prefix as api.tokens.prefix.
753 Discussed here.
754 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
755
756 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
757 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
758 (token.prefix): Rename as...
759 (api.tokens.prefix): this.
760
3c248d70
AD
7612009-05-11 Akim Demaille <demaille@gostai.com>
762
763 doc: use C++ headers.
764 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
765 headers.
766
99c08fb6
AD
7672009-05-11 Akim Demaille <demaille@gostai.com>
768
769 doc: token.prefix
770 * doc/bison.simple (Decl Summary): Document token.prefix.
771 (Calc++ Parser): Various fixes.
772 Formatting changes.
773 Use token.prefix.
774 Introduce a macro TOKEN to shorten the code and make it more
775 readable.
776 (Calc++ Scanner): Adjust.
777 * NEWS (Variable token.prefix): New.
778
84a1cb5a
AD
7792009-05-04 Akim Demaille <demaille@gostai.com>
780
781 bison: catch bad symbol names.
782 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
783 * tests/input.at: Adjust.
784
cdf3f113
AD
7852009-05-04 Akim Demaille <demaille@gostai.com>
786
787 identifiers: dashes are letters.
788 Dashes can now start identifiers (symbols and directives).
84a1cb5a 789
cdf3f113
AD
790 * src/scan-gram.l ({letter}): Add dash.
791 ({id}): Remove it.
792 * tests/input.at (Symbols): Adjust.
793 Remove stray comment.
794 * tests/regression.at (Invalid inputs): Adjust error message.
795 * doc/bison.texinfo (Symbols): Update.
796
98a345a2
JD
7972009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
798
799 Declare %code to be a permanent feature.
800 * NEWS (2.4.2): Here.
801 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
802 experimental.
803 (Decl Summary): Likewise.
804
67212941
JD
8052009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
806
807 Convert underscores to dashes in some %define variable names.
808 For now, just api.push-pull and lr.keep-unreachable-states.
809 Maintain old names for backward compatibility.
810 * NEWS (2.5): Document.
811 * data/c.m4 (b4_identification): Update comment.
812 * data/yacc.c: Update access.
813 * doc/bison.texinfo: Update.
814 * etc/bench.pl.in (bench_push_parser): Update use.
815 * src/files.c (tr): Move to...
816 * src/getargs.c, src/getargs.h (tr): ... here because I can't
817 think of a better place to expose it. My logic is that, for all
818 uses of tr so far, command-line arguments can be involved, and
819 getargs.h is already included.
820 * src/main.c (main): Update access.
821 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
822 variable names to new variable names before assigning value.
823 * src/reader.c (reader): Update setting default.
824 * tests/calc.at: Update uses.
825 * tests/conflicts.at (Unreachable States After Conflict
826 Resolution): Update use.
827 * tests/input.at (%define enum variables): Update use.
828 (%define backward compatibility): New test group.
829 * tests/push.at: Update uses.
830 * tests/reduce.at: Update uses.
831 * tests/torture.at: Update uses.
832
ba5c6d94
JD
8332009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
834
835 Set all front-end %define defaults in one place.
836 * src/main.c (main): Move lr.keep_unreachable_states default...
837 * src/reader.c (reader): ... to here.
838
5bab9d08
JD
8392009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
840
841 Rename lr.default_reductions to lr.default-reductions.
842 * NEWS (2.5): Here.
843 * doc/bison.texinfo: Here.
844 * src/lalr.c (initialize_LA): Here.
845 * src/print.c (print_reductions): Here.
846 * src/reader.c (reader): Here.
847 * src/tables.c (action_row): Here.
848 * tests/input.at (%define enum variables): Here.
849 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
850
d521ee19
JD
8512009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
852
853 Pacify ./configure --enable-gcc-warnings.
854 * tests/input.at (Symbols): Prototype yyerror and yylex.
855
8562009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
c9aded4b
JD
857
858 Document how `%define "var" "value"' is not M4-friendly.
859 * src/parse-gram.y (variable): In comments here.
860
8f0d265e
JD
8612009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
862
863 Clean up recent patches a little.
864 Reported by Akim Demaille.
865 * doc/bison.texinfo (Understanding): Fix typos.
866 * src/print.c (print_reductions): Don't use negated variable.
867
f4909773
JD
8682009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
869
870 List accepted values for a %define enum variable with an invalid value.
871 Suggested by Akim Demaille at
872 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
873 * data/bison.m4 (_b4_percent_define_check_values): Implement.
874 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
875 * tests/input.at (%define lr.default_reductions invalid values): Merge
876 into...
877 (%define enum variables): ... here, and update output.
878
110ef36a
JD
8792009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
880
881 Rename "default rule" to "default reduction".
882 This includes changing variable names in code, changing
883 comments, and renaming %define lr.default_rules to %define
884 lr.default_reductions.
885 * NEWS (2.5): Update IELR documentation.
886 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
887 documentation.
888 * data/glr.c, data/lalr1.java: Sync copyright dates.
889 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
890 and lr.type documentation. Make some other wording
891 improvements.
892 (Glossary): Adjust cross-references and Default Reduction
893 definition.
894 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
895 Remove a confusing comment pointed out by Akim Demaille.
896 (initialize_LA): Adjust code.
897 * src/print-xml.c (print_reductions): Adjust code.
898 * src/print.c (print_reductions): Adjust code.
899 * src/reader.c (reader): Adjust code.
900 * src/tables.c (action_row): Adjust code.
901 (token_actions): Adjust code.
902 * src/tables.h: Adjust YYDEFACT documentation.
903 * tests/input.at (%define lr.default_rules invalid values):
904 Rename test group to...
905 (%define lr.default_reductions invalid values): ... this, and
906 update grammar file and expected output.
907 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
908 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
909
746ee38c
AD
9102009-04-21 Akim Demaille <demaille@gostai.com>
911
912 tests: check the use of dashes and periods in symbols.
913 * tests/input.at (Symbol): New test group.
914
eb45ef3b
JD
9152009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
916
917 Document %define lr.type and lr.default_rules.
918 * NEWS (2.5): Add an entry.
919 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
920 besides just LALR(1) and GLR(1).
921 * doc/bison.texinfo (Introduction): Likewise.
922 (Language and Grammar): Bison is no longer limited to LALR(1)
923 restrictions.
924 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
925 when trying to distinguish from GLR. Talk about LR(1) grammars
926 rather than LALR(1) grammars.
927 (Decl Summary): In %define api.push_pull entry, say it applies
928 to deterministic parsers in C rather than LALR(1) parsers in C.
929 Add lr.default_rules entry.
930 Add lr.type entry.
931 (Mystery Conflicts): Bison is no longer limited to LALR(1)
932 restrictions.
933 (Generalized LR Parsing): Same changes as for the previous GLR
934 section.
935 (Memory Management): Say deterministic rather than LALR(1).
936 (Understanding): Correct some bison output.
937 Index discussion of "accepting state".
938 Say deterministic rather than LALR(1).
939 (Bison Options): In --yacc entry, say deterministic rather than
940 LALR(1).
941 In --report, --graph, and --xml entries, just don't mention
942 LALR(1).
943 (C++ Parsers): Say deterministic rather than LALR(1).
944 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
945 (Glossary): Add Accepting State, Consistent State, Default Rule,
946 and IELR(1) definitions.
947 In Generalized LR (GLR) definition, make same changes as in
948 previous GLR sections.
949 In LALR(1) definition, say Bison uses LALR(1) by default rather
950 than implying Bison is limited to LALR(1).
951 (LocalWords): Add IELR.
952
db34f798
JD
9532009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
954
955 Finish implementing %define lr.type.
956 Its value can be "LALR", "IELR", or "canonical LR".
957 * lib/timevar.def (TV_IELR_PHASE1): New var.
958 (TV_IELR_PHASE2): New var.
959 (TV_IELR_PHASE3): New var.
960 (TV_IELR_PHASE4): New var.
961 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
962 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
963 Sbitset.h, ielr.h, and ielr.c.
964 * src/getargs.h, src/getargs.c (enum trace, trace_args,
965 trace_types): Add trace_ielr.
966 * src/lalr.h, src/lalr.c (ngotos): Export it.
967 (F): Rename to...
968 (goto_follows): ... this, update all uses, and export it.
969 (set_goto_map): Export it.
970 (map_goto): Export it.
971 (compute_lookahead_tokens): Don't free goto_follows yet. Now
972 handled in ielr.
973 (initialize_LA): Export it. Move lookback allocation to...
974 (lalr): ... here because, for canonical LR, initialize_LA must
975 be invoked but lookback and much of the rest of LALR isn't
976 needed.
977 * main.c (main): Instead of lalr, invoke ielr, which invokes
978 lalr.
979 * src/reader.c (reader): Default lr.type to "LALR".
980 Default lr.default_rules to "accepting" if lr.type is "canonical
981 LR". Leave the default as "all" otherwise.
982 Check for a valid lr.type value.
983 * src/state.h, src/state.c (struct state_list): Add state_list
984 member.
985 (state_new): Initialize state_list member to NULL.
986 (state_new_isocore): New function, exported.
987 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
988 exercises all values of lr.type.
989 (GNU AWK Grammar): Rename test group to...
990 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
991 AT_TEST_EXISTING_GRAMMAR.
992 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
993 (GNU pic Grammar): Rename test group to...
994 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
995 AT_TEST_EXISTING_GRAMMAR.
996 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
997 all values of lr.type.
998 (Single State Split): New test groups using AT_TEST_LR_TYPE.
999 (Lane Split): Likewise.
1000 (Complex Lane Split): Likewise.
1001 (Split During Added Lookahead Propagation): Likewise.
1002
7fe11bb5
JD
10032009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1004
1005 Add new files for IELR and canonical LR implementation.
1006 * src/AnnotationList.c: New.
1007 * src/AnnotationList.h: New.
1008 * src/InadequacyList.c: New.
1009 * src/InadequacyList.h: New.
1010 * src/Sbitset.c: New.
1011 * src/Sbitset.h: New.
1012 * src/ielr.c: New.
1013 * src/ielr.h: New.
1014
7254f6a8
JD
10152009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1016
1017 Implement %define lr.default_rules.
1018 Its value describes the states that are permitted to contain
1019 default rules: "all", "consistent", or "accepting".
1020 * src/reader.c (reader): Default lr.default_rules to "all".
1021 Check for a valid lr.default_rules value.
1022 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1023 is "accepting", then only mark the accepting state as
1024 consistent.
1025 (initialize_LA): Tell state_lookahead_tokens_count whether
1026 lr.default_rules is "accepting".
1027 * src/tables.c (action_row): If lr.default_rules is not "all",
1028 then disable default rules in inconsistent states.
1029 * src/print.c (print_reductions): Use this opportunity to
1030 perform some assertions about whether lr.default_rules was
1031 obeyed correctly.
1032 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1033 helps with checking the parser tables for a grammar.
1034 * tests/input.at (%define lr.default_rules invalid values): New
1035 test group.
1036 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1037 AT_TEST_TABLES_AND_PARSE.
1038 (`no %define lr.default_rules'): New test group generated by
1039 AT_TEST_LR_DEFAULT_RULES.
1040 (`%define lr.default_rules "all"'): Likewise.
1041 (`%define lr.default_rules "consistent"'): Likewise.
1042 (`%define lr.default_rules "accepting"'): Likewise.
1043
72e727f2
AD
10442009-04-20 Akim Demaille <demaille@gostai.com>
1045
1046 Formatting change.
1047
90462b8d
AD
10482009-04-20 Akim Demaille <demaille@gostai.com>
1049
1050 bison: factoring.
1051 * src/output.c (token_definitions_output): Use symbol_id_get
1052 instead of duplicating its logic.
1053 * TODO (YYERRCODE): Extend.
1054
4f646c37
AD
10552009-04-20 Akim Demaille <demaille@gostai.com>
1056
71b00ed8
AD
1057 variables: prefer error-verbose to error_verbose.
1058 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1059 instead of error_verbose.
1060 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1061 variable.
1062 * doc/bison.texinfo: Promote %define error-verbose instead of
1063 %error-verbose.
1064 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1065
10662009-04-15 Akim Demaille <demaille@gostai.com>
1067
4f646c37
AD
1068 variables: accept dashes.
1069 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1070 underscores.
1071 * src/scan-gram.l ({id}): Also accept dashes after the initial
1072 letter.
1073 ({directive}): Use {id}.
1074 * src/parse-gram.y: Comment and formatting changes.
1075 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1076 symbols.
1077 * src/complain.h, src/complain.c (yacc_at): New.
1078 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1079 symbol names.
1080 * src/output.c (token_definitions_output): Do not #define token
1081 names with dashes.
1082
184e3179
AD
10832009-04-20 Akim Demaille <demaille@gostai.com>
1084
1085 Consistently refer to Yacc, not YACC.
1086 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1087
41253c3a
JD
10882009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1089
1090 Pacify make maintainer-check-posix.
1091 * tests/input.at (%define, --define): Move bison command-line
1092 options before grammar file name.
1093
197b82ba
JD
10942009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1095
1096 Document semicolon warnings.
1097 * NEWS (2.5): Here.
1098
0c90a1f5
AD
10992009-04-14 Akim Demaille <demaille@gostai.com>
1100
1101 variables: use `parse.assert' instead of `assert'.
1102 * TODO (assert): Remove.
1103 * data/bison.m4 (b4_assert_if): Replace with...
1104 (b4_parse_assert_if): this.
1105 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1106 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1107
fa819509
AD
11082009-04-14 Akim Demaille <demaille@gostai.com>
1109
16dc0d90 1110 variables: use `parse.trace' instead of `debug'.
fa819509
AD
1111 * src/getargs.c (getargs): Map -t to %define trace.parse.
1112 * src/scan-gram.l (%debug): Map to %define trace.parse.
1113 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1114 names to `_' in macro names.
1115 (b4_debug_if): Replace with...
1116 (b4_parse_trace_if): this.
1117 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1118 * data/yacc.c: Adjust.
1119 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1120 Use @code to label the variable list.
1121 Document the variable parse.trace.
1122 (Tracing): Promote the parse.trace variable.
1123 * TODO: %printer is not documented.
1124
f7dae1ea
AD
11252009-04-14 Akim Demaille <demaille@gostai.com>
1126
1127 doc: minor fixes.
1128 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1129 (Table of Symbols): Remove duplicate entry for %debug.
1130
3535c071
EB
11312009-04-10 Eric Blake <ebb9@byu.net>
1132
1133 submodules: update to latest
1134 * submodules/autoconf: Use latest upstream Autoconf.
1135
cf48f675
EB
11362009-04-06 Eric Blake <ebb9@byu.net>
1137
1138 Work around autoconf 2.63b bug in testsuite.
1139 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1140 autoconf bug related to # in test.
1141
50cca368
JD
11422009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1143
1144 * NEWS (2.5): New section. Describe new -D/--define feature.
1145
3583d96b
AD
11462009-04-06 Akim Demaille <demaille@gostai.com>
1147
1148 Regen.
1149 * src/parse-gram.h, src/parse-gram.c: Regen.
1150
00f5d575
AD
11512009-04-06 Akim Demaille <demaille@gostai.com>
1152
1153 rename muscle_tab.* as muscle-tab.* for consistency.
1154 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
1155 * src/muscle-tab.h, src/muscle-tab.c: these.
1156 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
1157 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
1158
76bf5102
AD
11592009-04-06 Akim Demaille <demaille@gostai.com>
1160
1161 Makefile: introduce $(BISON).
1162 * src/local.mk (BISON): New.
1163 (YACC): Use it.
1164
bc0f5737
AD
11652009-04-06 Akim Demaille <demaille@gostai.com>
1166
1167 parser: handle %locations as %define locations.
1168 * src/getargs.h, src/getargs.c (locations_flag): Remove.
1169 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
1170 to set "locations" to true.
1171 * src/output.c (prepare): Don't output "locations".
1172 * src/scan-gram.l (%locations): Handle it as a %<flag>.
1173 * src/parse-gram.y: It's no longer a token.
1174 Don't handle it.
1175 * data/bison.m4 (b4_locations_if): Define it with
1176 b4_percent_define_if_define.
1177 * data/c.m4, data/glr.cc: Adjust.
1178
697c912f
AD
11792009-04-06 Akim Demaille <demaille@gostai.com>
1180
1181 Regen.
1182 * src/parse-gram.c: Regen.
1183
4920ae8b
AD
11842009-04-06 Akim Demaille <demaille@gostai.com>
1185
1186 muscle: factor the handling of obsolete of obsolete directives.
1187 Suggested by Joel E. Denny.
50cca368 1188
4920ae8b
AD
1189 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
1190 New, extracted from...
1191 * src/parse-gram.y (prologue_declaration: pure-parser): here.
1192 Remove it.
1193 (prologue_declaration: "%<flag>"): Use
1194 muscle_percent_define_ensure.
1195 (%error-verbose, %pure-parser): No longer tokens.
1196 * src/scan-gram.l (pure-parser): Return as a %<flag>.
1197
1d5b3c08
JD
11982009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1199
1200 Fix options documentation.
1201 * build-aux/cross-options.pl: As in --help output, write optional
1202 arguments as [=ARG] not =[ARG].
1203 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1204
62c99cf4
JD
12052009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1206
1207 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1208 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1209 requirements for a correct m4 are stricter.
1210 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
1211 * configure.ac: Update to use AC_PROG_GNU_M4.
1212 Reported by Eric Blake.
1213
1c93f35b
JD
12142009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1215
1216 Help with updating web manual.
1217 * HACKING: Incorporate instructions from gnulib/doc/README.
1218 * bootstrap.conf (gnulib_modules): Add gendocs.
1219
86cfae0a
AD
12202009-04-03 Akim Demaille <demaille@gostai.com>
1221
1222 Regen.
1223 * src/parse-gram.h, src/parse-gram.c: Regen.
1224
ba061fa6
AD
12252009-04-03 Akim Demaille <demaille@gostai.com>
1226
1227 Factor %FLAG at scan level.
1228 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
1229 definitions and associated rules, replaced by....
1230 (PERCENT_FLAG): this new token type, and rule.
1231 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
1232 Use it for %debug and %error-verbose.
1233
b19ebeb3
AD
12342009-04-03 Akim Demaille <demaille@gostai.com>
1235
1236 Regen.
1237 * src/parse-gram.h, src/parse-gram.c: Regen.
1238
001a16a9
AD
12392009-04-03 Akim Demaille <demaille@gostai.com>
1240
1241 Treat %debug as %define debug.
1242 * data/bison.m4 (b4_debug_if): New.
1243 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
1244 * data/lalr1.java: Use it instead of b4_debug_flag.
1245 * src/getargs.h, src/getargs.c (debug_flag): Remove.
1246 * src/output.c (prepare): Don't output it.
1247 * src/parse-gram.y: Treat %debug as %define debug.
1248
12492009-04-03 Akim Demaille <demaille@gostai.com>
1250
1251 Treat %error-verbose as %define error_verbose.
1252 This allows to pass -Derror_verbose on the command line. Better
1253 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
1254 ERROR_VERBOSE being defined as false or true.
1255 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
1256 on b4_percent_define_ifdef, for does not check the defined value,
1257 but only whether the symbol is defined, rely on
1258 b4_percent_define_flag_if, so that a value of "false" is processed
1259 as a false.
1260 If not defined, define the flag to "false".
1261 (b4_error_verbose_if): New.
1262 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
1263 b4_error_verbose_flag.
1264 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
1265 * src/output.c (prepare): Don't output it.
1266 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
1267
92822aff
JD
12682009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1269
1270 Fix strange %define locations for default values.
1271 Reported by Akim Demaille at
1272 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1273 and discussed again starting at
1274 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1275 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1276 because location information is bogus.
1277 Use angle brackets to delimit fake file name because square brackets
1278 look like underexpanded m4. Choose a better fake file name.
1279 Use negative line numbers.
1280 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1281 * src/location.c (location_print): If line for a boundary is negative,
1282 only print that boundary's file name.
1283 * src/location.h: Document that.
1284 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1285 defaults): Update output.
1286
e021191b
JD
12872009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1288
1289 Pacify ./configure --enable-gcc-warnings.
1290 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
1291 in lib won't compile with it.
1292 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
1293
78f65418
AD
12942009-03-31 Akim Demaille <demaille@gostai.com>
1295
1296 bootstrap: --help to stdout.
1297 * bootstrap (usage): Don't send --help to stderr.
1298 Use a here doc instead of a long string.
1299
f7e241f4
AD
13002009-03-31 Akim Demaille <demaille@gostai.com>
1301
1302 bootstrap: README-hacking no longer exists
1303 * bootstrap (checkout_only_file): Set to HACKING.
1304
31d3e510
AD
13052009-03-26 Akim Demaille <demaille@gostai.com>
1306
1307 doc: merge HACKING and README-hacking.
1308 Two files is confusing.
1309 Reported by Alexandre Duret-Lutz.
1f9d8248 1310
31d3e510
AD
1311 * README-hacking: Merge into...
1312 * HACKING (Working from the repository): here.
1313
81535bfa
AD
13142009-03-26 Akim Demaille <demaille@gostai.com>
1315
1316 doc: update README-hacking.
1317 * README-hacking: We now use git and git submodules.
1318 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1319
56f772e9
AD
13202009-03-26 Akim Demaille <demaille@gostai.com>
1321
1322 lalr1.cc: avoid GCC 4.3 warnings.
1323 GCC 4.3 now warns about "a || b && c" and asks for explicit
1324 parentheses.
1325 Reported by Alexandre Duret-Lutz.
1326 * data/location.cc: Update copyright years.
1327 (Position::operator==): Use parens to make precedence explicit.
1328 Compare lines and columns first, as they are more likely to be
1329 different, and they are faster to compare.
1330
11c073b7
AD
13312009-03-26 Akim Demaille <demaille@gostai.com>
1332
1333 gnulib: update.
1334 * gnulib: Update to latest.
1335 * src/local.mk (AM_CFLAGS): Move to...
1336 * Makefile.am: here.
1337 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
1338 AM_CFLAGS.
1339
91be6b28
AD
13402009-03-02 Akim Demaille <demaille@gostai.com>
1341
1342 Comment changes.
1343
cbf25ce7
AD
13442009-03-02 Akim Demaille <demaille@gostai.com>
1345
1346 Share b4_yytranslate_define.
1347 * data/lalr1.cc (b4_yytranslate_define): Move to...
1348 * data/c++.m4: here.
1349
882f02ed
AD
13502009-03-02 Akim Demaille <demaille@gostai.com>
1351
1352 Use locations in the variant example.
1f9d8248
AD
1353 Yes, this obfuscates the point of this example, variants only.
1354 But glr.cc cannot work (yet?) without locations. This change
1355 makes it easier to use this example with glr.cc.
11c073b7 1356
882f02ed
AD
1357 * examples/variant.yy (assert): %define it.
1358 (locations): Request them.
1359 (yylex): Bind the location to the stage.
1360
0623bacc
AD
13612009-03-02 Akim Demaille <demaille@gostai.com>
1362
1363 Dub make_TOKEN as a public type interface.
1364 * data/c++.m4 (b4_symbol_constructor_declare)
1365 (b4_symbol_constructor_define): New empty stubs.
1366 (b4_public_types_declare, b4_public_types_define): Use them.
1367 * data/lalr1.cc (b4_symbol_constructor_declare)
1368 (b4_symbol_constructor_declare_)
1369 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
1370 Move to...
1371 * data/variant.hh: here.
1372 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
1373 needed.
1374 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
1375 b4_symbol_constructor_declare, as it is now done by
1376 b4_public_types_define and b4_public_types_declare.
1377
5f5a90df
AD
13782009-03-02 Akim Demaille <demaille@gostai.com>
1379
1380 Coding style changes.
1381 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1382 (b4_symbol_constructor_declarations)
1383 (b4_symbol_constructor_definition_)
1384 (b4_symbol_constructor_definitions)
1385 (b4_yytranslate_definition): Rename as...
1386 (b4_symbol_constructor_declare_)
1387 (b4_symbol_constructor_declare)
1388 (b4_symbol_constructor_define_)
1389 (b4_symbol_constructor_define)
1390 (b4_yytranslate_define): these.
1391 * data/variant.hh (b4_variant_definition): Rename as...
1392 (b4_variant_define): this.
1393
b47b6ff7
AD
13942009-03-02 Akim Demaille <demaille@gostai.com>
1395
1396 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
1397 * data/bison.m4 (b4_percent_define_if_define): New.
1398 * data/c++.m4 (b4_variant_if): Move to...
1399 * data/bison.m4: Here, using b4_percent_define_if_define.
1400 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
1401 * data/bison.m4: Here, using b4_percent_define_if_define.
1402
1d6b689b
AD
14032009-03-02 Akim Demaille <demaille@gostai.com>
1404
1405 Dub symbol_type_base as a public type.
1406 * data/c++.m4 (b4_public_types_declare): Now define
1407 symbol_type_base and symbol_type.
1408 (b4_public_types_define): New.
1409 In both cases, the definitions are taken verbatim from lalr1.cc.
1410 * data/lalr1.cc: Adjust.
1411
4f84717d
AD
14122009-03-02 Akim Demaille <demaille@gostai.com>
1413
1414 b4_public_types_declare.
1415 * data/c++.m4 (b4_public_types_declare): New.
1416 * data/glr.cc, data/lalr1.cc: Use it.
1417
b9e4eb5b
AD
14182009-03-02 Akim Demaille <demaille@gostai.com>
1419
1420 b4_semantic_type_declare.
1421 * data/c++.m4 (b4_semantic_type_declare): New.
1422 Factors and generalizes what was in glr.cc and lalr1.cc.
1423 * data/variant.hh (b4_semantic_type_declare): Redefine it for
1424 variants.
1425 * data/lalr1.cc, data/glr.cc: Use it.
1426
6a6e7f0c
AD
14272009-02-26 Akim Demaille <demaille@gostai.com>
1428
1429 Upgrade gnulib.
1430 * gnulib: Upgrade from master.
1431 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
1432 Regen.
1433
e9e61b00
AD
14342009-02-25 Akim Demaille <demaille@gostai.com>
1435
1436 Remove useless arguments.
1437 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
1438 relevant.
1439
3eead995
AD
14402009-02-25 Akim Demaille <demaille@gostai.com>
1441
1442 Comment changes.
1443 * data/lalr1.cc: here.
1444
87f28efe
AD
14452009-02-25 Akim Demaille <demaille@gostai.com>
1446
1447 Fix glr.cc's debug level handling.
1448 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
1449 glr.c which is used.
1450 (debug_level, set_debug_level): Adjust.
1451
9be2a009
AD
14522009-02-25 Akim Demaille <demaille@gostai.com>
1453
1454 Copyright years.
1455 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1456
07a6e87d
AD
14572009-02-25 Akim Demaille <demaille@gostai.com>
1458
1459 Style changes.
1460 * etc/bench.pl.in (generate_grammar_list): Consitently use
1461 location_type, not yy::location.
1462
33c78bd2
AD
14632009-02-25 Akim Demaille <demaille@gostai.com>
1464
1465 Comment change.
1466 * data/lalr1.cc: here.
1467
49572920
AD
14682009-02-19 Akim Demaille <demaille@gostai.com>
1469
1470 Make yyparser::error public.
1471 * data/lalr1.cc: here.
1472 There is no good reason to keep it private (and it is convenient
1473 to use it from the scanner for instance). It is already public in
1474 glr.cc.
1475
88654b47
AD
14762009-02-19 Akim Demaille <demaille@gostai.com>
1477
1478 Comment changes.
1479 * data/glr.cc: here.
1480
4524c55b
AD
14812009-02-19 Akim Demaille <demaille@gostai.com>
1482
1483 Remove trailing blanks.
6a6e7f0c
AD
1484 The epilogue has its own ending \n, no need to add another.
1485
4524c55b
AD
1486 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
1487 epilogue.
1488 * data/glr.cc: dnl when extending the epilogue.
1489 Remove stray "private:".
1490
6ceccee8
AD
14912009-02-19 Akim Demaille <demaille@gostai.com>
1492
1493 Use b4_c_modern.
1494 * data/c.m4 (b4_c_function_decl): Here.
1495
9c6a8966
AD
14962009-02-19 Akim Demaille <demaille@gostai.com>
1497
1498 Comment changes.
1499 * data/lalr1.cc: here.
1500
507aa0e2
AD
15012009-02-19 Akim Demaille <demaille@gostai.com>
1502
1503 Extract variant.hh
1504 * data/variant.hh: New, extracted from...
1505 * data/lalr1.cc: here.
1506 Adjust.
1507 * data/local.mk: Adjust.
1508
51bacae6
AD
15092009-02-19 Akim Demaille <demaille@gostai.com>
1510
1511 Extract stack.hh from lalr1.cc.
1512 * data/stack.hh: New.
1513 * data/lalr1.cc: Extract from here.
1514 * data/local.mk: Adjust.
1515
06c3084f
JD
15162009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1517
1518 Add reminder about uploading public key to keys.gnupg.net.
1519 * HACKING (Release Procedure): Here.
1520
0ea583d2
AD
15212009-01-28 Akim Demaille <demaille@gostai.com>
1522
1523 * NEWS: Update information about 2.4.1 and 2.4.2.
1524
402b123d
AD
15252008-11-04 Akim Demaille <demaille@gostai.com>
1526
1527 Reformat NEWS.
1528 * NEWS: Use more outline-mode markup.
1529 Suggested by Jim Meyering.
1530
74553c98
AD
15312009-01-08 Akim Demaille <demaille@gostai.com>
1532
1533 Fix grep portability issues.
1534 Grep on Solaris does not support -q.
1535 Reported by Summum Bonum.
1536
1537 * NEWS: Add a stub for 2.4.2.
1538 * THANKS: Add Summum Bonum.
1539 * tests/atlocal.in (EGREP): New.
1540 (CC, CXX, XSLTPROC): Make it possible to override them via
1541 envvars.
1542 * tests/java.at: Use $EGREP instead of egrep.
1543 Use AT_CHECK's ignore instead of grep's -q.
1544
84eedf86
AD
15452008-12-11 Akim Demaille <demaille@gostai.com>
1546
1547 Pass the token type to yysyntax_error.
1548 * data/yacc.c (yysyntax_error): Take the transated token instead
1549 of the raw number.
1550 Adjust callers.
1551 * TODO: Update.
1552
5860cc8c
AD
15532008-12-11 Akim Demaille <demaille@gostai.com>
1554
1555 Formatting changes.
1556 * data/glr.c: Formatting changes.
1557
2b008529
AD
15582008-12-11 Akim Demaille <demaille@gostai.com>
1559
1560 Propagate i18n changes into glr.c.
1561 * TODO: Update.
1562 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
1563 building the error message format dynamically.
1564 * data/lalr1.java: Formatting changes.
1565
2cd1af95
AD
15662008-12-11 Akim Demaille <demaille@gostai.com>
1567
1568 Use testsuite -C.
1569 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
1570 Solves problems when top_srcdir is an absolute path.
1571 Suggested by Eric Blake.
1572 * configure.ac: Require Autoconf 2.62.
1573
eeb29422
AD
15742008-12-11 Akim Demaille <demaille@gostai.com>
1575
1576 Simplify the i18n of the error messages.
1577 * data/lalr1.cc: Comment changes.
1578 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
1579 lalr1.cc instead of building dynamically the format string.
1580
6617622c
AD
15812008-12-08 Akim Demaille <demaille@gostai.com>
1582
1583 Fix portability issue in the test suite.
1584 * tests/local.at (AT_MATCHES_CHECK): New.
1585 Based on Perl instead of Sed. Sed has too many portability
1586 pitfalls, not ever Sed is GNU Sed.
1587 * tests/actions.at (Fix user actions without a trailing semicolon):
1588 Use it.
1589
2ca1136c
AD
15902008-12-08 Akim Demaille <demaille@gostai.com>
1591
1592 Update data/README.
1593 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1594
6c63b895
AD
15952008-12-08 Akim Demaille <demaille@gostai.com>
1596
1597 Install autoconf as a submodule to get m4sugar.
1598 * .gitmodules: Add submodules/autoconf.
1599 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1600 submodules/autoconf.
1601
417e31d2
AD
16022008-12-08 Akim Demaille <demaille@gostai.com>
1603
1604 Test token.prefix in all the skeletons.
1605 * data/java.m4 (b4_token_enum): Use the token.prefix.
1606 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
1607 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
1608 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
1609 * tests/java.at: Comment changes.
1610 (AT_CHECK_JAVA_MINIMAL): Define the END token.
1611 (Java parser class and package names): Add token.prefix check.
1612
97abf544
AD
16132008-12-08 Akim Demaille <demaille@gostai.com>
1614
1615 Fix regeneration of atconfig.
1616 * tests/local.mk (tests/atconfig): The rule was incorrect, but
1617 remove it: now that there is no tests/Makefile.am, the top-level
1618 Makefile properly updates atconfig when needed.
1619
e8cd1ad6
DJ
16202008-12-07 Di-an Jan <dianj@freeshell.org>
1621
1622 Implement the FIXME that ends an user action with a semicolon
1623 if it seems necessary.
1624 * src/scan-code.l (flex rules section): Flag cpp directive from
1625 any `#' to the first unescaped end-of-line. Semicolon is not
1626 needed after `;', `{', '}', or cpp directives and is needed after
1627 any other token (whitespaces and comments have no effect).
1628 * tests/actions.at (Fix user actions without a trailing semicolon):
1629 New test.
1630 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1631 to make user actions complete statements.
1632 Adjust column numbers in error messages.
1633 * tests/regression.at (Fix user actions without a trailing semicolon):
1634 Remove. Covered by new test.
1635
ce9447fc
AD
16362008-12-07 Akim Demaille <demaille@gostai.com>
1637
1638 Update gnulib.
1639 * gnulib: Update from master.
1640
d333175f
EB
16412008-12-05 Eric Blake <ebb9@byu.net>
1642
1643 Avoid compiler warning.
1644 * src/output.c (muscle_insert_item_number_table): Delete unused
1645 function.
1646
215b40ac
EB
16472008-12-02 Eric Blake <ebb9@byu.net>
1648
1649 Build testsuite with newer autoconf.
1650 * tests/output.at (m4_expand): Don't override in newer autoconf,
1651 where the underlying implementation changed.
1652 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1653 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1654 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1655 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1656 since some of them contain unbalanced ')'.
1657
3bb21113
AD
16582008-12-01 Akim Demaille <demaille@gostai.com>
1659
1660 Use b4_symbol for printers and destructors everywhere.
1661 * data/bison.m4 (b4_symbol_action_location): New.
1662 * data/c.m4 (b4_symbol_actions): Remove.
1663 Adjust all callers to use by b4_symbol_foreach and the corresponding
1664 b4_symbol_printer/destructor macro.
1665 * data/glr.cc: Adjust.
1666 * data/lalr1.java: Adjust the %destructor sanity check.
1667 * src/output.c (symbol_code_props_output): Remove, we no longer
1668 need the b4_symbol_printers/destructors tables.
1669
fb7c5b1f
AD
16702008-12-01 Akim Demaille <demaille@gostai.com>
1671
1672 Use b4_symbol_case_.
1673 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
1674 b4_symbol_case_.
1675
cf6fb222
AD
16762008-12-01 Akim Demaille <demaille@gostai.com>
1677
1678 Move b4_symbol based macro to bison.m4.
1679 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
1680 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
1681 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
1682 (b4_type_foreach): Move to...
1683 * data/bison.m4: Here.
1684 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
1685 b4_symbol_value_template instead of b4_symbol_value.
cf6fb222 1686
e3c52a63
AD
16872008-12-01 Akim Demaille <demaille@gostai.com>
1688
1689 b4_symbol/type_foreach.
1690 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
1691 Use them.
1692
2bde9113
AD
16932008-12-01 Akim Demaille <demaille@gostai.com>
1694
1695 Use the symbol properties to output the printer/destructor for lalr1.cc.
30c10faf
AD
1696 Instead of defining complex list of tuples to define various
1697 properties of the symbols, we now prefer to define symbols as
1698 "structs" in m4: using the symbol key (its number), and the
1699 property name, b4_symbol gives it value. Use this to handle
1700 destructors and printers.
1701
2bde9113
AD
1702 * src/output.c (CODE_PROP): New.
1703 (prepare_symbol_definitions): Use it to define the printer and
1704 destructor related attributes of the symbols.
1705 * data/lalr1.cc (b4_symbol_actions): Rename as...
1706 (b4_symbol_action): this.
1707 Use b4_symbol instead of 6 arguments.
1708 (b4_symbol_printer, b4_symbol_destructor): New.
1709 Use them instead of b4_symbol_actions.
1710
44494bf6
AD
17112008-12-01 Akim Demaille <demaille@gostai.com>
1712
1713 Avoid capturing variables too easily.
1714 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
1715 v__ and p__ instead of v and p.
1716
fad814bd
AD
17172008-12-01 Akim Demaille <demaille@gostai.com>
1718
1719 Remove spurious empty line before syncline.
1720 * data/bison.m4 (b4_syncline): Don't output an empty line before
1721 the output.
1722
feda5527
AD
17232008-11-26 Akim Demaille <demaille@gostai.com>
1724
1725 Convert lib/Makefile.am into lib/local.mk.
1726 The real problem is rather gnulib.mk, which itself is extracted
1727 from a Makefile.am that gnulib expects to the "recursive". The
1728 tool prefix-gnulib-mk converts such a gnulib.mk to be
1729 non-recursive. Also, some AC_SUBST variables need to be adjusted.
1730
1731 * etc/prefix-gnulib-mk: New.
1732 * bootstrap (slurp): Use it to convert further gnulib.mk.
1733 No longer try to avoid re-creation of lib/gnulib.mk as the changes
1734 are deeper.
1735 * lib/Makefile.am: Rename as...
1736 * lib/local.mk: this.
1737 Adjust to be prefixed.
1738 * Makefile.am, configure.ac: Adjust.
1739 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
1740
56ddee7f
AD
17412008-11-26 Akim Demaille <demaille@gostai.com>
1742
1743 s/_FLAGS/FLAGS/.
1744 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
1745 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
1746 Reported by Eric Blake.
1747
728e89a0
AD
17482008-11-26 Akim Demaille <demaille@gostai.com>
1749
1750 Use b4_parser_tables_define in glr.cc.
1751 * data/glr.c: Use b4_parser_tables_define instead of defining the
1752 (deterministic integral) tables by hand.
1753
2c1bf9bd
AD
17542008-11-26 Akim Demaille <demaille@gostai.com>
1755
1756 Use b4_parser_tables_define in Java.
1757 * data/java.m4 (b4_typed_parser_table): Rename as...
1758 (b4_typed_parser_table_define): this, for consistency.
1759 Accept a comment as $4.
1760 Move $2 into yy*_.
1761 (b4_integral_parser_table): Rename as...
1762 (b4_integral_parser_table_define): this.
1763 * data/lalr1.java: Adjust all uses.
1764 Use b4_parser_tables_define instead of generation by hand.
1765
ba206cf4
AD
17662008-11-26 Akim Demaille <demaille@gostai.com>
1767
1768 Prepare the convergence bw C style and Java table generation.
1769 * data/bison.m4 (b4_tables_map, b4_tables_declare)
1770 (b4_tables_define): Rename as...
1771 (b4_integral_parser_tables_map, b4_parser_tables_declare)
1772 (b4_parser_tables_define): these.
1773 * data/c.m4 (b4_table_define): Rename as...
1774 (b4_integral_parser_table_define): this.
1775 * data/lalr1.cc: Adjust.
1776 (b4_table_define, b4_table_declare): Rename as...
1777 (b4_integral_parser_table_define)
1778 (b4_integral_parser_table_declare): these.
1779 (yyrline_): Move the comment where it is actually used.
1780 * data/yacc.c: Adjust.
1781 (yyrline): Use b4_integral_parser_table_define.
1782
d12f8e49
AD
17832008-11-26 Akim Demaille <demaille@gostai.com>
1784
1785 Regen.
1786 * src/parse-gram.h, src/parse-gram.c: Regen.
1787
0991e29b
AD
17882008-11-26 Akim Demaille <demaille@gostai.com>
1789
1790 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
1791 * data/lalr1.cc (b4_tables_map): Move to...
1792 * data/bison.m4: here.
1793 Update the comment for yytable during the flight.
1794 (b4_tables_declare, b4_tables_define): New.
1795 * data/lalr1.cc: Use them.
1796 * data/c.m4 (b4_table_define): New.
1797 * data/yacc.c: Use b4_tables_define instead of output the tables
1798 by hand.
1799 * tests/regression.at (Web2c Actions): Adjust the expected output,
1800 the order of the tables changed.
1801
3d3bc1fe
AD
18022008-11-26 Akim Demaille <demaille@gostai.com>
1803
1804 Get rid of (yy)rhs and (yy)prhs.
1805 These tables are no longer needed in the parsers, and they don't seem to
1806 be useful. They are not documented either.
feda5527 1807
3d3bc1fe
AD
1808 * src/output.c (prepare_rules): Get rid of rhs and prhs.
1809 Adjust the computation of (yy)r2.
1810
08c81469
AD
18112008-11-26 Akim Demaille <demaille@gostai.com>
1812
1813 Rule length is unsigned.
1814 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
1815
932b0c96
AD
18162008-11-26 Akim Demaille <demaille@gostai.com>
1817
1818 Get rid of lalr1-split.cc.
1819 It was no longer maintainer.
feda5527 1820
932b0c96
AD
1821 * data/lalr1-split.cc: Remove.
1822 * etc/bench.pl.in (bench_fusion_parser): Remove.
1823 Adjust.
1824
8452c667
AD
18252008-11-26 Akim Demaille <demaille@gostai.com>
1826
1827 Use yy* consistently.
1828 * data/glr.c: Now that yyrhs no longer exists as a global
1829 variable, rename local "rhs" variables into "yyrhs" for
1830 consistency.
1831
783aa653
AD
18322008-11-25 Akim Demaille <demaille@gostai.com>
1833
1834 Get rid of yyrhs and yyprhs in glr.c.
1835 * data/glr.c (yyrhs, yyprhs): Remove.
1836 Instead, use the state stack and yystos.
1837
6130b755
AD
18382008-11-25 Akim Demaille <demaille@gostai.com>
1839
1840 Flag glr tests.
1841 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
1842 as an Autotest keyword.
1843
95a7b1c9
AD
18442008-11-25 Akim Demaille <demaille@gostai.com>
1845
1846 Prefer TESTSUITE_FLAGS.
1847 TESTSUITEFLAGS is barely readable.
feda5527 1848
95a7b1c9
AD
1849 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
1850 for backward compatibility.
1851 Use the former instead of the latter.
1852
b4f18401
AD
18532008-11-25 Akim Demaille <demaille@gostai.com>
1854
1855 Get rid of yyrhs and yyprhs in larl1.java.
1856 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
1857 (yy_reduce_print): Rather, use yystos_ and the state stack.
1858
c265fd6b
AD
18592008-11-25 Akim Demaille <demaille@gostai.com>
1860
1861 Formatting changes.
1862
68dbdee8
AD
18632008-11-25 Akim Demaille <demaille@gostai.com>
1864
1865 Get rid of yyrhs and yyprhs in yacc.c.
30c10faf
AD
1866 They were used to get the symbol types, given a rule number, when
1867 displaying the top of the stack before a reduction. But the
1868 symbol type is available from the state stack. This has two be
1869 benefits: two tables less in the parser (making it smaller), and a
1870 more consistent use of the three stacks which will help to fuse
1871 them.
feda5527 1872
68dbdee8
AD
1873 * data/yacc.c (yyprhs, yyrhs): Remove.
1874 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
1875 (yy_reduce_print): Take yyssp as argument.
1876 Use it, together with yystos, to get the symbol type.
1877 * tests/regression.at (Web2c Report): Remove these tables from the
1878 expected output.
1879
6ab1adbe
AD
18802008-11-25 Akim Demaille <demaille@gostai.com>
1881
1882 b4_tables_map.
1883 The point is to factor the generation of the tables across skeletons.
1884 This is language dependant.
feda5527 1885
6ab1adbe
AD
1886 * data/c.m4 (b4_comment_): New.
1887 Should be usable to define how to generate tables independently of
1888 the language.
1889 (b4_c_comment): New.
1890 (b4_comment): Bounce to b4_c_comment.
1891 Now support $2 = [PREFIX] for indentation.
1892 * data/lalr1.cc (b4_table_declare): Don't output a comment if
1893 there is no comment.
1894 Indent it properly when there is one.
1895 Output the ending semicolon.
1896 (b4_table_define): Space changes.
1897 Output the ending semicolon.
1898 (b4_tables_map): New.
1899 Use it twice instead of declaring and defining the (integral)
1900 tables by hand.
1901
0fddb3d5
AD
19022008-11-25 Akim Demaille <demaille@gostai.com>
1903
1904 b4_table_declare.
1905 * data/lalr1.cc (b4_table_declare): New.
1906 Use it to declare the tables defined with b4_table_define.
1907 (b4_table_define): Declare a third arg to match b4_table_declare
1908 signature.
1909 Move all the comments around invocations of b4_table_define into
1910 the invocations itselves.
1911 Move things around to have the order for declarations and
1912 definitions.
1913
c4ddc0fb
AD
19142008-11-25 Akim Demaille <demaille@gostai.com>
1915
1916 Formatting changes.
1917 * data/lalr1.java: here.
1918
e0c653e7
AD
19192008-11-25 Akim Demaille <demaille@gostai.com>
1920
1921 b4_args is more general than only C++.
1922 * data/lalr1.cc (b4_args, _b4_args): Move to...
1923 * data/bison.m4: here.
1924
4182a0a1
DJ
19252008-11-21 Di-an Jan <dianj@freeshell.org>
1926
1927 Implement no-XXX arguments for --warnings, --report, --trace.
1928 * src/getargs.c (flags_argmatch): Handles no-XXX.
1929 Fix typo in doxygen comment.
1930
01466c3e
AD
19312008-11-21 Akim Demaille <demaille@gostai.com>
1932
1933 Display the changes in cross-options.texi.
1934 * build-aux/cross-options.pl ($sep): New, to separate items.
1935 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
1936 changes.
1937
a7c09cba
DJ
19382008-11-20 Di-an Jan <dianj@freeshell.org>
1939
1940 Improves options in the manual.
1941 * doc/bison.texinfo (-g, -x): Add space before argument.
1942 (Option Cross Key): Implement FIXME: listing directives also.
1943 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
1944 (Short Option): Special case -d. Put arguments inside @option.
feda5527 1945 (Bison Directive): Add column, automatically extracted from
a7c09cba
DJ
1946 src/scan-gram.l (actual name passed as the first argument)
1947 with special case for %define.
1948 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
1949 to build-aux/cross-options.pl.
1950 * src/getargs.c (usage): Document limitations of cross-options.pl.
1951 * src/scan-gram.l: Likewise.
1952
6c88b51e
JD
19532008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
1954
1955 Fix unexpanded macros in GLR defines file.
1956 Reported by Csaba Raduly at
1957 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
1958 * THANKS (Csaba Raduly): Add.
1959 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
1960 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
1961 lexer in a separate module that includes the defines file.
1962 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
1963 source.
1964 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
1965 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
1966 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
1967 (AT_DATA_SOURCE_PROLOGUE): New.
1968 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
1969 (AT_DATA_SOURCE): New.
1970 (AT_FULL_COMPILE): Extend to support an additional source file.
1971
1e034807
AD
19722008-11-18 Akim Demaille <demaille@gostai.com>
1973
1974 More TODO.
1975 * TODO: More short term issues.
1976
e3dda35c
AD
19772008-11-18 Akim Demaille <demaille@gostai.com>
1978
1979 Regen.
1980 * src/parse-gram.h, src/parse-gram.c: Regen.
1981
bd187d7b
AD
19822008-11-18 Akim Demaille <demaille@gostai.com>
1983
1984 Use b4_subtract where possible.
1985 * data/lalr1.cc (b4_subtract): Move to...
1986 * data/bison.m4: here.
1987 * data/glr.c (b4_rhs_data): Use it.
1988 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
1989
6085ab0d
AD
19902008-11-18 Akim Demaille <demaille@gostai.com>
1991
1992 Remove incorrect mode specification.
1993 * data/glr.cc: Don't pretend it's C code.
1994
9ce405ce
JD
19952008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
1996
1997 Simplify last patch slightly.
1998 * src/getargs.c (getargs): Here.
1999
a8beef7e
JD
20002008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2001
2002 Fix last warning from --enable-gcc-warnings.
2003 * src/getargs.c (getargs): Don't assign const address to non-const
2004 pointer.
2005
d50eea6d
JD
20062008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2007
2008 Don't let maintainer-*-check targets force a version update.
2009 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2010 handled.
2011
f5f419de
DJ
20122008-11-17 Di-an Jan <dianj@freeshell.org>
2013
2014 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2015 Align menus. Adjust word wrapping. Use node names for menu names.
2016 (Examples): Don't abbreviate node names.
2017 (LocalWords): Remove abbreviations.
2018 (Copying): Make description a sentence.
d50eea6d 2019 (Java Action Features): Remove period to match the rest of menu.
f5f419de 2020
d73e55e0
DJ
20212008-11-17 Di-an Jan <dianj@freeshell.org>
2022
2023 Handles several --enable-gcc-warnings.
2024 * src/getargs.c (command_line_location): Set parameters to void.
2025 * src/output.c (symbol_type_name_cmp): Make static.
2026 (symbols_by_type_name): Set parameters to void.
2027 (symbol_definitions_output): Remove unused parameter. Rename as...
2028 (prepare_symbol_definitions): this.
2029 (muscles_output): Move symbol_definitions_output to...
2030 (output): here as prepare_symbol_definitions.
2031 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
d50eea6d 2032 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
d73e55e0 2033
68c989de
DJ
20342008-11-17 Di-an Jan <dianj@freeshell.org>
2035
2036 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2037 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2038
23ce6f4c
AD
20392008-11-16 Akim Demaille <demaille@gostai.com>
2040
2041 Add missing $(EXEEXT).
2042 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2043 "src/bison$(EXEEXT)".
2044 Reported by Di-an Jan.
2045
dd704c35
AD
20462008-11-15 Akim Demaille <demaille@gostai.com>
2047
2048 * TODO: Update.
2049
dab244d5
AD
20502008-11-15 Akim Demaille <demaille@gostai.com>
2051
2052 Formatting changes.
2053 * tests/input.at: here.
2054
4b4da9fb
AD
20552008-11-15 Akim Demaille <demaille@gostai.com>
2056
2057 Remove duplicate header inclusion.
2058 * src/LR0.c: here.
2059
4ea3f53d
AD
20602008-11-15 Akim Demaille <demaille@gostai.com>
2061
2062 * src/parse-gram.h, src/parse-gram.c: Regen.
2063
cb823b6f
AD
20642008-11-15 Akim Demaille <demaille@gostai.com>
2065
2066 Support parametric types.
b06df3c2
AD
2067
2068 There are two issues to handle: first scanning nested angle
2069 bracket pairs to support types such as std::pair< std::string,
2070 std::list<std::string> > >.
2071
2072 Another issue is to address idiosyncracies of C++: do not glue two
2073 closing angle brackets together (otherwise it's operator>>), and
2074 avoid sticking blindly a TYPE to the opening <, as it can result
2075 in '<:' which is a digraph for '['.
2076
cb823b6f
AD
2077 * src/scan-gram.l (brace_level): Rename as...
2078 (nesting): this.
2079 (SC_TAG): New.
2080 Implement support for complex tags.
b06df3c2 2081 (tag): Accept
cb823b6f
AD
2082 , but not <.
2083 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2084 (b4_symbol_variant): Leave space around types as parameters.
2085 * examples/variant.yy: Use nested template types and leading ::.
2086 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2087 Rename as...
2088 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2089 * tests/c++.at: Test parametric types.
2090
7b6e6753
AD
20912008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2092
2093 Test token.prefix.
2094 This is not sufficient, but we test at least that the make_SYMBOL
2095 interface is not affected by token.prefix. A more general test
2096 will be implemented when the support of token.prefix is generalized
2097 to more skeletons.
b06df3c2 2098
7b6e6753
AD
2099 * tests/c++.at: One more variant test, using token.prefix.
2100
dddec537
AD
21012008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2102
2103 Test the make_TOKEN interface.
2104 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2105 Factor the common code in yylex.
2106 Use it to test "%define lex_symbol".
2107
7d3e21ba
AD
21082008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2109
2110 Formatting change.
2111
4fc55348
AD
21122008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2113
2114 Simplify code for variants bench marks.
2115 * etc/bench.pl.in (&generate_grammar_list): Define and use
2116 location_type.
2117 Factor the common code in yylex.
2118
070e6509
AD
21192008-11-15 Akim Demaille <demaille@gostai.com>
2120
2121 Better error message.
2122 * bootstrap (find_tool): Fix the error message.
2123
0078681b
AD
21242008-11-15 Akim Demaille <demaille@gostai.com>
2125
2126 Update variant.yy to newest interface.
2127 * examples/variant.yy: Define lex_symbol.
2128 Adjust.
2129
ff084799
AD
21302008-11-15 Akim Demaille <demaille@gostai.com>
2131
2132 Don't use locations in variant.yy.
2133 * examples/variant.yy: Adjust to not using locations.
2134
b0d79ec6
AD
21352008-11-15 Akim Demaille <demaille@gostai.com>
2136
2137 Comment changes.
2138 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
2139 comments for the license.
2140
d4977ce3
AD
21412008-11-15 Akim Demaille <demaille@gostai.com>
2142
2143 Remove tests/Makefile.am.
2144 * tests/Makefile.am: Rename as...
2145 * tests/local.mk: this.
2146 * Makefile.am, configure.ac: Adjust.
2147 * Makefile.am (DISTCLEANFILES): Define.
2148 (maintainer-check, maintainer-xml-check, maintainer-push-check):
2149 Remove, we no longer need to bounce to the real targets.
2150
87f1149a
AD
21512008-11-15 Akim Demaille <demaille@gostai.com>
2152
2153 Comment changes.
2154
36415906
AD
21552008-11-15 Akim Demaille <demaille@gostai.com>
2156
2157 djgpp/local.mk.
2158 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
2159 * djgpp/local.mk: this new file.
2160
e2c2f696
AD
21612008-11-15 Akim Demaille <demaille@gostai.com>
2162
2163 Remove doc/Makefile.am.
2164 * doc/Makefile.am: Rename as...
2165 * doc/local.mk: this.
2166 Adjust paths
2167 * Makefile.am, configure.ac: Adjust.
2168 * Makefile.am (MOSTLYCLEANFILES): New.
2169 * src/local.mk: Adjust.
2170
2ead32e6
AD
21712008-11-15 Akim Demaille <demaille@gostai.com>
2172
2173 Move sc_tight_scope into maint.mk.
b06df3c2
AD
2174 It does not work, and I don't know how it was supposed to work: it
2175 seems to be looking for sources in the build tree. I just moved
2176 it at a better place, fixing it is still required.
2177
2ead32e6
AD
2178 * src/local.mk (echo): Remove.
2179 (sc_tight_scope): Move to...
2180 * maint.mk: here.
2181
2df9ec37
AD
21822008-11-15 Akim Demaille <demaille@gostai.com>
2183
2184 Regen.
2185 * src/parse-gram.h, src/parse-gram.h: Regen.
2186
0305d25e
AD
21872008-11-15 Akim Demaille <demaille@gostai.com>
2188
2189 Remove src/Makefile.am.
2190 * src/Makefile.am: Rename as...
2191 * src/local.mk: this.
2192 Prefix all the paths with src/.
2193 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
2194 (AM_CPPFLAGS): Find find in builddir/src.
2195 (YACC): Move the flags into...
2196 (AM_YFLAGS): here.
2197 * maint.mk (sc_tight_scope): Disable.
2198 It used to bounce to the version in src/Makefile.am which is now
2199 part of this very Makefile.
2200 * Makefile.am, configure.ac: Adjust.
2201 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
2202 include "..." to find files "here": we are no longer in src/, so
2203 qualify the includes with src/.
2204 * doc/Makefile.am (PREPATH): No longer include the top_builddir
2205 prefix.
2206 (.x.1): Adjust to be able to create src/foo from the top level
2207 Makefile, instead of going bounce to src/Makefile the creation of
2208 foo.
2209
5277c0a3
AD
22102008-11-15 Akim Demaille <demaille@gostai.com>
2211
2212 Remove useless variable.
2213 * doc/Makefile.am (srcsrcdir): Remove.
2214
6a5aa0cd
AD
22152008-11-15 Akim Demaille <demaille@gostai.com>
2216
2217 Remove data/Makefile.am.
2218 * data/Makefile.am: Rename as...
2219 * data/local.mk: this.
2220 Adjust paths.
2221 * Makefile.am, configure.ac: Adjust.
2222
7cb794dc
AD
22232008-11-15 Akim Demaille <demaille@gostai.com>
2224
2225 Remove etc/Makefile.am.
2226 * etc/Makefile.am: Rename as...
2227 * etc/local.mk: this.
2228 Adjust.
2229 * Makefile.am, configure.ac: Adjust.
2230
cd409e3b
AD
22312008-11-15 Akim Demaille <demaille@gostai.com>
2232
2233 Remove examples/local.mk.
2234 examples/calc++/Makefile.am might be interesting to keep as is, since
2235 it is an example in itself.
2df9ec37 2236
cd409e3b
AD
2237 * examples/Makefile.am: Rename as...
2238 * examples/local.mk: this.
2239 Adjust.
2240 * Makefile.am, configure.ac: Adjust.
2241
9a1e4214
AD
22422008-11-15 Akim Demaille <demaille@gostai.com>
2243
2244 Remove build-aux/Makefile.am.
2245 Recursive Makefiles are really way too slow, let's get rid of some of
2246 them.
2df9ec37 2247
9a1e4214
AD
2248 * build-aux/Makefile.am: Rename as...
2249 * build-aux/local.mk: this.
2250 Adjust paths.
2251 * Makefile.am, configure.ac: Adjust.
2252
0634493c
AD
22532008-11-15 Akim Demaille <demaille@gostai.com>
2254
2255 Provide convenience constructors for locations and positions.
2256 * data/location.cc (position::position): Accept file, line and
2257 column as arguments with default values.
2258 Always qualify initial line and column literals as unsigned.
2259 (location::location): Provide convenience constructors.
2260
fe1b448a
AD
22612008-11-15 Akim Demaille <demaille@gostai.com>
2262
b06df3c2
AD
2263 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
2264 token type.
fe1b448a
AD
2265 Using template buys us nothing, and makes it uselessly complex to
2266 construct a symbol. Besides, it could not be generalized to other
2267 languages, while make_FOO would work in C/Java etc.
2df9ec37 2268
fe1b448a
AD
2269 * data/lalr1.cc (b4_symbol_): New.
2270 (b4_symbol): Use it.
2271 (b4_symbol_constructor_declaration_)
2272 (b4_symbol_constructor_definition_): Instead of generating
2273 specializations of an overloaded template function, just generate
2274 several functions whose names are forged from the token names
2275 without the token.prefix.
2276 (b4_symbol_constructor_declarations): Generate them for all the
2277 symbols, not just by class of symbol type, now that instead of
2278 specializing a function template by the token, we generate a
2279 function named after the token.
2280 (b4_symbol_constructor_specialization_)
2281 (b4_symbol_constructor_specializations): Remove.
2282 * etc/bench.pl.in: Adjust to this new API.
2283
5679f311
AD
22842008-11-13 Akim Demaille <demaille@gostai.com>
2285
2286 %define token.prefix.
b06df3c2
AD
2287 Provide a means to add a prefix to the name of the tokens as
2288 output in the generated files. Because of name clashes, it is
2289 good to have such a prefix such as TOK_ that protects from names
2290 such as EOF, FILE etc. But it clutters the grammar itself.
2df9ec37 2291
5679f311
AD
2292 * data/bison.m4 (token.prefix): Empty by default.
2293 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
2294 * data/lalr1.cc (b4_symbol): Ditto.
2295
3204049e
AD
22962008-11-13 Akim Demaille <demaille@gostai.com>
2297
2298 Compute at M4 time some of the subtractions.
90290ce5 2299 * data/lalr1.cc (b4_subtract): New.
3204049e
AD
2300 (b4_rhs_data): Use it.
2301
202598d3
AD
23022008-11-13 Akim Demaille <demaille@gostai.com>
2303
2304 symbol::token.
b06df3c2 2305 This allows the user to get the type of a token returned by yylex.
2df9ec37 2306
202598d3
AD
2307 * data/lalr1.cc (symbol::token): New.
2308 (yytoknum_): Define when %define lex_symbol, independently of
2309 %debug.
2310 (yytoken_number_): Move into...
2311 (symbol::token): here, since that's the only use.
2312 The other one is YYPRINT which was not officially supported
2313 by lalr1.cc, and anyway it did not work since YYPRINT uses this
2314 array under a different name (yytoknum).
2315
fc2476c7
AD
23162008-11-13 Akim Demaille <demaille@gostai.com>
2317
2318 YYERRCODE.
2319 * TODO (YYERRCODE): Mention the case of $undef.
2320
865f1e9f
AD
23212008-11-13 Akim Demaille <demaille@gostai.com>
2322
2323 TODO: YYPRINT.
2324 * TODO (YYPRINT): New.
2325
cb0b136a
AD
23262008-11-13 Akim Demaille <demaille@gostai.com>
2327
2328 Comment changes.
2329 * data/lalr1.cc, data/yacc.c: Fix the description of the
2330 yytranslate and yytoknum tables.
2331
2c086d29
AD
23322008-11-13 Akim Demaille <demaille@gostai.com>
2333
2334 Define make_symbol in the header.
b06df3c2
AD
2335 To reach good performances these functions should be inlined (yet
2336 this is to measure precisely). To this end they must be available
2337 to the caller.
2df9ec37 2338
2c086d29
AD
2339 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
2340 location_type with the class name.
2341 Since will now be output in the header, declare "inline".
2342 No longer use b4_symbol_constructor_specializations, but
2343 b4_symbol_constructor_definitions in the header.
2344 Don't call it in the *.cc file.
2345
1c4af381
AD
23462008-11-13 Akim Demaille <demaille@gostai.com>
2347
2348 Define yytranslate in the header for lex_symbol.
2349 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
2350 into the header file when using %define lex_symbol.
2351 (yytranslate_): Declare inline.
2352
e51b0a82
AD
23532008-11-13 Akim Demaille <demaille@gostai.com>
2354
b06df3c2
AD
2355 Define the constructors of symbol_type in
2356 b4_symbol_constructor_definitions.
e51b0a82 2357 The constructors are called by the make_symbol functions, which a
b06df3c2
AD
2358 forthcoming patch will move elsewhere. Hence the interest of
2359 putting them together.
2df9ec37 2360
b06df3c2
AD
2361 The stack_symbol_type does not need to be moved, it is used only
2362 by the parser.
2df9ec37 2363
e51b0a82
AD
2364 * data/lalr1.cc: Move symbol_type and symbol_base_type
2365 constructors into...
2366 (b4_symbol_constructor_definitions): here.
2367 Adjust.
2368
78835571
AD
23692008-11-13 Akim Demaille <demaille@gostai.com>
2370
2371 Make it easier to move the definition of yytranslate_.
2372 Forthcoming changes will make it possible to use yytranslate_
2373 from outside the parser implementation file.
2df9ec37 2374
78835571
AD
2375 * data/lalr1.cc (b4_yytranslate_definition): New.
2376 Use it.
2377
c1e6c88c
AD
23782008-11-13 Akim Demaille <demaille@gostai.com>
2379
2380 Remove useless class specification.
2381 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
2382 to refer to the class name to use a type defined by the class for
2383 arguments of member functions.
2384
4654b0c0
AD
23852008-11-13 Akim Demaille <demaille@gostai.com>
2386
2387 Finer input type for yytranslate.
2388 This patch is debatable: the tradition expects yylex to return an int
2389 which happens to correspond to token_number (which is an enum). This
2390 allows for instance to return characters (such as '*' etc.). But this
2391 goes against the stronger typing I am trying to have with the new
2392 lex interface which return a symbol_type. So in this case, feed
2393 yytranslate_ with a token_type.
2df9ec37 2394
4654b0c0
AD
2395 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
2396 expect a token_type.
2397
dd735e4e
AD
23982008-11-13 Akim Demaille <demaille@gostai.com>
2399
2400 Honor lex-params in %define lex_symbol mode.
2401 * data/lalr1.cc: Use b4_lex_param.
2402
6659366c
AD
24032008-11-13 Akim Demaille <demaille@gostai.com>
2404
2405 Simplify names.
2406 * src/output.c (symbol_definitions_output): Rename symbol
2407 attributes type_name and has_type_name as type and has_type.
2408 * data/lalr1.cc: Adjust uses.
2409
e9805e57
AD
24102008-11-13 Akim Demaille <demaille@gostai.com>
2411
2412 Use b4_type_names for the union type.
b06df3c2
AD
2413 The union used to compute the size of the variant used to iterate
2414 over the type of all the symbols, with a lot of redundancy. Now
2415 iterate over the lists of symbols having the same type-name.
2df9ec37 2416
e9805e57
AD
2417 * data/lalr1.cc (b4_char_sizeof_): New.
2418 (b4_char_sizeof): Use it.
2419 Adjust to be called with a list of numbers instead of a single
2420 number.
2421 Adjust its caller for new-line issues.
2422
aea10ef4
AD
24232008-11-13 Akim Demaille <demaille@gostai.com>
2424
2425 Define the "identifier" of a symbol.
b06df3c2
AD
2426 Symbols may have several string representations, for instance if
2427 they have an alias. What I call its "id" is a string that can be
2428 used as an identifier. May not exist.
2df9ec37 2429
b06df3c2
AD
2430 Currently the symbols which have the "tag_is_id" flag set are
2431 those that don't have an alias. Look harder for the id.
2df9ec37 2432
aea10ef4
AD
2433 * src/output.c (is_identifier): Move to...
2434 * src/symtab.c (is_identifier): here.
2435 * src/symtab.h, src/symtab.c (symbol_id_get): New.
2436 * src/output.c (symbol_definitions_output): Use it to define "id"
2437 and "has_id".
2438 Remove the definition of "tag_is_id".
2439 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
2440 "tag_is_id" were used to produce code.
2441 We still use "tag" for documentation.
2442
2ea7730c
AD
24432008-11-11 Akim Demaille <demaille@gostai.com>
2444
2445 Locations are no longer required by lalr1.cc.
2446 * data/lalr1.cc (_b4_args, b4_args): New.
2447 Adjust all uses of locations to make them optional.
2448 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
2449 (AT_CHECK_NAMESPACE): Check the use of locations.
2450 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
2451 without locations with lalr1.cc.
2452 Test these cases.
2453 * tests/output.at: Check lalr1.cc with and without location
2454 support.
2455 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
2456 Don't use locations.
2457
7ca2266a
AD
24582008-11-11 Akim Demaille <demaille@gostai.com>
2459
2460 AT_FULL_COMPILE.
2461 * tests/local.at (AT_FULL_COMPILE): New.
2462 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
2463
1a7a65f9
AD
24642008-11-11 Akim Demaille <demaille@gostai.com>
2465
2466 Support parens in calc++.
2467 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
2468 * examples/calc++/test (run): Check the expected output.
2469 Adjust callers.
2470 Check parens too.
2471
c944f7f2
AD
24722008-11-11 Akim Demaille <demaille@gostai.com>
2473
2474 Simplify lalr1.cc since %defines is mandatory.
2475 * data/lalr1.cc: Remove useless calls to b4_defines_if.
2476
dada3cd1
AD
24772008-11-11 Akim Demaille <demaille@gostai.com>
2478
2479 TODO: yyfmt.
2480 * TODO (yysyntax_error): New item.
2481
422c18f4
AD
24822008-11-11 Akim Demaille <demaille@gostai.com>
2483
2484 Prefer M4 to CPP.
2485 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
2486 YYERROR_VERBOSE.
2487
a0ffc175
AD
24882008-11-11 Akim Demaille <demaille@gostai.com>
2489
2490 Support i18n of the parse error messages.
2491 * TODO (lalr1.cc/I18n): Remove.
2492 * data/lalr1.cc (yysyntax_error_): Support the translation of the
2493 error messages, as done in yacc.c.
2494 Stay within the yy* pseudo namespace.
2495
00a8a083
AD
24962008-11-11 Akim Demaille <demaille@gostai.com>
2497
2498 More TODO.
2499 * TODO (single stack, yysyntax_error): New.
2500
09277875
AD
25012008-11-11 Akim Demaille <demaille@gostai.com>
2502
2503 Make it possible to return a symbol_type from yylex.
2504 * data/lalr1.cc (b4_lex_symbol_if): New.
2505 (parse): When lex_symbol is defined, expected yylex to return the
2506 complete lookahead.
2507 * etc/bench.pl.in (generate_grammar_list): Extend to support this
2508 yylex interface.
2509 (bench_variant_parser): Exercise it.
2510
64c1b92a
AD
25112008-11-11 Akim Demaille <demaille@gostai.com>
2512
2513 Remove useless bench case.
2514 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
2515 no longer used.
2516
2722aa42
AD
25172008-11-11 Akim Demaille <demaille@gostai.com>
2518
2519 Improve display of directives.
2520 * etc/bench.pl.in (parse_term): Don't add useless eol.
2521
918eb7c5
AD
25222008-11-11 Akim Demaille <demaille@gostai.com>
2523
2524 Use string_cast in the bench.
2525 * etc/bench.pl.in (generate_grammar_list): Define and use
2526 string_cast.
2527
39be9022
AD
25282008-11-11 Akim Demaille <demaille@gostai.com>
2529
2530 Replace yychar with a Boolean.
2531 * data/lalr1.cc (parse::yychar): Replace by...
2532 (parse::yyempty): this.
2533
a2e3fa77
AD
25342008-11-11 Akim Demaille <demaille@gostai.com>
2535
2536 Factor the tables.
2537 * TODO: New item.
2538
aba12ad1
AD
25392008-11-11 Akim Demaille <demaille@gostai.com>
2540
2541 Let yytranslate handle the eof case.
2542 * data/lalr1.cc (yytranslate_): Handle the EOF case.
2543 Adjust callers.
2544 No longer expect yychar to be equal to yyeof_, rather, test the
2545 lookahead's (translated) kind.
2546
27cb5b59
AD
25472008-11-11 Akim Demaille <demaille@gostai.com>
2548
2549 yychar cannot be empty in yyerrlab.
2550 * TODO (yychar == yyempty_): New.
2551 * data/lalr1.cc: Remove the handling of this case.
2552 This eases forthcoming changes related to yychar and yytranslate.
2553
fce629c0
AD
25542008-11-11 Akim Demaille <demaille@gostai.com>
2555
2556 Bench: syntactic sugar for %define/#define.
2557 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
2558 (&bench_push_parser, bench_variant_parser): Use this feature.
2559 (&eat): New.
2560 Use it.
2561
ce671960
AD
25622008-11-11 Akim Demaille <demaille@gostai.com>
2563
2564 Less memory pressure on the "list" bench.
2565 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
2566 the values, to limit memory pressure.
2567
2873fdf8
AD
25682008-11-11 Akim Demaille <demaille@gostai.com>
2569
2570 Introduce make_symbol.
b06df3c2
AD
2571 make_symbol provides a means to construct a full symbol (kind,
2572 value, location) in a single shot. It is meant to be a Symbol
2573 constructor, parameterized by the symbol kind so that overloading
2574 would prevent incorrect kind/value pairs. Unfortunately
2575 parameterized constructors do not work well in C++ (unless the
2576 parameter also appears as an argument, which is not acceptable),
2577 hence the use of a function instead of a constructor.
2df9ec37 2578
2873fdf8
AD
2579 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2580 (b4_symbol_constructor_declarations)
2581 (b4_symbol_constructor_specialization_)
2582 (b4_symbol_constructor_specializations)
2583 (b4_symbol_constructor_definition_)
2584 (b4_symbol_constructor_definitions): New.
2585 Use them where appropriate to generate declaration, declaration of
2586 the specializations, and implementations of the templated
2587 overloaded function "make_symbol".
2588 (variant::variant): Always define a default ctor.
2589 Also provide a copy ctor.
2590 (symbol_base_type, symbol_type): New ctor overloads for value-less
2591 symbols.
2592 (symbol_type): Now public, so that functions such as yylex can use
2593 it.
2594
8be046d7
AD
25952008-11-11 Akim Demaille <demaille@gostai.com>
2596
2597 Inform m4 whether a tag is a valid id.
2598 * src/output.c (is_identifier): New.
2599 (symbol_definitions_output): Use it to define tag_is_id.
2600 But maybe this should be done at m4 level?
2601
de62edee
AD
26022008-11-11 Akim Demaille <demaille@gostai.com>
2603
2604 Test 214 was failing: it greps with a pattern containing [ ]*
2605 which obviously meant to catch spaces and tabs, but contained only
2606 spaces. Tabulations in sources are a nuisance, so to simplify the
2607 matter, get rid of all the tabulations in the Java sources. The
2608 other skeletons will be treated equally later.
2609
2610 * data/java.m4, data/lalr1.java: Untabify.
2611 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
2612 tabulations are no longer generated.
2613
905f0697
PB
26142008-11-11 Paolo Bonzini <bonzini@gnu.org>
2615
2616 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2617 * configure.ac: Adjust usage.
2618 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2619 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2620 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2621
09ccae9b
DJ
26222008-11-10 Di-an Jan <dianj@freeshell.org>
2623
2624 Workaround Java's ``code too large'' problem for parser tables
2625 in most cases, by using one function per initialization.
2626 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
2627 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
2628 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
2629 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
2630 (yytname_): Use b4_typed_parser_table.
2631 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
2632 ``code too large'' error.
2633
1979121c
DJ
26342008-11-10 Di-an Jan <dianj@freeshell.org>
2635
2636 * NEWS: Document them.
de62edee 2637
1979121c
DJ
2638 General Java skeleton improvements.
2639 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
2640 using gcj < 4.3 in the testsuite, according to comments in
2641 gnulib/m4/javacomp.m4.
2642 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
2643 location_type, position_type): Remove extraneous brackets from
2644 b4_percent_define_default.
2645 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
2646 m4_define and m4_define_default.
2647 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
2648 which marks the end of user code with appropriate syncline, like all
2649 the other skeletons.
2650 (b4_user_post_prologue): Add. Don't silently drop.
2651 (yylex): Remove.
2652 (parse): Inline yylex.
2653 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
2654 (%{...%}): Fix typo of %code imports.
2655 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
2656
2657 Support annotations on parser class with %define annotations.
2658 * data/lalr1.java (annotations): Add to parser class modifier.
2659 * doc/bison.texinfo (Java Parser Interface): Document
2660 %define annotations.
2661 (Java Declarations Summary): Document %define annotations.
2662 * tests/java.at (Java parser class modifiers): Test annotations.
2663
2664 Do not generate code for %error-verbose unless requested.
2665 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
2666 Make private. Make conditional on %error-verbose.
2667 (getErrorVerbose, setErrorVerbose): New.
2668 (yytnamerr_): Make conditional on %error-verbose.
2669 (yysyntax_error): Make some code conditional on %error-verbose.
2670 * doc/bison.texinfo (Java Bison Interface): Remove the parts
2671 about %error-verbose having no effect.
2672 (getErrorVerbose, setErrorVerbose): Document.
2673
2674 Move constants for token names to Lexer interface.
2675 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
2676 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
2677 (parse): Qualify EOF to Lexer.EOF.
2678 * doc/bison.texinfo (Java Parser Interface): Move documentation of
2679 EOF and token names to Java Lexer Interface.
2680 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
2681
2682 Make yyerror public.
2683 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
2684 (yyerror): Change to public. Add Javadoc comments. Use longer
2685 parameter names. Make the body rather than the declarator
2686 conditional on %locations.
2687 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
2688
2689 Allow user to add code to the constructor with %code init.
2690 * data/java.m4 (b4_init_throws): New, for %define init_throws.
2691 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
2692 Add %code init to the front of the constructor body.
2693 * doc/bison.texinfo (YYParser.YYParser): Document %code init
2694 and %define init_throws.
2695 (Java Declarations Summary): Document %code init and
2696 %define init_throws.
2697 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
2698 (Java constructor init and init_throws): Add tests.
de62edee 2699
42f832d6
AD
27002008-11-10 Akim Demaille <demaille@gostai.com>
2701
2702 Update TODO.
2703 * TODO (-D): is implemented.
2704 (associativity): Same precedence must have the same associativity.
2705 For instance, how can a * b / c be parsed if * is %left and / is
2706 %right?
2707 (YYERRORCODE, YYFAIL, YYBACKUP): New.
2708
247efe34
AD
27092008-11-10 Akim Demaille <demaille@gostai.com>
2710
2711 Formatting changes.
2712
5d731440
AD
27132008-11-10 Akim Demaille <demaille@gostai.com>
2714
2715 More information about the symbols.
2716 * src/output.c (type_names_output): Document all the symbols,
2717 including those that don't have a type-name.
2718 (symbol_definitions_output): Define "is_token" and
2719 "has_type_name".
2720 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
2721 type-name, now that they are defined too in b4_type_names.
2722
21db118b
AD
27232008-11-10 Akim Demaille <demaille@gostai.com>
2724
2725 Regen.
2726
6ed15cde
AD
27272008-11-10 Akim Demaille <demaille@gostai.com>
2728
2729 Make parser::yytranslate static.
b06df3c2
AD
2730 Small speedup (1%) on the list grammar. And makes yytranslate_
2731 available in non member functions.
de62edee 2732
6ed15cde
AD
2733 * data/lalr1.cc (yytranslate_): Does not need to be a instance
2734 function.
2735
30bb2edc
AD
27362008-11-10 Akim Demaille <demaille@gostai.com>
2737
2738 Avoid trailing spaces.
2739 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
2740 * data/lalr1.cc: Don't indent before rule and symbol actions, as
2741 they can be empty, and anyway this incorrectly indents the first
2742 action.
2743
b3a28fd4
AD
27442008-11-10 Akim Demaille <demaille@gostai.com>
2745
2746 Comment changes.
2747
914202bd
AD
27482008-11-10 Akim Demaille <demaille@gostai.com>
2749
2750 Use "enum" for integral constants.
2751 This is just nicer to read, I observed no speedup.
de62edee 2752
914202bd
AD
2753 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
2754 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
2755 (yyuser_token_number_max_, yyundef_token_): Move into...
2756 (yytranslate_): here.
2757
c17f9a4a
AD
27582008-11-10 Akim Demaille <demaille@gostai.com>
2759
2760 Shortcuts in bench directives.
2761 * etc/bench.pl.in (parse_dirs): New.
2762 Use it.
2763 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
2764 Create the benches in "benches/".
2765
b9855ea5
AD
27662008-11-10 Akim Demaille <demaille@gostai.com>
2767
2768 Formatting changes.
2769 * data/lalr1.cc: here.
2770
6e097787
AD
27712008-11-10 Akim Demaille <demaille@gostai.com>
2772
2773 Adjust verbose message to using emacs.
2774 * etc/bench.pl.in: Inform compilation-mode when we change the
2775 directory.
2776 (generate_grammar_list): Recognize %define "variant" in addition
2777 to %define variant.
2778
4c3cc7da
AD
27792008-11-10 Akim Demaille <demaille@gostai.com>
2780
2781 Classify symbols by type-name.
2782 * src/uniqstr.h (UNIQSTR_CMP): New.
2783 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
2784 (type_names_output): New.
2785 (muscles_output): Use it.
2786 * data/lalr1.cc (b4_symbol_action_): Remove.
2787 (b4_symbol_case_, b4_type_action_): New.
2788 Adjust uses of b4_symbol_action_ to use b4_type_action_.
2789
d69c9694
AD
27902008-11-10 Akim Demaille <demaille@gostai.com>
2791
2792 Change the handling of the symbols in the skeletons.
2793 Before we were using tables which lines were the symbols and which
2794 columns were things like number, tag, type-name etc. It is was
2795 difficult to extend: each time a column was added, all the numbers had
2796 to be updated (you asked for colon $2, not for "tag"). Also, it was
2797 hard to filter these tables when only a subset of the symbols (say the
2798 tokens, or the nterms, or the tokens that have and external number
2799 *and* a type-name) was of interest.
de62edee 2800
d69c9694
AD
2801 Now instead of monolithic tables, we define one macro per cell. For
2802 instance "b4_symbol(0, tag)" is a macro name which contents is
2803 self-decriptive. The macro "b4_symbol" provides easier access to
2804 these cells.
de62edee 2805
d69c9694
AD
2806 * src/output.c (type_names_output): Remove.
2807 (symbol_numbers_output, symbol_definitions_output): New.
2808 (muscles_output): Call them.
2809 (prepare_symbols): Define b4_symbols_number.
2810
5263bea9
AD
28112008-11-10 Akim Demaille <demaille@gostai.com>
2812
2813 --trace=muscles
2814 * src/getargs.h, src/getargs.c (trace_muscle): New.
2815 (trace_types, trace_args): Support it.
2816 * src/output.c (output_skeleton): Use it.
2817
4175f6bb
AD
28182008-11-10 Akim Demaille <demaille@gostai.com>
2819
2820 muscles_output.
2821 * src/output.c (muscles_output): New, extracted from...
2822 (output_skeleton): here.
2823 Adjust.
2824
1de69d6a
AD
28252008-11-10 Akim Demaille <demaille@gostai.com>
2826
2827 Formatting changes.
2828
36db78a7
AD
28292008-11-10 Akim Demaille <demaille@gostai.com>
2830
2831 Update the variant example.
2832 * examples/variant.yy: Formatting changes.
2833 One stage build.
2834
e5eb92e7
AD
28352008-11-10 Akim Demaille <demaille@gostai.com>
2836
2837 Support constructor with an argument.
2838 This improves the "list" bench by 2%.
de62edee 2839
e5eb92e7
AD
2840 * data/lalr1.cc (variant::build): Add an overloaded version with
2841 an argument.
2842 * tests/c++.at (AT_CHECK_VARIANT): Check it.
2843
76307410
AD
28442008-11-10 Akim Demaille <demaille@gostai.com>
2845
2846 Test variants.
2847 * tests/c++.at (AT_CHECK_VARIANTS): New.
2848 Use it with and without %define assert.
2849
d78f0ac9
AD
28502008-11-10 Akim Demaille <demaille@gostai.com>
2851
2852 Add %precedence support.
2853 Unfortunately it is not possible to reuse the %prec directive. This
2854 is because to please POSIX, we do not require to end the rules with a
2855 semicolon. As a result,
de62edee 2856
d78f0ac9 2857 foo: bar %prec baz
de62edee 2858
d78f0ac9
AD
2859 is ambiguous: either a rule which precedence is that of baz, or a rule,
2860 and then a declaration of the precedence of the token baz.
de62edee 2861
d78f0ac9
AD
2862 * doc/bison.texinfo: Document %precedence.
2863 (Precedence Only): New.
2864 * src/assoc.h, src/assoc.c (precedence_assoc): New.
2865 * src/conflicts.c (resolve_sr_conflict): Support it.
2866 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
2867 Parse it.
2868 * tests/calc.at: Use %precedence for NEG.
2869 * tests/conflicts.at (%precedence does not suffice)
2870 (%precedence suffices): New tests.
2871
c85be41a
AD
28722008-11-09 Akim Demaille <demaille@gostai.com>
2873
2874 Make benches in a sub dirs.
2875 * etc/bench.pl.in ($dir): New.
2876 Use it.
2877 Check the use of constructors with an argument.
2878 (bench_variant_parser): Fix.
2879
db65ca1f
AD
28802008-11-09 Akim Demaille <demaille@gostai.com>
2881
2882 fix eof condition
2883
9b0efa5b
AD
28842008-11-09 Akim Demaille <demaille@gostai.com>
2885
2886 Fix --help.
2887
432ac57a
AD
28882008-11-09 Akim Demaille <demaille@gostai.com>
2889
2890 Require the generation of parse-gram.output.
2891 * src/Makefile.am (YACC): Pass --report=all.
2892
deef2a0a
AD
28932008-11-09 Akim Demaille <demaille@gostai.com>
2894
2895 Formatting changes.
2896
df72984a
AD
28972008-11-09 Akim Demaille <demaille@gostai.com>
2898
2899 Update TODO.
2900 * TODO: Remove obsolete items.
2901 Update others.
2902
f10e19fd
AD
29032008-11-09 Akim Demaille <demaille@gostai.com>
2904
2905 Enhance bench.pl.
2906 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
2907 (@token, $grammar, $bench): New.
2908 (generate_grammar_variant): Rename as...
2909 (generate_grammar_list): this.
2910 (generate_grammar): Adjust.
2911 (bench_grammar): Rename as...
2912 (bench): this.
2913 Use it in the various bench-marking routines.
2914 (-b, -g): New options.
2915
5de9c593
AD
29162008-11-09 Akim Demaille <demaille@gostai.com>
2917
2918 Use a static hierarchy for symbols in the C++ parser.
2919 * data/lalr1.cc (symbol_base_type, symbol_type)
2920 (stack_symbol_type): Make it a static hierarchy.
2921 Adjust dependencies.
2922
757f8f98
AD
29232008-11-09 Akim Demaille <demaille@gostai.com>
2924
2925 bench.pl -d, --directive.
2926 * etc/bench.pl.in (@directive): New.
2927 (&bench_grammar): Use it.
2928 (&bench_list_grammar): New, to provide access to the "variant"
2929 grammar.
2930 Use it.
2931 (getopts): Support -d, --directive.
2932
d3be4f6d
AD
29332008-11-09 Akim Demaille <demaille@gostai.com>
2934
2935 Use inline for small operations.
2936 * data/lalr1.cc (symbol_base_type, symbol_type)
2937 (stack_symbol_type): Declare constructor and other operations as
2938 inline.
2939 (yy_destroy_): Inline.
2940
1f7d007b
AD
29412008-11-09 Akim Demaille <demaille@gostai.com>
2942
2943 Introduce a hierarchy for symbols.
2944 * data/lalr1.cc (symbol_base_type, symbol_type): New.
2945 (data_type): Rename as...
2946 (stack_symbol_type): this.
2947 Derive from symbol_base_type.
2948 (yy_symbol_value_print_): Merge into...
2949 (yy_symbol_print_): this.
2950 Rename as...
2951 (yy_print_): this.
2952 (yydestruct_): Rename as...
2953 (yy_destroy_): this.
2954 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
2955 (parser::parse): yyla is now of symbol_type.
2956 Use its type member instead of yytoken.
2957
bc0b0477
AD
29582008-11-09 Akim Demaille <demaille@gostai.com>
2959
2960 Rename data_type and stack_symbol_type.
2961 * data/lalr1.cc (data_type): Rename as...
2962 (stack_symbol_type): this.
2963
57295d14
AD
29642008-11-09 Akim Demaille <demaille@gostai.com>
2965
2966 Handle semantic value and location together.
2967 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
2968 yydata.value and yydata.location.
2969 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
2970 (YY_SYMBOL_PRINT): Now take semantic value and location as a
2971 single arg.
2972 Adjust all callers.
2973 (yydestruct_): New overload for a stack symbol.
2974
e9b0834e
AD
29752008-11-09 Akim Demaille <demaille@gostai.com>
2976
2977 Push a complete symbol, not connected parts.
2978 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
2979 state, value and location.
2980 Adjust callers.
2981
6082531a
AD
29822008-11-09 Akim Demaille <demaille@gostai.com>
2983
2984 Agregate yylval and yylloc.
2985 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
2986 (parser::yyla): this.
2987
33c195cc
AD
29882008-11-09 Akim Demaille <demaille@gostai.com>
2989
2990 Rely on the state stack to display reduction traces.
b06df3c2
AD
2991 To display rhs symbols before a reduction, we used information
2992 about the rule reduced, which required the tables yyrhs and
2993 yyprhs. Now use rely only on the state stack to get the same
2994 information.
de62edee 2995
33c195cc
AD
2996 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
2997 Use them.
2998 (parser::yyrhs_, parser::yyprhs_): Remove.
2999 (parser::yy_reduce_print_): Use the state stack.
3000
e1f93869
AD
30012008-11-09 Akim Demaille <demaille@gostai.com>
3002
3003 Fuse yyval and yyloc into yylhs.
3004 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3005 yylhs.
3006 (parse): Replace yyval and yyloc with yylhs.value and
3007 yylhs.location.
3008 After a user action, compute yylhs.state earlier.
3009 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3010 fresh error_token.
3011
2935744b
DJ
30122008-11-09 Di-an Jan <dianj@freeshell.org>
3013
3014 Remove unused variable.
3015 * src/output.c (type_names_output): Remove unused variable sep.
3016
bbf9ca37
PB
30172008-11-09 Paolo Bonzini <bonzini@gnu.org>
3018
3019 Change tests/output.at quoting.
3020 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3021 expanding arguments.
3022
d9a9b96b
JD
30232008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3024
3025 Don't add a semicolon to actions for %skeleton or %language.
3026 It breaks Java test cases as reported by Akim Demaille.
3027 * src/scan-code.l: Implement.
3028
51365192
JD
30292008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3030
3031 Clean up %skeleton and %language priority implementation.
3032 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3033 remove static qualifier because others will soon need to see it.
3034 (language_prio): Likewise.
3035 (getargs): Use command_line_prio rather than 0.
3036 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3037 enum fields.
3038 (skeleton_prio): Extern it.
3039 (language_prio): Extern it.
3040 * src/parse-gram.y: Use grammar_prio rather than 1.
3041
9380cfd0
AD
30422008-11-07 Akim Demaille <demaille@gostai.com>
3043
3044 Moving push traces into yypush_.
3045 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3046 Adjust all uses.
3047
8901f32e
AD
30482008-11-07 Akim Demaille <demaille@gostai.com>
3049
3050 The single-stack C++ parser is now the standard one.
3051 * data/lalr1.cc: Rename as...
3052 * data/lalr1-split.cc: this.
3053 * data/lalr1-fusion.cc: Rename as...
3054 * data/lalr1.cc: this.
3055 * etc/bench.pl.in: Adjust.
3056
8cdabf02
AD
30572008-11-07 Akim Demaille <demaille@gostai.com>
3058
3059 Avoid empty-if warnings.
3060 Reported by Quentin Hocquet.
de62edee 3061
8cdabf02
AD
3062 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3063 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3064
5a893c2b
AD
30652008-11-07 Akim Demaille <demaille@gostai.com>
3066
3067 Pass command line location to skeleton_arg and language_argmatch.
3068 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3069 The location argument is now mandatory.
3070 Adjust all dependencies.
3071 (getargs): Use command_line_location.
3072
58697c6d
AD
30732008-11-07 Akim Demaille <demaille@gostai.com>
3074
3075 -D, --define.
3076 * src/getargs.c (usage): Document -D.
3077 Fix help string for --locations.
3078 (command_line_location): New.
3079 (short_options, long_options, getargs): Support -D, --define.
3080 (getargs): Move -d support at the right place.
3081 * doc/bison.texinfo (Bison Options): Update.
3082 * tests/input.at (%define, --define): New.
3083
9fe5a457
AD
30842008-11-07 Akim Demaille <demaille@gostai.com>
3085
3086 Initialize the muscle table before parsing the command line.
3087 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3088 (getargs): Define file_name.
3089 * src/main.c (main): Initialize muscle_tab before calling
3090 getargs.
3091 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3092 its value is not available yet.
3093
56c5eca9
AD
30942008-11-07 Akim Demaille <demaille@gostai.com>
3095
3096 Locations without columns for command line arguments.
3097 * src/location.c (location_print): Don't display negative columns.
3098 * src/location.h: Document this.
3099
9b9e0a7d
AD
31002008-11-07 Akim Demaille <demaille@gostai.com>
3101
3102 Fix --help.
3103 * src/getargs.c (usage): Fix help string for -W.
3104
74eae918
AD
31052008-11-07 Akim Demaille <demaille@gostai.com>
3106
3107 Handle more general types of option arguments.
3108 * build-aux/cross-options.pl: The argument ends at the first
3109 space, not the first non-symbol character.
3110 Use @var for each word appearing the argument description.
3111
a3d4c6fb
AD
31122008-11-07 Akim Demaille <demaille@gostai.com>
3113
3114 Destroy the variants that remain on the stack in case of error.
3115 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3116 destructor.
3117 Display the value only if yymsg is nonnull.
3118 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3119
2d32fc9f
AD
31202008-11-07 Akim Demaille <demaille@gostai.com>
3121
3122 Add "%define assert" to variants.
3123 This is used to help the user catch cases where some value gets
3124 ovewritten by a new one. This should not happen, as this will
3125 probably leak.
de62edee 3126
2d32fc9f
AD
3127 Unfortunately this uncovered a bug in the C++ parser itself: the
3128 lookahead value was not destroyed between two calls to yylex. For
3129 instance if the previous lookahead was a std::string, and then an int,
3130 then the value of the std::string was correctly taken (i.e., the
3131 lookahead was now an empty string), but std::string structure itself
3132 was not reclaimed.
de62edee 3133
2d32fc9f
AD
3134 This is now done in variant::build(other&) (which is used to take the
3135 value of the lookahead): other is not only stolen from its value, it
3136 is also destroyed. This incurs a new performance penalty of a few
3137 percent, and union becomes faster again.
de62edee 3138
2d32fc9f
AD
3139 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
3140 (b4_variant_if): New.
3141 (variant::built): New.
3142 Use it whereever the status of the variant changes.
3143 * etc/bench.pl.in: Check the penalty of %define assert.
3144
f6038cb8
AD
31452008-11-07 Akim Demaille <demaille@gostai.com>
3146
3147 Use "%define variant" in bench.pl.
3148 * etc/bench.pl.in: No longer use the pseudo directive %variants,
3149 just use %define variants.
3150
ccde1f98
AD
31512008-11-07 Akim Demaille <demaille@gostai.com>
3152
3153 Regen.
3154 * src/parse-gram.h, src/parse-gram.c: Regen.
3155
58bd33b7
JD
31562008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3157
3158 Fix user actions without a trailing semicolon.
3159 Reported by Sergei Steshenko at
3160 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3161 * THANKS (Sergei Steshenko): Add.
3162 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3163 * tests/regression.at (Fix user actions without a trailing semicolon):
3164 New test case.
3165
639867b5
AD
31662008-11-04 Akim Demaille <demaille@gostai.com>
3167
3168 Use b4_copyright_years.
3169 * data/yacc.c (b4_copyright_years): New.
3170 Fix its value according to the comments in the file.
3171 Use it and undefine it.
3172
3c262606
AD
31732008-11-04 Akim Demaille <demaille@gostai.com>
3174
3175 Formatting changes.
3176 * data/lalr1-fusion.cc, src/parse-gram.y: here.
3177
a2b93d52
AD
31782008-11-04 Akim Demaille <demaille@gostai.com>
3179
3180 Formatting changes.
3181 * data/lalr1-fusion.cc: here.
3182
3a2803df
AD
31832008-11-04 Akim Demaille <demaille@gostai.com>
3184
3185 Use strict on bench.pl.
3186 * etc/bench.pl.in (&run, &generate_grammar): New.
3187 Rename the grammar generating functions for consistency.
3188 Change the interface so that the list of benches to run is passed
3189 as (optionless) arguments.
3190 (&compile): Use &run.
3191
a0d4650a
AD
31922008-11-04 Akim Demaille <demaille@gostai.com>
3193
3194 Remove spurious initial empty lines.
3195 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
3196 * data/yacc.c: End the @output lines with an @.
3197
cac9e09b
AD
31982008-11-04 Akim Demaille <demaille@gostai.com>
3199
3200 Improve the display of sizes.
3201 * etc/bench.p.in: Higher precision.
3202 Sort by decreasing size.
3203
4af4348a
AD
32042008-11-04 Akim Demaille <demaille@gostai.com>
3205
3206 Don't memcpy C++ structures.
3207 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
3208 arguments.
3209 (variant::build): New overload for
3210 copy-construction-that-destroys.
3211 (variant::swap): New.
3212 (parser::yypush_): Use it in variant mode.
3213
ef05c4d6
AD
32142008-11-04 Akim Demaille <demaille@gostai.com>
3215
3216 Better defaults for bench.pl.
3217 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
3218 default values.
3219 Adjust &verbose uses.
3220 (-q, --quiet): New.
3221
9718cfa9
AD
32222008-11-04 Akim Demaille <demaille@gostai.com>
3223
3224 Make variant.yy more complex.
3225 std::list cannot be copied via memcpy, they are more demanding than
3226 std::string. Use one std::list to strengthen the test.
de62edee 3227
9718cfa9
AD
3228 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
3229 Adjust.
3230 Create a list of strings, instead of a single large string.
3231
a6df593d
AD
32322008-11-04 Akim Demaille <demaille@gostai.com>
3233
3234 bench.pl --bench.
3235 * etc/bench.pl.in (--bench, $bench): New.
3236
006a0303
AD
32372008-11-04 Akim Demaille <demaille@gostai.com>
3238
3239 Sort methods.
3240 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
3241 Define it after as().
3242
faef3466
AD
32432008-11-04 Akim Demaille <demaille@gostai.com>
3244
3245 Useless parens.
3246 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
3247
2141aded
AD
32482008-11-04 Akim Demaille <demaille@gostai.com>
3249
3250 Issue missing synclines after user actions.
3251 * data/c.m4 (b4_case): Issue synclines on the output file.
3252
e426d17b
AD
32532008-11-04 Akim Demaille <demaille@gostai.com>
3254
3255 Remove trailing empty line.
3256 * data/lalr1-fusion.cc: Don't add an empty line after the user's
3257 epilogue.
3258
a9ce3f54
AD
32592008-11-04 Akim Demaille <demaille@gostai.com>
3260
3261 Fix output of copyright years.
3262 * data/bison.m4 (b4_copyright): Fix the indentation of the
3263 copyright year paragraph.
3264 Use b4_copyright_years when no years are given.
3265 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
3266 (b4_copyright_years): New.
3267 Use it.
3268
59c544c2
AD
32692008-11-04 Akim Demaille <demaille@gostai.com>
3270
3271 Avoid the spurious initial empty line.
3272 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
3273 the end of @output request to suppress the empty line that
3274 results.
3275
96b15448
AD
32762008-11-04 Akim Demaille <demaille@gostai.com>
3277
3278 Remove parser::rhs_number_type.
3279 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
3280 (yyrhs_): Use b4_table_define.
3281
f0633174
AD
32822008-11-04 Akim Demaille <demaille@gostai.com>
3283
3284 Fix iteration type.
3285 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
3286
417b8004
AD
32872008-11-04 Akim Demaille <demaille@gostai.com>
3288
3289 Factor the declaration of the integer tables.
3290 * data/lalr1-fusion.cc (b4_table_define): New.
3291 Use it.
3292
1a5246c6
AD
32932008-11-03 Akim Demaille <demaille@gostai.com>
3294
3295 Fix indentation of tables in lalr1.cc
3296 * data/lalr1-fusion.cc: Fix the indentation.
3297
f8a95c9c
AD
32982008-11-03 Akim Demaille <demaille@gostai.com>
3299
3300 Destroy the lhs symbols after reduction.
3301 * data/lalr1-fusion.cc (parse): After the user action, when in
3302 variant mode, destroy the lhs symbols.
3303
d7f4d823
AD
33042008-11-03 Akim Demaille <demaille@gostai.com>
3305
3306 Simplify yysyntax_error_ use.
3307 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
3308 type, but make it unnamed in the declaration when it is not used.
3309
8b9c89fb
AD
33102008-11-03 Akim Demaille <demaille@gostai.com>
3311
3312 Let yy::variant::build return an lvalue.
3313 * data/lalr1-fusion.cc (variant::build): Return a reference to the
3314 object.
3315
83243c24
AD
33162008-11-03 Akim Demaille <demaille@gostai.com>
3317
3318 Define yy::variant only when needed.
3319 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
3320 used.
3321
429b4848
AD
33222008-11-03 Akim Demaille <demaille@gostai.com>
3323
3324 Bench the three-stack lalr1.cc.
3325 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
3326 one-stack one.
3327
414c76a4
AD
33282008-11-03 Akim Demaille <demaille@gostai.com>
3329
3330 Fail on parse error in calc++.
3331 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
3332 status.
3333 * examples/calc++/test ($me, $number, $exit, run): New.
3334 Use them to propagate errors to the exit status.
3335
8a5783fd
AD
33362008-11-03 Akim Demaille <demaille@gostai.com>
3337
3338 Don't specify the skeleton twice in the example.
3339 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
3340 file does what is needed.
3341
0cc5bead
AD
33422008-11-03 Akim Demaille <demaille@gostai.com>
3343
3344 bench: Improve output.
3345 * etc/bench.pl.in (bench_grammar): Tune the printf format.
3346
5b421a4e
AD
33472008-11-03 Akim Demaille <demaille@gostai.com>
3348
3349 bench: check impact of %debug on variants.
3350 * etc/bench.pl.in (variant_grammar): Fix the computation of
3351 $variant.
3352 Generate a grammar file that can work with or without %debug.
3353 Do use the @directive.
3354 (bench_variant_parser): Check impact of %debug.
3355 (@directives): Rename all the occurrences to...
3356 (@directive): this, for consistency.
3357
d11ee647
AD
33582008-11-03 Akim Demaille <demaille@gostai.com>
3359
3360 bench: report the size too.
3361 * etc/bench.pl.in ($iterations): Defaults to -3.
3362 (&bench_grammar): Require hireswallclock.
3363 Compute and display the size of the result.
3364 More comments.
3365
e1b74b92
AD
33662008-11-03 Akim Demaille <demaille@gostai.com>
3367
3368 bench: More use of the verbosity level.
3369 * etc/bench.pl.in ($verbose, &verbose): New.
3370 Use them.
3371 More POD documentation.
3372
7e5f9c54
AD
33732008-11-03 Akim Demaille <demaille@gostai.com>
3374
3375 bench.pl: a command line interface
3376 * etc/bench.pl.in: More doc.
3377 Some fixes in the documentation.
3378 ($cflags, $iterations, &help, &getopt): New.
3379 Use them.
3380 (&variant_grammar): Let the number of stages be 10 times what is
3381 specified.
3382
7109a18d
AD
33832008-11-03 Akim Demaille <demaille@gostai.com>
3384
3385 Bench the use of Boost.Variants.
3386 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
3387 New.
3388 (&compile): Be ready to compile C++ parsers.
3389 (&bench_push_parser): Move debug information to the outermost
3390 level.
3391 * THANKS: Add Michiel De Wilde.
3392
922730fe
AD
33932008-11-03 Akim Demaille <demaille@gostai.com>
3394
3395 bench.pl: Pass directives as a list instead of as a string.
3396 * etc/bench.pl.in (&directives): New.
3397 (&triangular_grammar, &calc_grammar): Use it to format the Bison
3398 directives.
3399 (&triangular_grammar): Do use the directives (were ignored).
3400 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
3401 directives.
3402
7484f1d4
AD
34032008-11-03 Akim Demaille <demaille@gostai.com>
3404
3405 Improve genericity of bench.pl.
3406 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
3407 argument.
3408 (&bench_push_parser): New.
3409 Call it.
3410
15129f25
AD
34112008-11-03 Akim Demaille <demaille@gostai.com>
3412
3413 Add documentation to bench.pl.
3414 * etc/bench.pl.in: Comment changes.
3415
0e0ed236
AD
34162008-11-03 Akim Demaille <demaille@gostai.com>
3417
3418 Fuse the three stacks into a single one.
de62edee 3419
b06df3c2
AD
3420 In order to make it easy to perform benchmarks to ensure that
3421 there are no performance loss, lalr1.cc is forked into
3422 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
3423 lalr1.cc.
3424
3425 Meanwhile, to make sure that lalr1-fusion.cc is correctly
3426 exercized by the test suite, the user must install a symbolic link
3427 from lalr1.cc to it.
de62edee 3428
b06df3c2
AD
3429 Instead of having three stacks (state, value, location), use a
3430 stack of triples. This considerably simplifies the code (and it
3431 will be easier not to require locations as currently does the C++
3432 parser), and also gives a 10% speedup according to
3433 etc/bench (probably mainly since memory allocation is done once
3434 instead of three times).
de62edee 3435
0e0ed236
AD
3436 Another motivation is to make it easier to destruct properly
3437 semantic values: now that they are bound to their state (hence
3438 symbol type) it will be easier to call the appropriate destructor.
de62edee 3439
0e0ed236 3440 These changes should probably benefit the C parser too.
de62edee 3441
b06df3c2
AD
3442 * data/lalr1.cc: Copy as...
3443 * data/lalr1-fusion.cc: this new file.
0e0ed236
AD
3444 (b4_rhs_value, b4_rhs_location): New definitions overriding those
3445 from c++.m4.
3446 (state_stack_type, semantic_stack_type, location_stack_type)
3447 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
3448 (data_type, stack_type, yystack_): New.
3449 (YYLLOC_DEFAULT, yypush_): Adjust.
3450 (yyerror_range): Now based on data_type, not location_type.
3451
7dedf26e
AD
34522008-11-03 Akim Demaille <demaille@gostai.com>
3453
3454 Push the state, value, and location at the same time.
3455 This is needed to prepare a forthcoming patch that fuses the three
3456 stacks into one.
de62edee 3457
7dedf26e
AD
3458 * data/lalr1.cc (parser::yypush_): New.
3459 (parser::yynewstate): Change the semantics: instead of arriving to
3460 this label when value and location have been pushed, but yystate
3461 is to be pushed on the state stack, now the three of them must
3462 have been pushed before. yystate still must be the new state.
3463 This allows to use yypush_ everywhere instead of individual
3464 handling of the stacks.
3465
c4585f1e
AD
34662008-11-03 Akim Demaille <demaille@gostai.com>
3467
3468 Prefer references to pointers.
3469 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
3470 definition to use references instead of pointers.
3471 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
3472 Take the value and location as references.
3473 Adjust callers.
3474
56017c17
AD
34752008-11-03 Akim Demaille <demaille@gostai.com>
3476
3477 stack::size instead of stack::height.
3478 * data/lalr1.cc (stack::height): Rename as...
3479 (stack::size): this.
3480 Fix the output type.
3481 Comment changes.
3482
5ab8c47b
AD
34832008-11-03 Akim Demaille <demaille@gostai.com>
3484
3485 Use variants to support objects as semantic values.
b06df3c2
AD
3486 This patch was inspired by work by Michiel De Wilde. But he used
3487 Boost variants which (i) requires Boost on the user side, (ii) is
3488 slow, and (iii) has useless overhead (the parser knows the type of
3489 the semantic value there is no reason to duplicate this
3490 information as Boost.Variants do).
3491
3492 This implementation reserves a buffer large enough to store the
3493 largest objects. yy::variant implements this buffer. It was
3494 implemented with Quentin Hocquet.
de62edee 3495
5ab8c47b
AD
3496 * src/output.c (type_names_output): New.
3497 (output_skeleton): Invoke it.
3498 * data/c++.m4 (b4_variant_if): New.
3499 (b4_symbol_value): If needed, provide a definition for variants.
3500 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
3501 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
3502 (b4_char_sizeof, yy::variant): New.
3503 (parser::parse): If variants are requested, define
3504 parser::union_type, parser::variant, change the definition of
3505 semantic_type, construct $$ before running the user action instead
3506 of performing a default $$ = $1.
3507 * examples/variant.yy: New.
3508 Based on an example by Michiel De Wilde.
3509
1fa5d8bb
AD
35102008-11-03 Akim Demaille <demaille@gostai.com>
3511
3512 Parameterize the extraction of semantic values.
3513 To make future changes easier, no longer rely on ".TYPE" being the
3514 way to get a semantic value.
de62edee 3515
1fa5d8bb
AD
3516 * data/c.m4 (b4_symbol_value): New.
3517 Use it.
3518 * data/c++.m4, data/yacc.c: Use it.
3519 * data/glr.c: Use b4_symbol_value.
3520 (b4_rhs_data): New.
3521 Use it.
3522
91ba8a55
AD
35232008-11-03 Akim Demaille <demaille@gostai.com>
3524
3525 Prepare easier M4 changes.
3526 * data/lalr1.cc: Use escaped [] instead of literals to prepare
3527 future changes.
3528
c9ba9e59
JD
35292008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3530
3531 Initiate further development.
3532 * NEWS: Create an empty section for new entries.
3533 * gnulib: Update submodule to HEAD.
3534
bfb40910
JD
35352008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3536
3537 * NEWS: Version 2.4.
3538
241fda7a
JD
35392008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3540
3541 Prepare for next release.
3542 * NEWS: Briefly mention changes since 2.3b.
3543 * README: Say GNU m4 1.4.6, which we've been requiring in release
3544 announcements already, not 1.4.3, which breaks the build.
3545
ed4d67dc
JD
35462008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3547
3548 Say %language is experimental.
3549 We're thinking of extending it's effect on output file naming. See the
3550 thread at
3551 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
3552 * NEWS: Say it's experimental.
3553 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
3554 recommend it over %skeleton for now.
3555 (Bison Options): Likewise.
3556 (C++ Bison Interface): Use %skeleton not %language.
3557 (Calc++ Parser): Use %skeleton not %language.
3558 * src/getargs.c (usage): Say it's experimental.
3559
e254a580
DJ
35602008-11-01 Di-an Jan <dianj@freeshell.org>
3561 Paolo Bonzini <bonzini@gnu.org>
3562
3563 Support all Java parser class modifiers.
3564 * data/java.m4 (b4_percent_define_get3): New.
3565 (b4_final_if, b4_strictfp_if): New.
3566 * data/lalr1.java (final, strictfp, extends, implements): Support.
3567 * doc/bison.texinfo (final, strictfp, extends, implements): Add
3568 documentation.
3569 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
3570 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
3571 (AT_CHECK_JAVA_GREP): New.
3572 (Java parser class modifiers): New test.
3573 (Java parser class extends and implements): New test.
3574
3575 Model exception propagation better with throws and lex_throws.
3576 * data/java.m4 (b4_list2): New.
3577 (throws): Change default.
3578 * data/lalr1.java (yyaction): Add throws.
3579 (parse): Add lex_throws in addition to throws.
3580 * doc/bison.texinfo (throws, lex_throws): Add documentation.
3581 * tests/java.at (Java throws specifications): New test.
3582
3583 Improve documentation for Java parsers.
3584 * doc/bison.texinfo (Java Parsers): Add subsections.
3585 Don't quote first argument of %define.
3586 (Java Bison Interface): Document output files. Move documentation
3587 of parser class and merge into Java Parser Interface. Document
3588 features that error out. Document directives with no effect.
3589 Move note about Javadoc higher.
3590 (Java Semantic Values): Explicitly mention stype.
3591 Document that generic types cannot be used.
3592 (Java Location Values): Use @deftypeivar. Document constructors.
3593 Correct return value for toString.
3594 (Java Parser Interface): List undocumented constants/fields.
3595 Move documentation of fields added by %parse-param closer to list
3596 of members. Document that token names are added as fields.
3597 Document constructors accurately. Remove error method.
3598 (Java Scanner Interface): Move note on %pure-parser to Java Bison
3599 Interface. Describe %code lexer and yylex accutately.
3600 Remove documentation that does not match the code.
3601 (Java Action Features): New.
3602 (Java Differences): Add reference. Add item on semantic values.
3603 Add note about @{ ... @}. Clarify %% epilogue placement.
3604 (Java Declarations Summary): New.
3605
3606 Fix Java skeleton.
3607 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
3608 (b4_remove_comma): Quote test argument.
3609 (b4_identification): Remove "bison" field.
3610 * tests/java.at (Java parser class and package names): New test.
3611 (Java %parse-param and %lex-param): New test.
3612 (Java stype, position_class and location_class): New test.
3613
f259e4e6
PB
36142008-10-31 Di-an Jan <dianj@freeshell.org>
3615
3616 * data/lalr1.jave: Update copyright years.
3617 (YYParser): Correct name of "generated from" file in Javadoc:
3618 use b4_file_name instead of @ofile@.
3619 (Location constructor): Correct Javadoc parameter name.
3620 (yylloc): Add missing opening m4 quote after b4_location_if.
3621 This removes a stray [ in the Javadoc of Lexer.getStartPos.
3622 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
3623 (YYParser constructor): Correct Javadoc parameter name.
3624
cae5057f
JD
36252008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
3626
3627 Always put auxiliary code files in the same dir as other output files.
3628 * src/files.c (compute_file_name_parts): When the user specifies
3629 --output but not --file-prefix, extract the directory prefix from the
3630 file prefix not from the grammar file name. This affects the location
3631 of files like location.hh generated by the C++ skeleton. The includes
3632 in the other output files require this fix.
3633 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
3634 for expected output files.
3635 (Output files): Add a test for the above.
3636
4af432ba
JD
36372008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
3638
3639 * gnulib: Update submodule to HEAD.
3640
e26d4e43
JD
36412008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3642
3643 Update copyright year.
3644 * src/files.c: Here.
3645
c0ee9e21
DJ
36462008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
3647
3648 Don't overwrite the input file.
3649 * src/files.c (output_file_name_check): Fatal error if using input file
3650 for output.
3651 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
3652 argument.
3653 (Conflicting output files): Add test.
3654
482dc52f
AD
36552008-10-28 Akim Demaille <demaille@gostai.com>
3656
3657 Space changes.
3658 * data/lalr1.cc: Formatting changes.
3659
52cbbe84
AD
36602008-10-28 Akim Demaille <demaille@gostai.com>
3661
3662 Don't define debugging functions when !YYDEBUG.
3663 * data/lalr1.cc (debug_stream, set_debug_stream)
3664 (debug_level_type, debug_level, set_debug_level): Don't
3665 declare them when YYDEBUG is not defined.
3666 The implementation are already YYDEBUG-aware.
3667
0925d5bf
AD
36682008-10-28 Akim Demaille <demaille@gostai.com>
3669
3670 Prefer "continue" for empty loop bodies.
3671 * etc/bench.pl.in: Use "continue" instead of {}.
3672
cf98343c
AD
36732008-10-28 Akim Demaille <demaille@gostai.com>
3674
3675 Space and comments changes.
3676 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3677 * data/c.m4, data/lalr1.cc: Space changes.
3678
9f467b7d
AD
36792008-10-28 Akim Demaille <demaille@gostai.com>
3680
3681 Make gnulib a submodule.
3682 * gnulib: New.
3683 * .gitmodules (gnulib): New.
3684
0f0e1ace
JD
36852008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3686
3687 Fix yyerror_range for user-defined location type in C++. Reported by
3688 Georg Sauthoff at
3689 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3690 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3691 * THANKS (Georg Sauthoff): Add.
3692
548e2104
JD
36932008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3694
3695 Update several administrative files mainly to facilitate releasing.
3696 * HACKING (Administrivia): Make the git-merge-changelog notes more
3697 helpful.
3698 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3699 (Release Procedure): Update for git and add numerous details that were
3700 previously missing.
3701 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3702 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3703 that announcements don't claim we bootstrapped with whatever bison
3704 happened to be in PATH. Add flex as a bootstrap tool.
3705 * Makefile.maint: Remove, previously replaced by maint.mk.
3706 * Makefile.cfg: Remove, and migrate settings to...
3707 * cfg.mk: ... here for the sake of `make announcement'.
3708 * bootstrap.conf (gnulib_modules): Add announce-gen.
3709 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3710 Berry.
3711
ddf17a6e
PB
37122008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3713
3714 Small but important bugfixes for the Java skeleton.
3715 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3716 (yy_symbol_print): Call toString on yyvaluep.
3717
e1145ad8
AD
37182008-08-29 Akim Demaille <demaille@gostai.com>
3719
3720 Clarify UPDATED use.
215b40ac 3721 * doc/bison.texinfo: It refers to the last edition of this file,
e1145ad8 3722 not to the release date of Bison.
215b40ac 3723 Reported by Joel E. Denny.
e1145ad8 3724
0df72d78
AD
37252008-08-29 Akim Demaille <demaille@gostai.com>
3726
3727 * README: Update FAQ pointer.
3728 Reported by Joel E. Denny.
3729
9a90b6bb
EB
37302008-08-27 Eric Blake <ebb9@byu.net>
3731
3732 Resync m4sugar from autoconf.
3733 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3734 (m4_init): Adjust to latest m4.git changes.
3735 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3736 effects.
3737 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3738 (_m4_list_cmp): Reduce side effects.
3739
65015668
AD
37402008-08-27 Akim Demaille <demaille@gostai.com>
3741
3742 Check yyerrok in calc.at.
215b40ac
EB
3743 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3744 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3745 expected.
65015668 3746
98e26a92
AD
37472008-08-27 Akim Demaille <demaille@gostai.com>
3748
3749 Support yyerrok in lalr1.cc.
3750 YYBACKUP is still to import back into lalr1.cc.
215b40ac 3751 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
98e26a92 3752
86c0e784
JD
37532008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3754
3755 For maintainer-check*, don't recompile for a $(VERSION) update.
3756 * cfg.mk: New file.
3757 (_is-dist-target): Override the one in GNUmakefile.
3758 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3759
88511166
JD
37602008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3761
3762 Update for recent change to gnulib.
3763 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3764 string.h now.
3765
6bbb2ed5
EB
37662008-08-15 Eric Blake <ebb9@byu.net>
3767
d67c52e8
EB
3768 Remaining m4sugar merge from autoconf.
3769 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3770 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3771 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3772 * src/output.c (output_skeleton): Tell m4 how to find it.
3773
6bbb2ed5
EB
3774 Partial m4sugar merge from autoconf: m4_map.
3775 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3776 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3777 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3778 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3779 for empty list.
3780 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3781 Likewise.
3782 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3783 declares it.
3784
8dce3875
JD
37852008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3786
3787 Keep .version and PACKAGE_VERSION in sync.
3788 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3789 dependency, and add comments justifying this in more detail. Discussed
3790 starting at
3791 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3792
882a1fbf
EB
37932008-08-06 Eric Blake <ebb9@byu.net>
3794
a3764451
EB
3795 Partial m4sugar merge from autoconf: m4_shiftn.
3796 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3797 (m4_shift2, m4_shift3): New macros.
3798 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3799 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3800 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3801 * data/java.m4 (b4_remove_comma): Likewise.
3802
882a1fbf
EB
3803 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3804 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3805 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3806 (m4_init): Consolidate wrapped text into single m4_wrap.
3807 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3808 in wrapped text.
3809
a30e920d
EB
38102008-08-05 Eric Blake <ebb9@byu.net>
3811
dfcc5959
EB
3812 Partial m4sugar merge from autoconf: builtins, version.m4.
3813 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3814 (m4_prepend): Remove, as it is unused and inherently quadratic,
3815 whereas m4_append is linear in newer m4.
3816 (m4_mkstemp): New builtin.
3817 (m4_symbols): Make rename conditional.
3818 (m4_version_prereq): Ensure fatal error if used in bison, which
3819 intentionally lacks version.m4.
3820
a30e920d
EB
3821 Fix comments in m4sugar.
3822 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3823
445b7470
JD
38242008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3825
3826 Update for recent .gitignore fix in Gnulib.
3827 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3828 anchored .gitignore entries.
3829
a1e50014
JD
38302008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3831
3832 Set gnu or gnits strictness.
3833 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3834 development and gnits strictness for releases. Based on Eric Blake's
3835 suggestion at
3836 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3837
d43f77e7
PB
38382008-07-31 Paolo Bonzini <bonzini@gnu.org>
3839
3840 * NEWS: Clarify documentation of %language.
3841
fee2ed87
PB
38422008-07-31 Paolo Bonzini <bonzini@gnu.org>
3843
3844 Support usage of git-merge-changelog.
3845 * .gitattributes: New.
3846 * HACKING: Document usage of git-merge-changelog.
3847 * bootstrap: Install git-merge-changelog entries in .git/config
3848 if appropriate.
3849
78029cd5
JD
38502008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3851
3852 Remove remaining dependence on CVS Id keyword.
3853 * ChangeLog: For the sake of people still using CVS, don't use dollars
3854 when mentioning Id.
3855 * data/xslt/bison.xsl: Remove Id from header comments, where it was
3856 unusual anyway.
3857 * data/xslt/xml2dot.xsl: Likewise.
3858 * data/xslt/xml2text.xsl: Likewise.
3859 * data/xslt/xml2xhtml.xsl: Likewise.
3860 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
3861 * doc/Makefile.am (neutralize): Remove, no longer needed.
3862 (.x.1): Don't use neutralize.
3863 (edit): Don't substitute for ID.
3864 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
3865
c53d18b1
JD
38662008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
3867
3868 Fix dependence on computed configure variables.
3869 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
3870 $(top_srcdir)/configure.ac so that changes to computed variables, such
3871 as PACKAGE_VERSION, are seen.
3872 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
3873
5523ac79
JD
38742008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
3875
3876 Update copyright dates for recent changes.
3877 * Makefile.am: Here.
3878 * src/Makefile.am: Here.
3879 * src/reduce.c: Here.
3880 * tests/reduce.at: Here.
3881
8fa36911
JD
38822008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
3883
3884 Use git-version-gen for version names between releases.
3885 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
3886 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
3887 * .prev-version: New.
3888 * .version.in: Remove.
78029cd5 3889 * ChangeLog: Remove the Id previously used for capturing the CVS
8fa36911
JD
3890 revision.
3891 * GNUmakefile: Remove, now copied from Gnulib.
3892 * Makefile.am: Add code suggested by comments in
3893 build-aux/git-version-gen.
3894 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
3895 .prev-version, and .version.
3896 * NEWS (2.3b+): Rename to...
3897 (?.?): ... this because we're dropping the "+" version naming scheme,
3898 but, in general, we still can't be sure of our next release name.
3899 * bootstrap: Add a quick hack to remove from .gitignore the
3900 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
3901 entry. This should really be fixed in gnulib instead.
3902 * bootstrap.conf (gnulib_modules): Add gnumakefile.
3903 * configure.ac (AC_INIT): Set version name by invoking
3904 build-aux/git-version-gen.
3905 (AC_CONFIG_FILES): Remove .version, now generated by
3906 build-aux/git-version-gen.
3907 * maint.mk: New, copied from coreutils.
3908 * doc/.cvsignore (bison.1): Add.
3909 * doc/.gitignore (/bison.1): Add.
3910 * doc/bison.1: Remove, generated.
3911 * src/.cvsignore (revision.c): Remove.
3912 * src/.gitignore (/revision.c): Remove.
3913 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
3914 (BUILT_SOURCES): Remove revision.c.
3915 (revision.c): Remove.
3916 * src/getargs.c (version): Don't print revision after the VERSION.
3917 * src/revision.h: Remove.
3918
bcf07cb7
JD
39192008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
3920
3921 Fix untranslatable composition of sentences. Reported by Goran
3922 Uddeborg at
3923 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
3924 * THANKS (Goran Uddeborg): Add.
3925 * src/reduce.c (reduce_print): Report the number of nonterminals and
3926 rules useless in the grammar in separate sentences.
3927 * tests/reduce.at (Useless Rules): Update output.
3928 (Reduced Automaton): Likewise.
3929 (Underivable Rules): Likewise.
3930 (Empty Language): Likewise.
3931
9aacab9a
JD
39322008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3933
3934 Fix some .gitignore and .cvsignore problems.
3935 * bootstrap (insert_sorted_if_absent): Replace all uses with...
3936 (insert_vc_ignore): ... this new function, which prepends `/' to all
3937 .gitignore entries before passing them to insert_sorted_if_absent.
3938 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
3939 .cvsignore files are maintained even though Bison developers run
3940 bootstrap while using Git.
3941 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
3942 unneeded by Bison.
3943 (gnulib): Add.
3944 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
3945 unneeded. Reported by Eric Blake.
3946 * lib/.gitignore (/*~): Add.
3947 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
3948 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
3949 Blake.
3950 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
3951
a9fc7990
JD
39522008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
3953
3954 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
3955 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
3956 * bootstrap.conf (gnulib_modules): Add unsetenv.
3957 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
3958 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
3959 (/setenv.m4): Add.
3960 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
3961 the first argument because it may become position-dependent, and unset
3962 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
3963 Add comments explaining these issues in more detail.
3964
0f1d6f10
JD
39652008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
3966
3967 Add .gitignore everywhere based on .cvsignore.
3968 * .gitignore: New.
3969 * build-aux/.gitignore: New.
3970 * data/.gitignore: New.
3971 * doc/.gitignore: New.
3972 * etc/.gitignore: New.
3973 * examples/.gitignore: New.
3974 * examples/calc++/.gitignore: New.
3975 * lib/.gitignore: New.
3976 * m4/.gitignore: New.
3977 * po/.gitignore: New.
3978 * runtime-po/.gitignore: New.
3979 * src/.gitignore: New.
3980 * tests/.gitignore: New.
3981
7bd1665a
JD
39822008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3983
3984 * NEWS (2.3b+): New section, empty for now.
3985 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
3986
72c5b982
JD
39872008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
3988
3989 * NEWS (2.3b): Update release date since there has been a delay in
3990 getting the announcements and tarballs out.
3991
bd02cd5d
JD
39922008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3993
3994 * NEWS: Version 2.3b.
3995 * configure.ac (AC_INIT): Likewise.
3996 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
3997
9126263e
JD
39982008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
3999
4000 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4001 been doing it for years.
4002 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4003 (Release Procedure): Add FIXME about make alpha being unmaintained.
4004
fa6aa7b3
JD
40052008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4006
4007 * data/yacc.c: Reformat m4 a little for readability.
4008 * src/lalr.c (build_relations): Correct comment.
4009
d30b312d
JMG
40102008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4011
4012 DJGPP specific issue.
4013 * djgpp/config.sed: Fixes required to run configure scripts generated
4014 by autoconf 2.62.
4015
138d4cd9
JD
40162008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4017
4018 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4019 coordinator@translationproject.org.
4020
8f7e2e1f
JD
40212008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4022
4023 * THANKS: Add Eric Blake.
4024
f55efa38
JD
40252008-04-23 Eric Blake <ebb9@byu.net>
4026
4027 Revert prior patch, by working around autoconf regression.
4028 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4029 ("Output file name: ("): Uncomment test.
4030 ("Output file name: )"): Likewise.
4031 Based on an idea from Noah Misch.
4032
096c9f9d
JD
40332008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4034
4035 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4036 2.61. Reported by Juan Manuel Guerrero at
4037 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4038 * tests/output.at ("Output file name: ("): Comment out test case for
4039 now.
4040 ("Output file name: )"): Likewise.
4041
0f664b89
JD
40422008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4043
4044 * GNUmakefile: Update git-version-gen invocation so make dist
4045 succeeds.
4046
1cfe6375
JD
40472008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4048
4049 Update to the current gnulib CVS repository, and fix trigraph handling
4050 in Bison.
4051 * bootstrap: Update gnulib CVS repository URL.
4052 (symlink_to_dir): Encapsulate the code that guarantees the destination
4053 directory exists into...
4054 (check_dst_dir): ... this new function, and...
4055 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4056 fail when copying files into lib/uniwidth/.
4057 * src/output.c (prepare_symbols): When writing yytname muscles, where
4058 symbol names will be encoded in C-string literals, tell quotearg to
4059 escape trigraphs. This used to be the default in gnulib.
4060 * tests/regression.at (Token definitions): Because of the change in
4061 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4062 escapes trigraphs in symbol names. Thus, yytname no longer has
4063 trigraphs unnecessarily doubly escaped. Update test case output.
4064 Extend test case to be sure Bison's own error messages will no longer
4065 have trigraphs in symbol names unnecessarily escaped once.
4066
74c52fc8
JD
40672008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4068
4069 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4070 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4071 * .cvsignore: Add .version.
4072 * .version.in: New.
4073 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4074 * configure.ac (AC_CONFIG_FILES): Add .version.
4075 * build-aux/.cvsignore: Add git-version-gen.
4076
8e55b3aa
JD
40772008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4078
4079 * NEWS (2.3a+): Mention that -g now takes an argument.
4080 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4081 consistency. Update the -g and -x entries now that they take
4082 arguments. Use brackets to indicate optional arguments.
4083 * src/getargs.c (usage): Explain the relationship between arguments of
4084 long and short options more completely. Document --defines and -d
4085 separately since the former takes an argument but, for POSIX Yacc, the
4086 latter does not.
4087 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 4088 (getargs): Sort cases.
8e55b3aa 4089
59c5ac72
AD
40902008-02-28 Akim Demaille <demaille@gostai.com>
4091
4092 * doc/bison.texinfo: Fix a few typos.
4093
118d4978
AD
40942008-02-28 Akim Demaille <akim@epita.fr>
4095
4096 * doc/bison.texinfo (Bison Options): Document -W.
4097 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
4098
7020f1e9
AD
40992008-02-28 Akim Demaille <akim@epita.fr>
4100
4101 * src/getargs.c (short_options): Split and sort for readability.
4102 -g and -x take optional arguments, just like their long options.
4103 * build-aux/cross-options.pl: Use /x to make the regexp easier to
4104 understand.
4105 Fix the handling of $opt which resulted in all the argument to be
4106 considered as optional.
4107
59da312b
JD
41082008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4109
4110 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4111 say its interface is experimental.
4112 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4113 Java.
4114 (Bison Options): In the -L and --language entry, mention Java.
4115 (Java Bison Interface): Say the interface is experimental.
4116 * src/getargs.c (usage): Mention -L and --language.
4117
4118 * NEWS (2.3a+): Say the push parsing interface is experimental.
4119 * doc/bison.texinfo (Push Decl): Likewise.
4120 (Decl Summary): Likewise in the "%define api.push_pull" entry.
4121 (Push Parser Function): Likewise.
4122 (Pull Parser Function): Likewise.
4123 (Parser Create Function): Likewise.
4124 (Parser Delete Function): Likewise.
4125 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
4126 yypull_parse, and yypush_parse entries.
4127
4128 * NEWS (2.3a+): Mention XML support, and say the schema is
4129 experimental.
4130 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
4131 * src/getargs.c (usage): Say the XML schema is experimental.
4132
4133 * NEWS (2.3a+): Say option instead of flag.
4134
2bb3ebec
WP
41352008-02-21 Wojciech Polak <polak@gnu.org>
4136
4137 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
4138 text.
4139
333e670c
JD
41402008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
4141
4142 Fix impure push parser compile error reported by Bob Rossi at
4143 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
4144 * data/yacc.c: Clean up whitespace in the output a little.
4145 (yypstate_allocated): Define for impure push parsers regardless of
4146 whether the pull interface is also requested.
4147 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
4148 check impure push parsers without the pull interface.
4149
4150 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
4151 yyerror takes arguments specified by %parse-param while yypstate_new
4152 does not.
4153 * doc/bison.texinfo (Parser Create Function): Document that
4154 yypstate_new returns 0 for multiple impure parser instances.
4155 * tests/push.at (Push Parsing: Multiple impure instances): Update
4156 expected stderr output.
4157
798096e1
JD
41582008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4159
4160 * runtime-po/POTFILES.in (push.c): Remove.
4161
9ca7f077
JD
41622008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4163
4164 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
4165 * data/push.c: Rename to...
4166 * data/yacc.c: ... this, overwriting it.
4167 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
4168 `%push-pull-parser' -> `%define api.push_pull "both"'.
4169 Remove old yacc.c tests, and update push.c tests to yacc.c.
4170
42ee26bb
JD
41712008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4172
4173 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
4174 `"%code top" blocks' instead of `%code "top" blocks'.
4175 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
4176 Clean up whitespace in the output a little.
4177
b1cc23c4
JD
41782008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4179
4180 Fix documentation problems reported by Tim Josling at
4181 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
4182 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
4183 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
4184 integers. Explain the effect of literal string aliases on error
4185 messages. Copy token 0 documentation from the C++ skeleton
4186 documentation.
4187
ab7f29f8
JD
41882008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4189
4190 Accept a token number in a %left, %right, or %nonassoc for POSIX
4191 conformance. Reported by Tim Josling at
4192 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
4193 * NEWS (2.3a+): Mention.
4194 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
4195 and code numbers are treated by precedence declarations.
4196 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
4197 of symbols.1.
4198 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
4199 of symbol.
4200 (symbol.prec): New, just like symbol but allows INT.
4201 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
4202 longer holds.
4203 * tests/regression.at (Token number in precedence declaration): New
4204 test case.
4205
a924ef36
JMG
42062008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4207
4208 DJGPP specific issues.
4209 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
4210 be changed. Copyright timestamp adjusted.
4211 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
4212 be changed. Copyright timestamp adjusted.
4213 * djgpp/config.site: Copyright timestamp adjusted.
4214 * djgpp/config_h.sed: Copyright timestamp adjusted.
4215 * djgpp/djunpack.bat: Copyright timestamp adjusted.
4216 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
4217 filename translation list.
4218 * djgpp/subpipe.c (init_subpipe): Check the environment variables
4219 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
4220 files shall be created. Before trying to use the temp dir where the
4221 environment variable points to check that the dir really exists. If
4222 not default to the cwd as temp dir. Copyright timestamp adjusted.
4223 * djgpp/subpipe.h: Copyright timestamp adjusted.
4224 * djgpp/testsuite.sed: Copyright timestamp adjusted.
4225
389c8cfd
PE
42262008-01-30 Paul Eggert <eggert@cs.ucla.edu>
4227
4228 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
4229
5d1cfef4
PE
42302008-01-09 Paul Eggert <eggert@cs.ucla.edu>
4231
4232 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
4233 Problem reported by Claudio Saavedra in
4234 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
4235
e2dcf996
WP
42362008-01-05 Wojciech Polak <polak@gnu.org>
4237
4238 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
4239 document's title with the input grammar file name.
4240
da730230
JD
42412007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
4242
4243 Automate regression testing of the XML/XSLT implementation. Discussed
4244 starting at
4245 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
4246 * configure.ac (XSLTPROC): New substitution.
4247 * Makefile.am (maintainer-xml-check): New phony target invoking...
4248 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
4249 invoking make maintainer-check with BISON_TEST_XML=1.
4250 * tests/atlocal.in (XSLTPROC): New.
4251 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
4252 not to report reachable memory when Bison is expected to have a
4253 non-zero exit status and (2) to compare XML/XSLT output with --graph
4254 and --report=all output for every working grammar when
4255 BISON_TEST_XML=1.
4256 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
4257 (AT_BISON_CHECK_XML): New.
4258 (AT_QUELL_VALGRIND): New.
4259 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
4260 (AT_CHECK): ... don't redefine this since this was the old way to
4261 quell Valgrind.
4262 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
4263 AT_BISON_CHECK invocations.
4264 * tests/c++.at: Likewise.
4265 * tests/calc.at: Likewise.
4266 * tests/conflicts.at: Likewise.
4267 * tests/cxx-type.at: Likewise.
4268 * tests/existing.at: Likewise.
4269 * tests/glr-regression.at: Likewise.
4270 * tests/headers.at: Likewise.
4271 * tests/input.at: Likewise.
4272 * tests/java.at: Likewise.
4273 * tests/output.at: Likewise.
4274 * tests/push.at: Likewise.
4275 * tests/reduce.at: Likewise.
4276 * tests/regression.at: Likewise.
4277 * tests/sets.at: Likewise.
4278 * tests/skeletons.at: Likewise.
4279 * tests/synclines.at: Likewise.
4280 * tests/torture.at: Likewise.
4281 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
4282 tends to hang xsltproc.
4283 (Big horizontal): Likewise.
4284
408476bc
JD
42852007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4286
4287 In XML output, remove redundant class attribute on symbol element.
4288 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
4289 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
4290 look up a symbol to determine whether it's a nonterminal or terminal.
4291 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
4292 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
4293
4294 Add prec/assoc information to XML output.
4295 * src/gram.c (grammar_rules_print_xml): For each rule that has a
4296 %prec, add a percent_prec attribute.
4297 * src/print-xml.c (print_grammar): For each terminal that has a
4298 precedence or associativity, add a prec or assoc attribute.
4299 (xml_indent): New.
4300 (xml_puts): Use xml_indent.
4301 (xml_printf): Use xml_indent.
4302 * src/print-xml.h (xml_indent): Prototype.
4303
4304 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
4305 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
4306
d4a26c48
JD
43072007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4308
4309 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
4310 (bison:ruleByNumber): ... this for clarity.
4311 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
4312 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
4313 (xsl:template match="reduction"): Update.
4314 (xsl:template match="item"): Update.
4315 (xsl:template match="reduction"): Update.
4316
4317 In the XML output, don't print the list of rules where symbols appear.
4318 Compute it in XSLT instead. Discussed at
4319 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
4320 * data/xslt/bison.xsl (bison:ruleByLhs): New.
4321 (bison:ruleByRhs): New.
4322 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
4323 bison:ruleByRhs.
4324 (xsl:template match="terminal/rule"): Remove.
4325 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4326 bison:ruleByRhs.
4327 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4328 Remove.
4329 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
4330 bison:ruleByRhs and mode="number-link" for rule template.
4331 (xsl:template match="terminal/rule"): Remove.
4332 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4333 bison:ruleByRhs and mode="number-link" for rule template.
4334 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4335 Rewrite as...
4336 (xsl:template match="rule" mode="number-link"): ... this.
4337 * src/print-xml.c (print_grammar): Don't print the list of rules.
4338
ef1b4273
JD
43392007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4340
4341 Don't let --report affect XML output; always print all information.
4342 Discussed at
4343 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
4344 * src/conflicts.c (log_resolution): Implement.
4345 * src/print-xml.c (print_core): Implement.
4346 (print_state): Implement.
4347 (print_xml): Implement.
4348
4349 * NEWS (2.3a+): Fix quotes.
4350 * src/parse-gram.y (prologue_declaration): For consistency with -v,
4351 don't let %verbose clear the list specified by --report.
4352
0f6cd9e3
AD
43532007-11-26 Akim Demaille <akim@epita.fr>
4354
4355 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
4356
d80fb37a
JD
43572007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
4358
4359 In the XML output, list useless and unused symbols and rules with the
4360 useful ones and add a "usefulness" attribute. Discussed starting at
4361 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
4362 * src/gram.c (grammar_rules_partial_print_xml): Remove.
4363 (grammar_rules_print_xml): Print all rules instead of just those
4364 useful in the grammar, and add a "usefulness" attribute.
4365 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
4366 * src/print-xml.c (print_rules_useless_in_parser): Remove.
4367 (print_grammar): Print all nonterminals instead of just useful ones,
4368 and add a "usefulness" attribute to nonterminals and terminals.
4369 (print_xml): Don't print a separate "reductions" or
4370 "rules-useless-in-parser" element.
4371 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
4372 (reduce_xml): Remove.
4373 (reduce_token_unused_in_grammar): New.
4374 (reduce_nonterminal_useless_in_grammar): New.
4375 * src/reduce.h (reduce_xml): Remove prototype.
4376 (reduce_token_unused_in_grammar): Add prototype.
4377 (reduce_nonterminal_useless_in_grammar): Add prototype.
4378 * data/xslt/xml2text.xsl: Update for XML changes.
4379 * data/xslt/xml2xhtml.xsl: Update for XML changes.
4380 * tests/reduce.at (Useless Terminals): Update output.
4381 (Useless Rules): Update output.
4382 (Reduced Automaton): Update output.
4383
4384 Say "Terminals unused in grammar" instead of "Unused terminals".
4385 * NEWS (2.3a+): Update.
4386 * doc/bison.texinfo (Understanding): Update example output.
4387 * src/reduce.c (reduce_output): Implement.
4388 * data/xslt/xml2text.xsl: Implement.
4389 * data/xslt/xml2xhtml.xsl: Implement.
4390
1bb2bd75
JD
43912007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
4392
4393 Accept --report-file=FILE to override the default `.output' filename.
4394 * NEWS (2.3a+): Mention.
4395 * doc/bison.texinfo (Bison Options): Add an entry.
4396 * src/files.c (compute_output_file_names): Don't override
4397 spec_verbose_file if already set.
4398 * src/getargs.c (usage): Document --report-file.
4399 (REPORT_FILE_OPTION): New anonymous enum member.
4400 (long_options): Add entry for it.
4401 (getargs): Add case for it setting spec_verbose_file.
4402
4403 * build-aux/cross-options.pl: Don't record a short option just because
4404 there's an arg.
4405 * doc/.cvsignore: Add yacc.1.
4406
a005a9c4
AD
44072007-11-14 Akim Demaille <akim@epita.fr>
4408
4409 * doc/yacc.1.in: New.
4410 * configure.ac, doc/Makefile.am: Adjust.
4411 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
4412 config.h symbol.
4413 Use AC_SUBST for assignments too.
4414 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
4415
cff03fb2
JD
44162007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4417
4418 * src/gram.c: Remove comments that duplicate comments in gram.h.
4419
4420 When reporting useless rules and nonterminals, say "useless in grammar"
4421 instead of "useless", and say "useless in parser" instead of "never
4422 reduced". Discussed starting at
4423 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
4424 * NEWS (2.3a+): Mention this change.
4425 * data/xslt/xml2text.xsl: Update output text and expected input XML
4426 element names to match changes below.
4427 * data/xslt/xml2xhtml.xsl: Likewise.
4428 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4429 Contents: "Rules useless in parser due to conflicts".
4430 * doc/bison.texinfo (Decl Summary): Reword a little.
4431 (Understanding): Update example output for changes below.
4432 * src/gram.c: (rule_useful_p): Rename to...
4433 (rule_useful_in_grammar_p): ... this.
4434 (rule_useless_p): Rename to...
4435 (rule_useless_in_grammar_p): ... this.
4436 (rule_never_reduced_p): Rename to...
4437 (rule_useless_in_parser_p): ... this.
4438 (grammar_rules_print): Update for renames.
4439 (grammar_rules_print_xml): Update for renames.
4440 (grammar_rules_never_reduced_report): Rename to...
4441 (grammar_rules_useless_report): ... this since it is used for either
4442 kind of useless rule.
4443 * src/gram.h: Reword comments and update function names in prototypes.
4444 * src/main.c (main): Say "rule useless in parser due to conflicts".
4445 * src/print-xml.c (print_rules_never_reduced): Rename to...
4446 (print_rules_useless_in_parser): ... this, and rename output XML
4447 element "rules-never-reduced" to "rules-useless-in-parser".
4448 (print_xml): Update for rename.
4449 * src/print.c (print_results): Say "Rules useless in parser due to
4450 conflicts".
4451 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4452 (nonterminals_reduce): Say "nonterminal useless in grammar".
4453 (reduce_output): Say "Nonterminals useless in grammar".
4454 Say "Rules useless in grammar".
4455 (reduce_xml): Rename output XML element "useless" to
4456 "useless-in-grammar".
4457 (reduce_print): Don't report the count of grammatically useless rules
4458 as "rules never reduced" just because %yacc is specified.
4459 In the correct report of this count, say nonterminal(s) and rule(s)
4460 "useless in grammar".
4461 * tests/conflicts.at (S/R in initial): Update expected output.
4462 (Defaulted Conflicted Reduction): Likewise.
4463 (Unreachable States After Conflict Resolution): Likewise.
4464 * tests/existing.at (GNU pic Grammar): Likewise.
4465 * tests/reduce.at (Useless Nonterminals): Likewise.
4466 (Useless Rules): Likewise.
4467 (Reduced Automaton): Likewise.
4468 (Underivable Rules): Likewise.
4469 (Empty Language): Likewise.
4470
66f0441d
JD
44712007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4472
4473 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4474 here document and before the EOF so that BSD's implementation of Bourne
4475 shell doesn't parse the delimiter as part of the here document.
4476 * doc/.cvsignore: Add cross-options.texi.
4477 * src/getargs.c (usage): Add a blank line after the warning categories.
4478
d0ee4105
PB
44792007-11-08 Paolo Bonzini <bonzini@gnu.org>
4480
4481 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4482
e8b1fb9b
AD
44832007-11-05 Akim Demaille <akim@epita.fr>
4484
4485 Remove Id: from bison.1.
4486 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4487 (perl -0777 -pi -e 's/\.PP\nId): New.
4488 (.x.1): Use it to ignore the version control revision.
4489
2f7a96b5
AD
44902007-11-05 Akim Demaille <demaille@gostai.com>
4491
4492 * build-aux/Makefile.am: Ship cross-options.pl.
4493 * doc/Makefile.am: Always refer to cross-options.texi with
4494 $(srcdir).
4495 (MAINTAINERCLEANFILES): Add it.
4496
f4101aa6
AD
44972007-11-04 Akim Demaille <demaille@gostai.com>
4498
4499 Generate the long/short option cross-table.
4500 * build-aux/cross-options.pl: New.
4501 * doc/Makefile.am (cross-options.texi): New.
4502 * doc/bison.texinfo: Use it.
4503
727a1401
AD
45042007-11-04 Akim Demaille <demaille@gostai.com>
4505
4506 Generate bison.1 using help2man.
4507 * doc/common.x, doc/bison.x: New.
4508 * doc/Makefile.am (bison.1, .x.1): New.
4509 The code is taken from autoconf-2.61/man/Makefile.am.
4510 * configure.ac: Look for help2man.
4511
6aeb9c57
AD
45122007-11-04 Akim Demaille <demaille@gostai.com>
4513
4514 Complete --help.
4515 * src/getargs.c (usage): Document -W, make it clear that -d,
4516 -g and -x have optional arguments.
4517
d7be4085
AD
45182007-11-04 Akim Demaille <demaille@gostai.com>
4519
4520 Find sha1sum when named gsha1sum.
4521 * bootstrap (find_tool): New.
4522 ($SHA1SUM): New.
4523
d9df47b6
JD
45242007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4525
4526 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
4527 at
4528 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
4529 * NEWS (2.3a+): Mention.
4530 * data/bison.m4 (b4_pure_if): Don't define it here.
4531 * data/c.m4 (b4_identification): Depend on individual skeletons to
4532 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
4533 values of the %define variables api.pure or api.push_pull. Define
4534 YYPURE, YYPUSH, and YYPULL accordingly.
4535 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
4536 glr.cc has already defined b4_pure_flag.
4537 * data/push.c: Define b4_pure_if based on `%define api.pure'.
4538 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 4539 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
4540 * doc/bison.texinfo (Pure Decl): Update.
4541 (Push Decl): Update.
4542 (Decl Summary): Add api.pure to %define entry.
4543 In %pure-parser entry, say it's deprecated and reference %define.
4544 (Pure Calling): Update.
4545 (Error Reporting): Update.
4546 (C++ Scanner Interface): Update.
4547 (How Can I Reset the Parser): Update.
4548 (Table of Symbols): In %pure-parser entry, say it's deprecated and
4549 reference %define.
4550 * src/getargs.c (pure_parser): Remove global variable.
4551 * src/getargs.h (pure_parser): Remove extern.
4552 * src/output.c (prepare): Don't define pure_flag muscle.
4553 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
4554 wrapper around `%define api.pure'.
4555 * tests/calc.at (Simple LALR Calculator): Update.
4556 (Simple GLR Calculator): Update.
4557 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
4558 Update.
4559 (GLR: Resolve ambiguity, pure, locations): Update.
4560 (GLR: Merge conflicting parses, pure, no locations): Update.
4561 (GLR: Merge conflicting parses, pure, locations): Update.
4562 * tests/glr-regression.at (Uninitialized location when reporting
4563 ambiguity): Update
4564 * tests/input.at (Unused %define api.pure): New test case.
4565 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
4566 AT_PURE_IF and AT_PURE_AND_LOC_IF.
4567 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4568
c373bf8b
JD
45692007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4570
4571 %define push_pull -> %define api.push_pull. Discussed starting at
4572 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
4573 * data/push.c: Expect the new name.
4574 * data/yacc.c: Likewise.
4575 * doc/bison.texinfo (Push Decl): Update.
4576 (Decl Summary): Update %define entry.
4577 (Push Parser Function): Update.
4578 (Pull Parser Function): Update.
4579 (Parser Create Function): Update.
4580 (Parser Delete Function): Update.
4581 * tests/calc.at (Simple LALR Calculator): Update.
4582 * tests/input.at (%define enum variables): Update.
4583 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4584 (Push Parsing: Multiple impure instances): Update.
4585 (Push Parsing: Unsupported Skeletons): Update.
4586 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
4587 (Exploding the Stack Size with Malloc): Update.
4588
4589 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
4590 other entries some.
4591
32f19b6b
JD
45922007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
4593
4594 For the XML output's terminal element, rename @number to @token-number,
4595 and add @symbol-number. In the nonterminal element, rename @number to
4596 @symbol-number. Discussed starting at
4597 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
4598 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
4599 renames.
4600 (xsl:template match="nonterminal"): Likewise.
4601 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
4602 (xsl:template match="nonterminal"): Likewise.
4603 * src/print-xml.c (print_grammar): Implement.
4604
255a6b90
JD
46052007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4606
4607 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4608 2007-10-11 change, the child elements here are items not rules.
408476bc 4609 (xsl:template match="item"): New.
255a6b90
JD
4610 (xsl:template match="rule"): Update for new reduced itemset.
4611 (xsl:template match="point"): Remove.
4612 (xsl:template match="empty"): For consistency with --graph, don't
4613 output "/* empty */".
4614 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
4615 line-wrap, don't pass a negative value as first-line-length since this
4616 won't work with the following changes.
4617 (xsl:template name="line-wrap"): Simplify slightly.
4618 (xsl:template name="ws-search"): Eliminate recursion.
4619 * src/print_graph.c (print_core): Don't print a reduction's lookahead
4620 set next to an item whose dot is not at the end of the RHS even if it
4621 happens to be associated with the same rule.
4622
88c78747
JD
46232007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4624
31984206
JD
4625 Add %define lr.keep_unreachable_states.
4626 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
4627 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
4628 * src/main.c (main): Implement it.
4629 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4630 Extend to test it, and fix a typo.
4631
46322007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4633
4634 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
4635 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
4636 the example .output text.
4637 * tests/regression.at (Extra lookahead sets in report): Improve wording
4638 of comments.
4639
b7a70162
WP
46402007-10-17 Wojciech Polak <polak@gnu.org>
4641
4642 * src/print-xml.c (print_grammar): Renamed
4643 <terminal> and <nonterminal> attributes:
4644 "type" to "number" and "symbol" to "name".
4645 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
4646 Use new attribute names.
4647 (xsl:template match="nonterminal"): Likewise.
4648 * data/xslt/xml2xhtml.xsl: Likewise.
4649
a0de5091
JD
46502007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
4651
4652 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
4653 (Option Cross Key): Likewise.
4654
4655 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
4656 next to an item whose dot is not at the end of the RHS even if it
4657 happens to be associated with the same rule.
4658 * src/print.c (print_core): Likewise.
4659 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4660 (Resolved SR Conflicts): Update output.
4661 * tests/regression.at (Extra lookahead sets in report): New test case.
4662
4c20d18d
WP
46632007-10-11 Wojciech Polak <polak@gnu.org>
4664
4665 * src/print-xml.c (print_core): Remove item set
4666 redundancy.
4667 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4668 Improve processing time. Suggested by Joel E. Denny.
4669 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4670 Write xsl:param "required" attribute as comment.
4671 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4672 (xsl:template match="rule"): Support new reduced itemset.
4673 (xsl:template match="point"): Remove.
4674 * data/xslt/xml2xhtml.xsl: Likewise.
4675
f506ad1c
JD
46762007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4677
4678 * src/getargs.c (version): Update copyright year.
4679
21f1b063
JD
46802007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4681
4682 Make xml2dot.xsl and --graph produce the same output.
4683 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
4684 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4685 escaped later.
4686 (xsl:template name="output-node"): Use the new escape template instead
4687 of the string-replace template directly.
4688 (xsl:template name="output-edge"): Likewise.
4689 (xsl:template name="escape"): New, escapes backslashes and newlines in
4690 addition to quotation marks.
4691 * src/graphviz.c (start_graph, output_node, output_edge): Add
4692 whitespace to output for legibility.
4693
4694 Make xml2text.xsl and --report produce the same output, and remove the
4695 XML "conflicts" element since a conflict summary is easily extracted
4696 from the automaton.
4697 * data/xslt/bison.xsl: New.
4698 (xsl:template match="state" mode="bison:count-conflicts): New.
4699 * data/xslt/xml2text.xsl: Import bison.xsl.
4700 (xsl:template match="bison-xml-report"): Instead of styling the
4701 "conflicts" element, style the "automaton" element with mode
4702 "conflicts". Unlike the former, the latter lists S/R and R/R
4703 conflicts for a state on the same line.
4704 (xsl:template match="conflicts"): Remove.
4705 (xsl:template match="conflict"): Remove.
4706 (xsl:template match="terminal"): Line-wrap the list of rules in which
4707 the terminal is used.
4708 (xsl:template match="nonterminal"): Likewise for nonterminals.
4709 (xsl:template match="automaton" mode="conflicts"): New.
4710 (xsl:template match="state" mode="conflicts"): New.
4711 (xsl:template name="line-wrap"): New.
4712 (xsl:template name="ws-search"): New.
4713 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4714 (xsl:template match="bison-xml-report"): Instead of styling the
4715 "conflicts" element, style the "automaton" element with mode
4716 "conflicts."
4717 (xsl:template match="conflicts"): Remove.
4718 (xsl:template match="conflict"): Remove.
4719 (xsl:template match="automaton" mode="conflicts"): New.
4720 (xsl:template match="state" mode="conflicts): New.
4721 * src/conflicts.c (conflicts_output_xml): Remove.
4722 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4723 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4724 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4725 the corresponding XSLT is easier. Also, never wrap between a word and
4726 the comma that follows it.
4727
793fbca5
JD
47282007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4729
4730 Improve C++ namespace support. Discussed starting at
4731 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4732 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4733 b4_namespace_close): New macros that interpret the %define variable
4734 "namespace" so its value can contain "::" to indicate nested
4735 namespaces.
4736 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4737 the above macros.
4738 * data/lalr1.cc (b4_namespace): Likewise.
4739 * data/location.cc (b4_namespace): Likewise.
4740 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4741 inside a new table in the general %define entry. Document `%define
4742 namespace' there as well. Point the %name-prefix entry to it since it
4743 explains it more completely in the case of C++.
4744 (C++ Bison Interface): Mention `%define namespace' instead of
4745 %name-prefix.
4746 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4747 entry suffices.
4748 * tests/c++.at (Relative namespace references): New test case.
4749 (Absolute namespace references): New test case.
4750 (Syntactically invalid namespace references): New test case.
4751 * tests/input.at (C++ namespace reference errors): New test case.
4752
35b8730d
JD
47532007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4754
4755 Add syncline support and location accessor to internal %define
4756 interfaces.
4757 * data/bison.m4 (b4_percent_define_get_loc): New.
4758 (b4_percent_define_get_syncline): New.
4759 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4760 (b4_percent_define_default): Record defining location as line 1 rather
4761 than 0 for the sake of synchronizing #line's, and define
4762 b4_percent_define_syncline(VARIABLE).
4763 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4764 * src/muscle_tab.c (muscle_syncline_grow): New.
4765 (muscle_code_grow): Use muscle_syncline_grow.
4766 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4767 define b4_percent_define_syncline(VARIABLE).
4768 (muscle_percent_define_get_loc): New.
4769 (muscle_percent_define_get_syncline): New.
4770 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4771 remove some unused variables.
4772 (muscle_percent_define_default): Record defining location as line 1
4773 rather than 0 for the sake of synchronizing #line's, and define
4774 b4_percent_define_syncline(VARIABLE).
4775 (muscle_percent_define_check_values): Use
4776 muscle_percent_define_get_loc.
4777 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4778 (muscle_percent_define_get_syncline): Prototype.
4779 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4780 defaults): Update output for location change.
4781 (Complaining during macro argument expansion): Extend to test
4782 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4783
7dc4a694
JD
47842007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4785
4786 Fix some error-reporting macro bugs.
4787 * data/bison.m4 (b4_cat): New.
4788 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4789 to stdout so they don't become arguments to other macros. Update
4790 comments and add examples.
4791 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4792 add examples.
4793 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4794 after printing the error directive so that M4 doesn't report subsequent
4795 problems that are induced by this problem.
4796 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4797 instead of just in them. Recognize @\n in both places. Both expand to
4798 the empty string. Needed by b4_cat.
4799 * tests/skeletons.at (Complaining during macro argument expansion):
4800 New test case.
4801 (Fatal errors make M4 exit immediately): New test case.
4802
d4bd2295
JD
48032007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4804
4805 Implement --print-datadir.
4806 * src/getargs.c (usage): Mention.
4807 (PRINT_DATADIR_OPTION): New anonymous enum member.
4808 (long_options): Add entry for it.
4809 (getargs): Add case for it calling compute_pkgdatadir.
4810 * src/output.c (output_skeleton): Encapsulate data directory
4811 computation from here...
4812 (prepare): ... and from here...
4813 (compute_pkgdatadir): ... into this new function.
4814 * src/output.h (compute_pkgdatadir): Prototype.
4815
34cdeddf
JD
48162007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4817
4818 * src/print-xml.c (escape_bufs): New static global variable
4819 replacing...
4820 (xml_escape_n): ... the static local variable buf here.
4821 (print_xml): Free memory for escape_bufs.
4822 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4823
d782395d
JD
48242007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4825
4826 Replace `%push-parser' and `%push-pull-parser' with
4827 `%define push_pull "push"' and `%define push_pull "both"'.
4828 `%define push_pull "pull"' is the default.
4829 * doc/bison.texinfo (Push Decl, Push Parser Function,
4830 Pull Parser Function, Parser Create Function, Parser Delete Function):
4831 Update declarations.
4832 (Decl Summary, Table of Symbols): Replace %push-parser and
4833 %push-pull-parser entries with a %define push_pull entry.
4834 * data/bison.m4 (b4_percent_define_check_values): New macro.
4835 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4836 definitions...
4837 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4838 definitions...
4839 * data/push.c: ... to here and compute them from the value of the
4840 %define variable push_pull.
4841 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4842 parsing requests here...
4843 * data/yacc.c: ... hack this to switch to push.c any time
4844 b4_use_push_pull_flag or the %define variable push_pull is set. This
4845 will go away when we mv push.c yacc.c.
4846 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4847 push parsing is not supported since unused %define variables are
4848 reported anyway.
4849 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
4850 * src/muscle_tab.h (muscle_percent_define_check_values): Update
4851 comments for consistency with b4_percent_define_check_values.
4852 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
4853 muscles.
4854 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
4855 Remove.
4856 (prologue_declaration): Remove %push-parser and %push-pull-parser
4857 rules.
4858 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
4859 * tests/calc.at: Update declarations.
4860 * tests/input.at (%define enum variables): New test case.
4861 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
4862 declaration.
4863 (Push Parsing: Multiple impure instances): Update declaration.
4864 (Push Parsing: Unsupported Skeletons): New test case.
4865 * tests/torture.at (Exploding the Stack Size with Alloca): Update
4866 declaration.
4867 (Exploding the Stack Size with Malloc): Update declaration.
4868
3f999f78
WP
48692007-09-24 Wojciech Polak <polak@gnu.org>
4870
4871 Add XSLT transformations.
4872
4873 * data/xslt/xml2dot.xsl: Transform XML into DOT.
4874 * data/xslt/xml2text.xsl: Transform XML into plain text.
4875 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
4876 * data/Makefile.am (xsltdir): New variable.
4877 (dist_xslt_DATA): Add xslt/*.xsl files.
4878
a4f75309
PE
48792007-09-23 Paul Eggert <eggert@cs.ucla.edu>
4880
4881 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
4882 Problem reported by Wojciech Polak.
4883 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
4884 (xml_printf): Undo change I made on 21 September; that is,
4885 indent 2 spaces, not 1.
4886
ad5feac4
JD
48872007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
4888
4889 Pacify ./configure --enable-gcc-warnings.
4890 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
4891 `char const *' instead of `char *'.
4892 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
4893 local variable `sep'.
4894
41d7a5f2
PE
48952007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4896
4897 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
4898 elsewhere.
4899 * src/print-xml.c: Prefer "const" after types; that's more consistent.
4900 (xml_printf): Indent just 1 space for level.
4901 (e_char, xlate_char): Remove.
4902 (xml_escape_string): Rewrite to avoid undefined behavior (used
4903 storage that was freed from the stack).
4904 (xml_escape_n): Don't bother checking for subscript error.
4905
3f999f78
WP
49062007-09-21 Wojciech Polak <polak@gnu.org>
4907
4908 Add Bison XML Automaton Report.
41d7a5f2
PE
4909
4910 Add support for an -x option to generate an XML report.
4911 It is not documented yet.
4912 * src/print-xml.c: New file.
4913 * src/print-xml.h: Likewise.
4914 * lib/timevar.def (TV_XML): New var.
4915 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
4916 * src/conflicts.c: Include print-xml.h.
4917 (solved_conflicts_xml_obstack): New var.
4918 (log_resolution, conflicts_solve, conflicts_free):
4919 Add support for XML report.
4920 (conflicts_output_val): New function.
4921 * src/conflicts.h (conflicts_output_val): New decl.
4922 * src/files.c (spec_xml_file): New var.
4923 (compute_output_file_names, output_file_names_free): Add XML support.
4924 * src/files.h (spec_xml_file): New decl.
4925 * src/getargs.c (xml_flag): New var.
4926 (usage, short_options, long_options, getargs): Add XML support.
4927 * src/getargs.h (xml_flag): New decl.
4928 * src/gram.c: Include print-xml.h.
4929 (rule_lhs_print_xml, rule_rhs_print_xml):
4930 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
4931 New functions.
4932 * src/gram.h: Declare external ones.
4933 * src/main.c: Include print-xml.h.
4934 (main): Add XML support.
4935 * src/reduce.c: Include print-xml.h.
4936 (reduce_xml): New function.
4937 * src/reduce.h: Declare it.
4938 * src/state.c: Include print-xml.h.
4939 (state_new): Add XML support.
4940 (state_rule_lookahead_tokens_print_xml): New function.
4941 * src/state.h: Declare it.
4942 (struct state): New member solved_conflicts_xml.
4943 * src/symtab.c (symbol_class_get_string): New function.
4944 * src/symtab.h: Declare it.
4945
6d8e724d
PE
49462007-09-21 Paul Eggert <eggert@cs.ucla.edu>
4947
4948 * GNUmakefile: Switch to coreutils's version.
4949 * bootstrap: Likewise.
4950 * Makefile.cfg: Adjust to new GNUmakefile.
4951 * README-hacking: Likewise.
4952
4953 Import from gnulib:
4954
4955 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
4956 Bruno Haible <bruno@clisp.org>
4957
4958 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
4959 and is a script that invokes bison. Tighten the code. Add comments.
4960
922bdd7f
JD
49612007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
4962
4963 Spell "boolean" as "Boolean". Reported by Akim Demaille.
4964 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
4965 * doc/bison.texinfo (Decl Summary): Fix.
4966 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
4967 * tests/input.at (Boolean %define variables): Update output.
4968 * tests/skeletons.at (%define boolean variables: invalid skeleton
4969 defaults): Rename to...
4970 (%define Boolean variables: invalid skeleton defaults): ... this and
4971 update output.
4972
1b17b01d
JD
49732007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
4974
4975 In impure push mode, don't allow more than one yypstate to be allocated
4976 since multiple impure parsers would corrupt yynerrs.
4977 * data/push.c (yypstate_allocated): New static global variable
4978 initialized to 0.
4979 (yypull_parse): If yypstate_new returns 0, don't report it as memory
4980 exhaustion if yypstate_allocated is 1, but still return 2.
4981 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
4982 already 1. Otherwise, set it to 1.
4983 (yypstate_delete): Set it to 0.
4984 * tests/push.at (Push Parsing: Multiple impure instances): New test
4985 case.
4986
9987d1b3
JD
49872007-08-17 Bob Rossi <bob@brasko.net>
4988
4989 * doc/bison.texinfo (Push Decl): Document the push parser.
4990 (Table of Symbols): Ditto.
4991 (Pure Decl): Ditto.
4992 (Decl Summary): Ditto.
4993 (Multiple Parsers, Push Parser Function, Pull Parser Function,
4994 Parser Create Function, Parser Delete Function):
4995 Add new push parser symbols.
4996 (Table of Symbols): Document push-parser, push-pull-parser,
4997 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
4998
f16b0819
PE
49992007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5000
5001 Update to GPLv3.
5002 * doc/gpl-3.0.texi: New file.
5003 * doc/gpl.texi: Remove.
5004 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5005 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5006 * README-hacking, TODO, bootstrap, bootstrap.conf:
5007 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5008 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5009 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5010 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5011 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5012 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5013 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5014 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5015 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5016 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5017 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5018 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5019 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5020 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5021 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5022 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5023 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5024 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5025 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5026 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5027 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5028 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5029 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5030 * src/complain.c, src/complain.h, src/conflicts.c:
5031 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5032 * src/files.h, src/flex-scanner.h, src/getargs.c:
5033 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5034 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5035 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5036 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5037 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5038 * src/print.c, src/print.h, src/print_graph.c:
5039 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5040 * src/reduce.h, src/relation.c, src/relation.h:
5041 * src/revision.h, src/scan-code.h, src/scan-code.l:
5042 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5043 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5044 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5045 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5046 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5047 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5048 * tests/existing.at, tests/glr-regression.at:
5049 * tests/headers.at, tests/input.at, tests/java.at:
5050 * tests/local.at, tests/output.at, tests/push.at:
5051 * tests/reduce.at, tests/regression.at, tests/sets.at:
5052 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5053 * tests/torture.at:
5054 Update to GPLv3.
5055
728c4be2
JD
50562007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5057
5058 Get rid of broken %no-parser, -n, and --no-parser implementation and
5059 documentation.
5060 * TODO: Don't mention them.
5061 * doc/bison.1: Likewise.
5062 * doc/bison.texinfo (Decl Summary): Likewise.
5063 (Bison Options): Likewise.
5064 (Option Cross Key): Likewise.
5065 * src/getargs.c (no_parser_flag): Remove global variable.
5066 (usage): Don't print description of -n and --no-parser.
5067 (long_options): Remove --no-parser entry here.
5068 (getargs): Remove -n case in the switch here.
5069 * src/getargs.h (no_parser_flag): Remove extern.
5070 * tests/regression.at (Web2c Actions): Remove comment that mentions
5071 --no-parser.
5072
5d31a216
JD
50732007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5074
5075 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5076 name user variables starting with `yy'. Just pass NULL instead of a
5077 dummy local &yylval to yypush_parse.
5078 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5079 starting with `yy'.
5080
a2ea208d
JD
50812007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5082
5083 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5084 true since it's then always used regardless of whether yyoverflow is
5085 defined. Reported by Christian Burger at
5086 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5087 * THANKS: Add Christian Burger.
5088
91661ebb
JD
5089 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5090 node names: say "Decl Summary" not "Bison Declaration Summary".
5091
cbd50549
JD
50922007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5093
5094 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5095 determine whether this function has already complained about an invalid
5096 value for a %define boolean variable, don't check whether Bison has
5097 ever examined the value. As written, the check was a tautology.
5098 Instead, record and check for this complaint using a separate muscle.
5099
eb1b0740
JD
51002007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5101
5102 Fix push parsing memory leak reported by Brandon Lucia at
5103 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
5104 * THANKS: Add Brandon Lucia.
5105 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5106 but the parse never completed and thus freed it.
5107 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5108 * tests/testsuite.at: Include push.at.
5109 * test/push.at: New.
5110 (Push Parsing: Memory Leak for Early Deletion): New test case.
5111
9d774aff
JD
51122007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5113
5114 Improve handling of multiple S/R conflicts in the same state and of S/R
5115 conflicts involving multiple reductions.
5116 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5117 set for a state here or Bison will abort if it is reassigned on a
5118 later conflicted reduction in the same state.
5119 Similarly, don't finalize and assign the solved conflicts report here
5120 or it will be lost if it is reassigned on a later conflicted reduction
5121 in the same state.
5122 (set_conflicts): Instead, assign them both here after all S/R conflicts
5123 in the state have been fully examined.
5124 * src/print.c (shift_set): Rename to...
5125 (no_reduce_set): ... this.
5126 (print_reductions): Update for rename, and add %nonassoc error action
5127 tokens to no_reduce_set so that, when printing the first remaining
5128 reduction on an error action token, the reduction is enclosed in
5129 brackets.
5130 (print_results): Update for rename.
5131 * tests/conflicts.at (Solved conflicts report for multiple reductions
5132 in a state): New test case.
5133 (%nonassoc error actions for multiple reductions in a state): New test
5134 case.
5135
5136 * src/main.c (main): Don't depend on C99 features.
5137
10159d2a
JD
51382007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5139
5140 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
5141 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
5142 uniwidth.
10159d2a 5143
953b3935
JD
51442007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
5145
5146 * bootstrap (slurp): Create target directories that don't exist.
5147 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
5148
6ce2d93a
JD
51492007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5150
5151 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
5152 than item number.
5153 * closure.c (closure): Likewise.
5154 * state.h (reductions): Comment sorting of rules.
5155 (state): Comment sorting of items.
5156
ce3448d5
JD
51572007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
5158
5159 Fix C++ test cases after recent Gnulib changes. Discussed starting at
5160 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
5161 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
5162 definition in order to avoid Gnulib headers since we don't use config.h
5163 here.
5164 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
5165 rather than AT_DATA so that config.h is included.
5166
8a86eef0
JD
51672007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
5168
5169 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
5170 instead of fprintf. Guard these functions with #if YYDEBUG instead of
5171 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
5172 and so that YYFPRINTF is guaranteed to be defined here.
5173
b1a81613
JD
51742007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5175
5176 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
5177 with...
5178 (muscle_percent_define_check_values): ... this more helpful function.
5179 Again, it's not used yet, but it will be.
5180 * src/muscle_tab.h: Likewise.
5181
71b61d4d
JD
5182 Improve some comments in parser table construction.
5183 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
5184 (generate_states): Don't mention ruleset, which is internal to closure.
5185 * src/closure.c (closure): Explain sorting of core and itemset, which
5186 is required for this function to behave correctly.
5187 * src/closure.h (closure): Mention sorting.
5188
2a6b783d
JD
51892007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
5190
5191 * src/lalr.c (state_lookahead_tokens_count): For code readability,
5192 move the check for disabled transitions to an aver since conflict
5193 resolution hasn't happened yet.
5194
5195 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
5196 labels a state as inconsistent just because it has error transitions.
5197 The original form of this check appeared in revision 1.1 of lalr.c,
5198 which was committed on 1991-12-21. Now (at least), changing the
5199 consistency label on such a state appears to have no useful effect in
5200 any of the places it is examined, which I enumerate below. The key
5201 point to understanding each item in this enumeration is that a state
5202 with an error transition is labelled consistent in the first place only
5203 if it has no rules, so the check cannot matter for states that have
5204 rules. (1) Labelling a state as inconsistent will cause set_conflicts
5205 to try to identify its conflicts, and a state must have *rules* to have
5206 conflicts. (2) Labelling a state as inconsistent will affect how
5207 action_row sets the default *rule* for the state. (3) Labelling a
5208 state as inconsistent will cause build_relations to add lookback edges
5209 to *rules* in that state.
5210 * src/state.h (struct state): Word the comment for member consistent
5211 more carefully.
5212
14462c2b
JD
52132007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5214
5215 Don't depend on C99 features.
5216 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
5217 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
5218 * src/reader.c (check_and_convert_grammar): Fix for-loop.
5219 * src/state.c (state_mark_reachable_states): Fix for-loop.
5220 (state_remove_unreachable_states): Fix for-loop.
5221
5222 Don't widen struct state with member reachable just to temporarily
5223 record reachability. Instead, use a local bitset.
5224 * src/state.h (struct state): Remove member.
5225 * src/state.c (state_new): Don't initialize it.
5226 (state_mark_reachable_states): Rename to...
5227 (state_record_reachable_states): ... this, and use bitset.
5228 (state_remove_unreachable_states): Use bitset.
5229
5a43d418
JD
52302007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
5231
5232 * src/Makefile.am (yacc): Quote target action commands properly so
5233 that the yacc script isn't corrupt. Reported by Hans Aberg at
5234 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
5235
0c650a20
JD
5236 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
5237 the case of pure parsers. Reported by Frans Englich at
5238 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
5239 * THANKS: Add Frans Englich.
5240
61fee93e
JD
5241 * NEWS (2.3a+): In the %code entry, reference section `Bison
5242 Declaration Summary' from the manual now since the %code summary has
5243 moved there.
5244 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
5245 in the rules section must be terminated by semicolons.
5246
f124d423
JD
52472007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
5248
5249 Extend the front-end API for %define variables to more completely
5250 mirror the back-end. This will be useful in the future.
5251 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
5252 Update comments to mention the new front-end counterparts of these
5253 macros.
5254 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
5255 for muscle_string_decode and muscle_location_decode.
5256 (muscle_string_decode): New static function.
5257 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
5258 (muscle_percent_define_get, muscle_percent_define_ifdef): New
5259 functions.
5260 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
5261 muscle_percent_define_get to mimic the b4_percent_define_flag_if
5262 implementation more closely.
5263 (muscle_percent_define_invalid_value): New function.
5264 * src/muscle_tab.h (muscle_percent_define_get,
5265 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
5266 Prototype.
5267
75ad86ee
JD
52682007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5269
5270 * NEWS (2.3a+): Mention yesterday's state-removal change.
5271 (2.3a): Remove the %language entry, which was added after 2.3a.
5272 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
5273 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
5274 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
5275 tests/existing.at: Update copyright date.
5276
5967f0cf
JD
52772007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5278
5279 If conflict resolution makes states unreachable, remove those states,
5280 report rules that are then unused, and don't report conflicts in those
5281 states.
5282 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
5283 New global function.
5284 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
5285 function.
5286 * src/main.c (main): After conflict resolution, remove the unreachable
5287 states and update all data structures that reference states by number.
5288 * src/state.c (state_new): Initialize each state's reachable member to
5289 false.
5290 (state_mark_reachable_states): New static function.
5291 (state_remove_unreachable_states): New global function.
5292 * src/state.h (struct state): Add member bool reachable.
5293 (state_remove_unreachable_states): Prototype.
5294 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5295 New test case.
5296 * tests/existing.at (GNU pic Grammar): Update test case output now that
5297 an unused rule is discovered.
5298
b09f4f48
JD
52992007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5300
5301 Minor code cleanup in parser table construction.
5302 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
5303 (new_itemsets, save_reductions): Update for rename to nitemset.
5304 * src/closure.c (nritemset): Rename to...
5305 (nitemset): ... this since the "r" appears to meaningless and isn't
5306 used in the comments.
5307 (closure): Update for rename.
5308 * src/closure.h (nritemset): Update extern to...
5309 (nitemset): ... this.
5310 * src/lalr.c (LA): Fix a typo in comments.
5311 * src/print.c (print_core): Update for rename to nitemset.
5312 * src/print_graph.c (print_graph): Likewise.
5313 * src/state.h: Fix some typos in header comments.
5314
bbb44d83
PE
53152007-04-04 Paul Eggert <eggert@cs.ucla.edu>
5316
9b33de72
PE
5317 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
5318 still sticks to ASCII. Sorry!
5319
bbb44d83
PE
5320 * README-hacking: New file, taken mostly from coreutils, with changes
5321 for Bison. Contains much of the contents of:
5322 * README-cvs: Remove.
5323 * bootstrap: Sync from gnulib.
5324 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
5325 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
5326
29553547
JD
53272007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
5328
5329 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
5330 Setzer.
5331 (Java Differences): Fix some typos.
5332 * THANKS: Add Sebastian Setzer.
5333
01b477c6
PB
53342007-03-07 Paolo Bonzini <bonzini@gnu.org>
5335
730739e4
AD
5336 * data/java.m4 (b4_single_class_if): Remove.
5337 (b4_abstract_if): Look at "%define abstract".
5338 (b4_lexer_if): New.
5339 (b4_union_name): Rename...
5340 (b4_yystype): ... to this. Map to "%define stype".
5341 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
5342 b4_maybe_throws): Fix quoting.
5343 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
5344 * data/lalr1.java (Lexer interface): Always define.
5345 (Lexer interface within parser class): Remove.
5346 (YYLexer class): New, used when "%code lexer" is present.
5347 (constructor): When "%code lexer" is used, pass %lex-param
5348 to the lexer constructor.
5349 (yylex, yyparse): Remove %lex-param from method invocations
5350 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
5351
5352 * doc/bison.texinfo (Java Bison Interface): Mention "%define
5353 abstract". Rename "%define union_name" to "%define stype".
5354 Rename method names according to previous patch.
5355 (Java Scanner Interface): Describe "%code lexer" instead of
5356 "%pure-parser" and "%define single_class".
5357 (Java Differences): Mention "%code lexer".
5358
5359 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
5360 Include scanner here, using macros from tests/local.at.
5361 (AT_DATA_CALC_Y): Remove final argument.
5362 (_AT_CHECK_JAVA_CALC): Likewise.
5363 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
5364 of %locations and %error-verbose.
5365 (main): Test with and without %lex-param.
5366 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
5367 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 5368
122bea3a
JMG
53692007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5370
5371 DJGPP spefic issue. Inhibit the use of disallowed characters for
5372 file name genertion on Win98, WinXP, etc. These are |<>":?*\
5373 and concern testsuite case 46.
5374 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
5375 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
5376 * djgpp/config.bat: Inhibit the use of disallowed characters.
5377
9611cfa2
JD
53782007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5379
5380 Miscellaneous %define and %code cleanup.
5381 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
5382 values are interpreted.
5383 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
5384 documentation a little more.
5385 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
5386 muscle_percent_define_insert, muscle_percent_code_grow): New
5387 functions/macros.
5388 * src/muscle_tab.h (muscle_percent_define_insert,
5389 muscle_percent_code_grow): Prototype.
5390 * src/parse-gram.y (prologue_declaration): Use
5391 muscle_percent_define_insert and muscle_percent_code_grow when parsing
5392 %define and %code directives.
5393
5394 Make it easy to share %define boolean variables between the front-end
5395 and back-end. Though not used yet, this will be useful in the future.
5396 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
5397 Bison uses of names rather than just skeleton uses of names.
5398 (b4_percent_define_get, b4_percent_define_ifdef): Rename
5399 b4_percent_define_skeleton_variables(VARIABLE) to
5400 b4_percent_define_bison_variables(VARIABLE).
5401 (b4_percent_code_get, b4_percent_code_ifdef): Rename
5402 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
5403 b4_percent_code_bison_qualifiers(QUALIFIER).
5404 (b4_check_user_names_wrap): Update for renames.
5405 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
5406 muscle_percent_define_default): New functions mimicking
5407 b4_percent_define_flag_if and b4_percent_define_default.
5408
5409 For %define variables, report locations for invalid values and
bbb44d83 5410 redefinitions.
9611cfa2
JD
5411 * data/bison.m4 (b4_percent_define_flag_if): Read
5412 b4_percent_define_loc(VARIABLE) to report the location of an invalid
5413 value for VARIABLE.
5414 (b4_percent_define_default): Save a special location in
5415 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
5416 must later be reported as invalid.
5417 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
5418 functions.
5419 (muscle_percent_define_insert): Record the location of VARIABLE in
5420 muscle percent_define_loc(VARIABLE), and use it to report the previous
5421 location for a redefinition.
5422 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
5423 (muscle_percent_define_default): Update like b4_percent_define_default.
5424 (muscle_grow_user_name_list): Rename to...
5425 (muscle_user_name_list_grow): ... this for consistency and use
5426 muscle_location_grow.
5427 * src/muscle_tab.h (muscle_location_grow): Prototype.
5428 * tests/input.at (%define errors): Update expected output.
5429 * tests/skeletons.at (%define boolean variables: invalid skeleton
5430 defaults): New test case.
5431
0bf92491
JD
54322007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5433
5434 * src/print.c (lookahead_set, state_default_rule): Remove.
5435 (print_reductions): Replace state_default_rule invocation with
5436 equivalent use of yydefact, which was computed in token_actions in
5437 tables.c.
5438 (print_results): Don't allocate lookahead_set.
5439
d3b12988
PB
54402007-02-27 Paolo Bonzini <bonzini@gnu.org>
5441
5442 * data/lalr1.java: Prefix all private members with yy.
5443
f57a7536
JD
54442007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5445
5446 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 5447 Sebastien Fricker at
f57a7536 5448 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 5449 * THANKS: Add Sebastien Fricker.
f57a7536
JD
5450 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5451 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5452 accept a variable number of arguments.
5453
6404a5bf
JD
54542007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5455
5456 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5457
e4e09639
JMG
54582007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5459
5460 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5461 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5462 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5463
d7e0a1a7
PE
54642007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5465
5466 Undo my 2007-02-07 change, switching back to the c-strcase module
5467 introduced in the 2007-02-03 change. Bruno Haible reported that
5468 the 2007-02-07 change would be dangerous in Turkish if we add a
5469 language whose name contains "i", since "i" is not lowercase "I"
5470 in Turkish.
5471 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5472 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5473 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5474 * m4/.cvsignore: Remove strcase.m4.
5475 * src/getargs.c: Revert 2007-02-07 change, as follows.
5476 Include c-strcase.h.
5477 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5478
deee93a1
JD
54792007-02-11 Bruno Haible <bruno@clisp.org>
5480
5481 Enable the Java related testsuite tests when the only Java compiler
5482 found is a gcj < 4.3. Discussed at
5483 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5484 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5485
574add85
JD
54862007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5487
5488 * data/Makefile.am: Update copyright date.
5489 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5490 yypstate_new returns NULL.
5491 (yypstate_new): Return NULL if malloc does.
5492 * src/reader.c (packgram): Move translation of rule actions from the
5493 beginning of packgram to...
5494 (check_and_convert_grammar): ... here right before packgram is invoked
5495 so it's easier to write more complete comments, and remove redundant
5496 code.
5497
e785ccf7
JD
54982007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5499
5500 As in semantic actions, make @$ in %initial-action, %destructor, and
5501 %printer imply %locations.
5502 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5503 scanning @$.
5504 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5505 (@$ in %initial-action implies %locations,
5506 @$ in %destructor implies %locations,
5507 @$ in %printer implies %locations): ... these new test cases.
5508
1cfe1ed7
PE
55092007-02-07 Paul Eggert <eggert@cs.ucla.edu>
5510
5511 Undo most of the 2007-02-03 change, switching to the strcase module
5512 now that gnulib strcase has been fixed.
5513 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
5514 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
5515 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
5516 * m4/.cvsignore: Add strcase.m4.
5517 * src/getargs.c: Revert 2007-02-03 change, as follows.
5518 Don't include c-strcase.h.
5519 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
5520 strcasecmp has "unspecified behavior" outside the POSIX locale,
5521 but it works fine in practice if at least one argument is ASCII,
5522 as is the case in Bison.
5523
0049ec86
PB
55242007-02-07 Paolo Bonzini <bonzini@gnu.org>
5525
5526 * tests/java.at: Skip tests if only one of javac/java is present.
5527 Reported by Joel E. Denny.
5528 * tests/atlocal.in: Adjust copyright years.
5529
55302007-02-05 Paolo Bonzini <bonzini@gnu.org>
5531
5532 * data/lalr1.java (Stack): Work around old verifiers that disallow
5533 access to the private fields of an inner class, from the outer class.
5534 We can make Stack's fields public because user code doesn't have access
5535 to the instance of Stack used by parse(). Reported by Paul Eggert.
5536
2c2b7220
PE
55372007-02-03 Paul Eggert <eggert@cs.ucla.edu>
5538
5539 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
5540 the right spot for these files?
5541 * bootstrap.conf (gnulib_modules): Add c-strcase.
5542 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
5543 c-strncasecmp.c.
5544 * src/getargs.c: Include c-strcase.h.
5545 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
5546 to avoid unspecified behavior.
5547
b2b81dae
JD
55482007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
5549
5550 * doc/bison.texinfo (Decl Summary): Correct typo.
5551
c1d19e10
PB
55522007-01-30 Paolo Bonzini <bonzini@gnu.org>
5553
5554 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
5555 Complain if the value does not match empty, "true" or "false".
5556 * data/c++.m4: Adjust default definitions of %define variables.
5557 * data/java.m4: Adjust default definitions of %define variables.
5558 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
5559 to above behavior.
5560 * tests/input.at (Boolean %define variables): Test new behavior.
5561
8405b70c
PB
55622007-01-29 Paolo Bonzini <bonzini@gnu.org>
5563
5564 * NEWS: Mention java.
5565 * TODO: Remove things that are done.
5566 * bootstrap.conf: Add javacomp-script and javaexec-script.
5567 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
5568
5569 * data/Makefile.am: Add new files.
5570 * data/java-skel.m4: New.
5571 * data/java.m4: New.
5572 * data/lalr1.java: New.
5573
5574 * doc/bison.texinfo: Put "A Complete C++ Example" under
5575 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
5576 under Other Languages.
5577
5578 * src/getargs.c (valid_languages): Add Java.
5579 * src/getargs.h (struct bison_language): Update size of string fields.
5580
5581 * tests/Makefile.am: Add java.at.
5582 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
5583 * tests/java.at: New.
5584 * tests/testsuite.at: Include it.
5585
3eb82471
JD
55862007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
5587
5588 Clean up.
5589 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
5590 at_directive_argv arguments so these no longer have to be global
5591 variables. Also, update the implementation for the following changes.
5592 (fail_for_at_directive_too_many_args,
5593 fail_for_at_directive_too_few_args): Add at_directive_name argument.
5594 (at_directive_name): Remove as at_directive_argv[0] will be used for
5595 this now.
5596 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
5597 for the directive name.
5598 (at_directive_argc, at_directive_argv): Make these local within
5599 skel_lex instead of global.
5600 (INITIAL): Update directive start action for above changes.
5601 (SC_AT_DIRECTIVE_ARG): Rename to...
5602 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
5603 (SC_AT_DIRECTIVE_SKIP_WS): Update.
5604 (scan_skel): Move yylex_destroy to...
5605 (skel_scanner_free): ... here.
5606 * tests/skeletons.at (installed skeleton file name): Rename to...
5607 (installed skeleton file names): ... this.
5608
148d66d8
JD
56092007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
5610
5611 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5612 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
5613 Summary" not "Directives".
5614 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
5615 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
5616 since the former is now the more complete one.
5617 (Prologue Alternatives): Likewise and do the same for %defines.
5618 (Table of Symbols): Add summary of %code, add summary of %define, and
5619 move full %code documentation to...
5620 (Decl Summary): ... here for consistency with other entries in these
5621 sections.
5622 Move %define entry in order to keep this list alphabetized.
5623 Reword %define entry a little to put less emphasis on the skeleton
5624 concept, which most users shouldn't have to think about.
5625
665f0c24
PE
56262007-01-26 Paul Eggert <eggert@cs.ucla.edu>
5627
5628 Adjust to recent gnulib changes.
5629 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
5630 Add string.h, string_.h, unistd_.h, wchar_.h.
5631 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
5632 * src/system.h: Don't include <stpcpy.h>; this is now done by
5633 <string.h>.
5634
592d0b1e
PB
56352007-01-23 Paolo Bonzini <bonzini@gnu.org>
5636
5637 Simplify implementation of unqualified %code, implement macros for
5638 uniform treatment of boolean %define flags. Document %define.
5639 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
5640 b4_percent_code_ifdef): New.
5641 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
5642 * data/c++.m4: Define default value for global_tokens_and_yystype.
5643 * data/glr.cc: Likewise.
5644 * data/location.cc: Use b4_percent_define_flag_if.
5645
148d66d8 5646 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
5647
5648 * src/parse-gram.y (Unqualified %code): Change muscle name to
5649 b4_percent_code().
5650 (content.opt): Default to empty.
5651
a7867f53
JD
56522007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5653
5654 Implement support for relative and absolute skeleton file names.
5655 Discussed starting at
5656 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5657 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5658 (Bison Options): Document in --skeleton entry.
5659 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5660 full_skeleton can't necessarily hold all of pkgdatadir.
5661 If the specified skeleton file name contains a `/', don't prepend
5662 pkgdatadir.
5663 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5664 file name contains a `/', prepend the grammar file directory.
5665 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5666 * skeletons.at: New file.
5667 (relative skeleton file names): New test case.
5668 (installed skeleton file names): New test case.
5669 * tests/testsuite.at: Include skeletons.at.
5670
5671 * bootstrap: Update copyright to 2007.
5672
830c9b18
PB
56732007-01-17 Paolo Bonzini <bonzini@gnu.org>
5674
5675 * bootstrap: Remove occurrences of .#bootmp from the files.
5676
a8c2e813
AD
56772007-01-17 Akim Demaille <akim@epita.fr>
5678
5679 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5680 nonterminals.
5681 Use per-type %printer.
5682
279cabb6
JD
56832007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5684
5685 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5686 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5687 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5688 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5689 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5690 tests/glr-regression.at, tests/input.at, tests/local.at,
5691 tests/output.at, tests/torture.at: Update copyright to 2007.
5692
bb32f4f2
AD
56932007-01-16 Akim Demaille <akim@epita.fr>
5694
5695 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5696 error code.
5697 (Calc++ Scanner): Exit with failure if we can't open the input
5698 file.
5699 Accept "-" standing for stdin.
5700 (Calc++ Top Level): Print the result only if the parsing was
5701 successful.
5702
7cff04b5
AD
57032007-01-16 Akim Demaille <akim@epita.fr>
5704
5705 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5706
a4e25e1d
JD
57072007-01-15 Paolo Bonzini <bonzini@gnu.org>
5708 and Joel E. Denny <jdenny@ces.clemson.edu>
5709
5710 Clean up %define and %code implementation in M4 some. Most
5711 importantly, rename all related macros to be in the b4_percent_define
5712 and b4_percent_code namespaces. Also, complete support for `.' in
5713 %define variable names and %code qualifiers.
5714 * data/bison.m4 (b4_check_user_names): Check for special
5715 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5716 m4_foreach loops.
5717 (b4_get_percent_define, b4_get_percent_code): Rename to...
5718 (b4_percent_define_get, b4_percent_code_get): ... these.
5719 Extend documentation with examples.
5720 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5721 b4_percent_define_skeleton_variables and
5722 b4_percent_code_skeleton_qualifiers.
5723 Expect any value for the %define variable `foo' to be stored in the
5724 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5725 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5726 expect any unqualified %code blocks to be stored in a macro named
5727 `b4_percent_code_unqualified'.
5728 Use m4_indir so that %define variable names and %code qualifiers can
5729 contain `.', which is allowed by the grammar parser.
5730 (b4_percent_define_default): New macro to set a default value for a
5731 %define variable.
5732 (m4_wrap): Update wrapped code, and fix some underquoting.
5733 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5734 Expect grammar uses of %define variables and %code qualifiers to be
5735 defined in b4_percent_define_user_variables and
5736 b4_percent_code_user_qualifiers.
5737 * data/c++.m4: Use b4_percent_define_default rather than
5738 m4_define_default. Fix some underquoting. Skeleton usage of %define
5739 variable define_location_comparison now implies skeleton usage of
5740 %define variable filename_type.
5741 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5742 data/push.c, data/yacc.c: Update macro names.
5743 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5744 muscle names.
5745
e37c665c
JMG
57462007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5747
5748 DJGPP specific issues.
5749
5750 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5751 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5752
7d2d521f
JD
57532007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5754
5755 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5756 run parsers in all tests so that Valgrind is invoked during
5757 maintainer-check-valgrind.
5758 (Duplicate representation of merged trees): Free all semantic values.
5759 (Duplicated user destructor for lookahead): Likewise.
5760
e0ac9b4b
JD
57612007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5762
5763 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5764 command-line prefix.
5765 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5766 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5767 miss Valgrind messages.
5768 (Exploding the Stack Size with Malloc): Likewise.
5769
78143faa
JD
57702007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5771
5772 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5773 locals. Reported by Juan Manuel Guerrero at
5774 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5775 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5776 Fix some indentation also.
5777 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5778 explaining this issue.
5779
7ecec4dd
JD
57802007-01-09 Paolo Bonzini <bonzini@gnu.org>
5781 and Joel E. Denny <jdenny@ces.clemson.edu>
5782
5783 Simplify union and prologue handling, and escape union and lex/parse
5784 params with digraphs.
5785 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5786 values to the empty string since these are no longer guaranteed
5787 initialized by the front-end.
5788 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5789 braces around b4_user_stype since this is no longer done by the
5790 front-end.
5791 * src/files.c, src/files.h (pre_prologue_obstack,
5792 post_prologue_obstack): Remove.
5793 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5794 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5795 with digraphs. This fixes lex params and parse params.
5796 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5797 * src/output.c (prepare): Remove muscle insertion of the prologues.
5798 (output): Remove freeing of pre_prologue_obstack and
5799 post_prologue_obstack.
5800 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5801 than prologue_augment for prologue parsing so you don't need prologue
5802 obstacks.
5c80250c
JD
5803 (grammar_declaration): For %union RHS, use `braceless' instead of
5804 "{...}" so that braces are already stripped and code is escaped with
5805 digraphs.
7ecec4dd
JD
5806 * src/reader.c (prologue_augment): Remove.
5807 (reader): Remove initialization of pre_prologue_obstack and
5808 post_prologue_obstack.
5809 * src/reader.h (prologue_augment): Remove.
5810
5811 * data/c.m4: Remove stray parenthesis.
5812
16dc6a9e
JD
58132007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5814
5815 Remove quotes from variables names in %define directives and from
5816 qualifiers in %code directives, and restrict the characters that are
5817 allowed in them to M4-friendly ones. For %define, continue to support
5818 the quoted form as a deprecated feature. Discussed starting at
5819 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5820 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5821 %code.
5822 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
5823 (Decl Summary): In %defines entry, update mention of `%code requires'
5824 and `%code provides'.
16dc6a9e
JD
5825 (C++ Location Values): Update %define uses.
5826 (Calc++ Parser Interface): Likewise.
5827 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 5828 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
5829 * src/parse-gram.y (prologue_declaration): For %define variables, use
5830 `variable' instead of `STRING'.
5831 (grammar_declaration): For %code qualifiers, use `ID' instead of
5832 `STRING'.
5833 (variable): New nonterminal that takes an `ID' or a `STRING'.
5834 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5835 and %define uses.
5836 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5837 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5838 (%define errors): Update %define uses.
5839
e9813cd4
JD
58402007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5841
5842 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5843 instead of muscle_insert for %define values so that M4-special
5844 characters are replaced with digraphs.
5845 * tests/input.at (%define errors): Extend to check weird values.
5846
6afc30cc
JD
58472007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5848
5849 Instead of having skeletons declare all valid %define variables and
5850 %code qualifiers, provide macros that retrieve the associated values
5851 and build these lists automatically. Thus Bison will now warn when a
5852 variable or qualifier is not used by the skeleton in the current
5853 invocation regardless of whether it might sometimes be used by that
5854 skeleton in other invocations. Also, move all %define value macros to
5855 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
5856 form, which is replaced by %code.
5857 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
5858 (b4_check_user_names): ... this, and change the series of valid name
5859 arguments to a single list argument for names used in the skeleton
5860 similar to the existing list argument for names used in the grammar.
5861 Warn instead of complaining.
5862 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
5863 values and %code code, to format %code code properly, and to build
5864 lists of all %define variables and %code qualifiers used in the
5865 skeleton: b4_skeleton_percent_define_variables and
5866 b4_skeleton_percent_code_qualifiers.
5867 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
5868 Remove, and...
5869 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
5870 the skeleton names lists can finish building first. In place of
5871 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
5872 expect the lists b4_user_percent_define_variables and
5873 b4_user_percent_code_qualifiers.
5874 * data/c++.m4: Where setting default values for b4_parser_class_name,
5875 b4_location_type, b4_filename_type, b4_namespace, and
5876 b4_define_location_comparison, update their names to the
5877 b4_percent_define_ namespace.
5878 * data/glr.c: Don't use b4_check_percent_define_variables and
5879 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5880 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
5881 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 5882 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
5883 * data/location.cc: Use b4_get_percent_define.
5884 * data/push.c: Don't use b4_check_percent_define_variables and
5885 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
5886 * data/yacc.c: Likewise, and don't call m4_exit in
5887 b4_use_push_for_pull_if or m4_wrap code will never execute.
5888 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
5889 Rename to...
5890 (muscle_grow_user_name_list): ... this for consistency with the
5891 terminology used in bison.m4.
5892 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
5893 %define variable names, and rename muscle used_percent_define_variables
5894 to user_percent_define_variables.
5895 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
5896 user_percent_code_qualifiers.
5897 (content): Remove.
5898 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
5899 {CODE} form is no longer accepted.
5900 * tests/input.at (Reject bad %code qualifiers): Rename to...
5901 (Reject unused %code qualifiers): ... this, and update test output.
5902 (%define error): Update test output.
5903
7eb8a0bc
JD
59042007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
5905
5906 Check for unrecognized %define variables similar to checking for
5907 unrecognized %code qualifiers. Check for redefined %define variables.
5908 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
5909 generalizes...
5910 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
5911 (b4_check_percent_define_variables): New, also wraps it.
5912 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
5913 variables using b4_check_percent_define_variables.
5914 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
5915 all those exercised in the test suite and all those listed in the
5916 `Default values' section of c++.m4. Are there others?
5917 * data/push.c, data/yacc.c: Declare no valid %define variables.
5918 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
5919 similar to muscle_find, but it works even when the muscle stores a
5920 const value.
5921 (muscle_grow_used_name_list): New function for constructing the used
5922 name list muscles that b4_check_for_unrecognized_names requires.
5923 * src/parse-gram.y (prologue_declaration): Warn if a variable is
5924 %define'd more than once. Define the b4_used_percent_define_variables
5925 muscle with muscle_grow_used_name_list.
5926 (grammar_declaration): Abbreviate %code code with
5927 muscle_grow_used_name_list.
5928 * tests/input.at (%define errors): New.
5929
3fc65ead
JD
59302007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5931
5932 Provide warn_at, complain_at, and fatal_at function callbacks to the
5933 skeletons, and use this for %code qualifier complaints.
5934 * data/bison.m4 (b4_error_at): New, invoked by...
5935 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
5936 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
5937 @fatal_at(...@) directives.
5938 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
5939 qualifiers in b4_used_percent_code_qualifiers and to use
5940 b4_complain_at.
5941 * src/location.c, src/location.h (boundary_set_from_string): New global
5942 function.
5943 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
5944 function.
5945 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
5946 to b4_used_percent_code_qualifiers.
5947 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
5948 function.
5949 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
5950 (lineno): Rename to...
5951 (out_lineno): ... this so I don't misunderstand it again.
5952 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
5953 here; these newlines are in the input but not the output file.
5954 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
5955 (at_directive_perform): ... this new static function, and add handling
5956 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
5957 directives.
5958 * tests/input.at (Reject bad %code qualifiers): Update test output with
5959 locations and extend.
5960
5961 * tests/output.at (Output file name: [, Output file name: ]): Remove
5962 bogus comment about these tests failing.
5963
1c7b7e1d
JD
59642007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5965
5966 Clean up b4_check_percent_code_qualifiers a little.
5967 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
5968 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
5969 documentation and add examples.
5970 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
5971 qualifiers here.
5972
08af01c2
JD
59732007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5974
5975 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
5976 unreliable -- especially when they're hidden inside another macro.
5977 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
5978 data/c.m4: Remove m4_divert(-1).
5979 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5980 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
5981 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 5982 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
5983 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
5984 pushed and popped by m4sugar, should be first on the stack.
5985
5986 Provide warn, complain, and fatal function callbacks to the skeletons.
5987 This provides more flexibility than m4_fatal, improves the error
5988 message format, and captures messages for translation. Discussed
5989 starting at
5990 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
5991 * data/bison.m4 (b4_error): New, invoked by...
5992 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
5993 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
5994 directives. Because these M4 macros might be called when the current
5995 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
5996 the previous removal of uses of m4_divert, which caused trouble.
5997 (b4_check_percent_code_qualifiers): Use b4_complain instead of
5998 m4_fatal to report unrecognized %code qualifiers.
5999 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6000 push parser requests.
6001 * data/glr.c: Use b4_complain instead of m4_fatal to report
6002 non-deterministic push parser requests.
6003 Update @output usage to @output(...@) form.
6004 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6005 report missing %defines. Update @output usage to @output(...@) form.
6006 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6007 @output(...@) form.
6008 * src/main.c (main): Invoke skel_scanner_free.
6009 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6010 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6011 obstack_for_string from flex-scanner.h.
6012 (YY_DECL): Use to declare skel_lex static.
6013 (decode_at_digraphs): Remove; now handled in the new
6014 SC_AT_DIRECTIVE_ARG start condition.
6015 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6016 functions.
6017 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6018 at_directive_argv): New static globals.
6019 (INITIAL): Use fail_for_invalid_at.
6020 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6021 recognize the start of a generalized `@directive(...@)' form and
6022 start...
6023 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6024 directive args (using the new obstack_for_string), to decode the
6025 contained @ diagraphs, and to perform the directive. It recognizes
6026 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6027 @output(...@).
6028 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6029 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6030 `@,'.
6031 (scan_skel): Initialize obstack_for_string on the first call.
6032 (skel_scanner_free): New function to free obstack_for_string.
6033 * tests/input.at (Reject bad %code qualifiers): Update test output.
6034
8e0a5e9e
JD
60352007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6036
6037 Consolidate the 4 prologue alternative directives (%code, %requires,
6038 %provides, and %code-top) into a single %code directive with an
6039 optional qualifier field. Discussed at
6040 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6041 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6042 alternatives.
6043 * doc/bison.texinfo (Prologue Alternatives): Update.
6044 (Decl Summary): Update to %code "requires" and %code "provides".
6045 (Calc++ Parser): Update to %code "requires".
148d66d8 6046 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
6047 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6048 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6049 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6050 which are skeleton-specific.
6051 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6052 declare what %code qualifiers it supports and to complain if any other
6053 qualifiers were used in the grammar.
6054 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6055 and b4_user_code([b4_percent_code_provides]) in place of
6056 b4_user_requires and b4_user_provides.
6057 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6058 Add b4_user_code([b4_percent_code_top]) and
6059 b4_user_code([b4_percent_code]).
6060 Invoke b4_check_percent_code_qualifiers.
6061 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6062 PERCENT_REQUIRES): Remove.
6063 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6064 %requires. Rewrite the %code RHS as the unqualified form defining the
6065 muscle b4_percent_code. Add another RHS for the qualified %code form,
6066 which defines muscles of the form b4_percent_code_QUALIFIER and the
6067 b4_used_percent_code_qualifiers muscle.
6068 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6069 PERCENT_REQUIRES): Remove.
6070 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6071 %code "requires" and %code "provides".
6072 * tests/input.at (Reject bad %code qualifiers): New.
6073
95021767
JD
60742007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6075
6076 Use the new code_props interface for destructors and printers.
6077 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6078 printer_location members, and change the type of the destructor and
6079 printer members to code_props.
6080 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6081 symbol_printer_get, semantic_type_destructor_set,
6082 semantic_type_printer_set, default_tagged_destructor_set,
6083 default_tagless_destructor_set, default_tagged_printer_set,
6084 default_tagless_printer_set): Use code_props in arguments and return
6085 types in place of char const * and location.
6086 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6087 since the locations are now contained in the return of
6088 symbol_destructor_get and symbol_printer_get.
6089 * src/output.c (symbol_destructors_output, symbol_printers_output):
6090 Replace with...
6091 (symbol_code_props_output): ... this to eliminate duplicate code.
6092 (output_skeleton): Update to use symbol_code_props_output.
6093 * src/reader.c (symbol_should_be_used): Update use of
6094 symbol_destructor_get.
6095 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6096 Update uses of the various _destructor_set and _printer_set functions.
6097 * src/symtab.c: (default_tagged_destructor_location,
6098 default_tagless_destructor_location, default_tagged_printer_location,
6099 default_tagless_printer_location): Remove since we...
6100 (default_tagged_destructor, default_tagless_destructor,
6101 default_tagged_printer, default_tagless_printer): ... change the type
6102 of these to code_props.
6103 (symbol_new, semantic_type_new, symbol_destructor_set,
6104 semantic_type_destructor_set, symbol_destructor_get,
6105 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6106 symbol_check_alias_consistency, default_tagged_destructor_set,
6107 default_tagless_destructor_set, default_tagged_printer_set,
6108 default_tagless_printer_set): Update.
6109 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6110 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6111 code_props members.
6112 (symbol_print): Use SYMBOL_CODE_PRINT.
6113
f6857bbf
JD
61142007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6115
6116 Use the new code_props interface for rule actions.
6117 * src/symlist.h (symbol_list): Replace action, action_location, and
6118 used members with a code_props action_props member.
6119 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6120 grammar_midrule_action, grammar_current_rule_merge_set,
6121 grammar_current_rule_symbol_append, packgram): Update.
6122 * src/scan-code.h (translate_rule_action): Remove, no longer used.
6123 * src/scan-code.l (handle_action_dollar): Update.
6124 (translate_rule_action): Remove, no longer used.
6125 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
6126
7c0c6181
JD
61272007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6128
6129 Use the new code_props interface in parse-gram.y.
6130 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
6131 Update all uses of translate_* functions to use the new code_props
6132 interface and to use gram_scanner_last_string_free and
6133 code_scanner_last_string_free where possible.
6134 (grammar_declaration): symbol_list_destructor_set and
6135 symbol_list_printer_set now perform the translation, so don't do it
6136 here. Use gram_scanner_last_string_free where possible.
6137 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
6138 translate_code): Remove, no longer used.
6139 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
6140 symbol_list_printer_set): Perform code translation here rather than
6141 depending on the caller to do so.
6142
6143 * src/symlist.h (struct symbol_list): Correct some documentation typos.
6144 * src/scan-gram.h (gram_last_string): Remove declaration.
6145 * src/scan-gram.l (last_string): Declare it static.
6146
28e52c0d
JD
61472007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6148
6149 Encapsulate code properties and related functionality for the various
6150 destructors, printers, and actions into a code_props structure and
6151 interface. This patch merely implements code_props in scan-code.h and
6152 scan-code.l. Future patches will rewrite other modules to use it.
6153 Discussed starting at
6154 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
6155 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
6156 consistently initialize const structs that have an empty location
6157 field.
6158 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
6159 to ensure consistency.
6160 * src/scan-code.h (code_props): New structure.
6161 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
6162 function, macro, and const global variable for initializing a
6163 code_props with no code.
6164 (code_props_plain_init, code_props_symbol_action_init,
6165 code_props_rule_action_init, code_props_translate_code): The rest of
6166 the new code_props functional interface. Among other things, the init
6167 functions set the code_props kind field so that
6168 code_props_translate_code will know whether to behave like
6169 translate_symbol_action, translate_rule_action, or translate_code.
6170 These old translate functions must remain until all other modules are
6171 updated to use the new code_props interface.
6172 (code_scanner_last_string_free): New function similar to
6173 gram_scanner_last_string_free.
6174 (code_scanner_free): Add documentation.
6175 * src/scan-code.l: Implement the new interface.
6176 (code_lex): Make it static, add a code_props* argument, and remove the
6177 rule argument.
6178 (last_string): New static global similar to the one in scan-gram.l.
6179 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
6180 instead of rule.
6181 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
6182 code_props since Bison may one day use this information for destructors
6183 and printers.
6184 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
6185 (handle_action_dollar): Use symbol_list_n_get and set used flag
6186 directly since symbol_list_n_used_set is removed.
6187 (translate_action): Add a code_props* argument and remove the rule,
6188 action, and location arguments. Pass the code_props* on to code_lex.
6189 (translate_rule_action, translate_symbol_action, translate_code):
6190 Rewrite as wrappers around the new code_props interface.
6191 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
6192 it would eventually need to break the encapsulation of code_props.
6193
96034983
JD
61942007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6195
6196 * etc/.cvsignore: New.
6197
945e396c
JD
61982007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6199
6200 Add maintainer-push-check to run maintainer-check using push parsing in
6201 place of pull parsing where available.
6202 * Makefile.am (maintainer-push-check): New.
6203 * data/bison.m4 (b4_use_push_for_pull_if): New.
6204 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
6205 appropriately based on their existing values.
6206 (yypush_parse): Don't print push-parser-specific diagnostics if push
6207 parsing is being used in place of pull parsing.
6208 * data/yacc.c: If push parsing should replace pull parsing, redirect to
6209 push.c.
6210 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
6211 variable, and insert b4_use_push_for_pull_flag into muscles.
6212 * tests/Makefile.am (maintainer-push-check): New.
6213
7d596384
JD
62142006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6215
6216 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
6217 (whether successful or failed) so that yypush_parse can be invoked
6218 again to start a new parse using the same yypstate.
6219 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
6220 check multiple yypull_parse invocations on the same yypstate. For pull
6221 mode, extend to check multiple yyparse invocations.
6222 (Exploding the Stack Size with Alloca): Extend to try with
6223 %push-pull-parser.
6224 (Exploding the Stack Size with Malloc): Likewise.
6225
6226 * tests/calc.at (Simple LALR Calculator): Don't specify
6227 %skeleton "push.c" since %push-pull-parser implies that now.
6228 * tests/headers.at (export YYLTYPE): Don't check for the push
6229 declarations. Otherwise, this test case can't be used to see if push
6230 mode can truly emulate pull mode.
6231 * tests/input.at (Torturing the Scanner): Likewise.
6232 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
6233 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
6234 AT_YACC_IF, which now includes the case of push mode since %skeleton
6235 need not be used for push mode. This will be more intuitive once
6236 push.c is renamed to yacc.c.
6237
7172e23e
JD
62382006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6239
6240 For push mode, convert yyparse from a macro to a function, invoke yylex
6241 instead of passing a yylexp argument to yypull_parse, and don't
6242 generate yypull_parse or yyparse unless %push-pull-parser is declared.
6243 Discussed starting at
6244 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
6245 * data/bison.m4 (b4_pull_if): New.
6246 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
6247 * data/push.c: Improve M4 quoting a little.
6248 (b4_generate_macro_args, b4_parenthesize): Remove.
6249 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
6250 any time a pull parser is requested.
6251 Don't #define this as a wrapper around yypull_parse. Instead, when
6252 both push and pull are requested, make it a function that does that
6253 same thing.
6254 (yypull_parse): If there's a b4_prefix, #define this to
6255 b4_prefix[pull_parse] when both push and pull are requested.
6256 Don't define this as a function unless both push and pull are
6257 requested.
6258 Remove the yylexp argument and hard-code yylex invocation instead.
6259 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
6260 %push-parser.
6261 * src/getargs.c (pull_parser): New global initialized to true.
6262 * getargs.h (pull_parser): extern it.
6263 * src/output.c (prepare): Insert pull_flag muscle.
6264 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
6265 (prologue_declaration): Set both push_parser and pull_parser = true for
6266 %push-pull-parser. Set push_parser = true and pull_parser = false for
6267 %push-parser.
6268 * src/scan-gram.l: Don't accept %push_parser as an alternative to
6269 %push-parser since there's no backward-compatibility concern here.
6270 Scan %push-pull-parser.
6271 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
6272 instead of %push-parser.
6273 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
6274 prototype it in the module that calls yyparse.
6275 * tests/input.at (Torturing the Scanner): Likewise.
6276 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
6277
2e7944cb
JD
62782006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
6279
6280 Update etc/bench.pl. Optimize push mode a little (the yyn change
6281 deserves most of the credit).
6282 * Makefile.am (SUBDIRS): Add etc subdirectory.
6283 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
6284 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
6285 yytoken, yyval, and yyloc declarations to...
6286 (yyparse or yypush_parse): ... here to improve performance. For
6287 yypush_parse invocations after the first, be sure to assign yyn its old
6288 value again.
6289 (yypstate_new): Don't bother initializing the yyresult field since the
6290 initial value isn't used.
6291 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
6292 remove the #define that, in push mode, set it to yyps->NAME.
6293 * etc/Makefile.am: New.
6294 * etc/bench.pl: Remove and build it instead from...
6295 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
6296 "tests/bison" from the build directory by default rather than just
6297 invoking "bison" from $PATH.
6298 (calc_grammar): Update push parser code: don't declare yylval globally,
6299 don't define yyparse_wrapper, and don't #define yyparse.
6300 (bench_grammar): Update to check all working combinations of yacc.c,
6301 push.c, impure, pure, pull, and push.
6302
c3d50342
JD
63032006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6304
6305 For push mode, add pull wrappers around yypush_parse.
6306 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
6307 (yypull_parse): New function wrapping yypush_parse.
6308 (yyparse): New #define wrapping yypull_parse.
6309 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
6310 is declared.
6311 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
6312 prototype yylex in the module that calls yyparse, and don't prototype
6313 yyparse there. Otherwise, the yyparse expansion won't compile.
6314 * tests/input.at (Torturing the Scanner): Likewise.
6315
94ebeba5
JD
63162006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6317
6318 Enable push parsers to operate in impure mode. Thus, %push-parser no
6319 longer implies %pure-parser. The point of this change is to move
6320 towards being able to test the push parser code by running the entire
6321 test suite as if %push-parser had been declared.
6322 * data/push.c (yypush_parse): For impure mode, remove the
6323 yypushed_char, yypushed_val, and yypushed_loc arguments.
6324 Instead, declare these as local variables initialized to the global
6325 yychar, yylval, and yylloc.
6326 For the first yypush_parse invocation only, restore the initial values
6327 of these global variables when it's time to read a token since they
6328 have been overwritten.
6329 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
6330 %push-parser.
6331 * tests/calc.at (Simple LALR(1) Calculator): Always declare
6332 %pure-parser along with %push-parser since this test case was designed
6333 for pure push parsers.
6334 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
6335 (AT_YACC_OR_PUSH_IF): New.
6336 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
6337 add a note that it's still wrong for some cases (as it has been for a
6338 while).
6339 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
6340 %push-parser no longer implies %pure-parser.
6341
a0633178
JD
63422006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6343
6344 Remove some unnecessary differences between the pull parser code and
6345 the push parser code. This patch enables yynerrs in push mode.
6346 * data/push.c: Reformat M4 a little.
6347 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
6348 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
6349 because push mode is on. Instead, if pure mode is on, move yynerrs
6350 to...
6351 (b4_declare_parser_state_variables): ... here.
6352 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
6353 to yyps->NAME so it can be used in yypush_parse.
6354 (yypush_parse): Don't omit uses of yynerrs in push mode.
6355
8646b6a3
JD
63562006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6357
6358 Fix bug such that the first pushed token's value and location are
6359 sometimes overwritten (sometimes by %initial-action) before being used.
6360 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
6361 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
6362 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
6363 more closely mimic the pull parser logic.
6364 Don't copy the pushed token to yychar, yylval, and yylloc until it's
6365 time to read a token, which is after any initialization of yylval and
6366 yylloc.
6367 (gottoken): Rename label to...
6368 (yyread_pushed_token): ... for clarity and to avoid infringing on the
6369 user namespace.
6370
9baf4d74
JD
63712006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6372
6373 Rearrange initialization of the parser state variables so that the
6374 skeleton doesn't have to have a copy for pull mode and another for push
6375 mode. This patch also fixes at least a bug such that yylloc was not
6376 initialized (with b4_location_initial_line and
6377 b4_location_initial_column) upon calling yypush_parse. However, that
6378 initialization now overwrites the first token's location;
6379 %initial-action assigning @$ already did the same thing, and both bugs
6380 will be fixed in a later patch.
6381 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
6382 (b4_declare_parser_state_variables): Remove initialization of yytoken,
6383 yyss, yyvs, yyls, and yystacksize.
6384 (yypstate_new): Remove initialization of some yypstate fields: yystate,
6385 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
6386 yylsp.
6387 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
6388 yyps->NAME so it can be used in yypush_parse.
6389 (yyparse or yypush_parse): For yypush_parse, don't print the
6390 "Starting parse" diagnostic for invocations after the first.
6391 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
6392 yypush_parse, only do it for the first invocation.
6393 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
6394 initialization to occur in yypush_parse but only on the first
6395 invocation.
6396
23522164
JD
63972006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6398
6399 * data/push.c: Add CPP guards around push parser declarations in both
6400 the header and the code file.
6401 In the code file, move the push parser declarations to the same place
6402 they appear in the header file.
6403 Clean up the M4 some, especially the inconsistent underquoting in
6404 some b4_c_function_def and b4_c_function_decl uses.
6405
bb010fe5
JD
64062006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6407
6408 Encapsulate the push parser state variables into an M4 macro so the
6409 push skeleton doesn't have to list them again for pull mode's yyparse.
6410 For push mode, remove yypush_parse's local equivalents of these
6411 variables to eliminate unnecessary copying between the two sets at
6412 run-time. This patch also fixes at least a bug related to multiple
6413 %initial-action invocations in push mode.
6414 * data/push.c (b4_declare_parser_variables): Rename to...
6415 (b4_declare_scanner_communication_variables): ... this for clarity and
6416 update both uses.
6417 (b4_declare_yyparse_variables): Remove and move its contents to the one
6418 spot where it was invoked.
6419 (b4_declare_parser_state_variables): New macro containing the parser
6420 state variables required by push mode.
6421 (struct yypstate): Replace all fields but yynew with
6422 b4_declare_parser_state_variables.
6423 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
6424 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
6425 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6426 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6427 parser state variable declarations with
6428 b4_declare_parser_state_variables.
6429 Don't initialize parser state variables when calling yypush_parse since
6430 yypstate_new already does that.
6431 Invoke the user's initial action only upon the first yypush_parse
6432 invocation.
6433 Remove all code that copies between the local parser state variables
6434 and the yypstate.
6435
2d212f8c
JD
64362006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6437
6438 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6439 prevent a name collision in a future patch where these names will
6440 sometimes be #define'd.
6441 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6442 since it no longer has the same name as the existing argument.
6443 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6444
e6e704dc
JD
64452006-12-19 Paolo Bonzini <bonzini@gnu.org>
6446 and Joel E. Denny <jdenny@ces.clemson.edu>
6447
6448 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6449 that the argument is case-insensitive, and there's no `=' here.
6450 For the %skeleton entry, mention that %language is better.
6451 (Bison Options): Likewise for --language and --skeleton. Move the
6452 --skeleton entry so that the `Tuning the parser' section is sorted
6453 alphabetically on long options.
6454 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6455 %language directive in detail here; cross-reference the %language
6456 documentation instead.
6457 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6458 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 6459 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
6460 * examples/extexi (normalize): Instead of replacing every %require
6461 argument with the current Bison version, just substitute for
6462 `@value{VERSION}'. This guarantees that we're testing what actually
6463 appears in the documentation.
6464 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6465 rather than `@VERSION@'.
6466
0e021770
PE
64672006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6468
fd575f05
PE
6469 * NEWS: Reword the %language news a bit, and put it earlier.
6470
0e021770
PE
6471 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6472 Rewrite to simplify the logic.
6473 (language_argmatch): Likewise.
fd575f05
PE
6474 (program_name): We now own this var.
6475 * src/getargs.h (struct bison_language): Use char[] rather than
6476 const char *.
0e021770
PE
6477
6478 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6479 Java is supported.
6480 * src/complain.c (program_name): Remove decl; no longer needed.
6481 * src/main.c (program_name): Remove; now belongs to getargs.
6482
64832006-12-18 Paolo Bonzini <bonzini@gnu.org>
6484
6485 * NEWS: Document %language.
6486
6487 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6488
6489 * data/c-skel.m4, data/c++-skel.m4: New files.
6490 * data/glr.c: Complain on push parsers.
6491
6492 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6493 over %skeleton.
148d66d8 6494 (Decl Summary): Document %language and %skeleton.
0e021770
PE
6495 (Command line): Document -L.
6496
6497 * examples/extexi: Rewrite %require directive.
6498 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6499
6500 * src/files.c (compute_exts_from_gc): Look in language structure
6501 for .y extension.
6502 (compute_file_name_parts): Check whether .tab should be added.
6503 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6504 (language, skeleton_arg, language_argmatch): New.
6505 (long_options): Add --language.
6506 (getargs): Use skeleton_arg, add -L/--language.
6507 * src/getargs.h: Include location.h.
6508 (struct bison_language, language, skeleton_arg, language_argmatch): New.
6509 * src/output.c (prepare): Pick default skeleton from struct language.
6510 Don't dispatch C skeletons here.
6511 * src/parse-gram.y (PERCENT_LANGUAGE): New.
6512 (prologue_declaration): Add "%language" rule, use skeleton_arg.
6513 * src/scan-gram.l ("%language"): New rule.
6514
6515 * tests/calc.at: Test %skeleton and %language.
6516 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
6517 (AT_GLR_IF): Look for %skeleton "glr.cc".
6518 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
6519 (AT_YACC_IF): Reject %language.
6520
5691bf57
PE
65212006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6522
db06f0ce
PE
6523 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
6524 since it wasn't used; only the typedef name 'semantic_type' is needed.
6525 Also, omit trailing white space.
6526
5691bf57
PE
6527 * bootstrap: Sync from coreutils.
6528 (gnulib_extra_files): Add build-aux/announce.gen.
6529 (slurp): Adjust .gitignore files like .cvsignore files.
6530 * build-aux/announce-gen: Remove from CVS, since bootstrap
6531 now creates this.
6532
791934e4
JD
65332006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
6534
6535 Make %push-parser imply %pure-parser. This fixes several bugs; see
6536 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
6537 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6538 pure_parser = true.
6539 * data/push.c: Don't bother testing b4_push_if when deciding whether
6540 to expand b4_declare_parser_variables globally.
6541 (yypush_parse): Likewise in here.
6542
6543 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
6544 (yy_reduce_print): Reformat M4 for readability.
6545
ee5abb37
JD
65462006-12-15 Bob Rossi <bob@brasko.net>
6547 and Joel Denny <jdenny@ces.clemson.edu>
6548
6549 * data/push.c (yypstate): Add typedef, and update all uses of
6550 struct yypstate to just yypstate.
6551 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
6552
16ca01f9
JD
65532006-12-14 Bob Rossi <bob@brasko.net>
6554
6555 * data/push.c (yypush_parse): Declare prototype regardless of
6556 %locations option.
6557
ab8e7e1a
JD
65582006-12-14 Bob Rossi <bob@brasko.net>
6559
6560 * data/push.c (yyparse): Remove the prototype and the #define when in
6561 push-parser mode.
6562
9bf32be3
JD
65632006-12-13 Bob Rossi <bob@brasko.net>
6564
6565 * data/push.c (yypstate_init): Rename to...
6566 (yypstate_new): ... this and use b4_c_function_def.
6567 (yypstate_delete): New.
6568 (yypush_parse): Change parameters yynval and yynlloc to be const.
6569 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
6570 yypstate_delete functions.
6571
f02e2948
JD
65722006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
6573
6574 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
6575 strange test case titles. Reported by Bob Rossi.
6576
38eb7751
PE
65772006-12-13 Paul Eggert <eggert@cs.ucla.edu>
6578
6579 * TODO: Add pointer to Sylvain Schmitz's work on static detection
6580 of potential ambiguities in GLR grammers.
6581
bd9d212b
JD
65822006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
6583
6584 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
6585 `bison ', use m4_index instead of m4_substr since chopping up a string
6586 containing M4-special characters causes problems here.
6587
6588 Fix a couple of bugs related to special characters in user-specified
6589 file names, and make it easier for skeletons to compute output file
6590 names with the same file name prefix as Bison-computed output file
6591 names.
6592 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
6593 b4_parser_file_name and b4_spec_defines_file instead of
6594 @output_parser_name@ and @output_header_name@, which are now redundant.
6595 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
6596 b4_parser_file_name, b4_spec_defines_file, and the new
6597 @basename(FILENAME@) instead of @output_parser_name@ and
6598 @output_header_name@, which inappropriately escaped the file names as
6599 C string literals.
6600 * src/files.c (all_but_ext): Remove static qualifier.
6601 (compute_output_file_names): Move `free (all_but_ext)' to...
6602 (output_file_names_free): ... here since all_but_ext is needed later.
6603 * src/files.h (all_but_ext): Extern.
6604 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
6605 exactly what MUSCLE_INSERT_STRING used to do.
6606 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
6607 characters are escaped properly.
6608 * src/output.c (prepare): Define muscle file_name_all_but_ext as
6609 all_but_ext.
6610 For pkgdatadir muscle, maintain previous functionality by using
6611 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
6612 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
6613 digraphs would never be expanded. Hopefully no one has M4-special
6614 characters in his Bison installation path.
6615 * src/scan-skel.l: Don't parse @output_header_name@ and
6616 @output_parser_name@ anymore since they're now redundant.
6617 In @output, use decode_at_digraphs.
6618 Parse a new @basename command that invokes last_component.
6619 (decode_at_digraphs): New.
6620 (BASE_QPUTS): Remove unused.
6621 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
6622 (Output file name): New tests.
6623
3f7ca628
JD
66242006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
6625
6626 Warn about output files that are generated by the skeletons and that
6627 conflict with other output files.
6628 * data/glr.c: Don't generate the header file here when glr.cc does.
6629 * src/files.c (file_names, file_names_count): New static globals.
6630 (compute_output_file_names): Invoke output_file_name_check for files
6631 not generated by the skeletons and remove existing checks.
6632 (output_file_name_check): New function that warns about conflicting
6633 output file names.
6634 (output_file_names_free): Free file_names.
6635 * src/files.h (output_file_name_check): Declare.
6636 * src/scan-skel.l: Invoke output_file_name_check for files generated by
6637 the skeletons.
6638 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
6639 (Conflicting output files): New tests.
6640
178e123e
PE
66412006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6642
6643 * doc/bison.texinfo: Fix a couple of typos.
6644
66452006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
6646
6647 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
6648 Rename to...
6649 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
6650 update all uses.
6651 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
6652 (yypush_parse): Rename yypvars argument to yyps and remove redundant
6653 local pv.
6654 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
6655 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
6656
ea17f233
JD
66572006-12-07 Bob Rossi <bob@brasko.net>
6658 and Joel Denny <jdenny@ces.clemson.edu>
6659
6660 * data/push.c (yypvarsinit): Change return type from void* to struct
6661 yypvars*. No longer cast to void* on return.
6662 (struct yypvars): Remove yylen since it need not be remembered between
6663 yypushparse invocations.
6664 (yypushparse): Don't copy between yylen and pv->yylen.
6665
55a30bda
JD
66662006-12-05 Bob Rossi <bob@brasko.net>
6667
6668 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6669 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6670 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6671 (struct yypvars): Remove b4_declare_parser_variables.
6672 (yypvarsinit): Remove init code for removed variables.
6673 (global scope): Do not declare b4_declare_parser_variables if
6674 push or pure mode.
6675 (yypushparse): Add b4_declare_parser_variables.
6676 Init new local variables, and remove init code for removed
6677 yypvars variables.
6678 (yyparse): Delete.
6679 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6680 and yyparse for other modes.
6681 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6682 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6683 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6684 (AT_PURE_LEX_IF): True if pure or push parser.
6685
85894313
JD
66862006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6687
6688 Document Yacc prologue alternatives and default %destructor's and
6689 %printer's as experimental. Don't mention Java yet. Discussed at
6690 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6691 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6692 (2.3a): Annotate this entry to say the old forms of these features were
6693 also experimental.
6694 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 6695 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
6696 of Java (we'll want this back eventually).
6697
02975b9a
JD
66982006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6699
6700 Support a file name argument to %defines. Deprecate `=' in
6701 %file-prefix, %name-prefix, and %output. Discussed at
6702 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6703 * NEWS (2.3a+): Mention.
148d66d8 6704 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
6705 form of %defines, and remove `=' from entries for %file-prefix,
6706 %name-prefix, and %output.
6707 * src/parse-gram.y (prologue_declaration): Implement.
6708 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6709 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6710 all but one occurrence of %name-prefix.
6711 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6712 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6713 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6714 occurrence of each of %file-prefix and %output. Add check for %defines
6715 with argument.
6716 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6717 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6718 Remove the `=' from %output.
6719
287b314e
JD
67202006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6721
6722 Don't escape $ in test case titles since Autoconf 2.61 now does that
6723 correctly.
6724 * tests/actions.at (Default %printer and %destructor are not for error
6725 or $undefined): Here.
6726 (Default %printer and %destructor are not for $accept): Here.
6727 * tests/input.at (Invalid $n and @n): Here.
6728
3ebecc24
JD
67292006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6730
6731 Rename <!> to <>. Discussed starting at
6732 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6733 * NEWS (2.3a+): Update.
148d66d8 6734 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
6735 Update.
6736 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6737 * src/scan-gram.l (INITIAL): Implement.
6738 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6739 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6740 comment.
6741 * tests/actions.at (Default tagless %printer and %destructor,
6742 Default tagged and per-type %printer and %destructor,
6743 Default %printer and %destructor are not for error or $undefined,
6744 Default %printer and %destructor are not for $accept,
6745 Default %printer and %destructor for mid-rule values): Update.
6746 * tests/input.at (Default %printer and %destructor redeclared,
6747 Unused values with default %destructor): Update.
6748
26b8a438
JD
67492006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6750
6751 Don't let %prec take a nonterminal.
6752 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6753 token.
6754 * tests/input.at (%prec takes a token): New test checking that %prec
6755 won't take a nonterminal.
6756
07c39ae9
JD
67572006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6758
405d53b7
JD
6759 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6760 it was double-quoted.
07c39ae9
JD
6761 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6762 grammar is maintained with Bison's highest standards.
6763 * src/getargs.c: Fix some typos in Doxygen comments.
6764
580b8926
JD
67652006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6766
6767 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6768 later. Reported by Paul Eggert in
6769 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6770 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6771 * src/scan-code.l (translate_action): Don't bother invoking
6772 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6773 (code_scanner_free): Instead of invoking
6774 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6775 which frees more.
6776 * src/scan-gram.l (gram_scanner_free): Likewise.
6777 * src/scan-skel.l (scan_skel): Likewise.
6778
4502eadc
JD
67792006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6780
6781 * src/files.c (tr): Change return type to void.
6782 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6783 has been called previously for the same key.
6784 (muscle_find): Return storage instead of value so that
6785 --enable-gcc-warnings doesn't produce warnings that the return discards
6786 const. aver that the value and storage are the same since storage
6787 could potentially be NULL when value is not.
6788 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6789 same as 0.
6790
7746c8f6
PE
67912006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6792
6793 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6794 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6795 us a slightly cleaner distribution, and also works.
6796 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6797 gnulib changes.
6798
eb095650
PE
67992006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6800 and Paul Eggert <eggert@cs.ucla.edu>
6801
6802 Don't let Bison leak memory except when it complains.
6803 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6804 (spec_defines_file, dir_prefix): Now char *, not const char *,
6805 since they are freed.
6806 * src/files.c: Likewise.
6807 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6808 Likewise.
6809 (tr): Now operates in-place. All uses changed.
6810 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6811 values.
6812 (compute_file_name_parts, compute_output_file_names): Don't store
6813 read-only data in variables that will be freed.
6814 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6815 src_extension, and header_extension.
6816 (output_file_names_free): New public function to free
6817 spec_verbose_file, spec_graph_file, spec_defines_file,
6818 parser_file_name, and dir_prefix.
6819 * src/getargs.c (getargs): Don't store read-only data in variables that
6820 will be freed.
6821 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6822 (which previously existed but was unused), and quotearg_free.
6823 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6824 * src/muscle_tab.c: Likewise.
6825 (muscle_entry): Make the value char const *,
6826 and add a new storage member that is char * and can be freed.
6827 (muscle_entry_free): New private function.
6828 (muscle_init): Use it instead of free.
6829 (muscle_insert, muscle_grow): Update and use new storage member.
6830 (muscle_code_grow): Free the string passed to muscle_grow
6831 since it's not needed anymore.
6832 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6833 add a new `char *code' member.
6834 ("{...}"): Declare semantic type as code.
6835 * src/scan-code.h (translate_rule_action):
6836 (translate_symbol_action, translate_code, translate_action): Return
6837 `char const *' rather than `char *' since external code should not free
6838 these strings.
6839 * src/scan-code.l: Likewise.
6840 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6841 which is "{...}" in the parser.
6842 * tests/Makefile.am (maintainer-check-valgrind): Set
6843 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6844 Valgrind.
6845 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6846 complain.
6847 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6848 expecting a non-zero exit status sets --leak-check=summary and
6849 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
6850 this case, and we don't want to hear about it.
6851
ac564be4
PE
68522006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6853
6854 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
6855 instead of from the template, to simplify configuration a bit.
6856 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
6857 and m4/wint_t.m4, as they are needed with the latest gnulib.
6858
17bd8a73
JD
68592006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6860
6861 Disable unset/unused mid-rule value warnings by default, and recognize
6862 --warnings=midrule-values to enable them. Discussed starting at
6863 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
6864 * NEWS (2.3a+): Mention.
6865 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
6866 warnings): Add entry for midrule-values subargument.
6867 * src/reader.c (symbol_should_be_used): Don't return true just because
6868 the value is a set/used mid-rule value unless
6869 --warnings=midrule-values was specified.
6870 * tests/input.at (Unused values, Unused values before symbol
6871 declarations): Run tests with and without --warnings=midrule-values.
6872
6873 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
6874 than LIST_FREE directly.
6875
89eb3c76
JD
68762006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6877
6878 Finish implementing --warnings=error, which should not be implied by
6879 --warnings=all (or by its synonyms -W and --warnings without
6880 subarguments).
6881 * src/complain.c (set_warning_issued): New function to report that
6882 warnings are being treated as errors and to record an error if so.
6883 Invoke...
6884 (warn_at, warn): ... here.
6885 * src/getargs.c (warnings_args, warnings_types): Reorder so that
6886 "error - warnings are errors" does not appear above "all - all of the
6887 above".
6888 (getargs): For -W and --warnings without subarguments, don't let
6889 FLAGS_ARGMATCH set warnings_error in warnings_flag.
6890 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
6891
ba7560e2
JD
68922006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
6893
6894 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
6895 empty subargument list. For example: `bison --warnings= parser.y'.
6896
31283fc3
JD
68972006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6898
6899 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
6900 the parser header file so that gcc doesn't warn.
6901
12e35840
JD
69022006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6903
6904 Split the default %destructor/%printer into two kinds: <*> and <!>.
6905 Discussed starting at
6906 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
6907 * NEWS (2.3a+): Mention.
6908 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
6909 previous change today related to mid-rules.
148d66d8 6910 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 6911 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
6912 (TYPE_TAG_ANY): Add as <*>.
6913 (TYPE_TAG_NONE): Add as <!>.
6914 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
6915 for <*> and <!>.
6916 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
6917 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
6918 * src/symlist.c (symbol_list_default_new): Split into tagged and
6919 tagless versions.
6920 (symbol_list_destructor_set, symbol_list_printer_set): Split
6921 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
6922 SYMLIST_DEFAULT_TAGLESS.
6923 * src/symlist.h: Update symbol_list_default*_new prototypes.
6924 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
6925 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
6926 * src/symtab.c (default_destructor, default_destructor_location,
6927 default_printer, default_printer_location): Split each into tagged and
6928 tagless versions.
6929 (symbol_destructor_get, symbol_destructor_location_get,
6930 symbol_printer_get, symbol_printer_location_get): Implement tagged
6931 default and tagless default cases.
6932 (default_destructor_set, default_printer_set): Split each into tagged
6933 and tagless versions.
6934 * src/symtab.h: Update prototypes.
6935 * tests/actions.at (Default %printer and %destructor): Rename to...
6936 (Default tagless %printer and %destructor): ... this, and extend.
6937 (Per-type %printer and %destructor): Rename to...
6938 (Default tagged and per-type %printer and %destructor): ... this, and
6939 extend.
6940 (Default %printer and %destructor for user-defined end token): Extend.
6941 (Default %printer and %destructor are not for error or $undefined):
6942 Update.
6943 (Default %printer and %destructor are not for $accept): Update.
6944 (Default %printer and %destructor for mid-rule values): Extend.
6945 * tests/input.at (Default %printer and %destructor redeclared): Extend.
6946 (Unused values with default %destructor): Extend.
6947
f91b1629
JD
69482006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
6949
6950 Don't apply the default %destructor/%printer to an unreferenced midrule
6951 value. Mentioned at
6952 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
6953 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
6954 like $@n instead of just @n so that the default %destructor/%printer
6955 logic doesn't see them as user-defined symbols.
6956 (symbol_is_dummy): Check for both forms of the name.
6957 * src/reader.c (packgram): Remove the `$' from each midrule symbol
6958 name for which the midrule value is referenced in any action.
6959 * tests/actions.at (Default %printer and %destructor for mid-rule
6960 values): New test.
6961 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
6962 for change to dummy symbol names.
6963
519d0004
JD
69642006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6965
6966 Warn about unset midrule $$ if the corresponding $n is used.
6967 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
6968 $n usage.
6969 (packgram): Before invoking grammar_rule_check on any rule, make sure
6970 all actions have already been scanned in order to set `used' flags.
6971 Otherwise, checking that a midrule's $$ is set will not always work
6972 properly because the midrule check must forward-reference the midrule's
6973 parent rule.
6974 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
6975 warning.
6976
a501eca9
JD
69772006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
6978
6979 More improvements to the documentation of the prologue alternatives:
6980 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
6981 Bison manual.
6982 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
6983 some text to clarify the relative importance of the new directives and
6984 to show how these directives may be viewed as code labels.
6985
2cbe6b7f
JD
69862006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
6987
6988 Similar to the recently removed %before-header, add %code-top as the
6989 alternative to the pre-prologue. Mentioned at
6990 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
6991 Also, let the prologue alternatives appear in the grammar section.
6992 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
6993 (prologue_declaration): Move the existing prologue alternatives to...
6994 (grammar_declaration): ... here and add %code-top.
6995 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
6996
6997 Clean up and extend documentation for the prologue alternatives.
6998 * NEWS (2.3a+): Describe prologue alternatives.
6999 * doc/bison.texinfo (Prologue): Move discussion of prologue
7000 alternatives to...
7001 (Prologue Alternatives): ... this new section, and extend it to discuss
7002 all 4 directives in detail.
148d66d8
JD
7003 (Table of Symbols): Clean up discussion of prologue alternatives and
7004 add %code-top.
2cbe6b7f 7005
e557d3ea
JMG
70062006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7007
7008 DJGPP specific issues.
7009
7010 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7011 config.bat accordingly.
7012 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7013 * djgpp/config.site: Likewise.
7014
136a0f76
PB
70152006-10-16 Paolo Bonzini <bonzini@gnu.org>
7016
27bd5d67
PB
7017 Replace %*-header with %provides, %requires, %code. See discussion at
7018 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7019
136a0f76
PB
7020 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7021 (b4_user_start_header): Remove.
7022 * data/glr.c: Use new macros instead of b4_*start_header
7023 and b4_*end_header.
7024 * data/glr.cc: Likewise.
7025 * data/lalr1.cc: Likewise.
7026 * data/push.c: Likewise.
7027 * data/yacc.c: Likewise.
7028
7029 * doc/bison.texinfo: Remove %before-header, rename
7030 %{start,end,after}-header to %requires, %provides, %code.
7031
7032 * src/parse-gram.y: Likewise (also rename token names accordingly).
7033 * src/scan-gram.l: Likewise.
7034 * tests/actions.at: Likewise.
7035
10f429ef
PE
70362006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7037
7038 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7039 Problem reported by Joel E. Denny.
7040
70412006-10-14 Jim Meyering <jim@meyering.net>
7042
7043 (Sync from coreutils.)
7044 Work also when the working directory (with e.g. coreutils sources)
7045 is version controlled with git, rather than CVS.
7046 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7047 rather than CVS.
7048 In messages and comments, say e.g., "checked-out sources",
7049 rather than "CVS sources".
7050 (version_controlled_file): New function. Work for git as well as
7051 for CVS. Don't use grep's -q option.
7052 (slurp): Call it here, in place of CVS-specific code.
7053
c4bd5bf7
JD
70542006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7055
7056 Fix testsuite for ./configure --enable-gcc-warnings:
7057 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7058 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7059 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7060 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7061 * test/regression.at (Diagnostic that expects two alternatives):
7062 Likewise.
7063
46356ea4
PE
70642006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7065
231ed89a
PE
7066 * bootstrap.conf (gnulib_modules): Add config-h.
7067 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7068 worry about HAVE_CONFIG_H.
7069 * lib/abitset.c: Likewise.
7070 * lib/bitset.c: Likewise.
7071 * lib/bitset_stats.c: Likewise.
7072 * lib/bitsetv-print.c: Likewise.
7073 * lib/bitsetv.c: Likewise.
7074 * lib/ebitset.c: Likewise.
7075 * lib/get-errno.c: Likewise.
7076 * lib/lbitset.c: Likewise.
7077 * lib/subpipe.c: Likewise.
7078 * lib/timevar.c: Likewise.
7079 * lib/vbitset.c: Likewise.
7080 * lib/bitset.c: Include "bitset.h" first, to test interface.
7081 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7082 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7083 * lib/bitsetv.c: Include "bitsetv.h" first.
7084 * lib/get-errno.c: Include "get-errno.h" first.
7085 * m4/.cvsignore: Add config-h.m4.
7086 * tests/actions.at (Default %printer and %destructor for ...):
7087 Adjust expected line numbers in output to reflect removal of #if
7088 HAVE_CONFIG_H lines.
7089 * tests/glr-regression.at (Missed %merge type warnings when ...):
7090 Likewise.
7091 * tests/regression.at (Braced code in declaration in rules section):
7092 Likewise.
7093 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7094 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7095 Include <config.h> unconditionally.
7096
46356ea4
PE
7097 * bootstrap: Sync from coreutils, as follows:
7098
7099 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7100
7101 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
7102 variable was sometimes used without being initialized. This
7103 messed up the installation of the INSTALL file in some cases.
7104
7105 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7106
7107 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7108 --copy. Inspired by a suggestion from Bruno Haible.
7109
7110 2006-10-03 Jim Meyering <jim@meyering.net>
7111
7112 * bootstrap: Undo last change to this file, since now gnulib-tool
7113 sticks with the automake default in generating dependencies.
7114
dd4bf078
PE
71152006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7116
cf2a5f7c
PE
7117 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7118 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7119
7120 * doc/bison.1: Add copyright notice.
7121
7122 * data/glr.c: Don't include <stdarg.h>; not used.
7123
35fe0834
PE
7124 * NEWS: The -g and --graph options now output graphs in Graphviz
7125 DOT format, not VCG format.
7126 * doc/bison.1: Likewise.
7127 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
7128 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
7129 of this change in
7130 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
7131 * TODO: Remove Graphviz entry.
7132 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
7133 remove vcg.c, vcg.h, vcg_defaults.h.
7134 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
7135 * src/graphviz.c, src/graphviz.h: New files.
7136 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
7137 * src/files.h: Make comment more generic.
7138 * src/main.c (main): Likewise.
7139 * src/print_graph.h: Likewise.
7140 * src/getargs.c (usage): Make usage description more generic.
7141 * src/print_graph.c: Include graphviz.h rather than vcg.h.
7142 (static_graph, fgraph): Remove. All uses changed to pass
7143 arguments instead of sharing a static var.
7144 (print_core, print_actions, print_state, print_graph):
7145 Output graphviz format rather than VCG format.
7146 * tests/.cvsignore: Remove *.vcg; add *.dot.
7147 * tests/output.at: Expect *.dot files, not *.vcg files.
7148
dd4bf078
PE
7149 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
7150 accommodates the 2006-10-08 change.
7151
efdd7421
PE
71522006-10-11 Bob Rossi <bob@brasko.net>
7153
7154 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
7155 (b4_yyssa, b4_yyerror_range): New macros.
7156 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
7157 (yypvarsinit): Remove init of removed fields.
7158 (yypushparse): Remove use of removed fields; use new macros instead.
7159
96a1981a
PE
71602006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7161
7162 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
7163 in a push parser. Reindent slightly to match yacc.c better.
7164
71652006-10-11 Bob Rossi <bob@brasko.net>
7166
46356ea4
PE
7167 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
7168 yymsg_alloc fields.
7169 (yypvarsinit, yypushparse): Remove init of removed fields.
7170 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 7171
c1630a8b
PE
71722006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7173
7174 * THANKS: Add Paolo Bonzini and Bob Rossi.
7175
90b9908d
PB
71762006-10-08 Paolo Bonzini <bonzini@gnu.org>
7177
7178 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
7179 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
7180 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
7181 b4_define_user_cde and uses): Remove.
7182 (b4_comment, b4_prefix, b4_sync_start): New.
7183 * data/bison.m4: New file, with most of the content removed from c.m4.
7184 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
7185 * src/output.c (output_skeleton): Pass bison.m4.
7186 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
7187 only if specified.
7188
cf806753
PE
71892006-10-05 Paul Eggert <eggert@cs.ucla.edu>
7190
7191 Fix test failure reported by Tom Lane in
7192 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
7193 and try to make such failures easier to catch in the future.
7194 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
7195 that's now the caller's responsibility.
7196 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
7197 Set yychar = YYEOF if it's negative.
7198 * tests/actions.at (yylex): Abort if asked to read past EOF.
7199 * tests/conflicts.at (yylex): Likewise.
7200 * tests/cxx-type.at (yylex): Likewise.
7201 * tests/glr-regression.at (yylex): Likewise.
7202 * tests/input.at (yylex): Likewise.
7203 * tests/regression.at (yylex): Likewise.
7204 * tests/torture.at (yylex): Likewise.
7205
0e2f006a
PE
72062006-10-01 Paul Eggert <eggert@cs.ucla.edu>
7207
7208 Fix problems with translating English-language diagnostics.
7209 * bootstrap: Fix bug introduced in recent bootstrap changes, with
7210 respect to bison-runtime pot generation. The YY_ stuff
7211 wasn't being captured.
7212 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
7213 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
7214 * runtime-po/POTFILES.in: Add data/push.c.
7215
e3ddc1e3
PE
72162006-09-29 Paul Eggert <eggert@cs.ucla.edu>
7217
7218 Merge bootstrap changes from coreutils.
7219
7220 2006-09-28 Jim Meyering <jim@meyering.net>
7221
7222 Automatically generated dependencies are important even
7223 when all of the sources in a directory come from gnulib.
7224 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
7225 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
7226
7227 2006-09-23 Jim Meyering <jim@meyering.net>
7228
7229 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
7230
7231 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7232
7233 * bootstrap: Add support for --force.
7234 (usage): New function. Describe usage less tersely.
7235 (CVS_only_file): New var.
7236
01e972b3
PE
72372006-09-21 Paul Eggert <eggert@cs.ucla.edu>
7238
7239 * data/push.c (YYPUSH_MORE): Make it an enum instead.
7240 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
7241 Adjust white space and comments to match GNU style better.
7242
c63d3e90
PE
72432006-09-20 Bob Rossi <bob@brasko.net>
7244
7245 * data/push.c (yyresult_get): Remove function.
7246 (YYPUSH_MORE): Add #define.
7247 (yypushparse): Modify return value.
7248
e70f46d1
PE
72492006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7250
7251 * stamp-h.in: Remove; no longer needed.
7252 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
7253 Remove config.h, config.hin, intl (no longer created).
7254 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
7255 stamp-h1.
7256
7257 Sync bootstrap from coreutils, as follows:
7258
7259 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
7260
7261 * bootstrap (symlink_to_gnulib): New function.
7262 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
7263 to copies-of-gnulib.
7264 (cp_mark_as_generated, slurp, gnulib_files):
7265 Avoid making a copy if it's the same as the old version.
7266 (gnulib_files): Add support for this variable (used by Bison).
7267
a92be413
PE
72682006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7269
7270 * src/getargs.c (usage): Rework to use conventions similar to
7271 coreutils, to make translation a bit easier and the code a bit
7272 smaller. Problem reported by Tim Van Holder.
7273
4f82b42a
PE
72742006-09-15 Paul Eggert <eggert@cs.ucla.edu>
7275
3b2942e6
PE
7276 Use some of gnulib's new modules, taken from coreutils.
7277
7278 * bootstrap: Sync from coreutils, except add support for gnulib_files.
7279 * bootstrap.conf: New file.
7280 (gnulib_modules): Add configmake, inttypes, unistd.
7281 (XGETTEXT_OPTIONS): Add complain, complain_at,
7282 fatal, fatal_at, warn, warn_at, unexpected_end.
7283 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
7284 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
7285 (gl_EARLY): Add.
7286 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
7287 (gl_INIT): Add
7288 (GNULIB_AUTOCONF_SNIPPET): Remove.
7289 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
7290 the pickiest.
7291 * lib/.cvsignore: Add inttypes_.h.
7292 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
7293 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
7294 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
7295 no-longer-necessary initializations.
7296 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
7297 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
7298 use the unistd module.
7299 * src/system.h: Likewise.
7300 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
7301 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
7302 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
7303 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
7304 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
7305 * src/system.h: Include inttypes.h unconditionally, now that we
7306 use the inttypes module. Don't bother to include stdint.h, since
7307 inttypes.h now does that for us.
7308 (LOCALEDIR): Remove, now that we use the configmake module.
7309 * src/getargs.c: Include configmake.h.
7310 * src/main.c: Likewise.
7311 * src/output.c: Likewise.
7312 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
7313 not from $abs_top_builddir, since config.h moved.
7314
7315
4f82b42a
PE
7316 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
7317 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
7318
7319 * src/parse-gram.y (symbol_declaration): Don't put statements
7320 before declarations; it's not portable to C89.
7321 * src/scan-code.l (handle_action_at): Likewise.
7322
7323 * src/scan-code.l: Always initialize braces_level; the old code
7324 left it uninitialized and therefore had undefined behavior.
7325
7326 Don't attempt to redefine 'assert', since it runs afoul of
7327 systems where standard headers (mistakenly) include <assert.h>.
7328 Instead, define and use our own alternative, called 'aver'.
7329 * src/reader.c: Don't include assert.h, since we no longer
7330 use assert.
7331 * src/scan-code.l: Likewise.
7332 * src/system.h (assert): Remove, replacing with....
7333 (aver): New function, taking a bool arg. All uses changed.
7334 * src/tables.c (pack_vector): Ensure that aver arg is bool,
7335 not merely an integer.
7336
31c10e38
PE
73372006-09-15 Bob Rossi <bob@brasko.net>
7338
7339 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
7340 * data/c.m4 (YYPUSH): New.
7341 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
7342 * src/getargs.c (push_parser): New var.
7343 * src/getargs.h (push_parser): New declaration.
7344 * src/output.c (prepare): Add macro insertion of `push_flag'.
7345 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
7346 (prologue_declaration): Parse %push-parser.
7347 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
7348 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
7349 list of removed lines from the traces observed.
7350 (AT_CHECK_CALC_LALR): Added push parser tests.
7351
fa7b79c0
PE
73522006-09-13 Paul Eggert <eggert@cs.ucla.edu>
7353
21fe08ca
PE
7354 * NEWS: Version 2.3a.
7355 * configure.ac (AC_INIT): Likewise.
7356
e8ec4d9b
PE
7357 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
7358 "#define YYSTYPE int" that caused "make maintainer-check" to fail
7359 due to header ordering dependencies. I don't know why the #define
7360 was there.
7361
fa7b79c0
PE
7362 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
7363 runtime cost when YYDEBUG is not defined, and so that some tests
7364 that used to fail now work. Problem and initial suggestion by
7365 Paolo Bonzini.
7366 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
7367 * data/glr.cc (b4_parser_class_name):
7368 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
7369 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
7370 (yydebug_) [YYDEBUG]: New member.
7371 (yycdebug_): Now defined only if YYDEBUG.
7372 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
7373 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
7374 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
7375 if YYYDEBUG.
7376 (debug_stream, set_debug_stream, debug_level, set_debug_level):
7377 Define only if YYDEBUG.
7378 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
7379 set_debug_level.
7380 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
7381 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
7382 AT_CHECK_CALC_GLR_CC that are working now.
7383
4ec13d60
PE
73842006-09-12 Paul Eggert <eggert@cs.ucla.edu>
7385
7386 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
7387 We don't need them in glr.cc, and glr.c defines them.
7388 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
7389 assumes that defining it to anything is the same as defining
7390 it to 1. Problem reported by Paolo Bonzini.
7391
8e1687ae
PE
73922006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
7393
7394 * data/c.m4 (b4_null, b4_case): Define.
7395 * src/output.c (prepare_symbols): Use b4_null.
7396 (user_actions_output): Use b4_case.
7397
3dc5e96b
PE
73982006-09-11 Paul Eggert <eggert@cs.ucla.edu>
7399
aef3da86
PE
7400 * data/glr.c (b4_shared_declarations): Put start-header first,
7401 before any #includes that we generate, so that feature-test
7402 macros work. Problem reported by Michael Deutschmann in
7403 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7404 * data/lalr1.cc: Likewise.
7405 * doc/bison.texinfo (Prologue): Document that feature-test macros
7406 should be defined before any Bison declarations.
7407 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
7408 that depend on location.hh after, not before, Bison decls, since
7409 we now include location.hh after the first user prologue.
7410
3dc5e96b
PE
7411 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
7412 Sander Brandenburg in
7413 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
7414 Also, fix minor white space and comment issues.
aef3da86
PE
7415 (Prologue): Mention that it's better to define feature-test macros
7416 before Bison declarations. Problem reported by Michael Deutschmann.
7417
7418 * README-cvs: Fix typo: "&" should be "&&". Problem reported
7419 by Jim Meyering.
7420 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
7421 This adjusts to recent gnulib changes.
3dc5e96b 7422
b2a0b7ca
JD
74232006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7424
7425 Finish implementation of per-type %destructor/%printer. Discussed
7426 starting at
7427 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7428 and
7429 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7430 * NEWS (2.3+): Add a description of this feature to the default
7431 %destructor/%printer description.
7432 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7433 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7434 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7435 list node contains a semantic type.
7436 * src/symtab.c, src/symtab.h: Extend with a table that associates
7437 semantic types with their %destructor's and %printer's.
7438 (semantic_type_from_uniqstr, semantic_type_get,
7439 semantic_type_destructor_set, semantic_type_printer_set): New functions
7440 composing the public interface of that table.
7441 (symbol_destructor_get, symbol_destructor_location_get,
7442 symbol_printer_get, symbol_printer_location_get): If there's no
7443 per-symbol %destructor/%printer, look up the per-type before trying
7444 the default.
7445 * tests/actions.at (Per-type %printer and %destructor): New test case.
7446 * tests/input.at (Default %printer and %destructor redeclared):
7447 Extend to check that multiple occurrences of %symbol-default in a
7448 single %destructor/%printer declaration is an error.
7449 (Per-type %printer and %destructor redeclared, Unused values with
7450 per-type %destructor): New test cases.
7451
3be03b13
JD
74522006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7453
7454 Require default %destructor/%printer to be declared using
7455 %symbol-default instead of an empty symbol list, and start working on
7456 new per-type %destructor/%printer. Discussed at
7457 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7458 * NEWS (2.3+): Add %symbol-default to example.
7459 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 7460 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
7461 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7462 (generic_symlist, generic_symlist_item): New nonterminals for creating
7463 a list in which each item is a symbol, semantic type, or
7464 %symbol-default.
7465 (grammar_declaration): Use generic_symlist in %destructor and %printer
7466 declarations instead of symbols.1 or an empty list.
7467 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7468 for changes to symbol_list.
7469 * src/reader.c: Update for changes to symbol_list.
7470 * src/scan-code.l: Likewise.
7471 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7472 * src/symlist.c, src/symlist.h: Extend such that a list node may
7473 represent a semantic type or a %symbol-default in addition to just an
7474 ordinary symbol. Add switched functions for setting %destructor's and
7475 %printer's.
7476 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7477 %destructor/%printer declarations.
7478
3508ce36
JD
74792006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7480
7481 Whether the default %destructor/%printer applies to a particular symbol
7482 isn't a question of whether the user *declares* that symbol (in %token,
7483 for example). It's a question of whether the user by any means
7484 *defines* the symbol at all (by simply using a char token, for
7485 example). $end is defined by Bison whereas any other token with token
7486 number 0 is defined by the user. The error token is always defined by
7487 Bison regardless of whether the user declares it with %token, but we
7488 may one day let the user define error as a nonterminal instead.
7489 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7490 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7491 the meaning of "user-defined".
7492 * tests/actions.at (Default %printer and %destructor for user-declared
7493 end token): Rename to...
7494 (Default %printer and %destructor for user-defined end token): ...
7495 this.
7496
7497 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7498 computation of whether to apply the default, don't maintain a list of
7499 every Bison-defined symbol. Instead, just check for a first character
7500 of '$', which a user symbol cannot have, and check for the error token.
7501
9350499c
JD
75022006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7503
7504 Don't apply the default %destructor or %printer to the error token,
7505 $undefined, or $accept. This change fits the general rule that the
7506 default %destructor and %printer are only for user-declared symbols,
7507 and it solves several difficulties that are described in the new test
7508 cases listed below.
7509 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
7510 * tests/actions.at (Default %printer and %destructor are not for error
7511 or $undefined, Default %printer and %destructor are not for $accept):
7512 New test cases.
7513
4d7370cb
JD
75142006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
7515
7516 Allow %start after the first rule.
7517 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
7518 when parsing the first rule.
7519 (check_and_convert_grammar): Search for it here after all grammar
7520 declarations have been parsed. Skip midrules, which have dummy LHS
7521 nonterminals.
7522 * src/symtab.c (symbol_is_dummy): New function.
7523 * src/symtab.h (symbol_is_dummy): Declare it.
7524 * tests/input.at (%start after first rule): New test.
7525
6d0ef4ec
JD
75262006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7527
7528 Redo some of the previous commit: add back the ability to use
7529 non-aliased/undeclared string literals since it might be useful to
7530 those declaring %token-table.
7531 * src/reader.c (check_and_convert_grammar): Undo changes in previous
7532 commit: don't worry about complaints from symbols_pack.
7533 * src/symtab.c (symbol_new, symbol_class_set,
7534 symbol_check_alias_consistency): Undo changes in previous commit: count
7535 each string literal as a new symbol and token, assign it a symbol
7536 number, and don't complain about non-aliased string literals.
7537 (symbols_pack): Since symbol_make_alias still does not decrement symbol
7538 and token counts but does still set aliased tokens to the same number,
7539 symbol_pack_processor now leaves empty slots in the symbols array.
7540 Remove those slots.
7541 * tests/regression.at (Undeclared string literal): Remove test case
7542 added in previous commit since non-aliased string literals are allowed
7543 again.
7544 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
7545 remove unnecessary string literal declarations.
7546 * tests/sets.at (Firsts): Likewise.
7547
965537bc
JD
75482006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7549
7550 Don't allow an undeclared string literal, but allow a string literal to
7551 be used before its declaration.
7552 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
7553 symbols_pack complained.
7554 * src/symtab.c (symbol_new): Don't count a string literal as a new
7555 symbol.
7556 (symbol_class_set): Don't count a string literal as a new token, and
7557 don't assign it a symbol number since symbol_make_alias does that.
7558 (symbol_make_alias): It's not necessary to decrement the symbol and
7559 token counts anymore. Don't assume that an alias declaration occurs
7560 before any uses of the identifier or string, and thus don't assert that
7561 one of them has the highest symbol number so far.
7562 (symbol_check_alias_consistency): Complain if there's a string literal
7563 that wasn't declared as an alias.
7564 (symbols_pack): Bail if symbol_check_alias_consistency failed since
7565 symbol_pack asserts that every token has been assigned a symbol number
7566 although undeclared string literals have not.
7567 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 7568 string literal): New test cases.
965537bc
JD
7569 (Characters Escapes, Web2c Actions): Declare string literals as
7570 aliases.
7571 * tests/sets.at (Firsts): Likewise.
7572
47aee066
JD
75732006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
7574
7575 In the grammar scanner, STRING_FINISH unclosed constructs and return
7576 them to the parser in order to improve error messages.
7577 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
7578 SC_BRACED_CODE, SC_PROLOGUE): Implement.
7579 * tests/input.at (Unclosed constructs): New test case.
7580 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
7581 seen.
7582
7583 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
7584 unused global.
7585
1f6b3679
JD
75862006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
7587
7588 Handle string aliases for character tokens correctly.
7589 * src/symtab.c (symbol_user_token_number_set): If the token has an
7590 alias, check and set its alias's user token number instead of its own,
7591 which is set to indicate the alias. Previously, every occurrence of
7592 the character token in the grammar overwrote that alias indicator with
7593 the character code.
7594 * tests/input.at (String aliases for character tokens): New test.
7595
219741d8
JD
75962006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
7597
7598 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
7599
11daa4e7
PE
76002006-08-11 Paul Eggert <eggert@cs.ucla.edu>
7601
7602 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
7603 to prevent failures when building on older platforms.
7604 Check for autopoint failure.
7605 Set XGETTEXT_OPTIONS to values that check for C format strings,
7606 so that translators are warned about them (this also helps
7607 prevent core dumps).
7608
7609 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
7610 function, since it simplifies our code a bit.
7611
7612 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
7613 rather than -W, so we don't get bogus warnings about sign comparisons.
7614 Add -Wpointer-arith, since that warning is useful (it reports code
7615 that does not conform to C89 and that some compilers reject).
7616 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
7617 since it's no longer needed.
7618
f9bfc42a
JD
76192006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
7620
7621 Clean up scanners a bit.
7622 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
7623 definitions so gcc won't warn when obstack_for_string is unused.
7624 * src/scan-code.l: config.h and system.h are already #include'd by
7625 scan-code-c.c, so get rid of them here.
7626 * src/scan-gram.l: Likewise.
7627 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
7628 definitions rather than duplicating the rest of it.
7629 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
7630
06e8700a
JD
76312006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
7632
7633 Suppress signed/unsigned comparison warnings for yycheck.
7634 * data/c.m4 (b4_safest_int_type): New macro.
7635 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
7636 a signed int type, cast it to b4_safest_int_type first.
7637 * data/yacc.c: Likewise.
7638 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
7639 also overwritten.
7640
9c437126
PE
76412006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
7642
7643 * doc/bison.texinfo: Fix some typos.
7644
284d8a13
PE
76452006-08-02 Paul Eggert <eggert@cs.ucla.edu>
7646
7647 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
7648 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
7649
7650 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
7651 the latest gnulib does this a different way.
7652 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
7653 translation was patched, so stop omitting it.
7654
ec5479ce
JD
76552006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7656
7657 Enable declaration of default %printer/%destructor. Make the parser
7658 use these for all user-declared grammar symbols for which the user does
7659 not declare a specific %printer/%destructor. Thus, the parser uses it
7660 for token 0 if the user declares it but not if Bison generates it as
7661 $end. Discussed starting at
7662 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7663 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7664 and
7665 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7666 * NEWS (2.3+): Mention.
7667 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7668 declare a %destructor for a mid-rule's semantic value. It's just
7669 impossible to declare one specific to it.
7670 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7671 code. Describe default %destructor form.
7672 * src/parse-gram.y (grammar_declaration): Parse default
7673 %printer/%destructor declarations.
7674 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7675 and symbol_destructor_location_get rather than accessing the destructor
7676 and destructor_location members of struct symbol.
7677 (symbol_printers_output): Likewise but for %printer's.
7678 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7679 again.
7680 * src/symtab.c (default_destructor, default_destructor_location,
7681 default_printer, default_printer_location): New static global
7682 variables to record the default %destructor and %printer.
7683 (symbol_destructor_get, symbol_destructor_location_get,
7684 symbol_printer_get, symbol_printer_location_get): New functions to
7685 compute the appropriate %destructor and %printer for a symbol.
7686 (default_destructor_set, default_printer_set): New functions to set the
7687 default %destructor and %printer.
7688 * src/symtab.h: Prototype all those new functions.
7689 * tests/actions.at (Default %printer and %destructor): New test to
7690 check that the right %printer and %destructor are called, that they're
7691 not called for $end, and that $$ and @$ work correctly.
7692 (Default %printer and %destructor for user-declared end token): New
7693 test to check that the default %printer and %destructor are called for
7694 a user-declared end token.
7695 * tests/input.at (Default %printer and %destructor redeclared, Unused
7696 values with default %destructor): New tests to check related grammar
7697 warnings and errors.
7698
868d2d96
JD
76992006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7700
7701 Clean up handling of %destructor for the end token (token 0).
7702 Discussed starting at
7703 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7704 and
7705 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7706
7707 Make the skeletons consistent in how they pop the end token and invoke
7708 its %destructor.
7709 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7710 state, which has token number 0, since this would invoke the
7711 %destructor for the end token.
7712 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7713 until after shifting the end token, or else it won't be popped.
7714 * data/yacc.c (yyparse): Likewise.
7715
7716 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7717 it's the end token. Upon termination, destroy an unshifted lookahead
7718 even when it's the end token.
7719 * data/lalr1.cc (yy::parser::parse): Likewise.
7720 * data/yacc.c (yyparse): Likewise.
7721
7722 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7723 value warnings for the end token when the user gives the end token a
7724 %destructor.
7725
7726 * tests/actions.at (Printers and Destructors): Test all the above.
7727
62a9592d
PE
77282006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7729
7730 Update to latest gnulib and gettext versions.
7731 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7732 Add fopen-safer.
7733 (gnulib_files): Add m4/warning.m4. Don't worry about files
7734 overwritten by autopoint.
7735 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7736 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7737 rejects them.
7738 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7739 so that we can remove the intl files at a better time.
7740 (intl_files_to_remove): Remove aclocal.m4, since it gets
7741 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7742 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7743 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7744 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7745 Remove datarootdir hack; no longer needed.
7746 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7747 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7748 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7749 strdup.h.
7750 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7751 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7752
10d6970f
PE
77532006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7754
7755 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7756 it with --assume-autoconf='latest-stable'.
7757
50a33993
JD
77582006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7759
7760 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7761 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7762 YYSTYPE' and `{'.
7763 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7764 those from muscle_tab.c since the old ones are misleading.
7765
2ce4ed68
AD
77662006-07-13 Akim Demaille <akim@epita.fr>
7767
7768 Support %define "KEY" {VALUE}.
7769 * src/scan-code.h, src/scan-code.l (translate_action)
7770 (translate_rule_action, translate_symbol_action, translate_code):
7771 Return char *, not const char *.
7772 * src/parse-gram.y (declaration): Rename as...
7773 (prologue_declaration): this.
7774 (string_content): Remove this nonterminal, use STRING.
7775 (braceless, content, content.opt): New nonterminal.
7776 Use them.
7777 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7778 as value.
7779 * src/scan-gram.l (getargs.h): Don't include it.
7780
db7e5eb5
PE
77812006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7782
7783 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7784 rather than a for-loop that declares a local bool variable. This
7785 should work around a compatibility problem with a Cray x1e C++
7786 compiler reported by Hung Nguyen in
7787 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7788 The for-loop was introduced in the 2004-11-17 change but I don't
7789 know why it was needed.
7790
a5d80ba5
AD
77912006-07-12 Akim Demaille <akim@epita.fr>
7792
7793 * data/c.m4: Comment changes.
7794
23eb2a69
AD
77952006-07-10 Akim Demaille <akim@lrde.epita.fr>
7796
7797 * src/complain.c (error_message, ERROR_MESSAGE): New.
7798 To factor...
7799 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7800 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7801
ddc8ede1
PE
78022006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7803
7804 * NEWS: Instead of %union, you can define and use your own union type
7805 YYSTYPE if your grammar contains at least one <type> tag.
7806 Your YYSTYPE need not be a macro; it can be a typedef.
7807 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7808 (Union Decl, Decl Summary): Document this.
7809 * data/glr.c (YYSTYPE): Implement this.
7810 * data/glr.cc (YYSTYPE): Likewise.
7811 * data/lalr1.cc (YYSTYPE): Likewise.
7812 * data/yacc.c (YYSTYPE): Likewise.
7813 * src/output.c (prepare): Output tag_seen_flag.
7814 * src/parse-gram.y (declaration, grammar_declaration):
7815 Use 'union_seen' rather than 'typed' to determine whether
7816 %union has been seen, since grammars can now be typed without
7817 %union.
7818 (symbol_declaration, type.opt, symbol_def):
7819 Keep track of whether a tag has been seen.
7820 * src/reader.c (union_seen, tag_seen): New vars.
7821 (typed): remove.
7822 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7823 * src/scan-code.l (untyped_var_seen): New variable.
7824 (handle_action_dollar): Adjust to above changes.
7825 (handle_action_dollar, handle_action_at):
7826 Improve overflow checking for outlandish numbers.
7827 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7828 avoid new diagnostics generated by above changes.
7829 * tests/regression.at (YYSTYPE typedef): Add test to check
7830 for type tags without %union.
7831
7832 * src/symlist.c (symbol_list_length): Return int, not unsigned
7833 int, since callers expect int. This may need to get revisited
7834 once we have proper integer overflow checking.
7835
7836 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7837 object is now static.
7838
7839 * src/getargs.c (flags_argmatch): Return void, not int,
7840 to pacify ./configure --enable-gcc-warnings.
7841
7842 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7843 since last_string is already defined to FLEX_PREFIX (last_string).
7844
7b42569e
AD
78452006-07-09 Akim Demaille <akim@lrde.epita.fr>
7846
7847 Implement --warnings/-W.
7848 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7849 replaced by...
7850 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
7851 Adjust callers.
7852 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
7853 (warnings_args, warnings_types): New.
7854 (getargs, short_options, long_options): Accept -W/--warnings.
7855 Sort the options by alphabetical order, upper case letter right
7856 before its lower case.
7857
3b452f4e
JD
78582006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
7859
7860 Change %merge result type clash warnings to errors. Discussed at
7861 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
7862 * src/reader.c (record_merge_function_type): Use complain_at.
7863 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7864 declared later): Update test case results.
7865
b8a41559
AD
78662006-07-09 Akim Demaille <akim@lrde.epita.fr>
7867
7868 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
7869 to be in alphabetical order.
7870 (trace_args): Spelling fixes.
7871
cd9e1ba2
PE
78722006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7873
7874 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
7875 so they don't collide with user-defined macros.
7876 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
7877 this was never guaranteed, and now that we're using gnulib stdint,
7878 which defines int_fast16_t to long int, the problem is exposed.
7879
cb48f191
PE
78802006-07-08 Paul Eggert <eggert@cs.ucla.edu>
7881
b8445a15
PE
7882 * data/c.m4 (b4_basename): Simplify a bit, since we don't
7883 need the full POSIX semantics (and weren't implementing them
7884 anyway).
7885
cb48f191
PE
7886 Adjust to Autoconf 2.60 and today's gnulib.
7887 * bootstrap (gnulib_modules): Add stdint.
7888 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
7889 no longer copies it.
7890 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
7891 since stdint needs the former and wcwidth (which is now required
7892 by mbswidth) needs the latter.
7893 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
7894 work around a compatibility glitch between gettext 0.14.6 and
7895 Autoconf 2.60.
7896 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
7897 Do not check for uintptr_t, since new stdint module does the right
7898 thing.
7899 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
7900 Add stdint.h, stdint_.h, wcwidth.h.
7901 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
7902 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
7903 stdint.m4, wchar_t.m4, wcwidth.m4.
7904 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
7905 usual order for ../lib/*.h files.
7906 (file_name_split): Use last_component, not base_name, to adjust
7907 to gnulib changes.
7908 * src/parse-gram.h: Include <strverscmp.h> in the usual order
7909 for ../lib/*.h files.
7910 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
7911 Define unconditionally, since we now assume the stdint module.
7912 * src/scan-skel.l: Include <dirname.h>.
7913 (BASE_QPUTS): Use last_component, not base_name.
7914 * src/system.h: Include <unlocked-io.h> in the usual order
7915 for ../lib/*.h files. Include <stdint.h> unconditionally,
7916 since we now use the stdint module.
7917 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
7918 HAVE_UINTPTR_T, since we now use the stdint module.
7919 (base_name): Remove decl, since files now include <dirname.h>
7920 to get the decl.
7921
cd48d21d
AD
79222006-07-08 Akim Demaille <akim@lrde.epita.fr>
7923
7924 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
7925 New, default to 1.
7926 * data/yacc.c, data/glr.c, data/location.cc: Use them.
7927 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
7928 default.
7929 * tests/calc.at: Adjust.
7930
8ec0a172
AD
79312006-07-08 Akim Demaille <akim@lrde.epita.fr>
7932
b8445a15 7933 * data/c.m4 (b4_basename): New.
8ec0a172
AD
7934 (b4_syncline): Also output the location of its invocation (from
7935 the skeleton).
7936 (b4_user_action, b4_define_user_action, b4_user_actions)
7937 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
7938 (b4_user_stype): New.
7939 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
7940
4a678af8
JD
79412006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7942
7943 In the grammar file, the first column is 1 not 0 on the first line as
7944 on every other line.
7945 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
7946 * tests/input.at (Torturing the Scanner): Update output.
7947
7948 * src/scan-gram.l (scanner_cursor): Declare it static.
7949
dd60572a
JD
79502006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
7951
7952 In warnings, say "previous declaration" rather than "first
7953 declaration".
7954 * src/symtab.c (redeclaration): Do that here.
7955 * src/reader.c (record_merge_function_type): In the case of a result
7956 type clash, report the previous declaration rather than the very first
7957 one in the grammar file.
7958 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7959 declared later): Add a third declaration to check this behavior.
7960 * tests/input.at (Incompatible Aliases): Update output.
7961
2073e1b6
AD
79622006-06-27 Akim Demaille <akim@epita.fr>
7963
7964 * doc/Doxyfile.in: New.
7965 * doc/Makefile.am: Use it.
7966 * src/lalr.h, src/symtab.h: Initial doxygenation.
7967
8ee5b538
JD
79682006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7969
7970 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
7971 declared after the %merge. This continues the effort of the previous
7972 patch.
8ee5b538
JD
7973 * src/reader.c (get_merge_function): Don't set the merger type yet.
7974 (record_merge_function_type): New function for setting the merger type
7975 and checking for clashes.
7976 (grammar_current_rule_merge_set): Set the location of the %merge for
7977 the current rule.
7978 (packgram): Invoke record_merge_function_type for each rule now that
7979 all symbol type declarations have been parsed.
7980 * src/reader.h (merger_list.type_declaration_location): New member
7981 storing the location of the first %merge from which the type for this
7982 merging function was derived.
7983 * src/symlist.h (symbol_list.merger_declaration_location): New member
7984 storing the location of a rule's %merge, if any.
7985 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
7986 declared later): New test to catch the error fixed by the above patch.
7987
ffa4ba3a
JD
79882006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
7989
7990 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
7991 declarations appear after the rules. Discussed at
7992 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
7993 and
7994 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
7995 Don't mistake the type of $$ in a midrule to be that of its parent
7996 rule's $$.
ffa4ba3a
JD
7997 * src/reader.c (grammar_current_rule_end): Don't invoke
7998 grammar_rule_check yet since not all symbol declarations may have been
7999 parsed yet.
8000 (grammar_midrule_action): Likewise.
8001 Don't record whether the midrule's $$ has been used yet since actions
8002 haven't been translated yet.
8003 Record the midrule's parent rule and its RHS index within the parent
8004 rule.
8005 (grammar_current_rule_action_append): Don't translate the action yet
8006 since not all symbol declarations may have been parsed yet and, thus,
8007 warnings about types for $$, $n, @$, and @n can't be reported yet.
8008 (packgram): Translate the action and invoke grammar_rule_check now that
8009 all symbol declarations have been parsed.
8010 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8011 after parsing the entire grammar file, the symbol list here in the case
8012 of a midrule is actually the midrule's empty RHS, so reference its
8013 parent rule's RHS where necessary.
8014 On the other hand, now that you can already know it's a midrule, you
8015 aren't forced to think $$ has the same type as its parent rule's $$.
8016 (handle_action_at): In the case of a midrule, reference the parent rule
8017 where necessary.
8018 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8019 members.
8020 (symbol_list_length): Now that this is invoked after all rules have
8021 been parsed, a NULL symbol (rather than a NULL symbol list node)
8022 terminates a rule. symbol_list_print already does this correctly.
8023 * src/symlist.h (symbol_list.midrule_parent_rule,
8024 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8025 remember their relationships with their parents.
8026 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8027 fixed by the above patch.
8028 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8029 implementing...
8030 (Unused values): ... this old test case and...
8031 (Unused values before symbol declarations): ... this new test case.
8032 This one is the same as `Unused values' except that all symbol
8033 declarations appear after the rules in order to catch the rest of the
8034 errors fixed by the above patch.
8035
e256e17f
JD
80362006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8037
300a1930
JD
8038 More cleanup.
8039 * src/reader.c (current_rule): Declare it static since it's no longer
8040 used outside this file.
8041 (grammar_current_rule_action_append): Remove redundant arguments from
8042 translate_rule_action invocation.
8043 * src/reader.h (current_rule): Remove this unused extern.
8044 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8045 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 8046
381ecb06
JD
80472006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8048
8049 Clean up yesterday's patch.
8050 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8051 to...
8052 * src/reader.c (grammar_current_rule_action_append): ... here for
8053 consistency with grammar_current_rule_symbol_append.
8054 * tests/regression.at (Braced code in declaration in rules section):
8055 Make yyerror and yylex static as usual.
8056
4210cd0b
JD
80572006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8058
8059 Fix bug that mistakes braced code in a declaration in the rules section
8060 to be a rule action. Mentioned at
8061 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8062 * src/scan-gram.l: Move midrule action detection from the start of the
8063 scanning of any braced code to...
8064 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8065 action. For readability, use $2 and @2 rather than the equivalent
8066 global variables.
8067 * tests/regression.at (Braced code in declaration in rules section):
8068 New test to catch the error fixed by the above patch.
8069
8070 Work on code readability some.
8071 * src/scan-code.l (current_rule): Get rid of this misleading and
8072 redundant declaration: it's actually extern'ed in reader.h.
8073 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8074 translate_action): Add a rule argument and use it instead of the global
8075 current_rule.
8076 (translate_rule_action): This already receives current_rule through an
8077 argument, so pass it on to translate_action instead of assigning
8078 current_rule to current_rule.
8079 (translate_symbol_action, translate_code): Pass rule = NULL to
8080 translate_action.
8081
34f98f46
JD
80822006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8083
8084 Rename %before-definitions to %start-header and %after-definitions to
8085 %end-header. Don't use these declarations to separate pre-prologue
8086 blocks from post-prologue blocks. Add new order-independent
8087 declarations %before-header and %after-header as alternatives to the
8088 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8089 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8090 * NEWS (2.3+): Update for these changes.
8091 * data/glr.c (b4_before_definitions): Update to...
8092 (b4_start_header): ... this.
8093 (b4_after_definitions): Update to...
8094 (b4_end_header): ... this.
8095 * data/glr.cc: Likewise.
8096 * data/lalr1.cc: Likewise.
8097 * data/yacc.c: Likewise.
8098 * doc/bison.texinfo (The prologue): Update names, and replace remaining
8099 prologue blocks with %*-header declarations.
8100 (Calc++ Parser): Likewise.
91661ebb 8101 (Decl Summary): Update names.
148d66d8 8102 (Table of Symbols): Update description.
34f98f46
JD
8103 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
8104 (PERCENT_END_HEADER): ... this.
8105 (PERCENT_BEFORE_DEFINITIONS): Update to...
8106 (PERCENT_START_HEADER): ... this.
8107 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8108 (declaration): Update token names and m4 macro names.
8109 When parsing %end-header and %start-header, invoke translate_code
8110 before muscle_code_grow, and no longer set global booleans to remember
8111 whether these declarations have been seen.
8112 Parse new %after-header and %before-header.
8113 * src/reader.c (before_definitions, after_definitions): Remove.
8114 (prologue_augment): Accept a new bool argument to specify whether to
8115 augment the pre-prologue or post-prologue.
8116 * src/reader.h (before_definitions, after_definitions): Remove these
8117 extern's.
8118 (prologue_augment): Add new bool argument.
8119 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
8120 (PERCENT_END_HEADER): ... this.
8121 (PERCENT_BEFORE_DEFINITIONS): Update to...
8122 (PERCENT_START_HEADER): ... this.
8123 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8124 * tests/actions.at (Printers and Destructors): Update names.
8125
31b2b07e
JD
81262006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
8127
8128 Add comparison operators for C++ location classes. Discussed at
8129 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
8130 * data/c++.m4 (b4_define_location_comparison): New boolean %define
8131 declaration indicating whether filename_type has an operator==. If
8132 filename_type is `std::string', it defaults to `1', `0' otherwise.
8133 * data/location.cc: Iff b4_define_location_comparison is `1', add
8134 operator== and operator!= for class position and for class location.
8135
8136 Some minor fixes.
8137 * src/scan-action.l: Remove unused file.
8138 * src/symtab.c (symbol_printer_set): Use printer_location not
8139 destructor_location.
8140 * src/symtab.h (struct symbol): Replace incorrect source comment for
8141 printer members.
8142 * tests/input.at (Incompatible Aliases): Update output with correct
8143 printer location.
8144
9bc0dd67
JD
81452006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
8146
8147 Don't put the pre-prologue in the header file. For the yacc.c code
8148 file and the glr.c header and code files, move the pre-prologue before
8149 the token definitions. Add new %before-definitions and
8150 %after-definitions to declare code that will go in both the header file
8151 and code file. Discussed at
8152 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
8153 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
8154 and
8155 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
8156 * NEWS (2.3+): Describe these changes.
8157 * data/glr.c (b4_pre_prologue): Move from within to before...
8158 (b4_shared_declarations): ... this.
8159 Add new b4_before_definitions before b4_token_enums.
8160 Add new b4_after_definitions at the end.
8161 * data/glr.cc (b4_pre_prologue): Replace with...
8162 (b4_before_definitions): ... this in the header file.
8163 (b4_after_definitions): New near the end of the header file.
8164 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
8165 code file right before including the header file.
8166 (b4_before_definitions): New in the previous position of
8167 b4_pre_prologue in the header file.
8168 (b4_after_definitions): New near the end of the header file.
8169 * data/yacc.c: Clean up some m4 quoting especially in the header file.
8170 (b4_token_enums_defines): In the code file, move to right before
8171 YYSTYPE for consistency with the header file.
8172 (b4_before_definitions): New right before b4_token_enums_defines in
8173 both the header and code file.
8174 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
8175 header and code file.
8176 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
8177 of prologues for %union dependencies.
91661ebb
JD
8178 (Decl Summary): In %defines description, mention the effect of
8179 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
8180 (Calc++ Parser): Forward declare driver in a %before-definitions rather
8181 than in the pre-prologue so that make check succeeds.
148d66d8 8182 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
8183 %after-definitions.
8184 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
8185 %before-definitions.
8186 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
8187 (declaration): Parse those declarations and append to
8188 b4_before_definitions and b4_after_definitions, respectively.
8189 * src/reader.c (before_definitions, after_definitions): New bools to
8190 track whether those declarations have been seen.
8191 (prologue_augment): Add to the post-prologue if %union,
8192 %before-definitions, or %after-definitions has been seen.
8193 * src/reader.h (before_definitions, after_definitions): New extern's.
8194 * src/scan-gram.l: Scan the new declarations.
8195 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
8196 prologue block in a %before-definitions or a %after-definitions based
8197 on whether the %union is declared.
8198 * tests/regression.at (Early token definitions with --yacc, Early token
8199 definitions without --yacc): Move tests for token definitions into the
8200 post-prologue since token names are no longer defined in the
8201 pre-prologue.
8202
203b9274
AD
82032006-06-20 Akim Demaille <akim@epita.fr>
8204
8205 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
8206 (symbol_get): Use it.
8207 * src/parse-gram.y: Use it.
8208
a7ee59cf
JD
82092006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
8210
8211 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
8212 build succeeds when configured with --enable-gcc-warnings.
8213
5a2baae7
PE
82142006-06-19 Paul Eggert <eggert@cs.ucla.edu>
8215
33ad1a9c
PE
8216 * src/parse-gram.y (char_name): New function.
8217 (CHAR, STRING, string_content): For %printer, properly escape.
8218 (ID): Prefer fputs to fprintf.
8219 (id): Reindent to be consistent with other rules.
8220 Properly quote char.
8221
5a2baae7
PE
8222 The Translation Project changed its way of publishing translations
8223 to maintainers. I haven't received any responses to my request
8224 for supporting the old way, or for documenting the new way. I
8225 have modified 'bootstrap' to use screen scraping
8226 (in this case, HTML scraping). This is unreliable and inelegant,
8227 but I don't see any better way. Yuck.
8228 * bootstrap (TP_URL, WGET_COMMAND): New vars.
8229 (get_translations): New function, which uses HTML scraping to
8230 deduce locations of latest translations.
8231 Use this function to grab both bison and bison-runtime .po files.
8232 Don't bother priming the pump for the runtime-po domain any more,
8233 as it's now translated better than bison is.
8234
58d7a1a1
AD
82352006-06-19 Akim Demaille <akim@epita.fr>
8236
8237 * src/scan-gram.l: No longer "parse" things after `%union' until
8238 `{'. Rather, return a single "%union" token.
8239 No longer make symbols: return strings, and leave the conversion
8240 to symbols to the parser.
8241 (SC_PRE_CODE, token_type): Remove.
8242 * src/parse-gram.y (%union): New field `character'.
8243 Sort tokens.
8244 (CHAR): New token.
8245 (ID, ID_COLON): Now that the scanner no longer makes them
8246 identifiers, adjust all uses to invoke symbol_get.
8247 (id_colon): New, wraps the conversion from string to symbol.
8248 (%union): Accept a possible union_name.
8249 (symbol): Now can be a char.
8250 * data/c.m4 (b4_union_name): Leave a default value.
8251 * data/glr.c, data/yacc.c: Use it.
8252
b931235e
JD
82532006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
8254
8255 For associating token numbers with token names for "yacc.c", don't use
8256 #define statements unless `--yacc' is specified; always use enum
8257 yytokentype. Most important discussions start at:
8258 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
8259 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
8260 and
8261 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
8262 * NEWS (2.3+): Mention.
8263 * data/c.m4 (b4_yacc_if): New.
8264 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
8265 token #define's.
8266 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
8267 on token name definitions.
8268 * src/getargs.c (usage): Capitalize `Yacc' in English.
8269 * src/output.c (prepare): Define b4_yacc_flag.
8270 * tests/regression.at (Early token definitions): Test that tokens names
8271 are defined before the pre-prologue not just before the post-prologue.
8272 Remove this test case and copy to...
8273 (Early token definitions with --yacc): ... this to test #define's.
8274 (Early token definitions without --yacc): ... and this to test enums.
8275
9e6e7ed2
PE
82762006-06-11 Paul Eggert <eggert@cs.ucla.edu>
8277
8278 * NEWS: Reword the post-2.3 change to not be so optimistic about
8279 removing the old "look-ahead" spelling.
8280 Update previous look-ahead/lookahead change reports.
8281 * REFERENCES: look-ahead -> lookahead (since that's
8282 what he actually wrote).
8283 * doc/refcard.tex: look ahead -> lookahead,
8284 look-ahead -> lookahead
8285
742e4900
JD
82862006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
8287
8288 For consistency, use `lookahead' instead of `look-ahead' or
8289 `look_ahead'. Discussed starting at
8290 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
8291 and then at
8292 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
8293 * NEWS: For the next release, note the change to `--report'.
8294 * TODO, doc/bison.1: Update English.
8295 * doc/bison.texinfo: Update English.
8296 (Understanding Your Parser, Bison Options): Document as
8297 `--report=lookahead' rather than `--report=look-ahead'.
8298 * src/conflicts.c: Update English in comments.
8299 (lookahead_set): Rename from look_ahead_set.
8300 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
8301 (resolve_sr_conflict): Rename local look_ahead_tokens to
8302 lookahead_tokens, and update other uses.
8303 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
8304 count_rr_conflicts, conflicts_free): Update uses.
8305 * src/getargs.c (report_args): Move "lookahead" before alternate
8306 spellings.
8307 (report_types): Update uses.
8308 (usage): For `--report' usage description, state `lookahead' spelling
8309 rather than `look-ahead'.
8310 * src/getargs.h (report.report_lookahead_tokens): Rename from
8311 report_look_ahead_tokens.
8312 * src/lalr.c: Update English in comments.
8313 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
8314 (state_lookahead_tokens_count): Rename from
8315 state_look_ahead_tokens_count.
8316 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8317 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
8318 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8319 Update other uses.
8320 Update English in output.
8321 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
8322 * src/print.c: Update English in comments.
8323 (lookahead_set): Rename from look_ahead_set.
8324 (print_reduction): Rename argument lookahead_token from
8325 look_ahead_token.
8326 (print_core, state_default_rule, print_reductions, print_results):
8327 Update uses.
8328 * src/print_graph.c: Update English in comments.
8329 (print_core): Update uses.
8330 * src/state.c: Update English in comments.
8331 (reductions_new): Update uses.
8332 (state_rule_lookahead_tokens_print): Rename from
8333 state_rule_look_ahead_tokens_print, and update other uses.
8334 * src/state.h: Update English in comments.
8335 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
8336 (state_rule_lookahead_tokens_print): Rename from
8337 state_rule_look_ahead_tokens_print.
8338 * src/tables.c: Update English in comments.
8339 (conflict_row, action_row): Update uses.
8340 * tests/glr-regression.at
8341 (Incorrect lookahead during deterministic GLR,
8342 Incorrect lookahead during nondeterministic GLR): Rename
8343 print_look_ahead to print_lookahead.
8344 * tests/torture.at: Update English in comments.
8345 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
8346 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
8347 (Many lookahead tokens): Update uses.
8348 * data/glr.c: Update English in comments.
8349 * lalr1.cc: Likewise.
8350 * yacc.c: Likewise.
8351 * src/conflicts.h: Likewise.
8352 * src/lalr.h: Likewise.
8353 * src/main.c: Likewise.
8354 * src/output.c: Likewise.
8355 * src/parse-gram.c: Likewise.
8356 * src/tables.h: Likewise.
8357 * tests/calc.at: Likewise.
8358
3c40d0b5
JD
83592006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
8360
8361 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
8362
5d278082
PE
83632006-06-07 Paul Eggert <eggert@cs.ucla.edu>
8364
8365 * TODO: Add request from Nelson H. F. Beebe to be able to install
8366 Bison without installing the yacc script.
8367
9e668899
JD
83682006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8369
8370 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
8371 and yytext if they're already #define'd.
8372 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
8373 * src/scan-code-c.c: ... here.
8374 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
8375 <config.h>.
8376
0c8e079f
JD
83772006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8378
8379 Get Bison to build again when configured with --enable-gcc-warnings.
8380 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
8381 missing #include's.
8382 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
8383 loc argument as it shadows a global.
8384 * src/scan-gram.l: Remove stray comma that prevents boundary_set
8385 invocation.
8386
8387 * src/.cvsignore: Add scan-code.c.
8388
2346344a
AD
83892006-06-07 Akim Demaille <akim@epita.fr>
8390
8391 * src/scan-gram.l: Move the "add a trailing ; to actions" code
8392 to...
8393 * src/scan-code.l: here.
8394 * tests/input.at (Torturing the Scanner): Fix another location
8395 error.
8396
4862bdfd
AD
83972006-06-07 Akim Demaille <akim@epita.fr>
8398
8399 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
8400
e9071366
AD
84012006-06-06 Akim Demaille <akim@epita.fr>
8402
8403 Extract the parsing of user actions from the grammar scanner.
8404 As a consequence, the relation between the grammar scanner and
8405 parser is much simpler. We can also split "composite tokens" back
8406 into simple tokens.
8407 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
8408 * src/scan-gram.l (add_column_width, adjust_location): Move to and
8409 rename as...
8410 * src/location.h, src/location.c (add_column_width)
8411 (location_compute): these.
8412 Fix the column count: the initial column is 0.
8413 (location_print): Be robust to ending column being 0.
8414 * src/location.h (boundary_set): New.
8415 * src/main.c: Adjust to scanner_free being renamed as
8416 gram_scanner_free.
8417 * src/output.c: Include scan-code.h.
8418 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
8419 Use boundary_set.
8420 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
8421 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
8422 which is now, again, a separate token.
8423 Adjust all dependencies.
8424 Whereever actions with $ and @ are used, use translate_code.
8425 (action): Remove this nonterminal which is now useless.
8426 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8427 (grammar_current_rule_action_append): Use translate_code.
8428 (packgram): Bound check ruleno, itemno, and rule_length.
8429 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8430 (last_string, last_braced_code_loc, max_left_semantic_context)
8431 (scanner_initialize, scanner_free, scanner_last_string_free)
8432 (gram_out, gram_lineno, YY_DECL_): Move to...
8433 * src/scan-gram.h: this new file.
8434 (YY_DECL): Rename as...
8435 (GRAM_DECL): this.
8436 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8437 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8438 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8439 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8440 Move these declarations, and...
8441 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8442 these to...
8443 * src/flex-scanner.h: this new file.
8444 * src/scan-gram.l (rule_length, rule_length_overflow)
8445 (increment_rule_length): Remove.
8446 (last_braced_code_loc): Rename as...
8447 (gram_last_braced_code_loc): this.
8448 Adjust to the changes of the parser.
8449 Move all the handling of $ and @ into...
8450 * src/scan-code.l: here.
8451 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8452 (handle_action_dollar, handle_action_at): Move to...
8453 * src/scan-code.l: here.
8454 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8455 scan-code.h, scan-code-c.c, scan-gram.h.
8456 (EXTRA_bison_SOURCES): Add scan-code.l.
8457 (BUILT_SOURCES): Add scan-code.c.
8458 (yacc): Be robust to white spaces.
8459
8460 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8461 * tests/regression.at: Adjust the column numbers.
8462 * tests/regression.at: Adjust the error message.
7891a7c4 8463
184e42f0
JD
84642006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8465
8466 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8467 Use Akim's wording from
8468 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8469
7891a7c4
JD
84702006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8471
8472 Between Bison releases, manually append `+' to the previous Bison
8473 release number, and use that as a signal to automatically print the
8474 ChangeLog's CVS Id keyword from --version. Discussed starting at
8475 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8476 * ChangeLog: Add Id header.
8477 * configure.ac (AC_INIT): Append `+' to `2.3'.
8478 * src/.cvsignore: Add revision.c.
8479 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8480 (BUILT_SOURCES): Add revision.c.
8481 (revision.c): New target rule. This file defines a new global variable
8482 named revision. It initializes it with either the Id from ChangeLog
8483 or, if VERSION doesn't contain `+', with the empty string.
8484 * src/getargs.c (version): Print the value of revision.
8485 * src/revision.h: Extern revision.
8486
4ad3ed84
PE
84872006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8488
8489 * NEWS: Version 2.3.
8490 * configure.ac (AC_INIT): Likewise.
8491
02103984
PE
84922006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8493
8494 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8495 with no arguments, not as an object-like macro. This is for
8496 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8497 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8498 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8499 Document this.
8500
2c08afa5
JD
85012006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8502
8503 * src/getargs.c (usage): Back out yesterday's modification of the
8504 --help output so that we don't have to wait for translation before
8505 releasing 2.3.
8506
6077da58
PE
85072006-05-29 Paul Eggert <eggert@cs.ucla.edu>
8508
8509 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
8510 Problem reported by Akim Demaille.
8511
2a26b6c2
JD
85122006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
8513
8514 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8515
aefef0d6
PE
85162006-05-26 Paul Eggert <eggert@cs.ucla.edu>
8517
8518 * data/yacc.c (yy_reduce_print): Omit trailing white space in
8519 generated source code. Problem reported by Frans Englich in
8520 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
8521
fcd8e201
PE
85222006-05-22 Paul Eggert <eggert@cs.ucla.edu>
8523
8524 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
8525 shell, not within 'make', so that 'make' by an ordinary builder
8526 (using GNU make) does not worry about configuring gzip. This also
8527 works around a bug reported independently by Keith Thompson and by
8528 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
8529 stderr rather than stdout, messing up the build logs.
8530
7b5cdcbd
JD
85312006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8532
8533 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
8534 to make sure that YYID will never be unused. This fixes a 'make
8535 maintainer-check' failure caused by the recent changes to the 'Trivial
8536 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
8537 not used.
8538 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
8539
5ad0a449
JD
85402006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8541
8542 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
8543 state before an empty RHS is always resolved here. Only the location
8544 of that state is guaranteed to be resolved, and that's enough. This
8545 fixes the remaining bug reported by Derek M. Jones in
8546 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8547 * tests/glr-regression.at (Uninitialized location when reporting
8548 ambiguity): Test the above case.
8549 Also, the embedded comments in this test case claim it checks the case
8550 of an empty RHS that has inherited the initial location. However, the
8551 corresponding LHS was already resolved, so yyresolveLocations didn't
8552 actually have reason to modify it. Fix this by forcing
8553 nondeterministic operation at the beginning of the parse.
8554
50cce58e
PE
85552006-05-20 Paul Eggert <eggert@cs.ucla.edu>
8556
8557 * data/c.m4 (b4_yy_symbol_print_generate):
8558 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
8559 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
8560 of the bugs reported today by Derek M Jones in
8561 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8562 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
8563 defined to be a type name without parens or brackets.
8564 (Location Type): Similarly for YYLTYPE.
8565 * tests/regression.at (Trivial grammars): Put in a test for this
8566 bug that will be caught by 'make maintainer-check' (though not,
8567 alas, by 'make check' unless your compiler is picky).
8568
ab8d9dc5
PE
85692006-05-19 Paul Eggert <eggert@cs.ucla.edu>
8570
0d2c8934 8571 * NEWS: Version 2.2.
ab8d9dc5
PE
8572 * configure.ac (AC_INIT): Likewise.
8573
9138c575
JD
85742006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
8575
8576 * data/glr.c (yyreportTree): Make room in yystates for the state
8577 preceding the RHS. This fixes the segmentation fault reported by Derek
8578 M. Jones in
8579 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
8580 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
8581 to the user. Reported for yyreportTree by Derek M. Jones later in the
8582 same thread.
8583 * THANKS: Add Derek M. Jones.
8584 Update my email address.
8585 Fix typo in Steve Murphy's name.
8586
276f48df
PE
85872006-05-14 Paul Eggert <eggert@cs.ucla.edu>
8588
d6645148
PE
8589 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
8590 checking against YYLAST that caused the parser to miss a potential
8591 alternative in its diagnostic.
8592 Problem reported by Maria Jose Moron Fernandez in
8593 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
8594 * data/lalr1.cc (yysyntax_error_): Likewise.
8595 * data/yacc.c (yysyntax_error): Likewise.
8596 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
8597 tokens, in case we run into an older C compiler.
8598 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
8599 Use them to check for the off-by-one error fixed above.
8600
276f48df
PE
8601 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
8602 YYSIZE_T, not size_t.
8603 * tests/regression.at (Trivial grammars): New test, to catch
8604 the error fixed by the above patch.
8605
cd8b5791
AD
86062006-05-14 Akim Demaille <akim@lrde.epita.fr>
8607
8608 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
8609 scheme.
8610 Reported by Steve Murphy.
8611
34376418
AD
86122006-05-14 Akim Demaille <akim@lrde.epita.fr>
8613
8614 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
8615 * data/glr.cc: b4_location_flag is now b4_locations_flag.
8616
327afc7c
AD
86172006-05-14 Akim Demaille <akim@lrde.epita.fr>
8618
8619 Implement --trace=m4.
8620 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
8621 * src/output.c (output_skeleton): When set, pass -dV to m4.
8622
8623 Factor the handling of flags in m4.
8624 * src/output.c (prepare): Rename the muscle names debug, defines,
8625 error_verbose to debug_flag, defines_flag, error_verbose_flag.
8626 * data/c.m4: Adjust.
8627 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
8628 Use b4_define_flag_if to define other b4_FLAG_if macros.
8629 (b4_location_if): As a consequence, rename as...
8630 (b4_locations_if): this, for consistency.
8631 Adjust all the skeletons.
8632
ba9ecd19
AD
86332006-05-14 Akim Demaille <akim@lrde.epita.fr>
8634
8635 * etc/bench.pm: Shorten bench names.
8636
4e83ea15
AD
86372006-05-14 Akim Demaille <akim@lrde.epita.fr>
8638
8639 * src/output.h, src/output.c (error_verbose): Move to...
8640 * src/getargs.h, src/getargs.c: here.
8641 Sort the flags.
8642 Adjust dependencies.
8643
6e93d810
PE
86442006-05-13 Paul Eggert <eggert@cs.ucla.edu>
8645
8646 * data/c.m4 (b4_copyright): Put the special exception for Bison
8647 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
8648 uses changed. Suggested by Akim Demaille. Also, wrap the
8649 copyright notice, in case it is longer than 80 columns. Replace
8650 comma by newline after title.
6e93d810 8651
eaea13f5
PE
86522006-05-11 Paul Eggert <eggert@cs.ucla.edu>
8653
8654 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
8655 incompatibility, not a bug. Mention that it wasn't fixed as of
8656 flex 2.5.33.
8657
3cf084ec
AD
86582006-05-11 Akim Demaille <akim@lrde.epita.fr>
8659
8660 * examples/extexi: Enforce the precedence of concatenation over
8661 >>.
0a9f1c7d 8662 Reported by Tommy Nordgren.
3cf084ec 8663
32c96bd7
AD
86642006-05-11 Akim Demaille <akim@lrde.epita.fr>
8665
8666 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8667 with the member "token".
f94705b2 8668 Reported by Martin Nylin.
32c96bd7 8669
eaea13f5
PE
86702006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8671
8672 * data/glr.c: Switch to Bison 2.2 special-exception language in
8673 the copyright notice. Use more-regular format for titles and
8674 copyright notices.
8675 * data/glr.cc: Likewise.
8676 * data/location.cc: Likewise.
8677 * data/yacc.cc: Likewise.
8678 * doc/bison.texinfo (Conditions): Document this.
8679 * NEWS: likewise. Upgrade version to 2.2.
8680
6e2d1146
AD
86812006-04-27 Akim Demaille <akim@lrde.epita.fr>
8682
8683 * data/glr.cc: Remove dead code.
8684
47671055
PE
86852006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8686
8687 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8688 that variable and the line breaks the bootstrap. Problem reported
8689 by Juan M. Guerrero.
8690
ed2e6384
AD
86912006-04-24 Akim Demaille <akim@lrde.epita.fr>
8692
8693 * doc/bison.texinfo (Multiple start-symbols): New.
8694
3cedc2dc
AD
86952006-04-24 Akim Demaille <akim@lrde.epita.fr>
8696
8697 * etc/README, etc/bench.pl: New.
8698
b2ddc3f3
AD
86992006-04-03 Akim Demaille <akim@lrde.epita.fr>
8700
8701 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8702 rule.
8703 Reported by Mickael Labau.
8704 * tests/input.at (Torturing the Scanner): Test it.
8705
91e3ac9a
PE
87062006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8707
8708 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8709 Problem reported by Bob Rossi.
8710
87112006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8712
8713 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8714 and didn't really work.
8715 For the index, use @ifnotinfo, not @iftex.
8716 Minor cleanups of spacing and terminology.
8717
5cf61e93
AD
87182006-03-12 Akim Demaille <akim@lrde.epita.fr>
8719
8720 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8721 of AT_NAME_PREFIX when %name-prefix is not used.
8722
aa08666d
AD
87232006-03-12 Akim Demaille <akim@lrde.epita.fr>
8724
8725 Apply --prefix to C++ skeletons too: they change the namespace.
8726 The test suite already exercize these cases.
8727 * data/c++.m4 (b4_namespace): New.
8728 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8729 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8730 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8731 * doc/bison.texinfo: Document it.
8732 (Option Cross Key): Use @multitable in all formats. It looks
8733 nicer, even in TeX outputs.
8734 (Rules): Use the same code whatever the output type is.
8735 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8736 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8737 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 8738
45567173
AD
87392006-03-10 Akim Demaille <akim@lrde.epita.fr>
8740
8741 * TODO: Remove dead items.
8742
e9d8f881 87432006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
8744
8745 * doc/FAQ: Remove, merged into...
8746 * doc/bison.texinfo (FAQ): this.
8747 * doc/Makefile.am (EXTRA_DIST): Adjust.
8748
c095d689
AD
87492006-03-10 Akim Demaille <akim@lrde.epita.fr>
8750
8751 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8752 even if empty.
8753 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8754 * doc/bison.texinfo (Calc++ Scanner): Use it.
8755
6e0f8287
PE
87562006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8757
8758 Fix two nits reported by twlevo, plus one more that I discovered.
8759
8760 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8761 this is the usual Bison style.
8762 * src/location.h (location_print): Likewise.
8763
8764 * src/reader.h (token_name): Likewise.
8765
d6b771c3
PE
87662006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8767
8768 Fix some nits reported by twlevo.
8769 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8770 and "POSIX". Use more-modern syntax for URLs. Mention C++
8771 and ask for Java. Don't hardwire OS version numbers. Add
8772 copyright notice.
8773 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8774 * src/conflicts.c (solved_conflicts_obstack): Now static.
8775
1e137b71
JD
87762006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8777
8778 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8779 page. Say "you can use it" not "you may use it" as on the web page;
8780 we're describing capabilities not granting permission.
8781
73f2e47e
PE
87822006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8783
6d05403d
PE
8784 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8785 shadowing warnings. Use usual patter for iterating through RHS.
8786 * tests/glr-regression.at
8787 (Uninitialized location when reporting ambiguity):
8788 Modify yylex so that it uses its argument, rather than trying
8789 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8790 const char -> char const.
8791
73f2e47e
PE
8792 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8793 Don't use tabs inside commands; it messes up 'ps'.
8794 Problem reported by twlevo.
8795
8710fc41
JD
87962006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8797
8798 * tests/glr-regression.at (Uninitialized location when reporting
8799 ambiguity): New test case.
8800 * data/glr.c (yyresolveLocations): New function, which uses
8801 YYLLOC_DEFAULT.
8802 (yyresolveValue): Invoke yyresolveLocations before reporting an
8803 ambiguity.
8804 * doc/bison.texinfo (Default Action for Locations): Note
8805 YYLLOC_DEFAULT's usage for ambiguity locations.
8806 (GLR Semantic Actions): Cross-reference those notes.
8807
ae952af2
JD
88082006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8809
8810 * tests/glr-regression.at (Leaked semantic values when reporting
8811 ambiguity): Remove unnecessary union and type declarations.
8812 (Leaked lookahead after nondeterministic parse syntax error): New test
8813 case.
8814 * data/glr.c (yyparse): Check for zero stacks remaining before
8815 attempting to shift the lookahead so that you don't lose it.
8816
35ee866a
JD
88172006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8818
8819 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8820 * tests/glr-regression.at (Leaked semantic values when reporting
8821 ambiguity): New test case.
8822 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8823 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8824 now unnecessary yystackp parameter.
8825 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8826 destructors can be called.
8827
8828 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8829 in existing testcases.
8830
520181ab
JD
88312006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8832
8833 Don't leak semantic values for parent RHS when a user action cuts the
8834 parser, and clean up related code a bit.
8835 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
8836 cuts parse): Rename to...
8837 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
8838 for leaked parent RHS values.
8839 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8840 between an unresolved state (non-empty chain of semantic options) and
8841 an incomplete one (signaled by an empty chain).
ae952af2 8842 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
8843 successfully or unsuccessfully resolved yyGLRState to...
8844 (yyresolveValue): ... here so that yyresolveValue always leaves a
8845 yyGLRState with consistent data and thus is easier to understand.
8846 Remove the yyvalp and yylocp parameters since they are always just
8847 taken from the yys parameter. When reporting a discarded merged value
8848 in debugging output, note that it is incompletely merged. Document the
8849 interface.
8850 (yyresolveAction): If resolving any of the RHS states fails, destroy
8851 them all rather than leaking them. Thus, as long as user actions are
8852 written to clean up the RHS correctly, yyresolveAction always cleans up
8853 the RHS of a semantic option. Document the interface.
8854
18d9185c
PE
88552006-02-27 Paul Eggert <eggert@cs.ucla.edu>
8856
8857 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
8858 led to a segmentation fault in GNU Pascal. Problem reported
8859 by Waldek Hebisch.
8860
841a7737
JD
88612006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
8862
8863 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
8864 mid-rule action inside a nonterminal symbol in order to declare a
8865 destructor for its semantic value.
8866
fc3f467f
PE
88672006-02-16 Paul Eggert <eggert@cs.ucla.edu>
8868
8869 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
8870 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
8871 __cplusplus && ! defined _STDLIB_H && !
8872 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
8873 defined free))]: Include <stdlib.h> rather than rolling our own
8874 declarations of malloc and free, to avoid problems with
8875 incompatible declarations (using 'throw') C++'s stdlib.h. This
8876 should fix Debian bug 340012
8877 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
8878 reported by Guillaume Melquiond.
8879
a3af26dd
PE
88802006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8881
4d7bc38c
PE
8882 * NEWS: Clarify symbols versus types in unused-value warnings.
8883
a3af26dd
PE
8884 * configure.ac (AC_INIT): Bump version number.
8885
4e26c69e
PE
88862006-02-13 Paul Eggert <eggert@cs.ucla.edu>
8887
8888 * NEWS: Version 2.1a.
8889 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
8890 since C99 requires this.
8891
498e897c
PE
88922006-02-11 Paul Eggert <eggert@cs.ucla.edu>
8893
8894 * m4/c-working.m4: New file.
8895 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
8896
57bb17ca
PE
88972006-02-10 Paul Eggert <eggert@cs.ucla.edu>
8898
8899 * Makefile.maint: Merge from coreutils.
8900
0be105dc
PE
89012006-02-09 Paul Eggert <eggert@cs.ucla.edu>
8902
8903 More portability fixes for problems summarized by Nelson H. F. Beebe.
8904
8905 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
8906 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
8907 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
8908 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
8909 messes up because C++ code is compiled in 32-bit mode but linked
8910 in 64-bit mode.
8911
6fc0c024
PE
89122006-02-08 Paul Eggert <eggert@cs.ucla.edu>
8913
8914 More portability fixes for problems summarized by Nelson H. F. Beebe.
8915
7870f699
PE
8916 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
8917 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
8918
6fc0c024
PE
8919 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
8920 nodist_PROGRAMS, since we don't need to actually compile the
8921 example if we're just doing a plain 'make'. This avoids bothering
8922 the installer unnecessarily about problems due to weird C++
8923 compilers.
8924
fe6c2fde
PE
89252006-02-06 Paul Eggert <eggert@cs.ucla.edu>
8926
8927 More portability fixes for problems summarized by Nelson H. F. Beebe.
8928
8929 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
8930 than #include "...", and compile with -I'.'. The old method was
8931 not portable, according to Posix and the C standard, and it does
8932 not work with Sun C 5.7, where previous #line directives affect
8933 the working directory used in later #include "..." directives.
8934
927b425b
JMG
89352006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
8936
8937 Various DJGGP specific issues in /djgpp
8938
d9735e9e
PE
89392006-02-02 Paul Eggert <eggert@cs.ucla.edu>
8940
8941 More portability fixes for problems summarized by Nelson H. F. Beebe.
8942
8943 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
8944 '#include <map>' works and that you can apply ++ to iterators.
8945
5a6755af
PE
89462006-02-01 Paul Eggert <eggert@cs.ucla.edu>
8947
67a0dc4f
PE
8948 Work around portability problems summarized by Nelson H. F. Beebe in
8949 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
8950
8c86f0ef
PE
8951 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
8952 that '#include <string>' works.
8953
de35dd59
PE
8954 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
8955 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
8956 "warning: sorry: semantics of inline function static data `const
8957 unsigned char translate_table[262]' are wrong (you'll wind up with
8958 multiple copies)".
8959
67a0dc4f
PE
8960 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
8961 or, xor to not_, and_, or_, and xor_, respectively. This works
8962 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
8963 random system header somewhere that includes the equivalent of
8964 <iso646.h>.
8965
5a6755af
PE
8966 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
8967 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 8968 Suite Version 2.0.
5a6755af 8969
3f001415
JD
89702006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
8971
8972 During deterministic GLR operation, user actions should be able to
8973 influence the parse by changing yychar. To make this easier to fix and
8974 to make glr.c easier to evolve in general, don't maintain yytoken in
8975 parallel with yychar; just compute yytoken when needed.
8976 * tests/glr-regression.at (Incorrect lookahead during deterministic
8977 GLR): Check that setting yychar in a user action has the intended
8978 effect.
8979 * data/glr.c (yyGLRStack): Remove yytokenp member.
8980 (yyclearin): Don't set *yytokenp.
8981 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
8982 yychar rather than *yytokenp to determine the current lookahead.
8983 Compute yytoken locally when needed.
8984 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
8985 point to.
8986
8987 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
8988 after `--report' documentation.
8989
e2a8c0f5
PE
89902006-01-30 Paul Eggert <eggert@cs.ucla.edu>
8991
8992 * src/parse-gram.y (grammar_declaration): Location of printer
8993 symbol is @1, not list->location. Bug reported by twlevo.
8994 * tests/input.at (Incompatible Aliases): Adjust to above change.
8995
6b702268
PE
89962006-01-29 Paul Eggert <eggert@cs.ucla.edu>
8997
27622431
PE
8998 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
8999 all the test at once. This makes the output easier to read in the
9000 normal case.
9001
6b702268
PE
9002 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9003 got from <http://bro-ids.org/download.html>. The bug is that
9004 when two actions appeared in succession, the second one was
9005 scanned before the first one was added to the grammar rule
9006 as a midrule action. Bison then output the incorrect warning
9007 "parse.y:905.17-906.36: warning: unused value: $3".
9008 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9009 associated with a value.
9010 (rhs): Don't invoke grammar_current_rule_action_append.
9011 (action): Invoke it here instead.
9012 * src/reader.c (grammar_midrule_action): Now extern.
9013 (grammar_current_rule_action_append): Don't invoke
9014 grammar_midrule_action; that is now the scanner's job.
9015 * src/reader.h (last_string, last_braced_code_loc):
9016 (grammar_midrule_action): New decls.
9017 * src/scan-gram.l (last_string): Now extern, sigh.
9018 (last_braced_code_loc): New extern variable.
9019 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9020 rule already has an action.
9021 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9022 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9023 Add some tests to check that the above changes fixed the bug.
9024
d40ba6c2
PE
90252006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9026
9027 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9028 All used changed. Check whether the symbol has a destructor,
9029 not whether it is typed.
9030 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9031 that the values are still reported as unused. All line numbers
9032 adjusted.
9033
401aace6
PE
90342006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9035
9036 Work around a bug in bro 0.8, which underparenthesizes its
9037 definition of YYLLOC_DEFAULT.
9038 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9039 their arguments.
9040 * data/lalr1.cc: Likewise.
9041 * data/yacc.cc: Likewise.
9042
06f01bc4
PE
90432006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9044
401aace6
PE
9045 Work around a bug in Pike 7.0, and give the Pike folks a
9046 better way to override the usual int widths.
9047 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9048 user can override the types.
9049 (short): #undef, to work around a bug in Pike 7.0.
9050 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9051 (union yyalloc.yyss): Use yytype_int16 rather than short.
9052 All uses changed.
9053 (yysigned_char): Remove.
9054 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9055 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9056 * tests/regression.at (Web2c Actions): Adjust to above changes.
9057
9058 * src/reader.c (check_and_convert_grammar): New function.
9059 (reader): Close the input file even if something went wrong during
9060 parsing. Minor file descriptor leak reported by twlevo.
9061
06f01bc4
PE
9062 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9063 to pacify gcc -Wswitch-default.
9064 * src/scan-gram.l (adjust_location): Use a default: break; case
9065 to pacify gcc -Wswitch-default.
9066 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9067 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9068 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9069 Move these decls to scan-skel.l, since they don't need to be
9070 visible elsewhere.
9071 * src/scan-skel.l: Accept the above decls.
9072 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9073 is used.
9074
02650b7f
PE
90752006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9076
9077 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9078 since we don't want to insist on a version number at the start
9079 of the changelog every time.
9080 * Makefile.maint: Sync from coreutils a bit better.
9081 (sc_trailing_blank): Renamed from sc_trailing_space.
9082 All uses changed.
9083 (sc_no_if_have_config_h, sc_require_config_h):
9084 (sc_prohibit_assert_without_use): New rules.
9085 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9086 (sc_dd_max_sym_length): Fix leading spaces in rule.
9087 (sc_system_h_headers): Prefix with @.
9088 (sc_useless_cpp_parens, m4-check): Output line numbers.
9089 (changelog-check): Allow version only in head.
9090 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9091 satisfy new Makefile.maint rule.
9092 * data/glr.c: Likewise.
9093 * data/glr.cc: Likewise.
9094 * data/lalr1.cc: Likewise.
9095 * data/yacc.c: Likewise.
9096 * lib/ebitsetv.c: Likewise.
9097 * lib/lbitset.c: Likewise.
9098 * lib/subpipe.c: Likewise.
9099 * lib/timevar.c: Likewise.
9100 * src/system.h: Likewise.
9101 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
9102 * djgpp/Makefile.maint: Add copyright notice.
9103 * djgpp/README.in: Likewise.
9104 * djgpp/config.bat: Likewise.
9105 * djgpp/config.site: Likewise.
9106 * djgpp/config_h.sed: Likewise.
9107 * djgpp/djunpack.bat: Likewise.
9108 * djgpp/config.sed: Fix copyright notice to match standard format.
9109 * djgpp/subpipe.h: Likewise.
9110 * lib/bitsetv-print.c: Likewise.
9111 * lib/bitsetv.c: Likewise.
9112 * lib/subpipe.h: Likewise.
9113 * lib/timevar.c: Likewise.
9114 * lib/timevar.h: Likewise.
9115 * djgpp/subpipe.c: Use standard recipe for config.h.
9116 * lib/abitset.c: Likewise.
9117 * lib/bitset.c: Likewise.
9118 * lib/bitset_stats.c: Likewise.
9119 * lib/bitsetv-print.c: Likewise.
9120 * lib/bitsetv.c: Likewise.
9121 * lib/ebitsetv.c: Likewise.
9122 * lib/get-errno.c: Likewise.
9123 * lib/lbitset.c: Likewise.
9124 * lib/subpipe.c: Likewise.
9125 * lib/timevar.c: Likewise.
9126 * lib/vbitset.c: Likewise.
9127 * tests/local.at: Likewise.
9128 * src/scan-gram.l: Don't include verify.h, since system.h does
9129 that for us.
9130 * .x-sc_require_config_h: New file.
9131 * .x-sc_unmarked_diagnostics: New file.
9132
287c78f6
PE
91332006-01-20 Paul Eggert <eggert@cs.ucla.edu>
9134
287c78f6
PE
9135 Be a bit more systematic about using 'abort'.
9136 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
9137 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
9138 Put 'default: abort ();' before some other case, to satisfy older
9139 pedantic compilers.
9140 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9141 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
9142 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
9143 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
9144 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
9145 (get_decision_str, get_orientation_str, get_node_alignment_str):
9146 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
9147 (get_linestyle_str, get_arrowstyle_str): Likewise.
9148 * src/conflicts.c (resolve_sr_conflict):
9149 Use a default case rather than one for the one remaining enum
9150 value, to catch invalid enum values as well.
9151 * src/lalr.c (set_goto_map, map_goto):
9152 Prefer "assert (FOO);" to "if (!FOO) abort ();".
9153 * src/nullable.c (nullable_compute, token_definitions_output):
9154 Likewise.
9155 * src/reader.c (packgram, reader): Likewise.
9156 * src/state.c (transitions_to, state_new, state_reduction_find):
9157 Likewise.
9158 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
9159 (symbol_pack): Likewise.
9160 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
9161 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
9162 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
9163 * src/system.h: Don't include <assert.h>.
9164 (assert): New macro.
9165
9166 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
9167 (Destructor Decl, Parser Function, Pure Calling):
9168 Describe rules for braces inside C code more carefully.
287c78f6 9169
c66dfadd
PE
91702006-01-19 Paul Eggert <eggert@cs.ucla.edu>
9171
c21493b8
PE
9172 Fix some porting glitches found by Nelson H. F. Beebe.
9173 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
9174 compilers that don't understand that abort () does not return.
9175 * src/state.c (transitions_to): Likewise.
9176 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9177 that '#include <cstdlib>' works.
9178 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
9179 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
9180 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
9181 for the benefit of some pre-C99 compilers.
9182
b6e3facf
PE
9183 * bootstrap: Undo changes to gnulib files that autoreconf made.
9184
c66dfadd
PE
9185 Minor fixups to get 'make maintainer-check' to work.
9186 * configure.ac: Don't use -Wnested-externs, as it's incompatible
9187 with the new verify.h implementation.
9188 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
9189 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
9190 * data/yacc.c (YYUSE): Likewise.
9191 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
9192 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
9193 * src/parse-gram.y (declaration): Don't pass a string constant
9194 to a function that expects char *, since GCC might complain
9195 about the constant value.
9196 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
9197 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
9198 before #defining them.
9199 * tests/glr-regression.at
9200 (Incorrectly initialized location for empty right-hand side in GLR):
9201 In yyerror, use the msg arg.
9202 (Corrupted semantic options if user action cuts parse):
9203 (Incorrect lookahead during deterministic GLR):
9204 (Incorrect lookahead during nondeterministic GLR):
9205 Don't name a local var 'index'; it shadows string.h's 'index'.
9206
ed94ef2a
AD
92072006-01-19 Akim Demaille <akim@epita.fr>
9208
9209 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
9210 location, not just parts of it.
9211
e9ad4aec
PE
92122006-01-18 Paul Eggert <eggert@cs.ucla.edu>
9213
d6ca7905
PE
9214 * NEWS: Document the fact that multiple %unions are now allowed.
9215 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
9216 * TODO: This feature is now implemented, so remove it from
9217 the wishlist.
d6ca7905 9218
ef1b70e0
PE
9219 * Makefile.maint: Merge with coreutils Makefile.maint.
9220 (CVS_LIST): Use build-aux version if available.
9221 (VERSION_REGEXP): New macro.
9222 (syntax-check-rules): Add sc_no_if_have_config_h,
9223 sc_prohibit_assert_without_use, sc_require_config_h,
9224 sc_useless_cpp_parens.
9225 (sc_obsolete_symbols): Check for O_NDELAY.
9226 (sc_dd_max_sym_length): Track coreutils.
9227 (sc_unmarked_diagnostics): Look in all files, not just *.c.
9228 (sc_useless_cpp_parens): New rule.
9229 (news-date-check): Look for version or today's date.
9230 (changelog-check): Don't require version number near head.
9231 (copyright-check): Use current year instead of hardwiring 2005.
9232 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
9233 (announcement): Add --gpg-key-ID.
9234
9235 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
9236 with "file system".
9237
2073ce56 9238 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
9239 array. Problem reported by twlevo.
9240 * src/reader.c (packgram): Prepend a new sentinel before ritem.
9241 * src/lalr.c (build_relations): Rely on new sentinel.
9242 * src/gram.c (gram_free): Adjust to new sentinel.
9243
b7691f15
JD
92442006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
9245
9246 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
9247 yylookaheadNeeds. All uses updated.
9248 (yysplitStack): Rename local yynewLookaheadStatuses to
9249 yynewLookaheadNeeds.
9250 * data/glr-regression.at (Incorrect lookahead during nondeterministic
9251 GLR): In comments, change `lookahead status' to `lookahead need'.
9252
ddee1b06
PH
92532006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9254
9255 * data/glr.c (yysplitStack): A little stylistic rewrite.
9256
12f4614d
PH
92572006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9258
9259 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
9260
32c29292
JD
92612006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
9262
9263 * doc/bison.texinfo: Fix some typos.
9264 (GLR Semantic Actions): New subsection discussing special
9265 considerations because GLR semantic actions might be deferred.
9266 (Actions): Mention look-ahead usage of yylval.
9267 (Actions and Locations): Mention look-ahead usage of yylloc.
9268 (Special Features for Use in Actions): Add YYEOF entry and mention it
9269 in the yychar entry.
9270 In the yychar entry, remove mention of the local yychar case (pure
9271 parser) since this is irrelevant information when writing semantic
148d66d8 9272 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
9273 yychar is otherwise described as an external variable.
9274 In the yychar entry, don't call it the `current' look-ahead since it
9275 isn't when semantic actions are deferred.
9276 In the yychar and yyclearin entries, add note about deferred semantic
9277 actions.
9278 Add yylloc and yylval entries discussing look-ahead usage.
9279 (Look-Ahead Tokens): When discussing yychar, don't call it the
9280 `current' look-ahead, and do mention yylval and yylloc.
9281 (Error Recovery): Cross-reference `Action Features' when mentioning
9282 yyclearin.
148d66d8 9283 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
9284 look-ahead.
9285 In the yylloc and yylval entries, mention look-ahead usage.
9286
de366a2f 92872006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
9288
9289 * tests/glr-regression.at: Update copyright year to 2006.
9290
bf70fa87
JD
92912006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9292
9293 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
9294 use during nondeterministic operation to track which stacks have
9295 actually needed the current lookahead.
9296 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
9297 Allocate, deallocate, resize, and otherwise shuffle space for
9298 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
9299 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
9300 appropriately during nondeterministic operation.
9301 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
9302 members to store the current lookahead to be used by the deferred
9303 user action.
9304 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
9305 from which the RHS is taken. Set the lookahead members of the new
9306 yySemanticOption according to the lookahead status for stack yyk.
9307 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
9308 yyaddDeferredAction.
9309 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
9310 members of yySemanticOption before invoking yyuserAction, and then set
9311 them back to their current values afterward.
9312 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
9313 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
9314 * tests/glr-regression.at: Remove `.' from the ends of recent test case
9315 titles for consistency.
9316 (Leaked merged semantic value if user action cuts parse): In order to
9317 suppress lint warnings, use arguments in merge function, and assign
9318 char value < 128 in main.
9319 (Incorrect lookahead during deterministic GLR): New test case.
9320 (Incorrect lookahead during nondeterministic GLR): New test case.
9321
05449a2c
JD
93222006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9323
de366a2f 9324 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
9325 !yyvaluep as signal that no semantic value is available to print.
9326 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
9327 to print a semantic value.
9328
4158e0a1 93292006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 9330
4158e0a1
JD
9331 * tests/glr-regression.at: For consistency with my newer test cases,
9332 don't thank myself.
9333
d659304d
JD
93342006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
9335
9336 * data/glr.c (yyresolveValue): When merging semantic options, if at
9337 least one user action succeeds but a later one cuts the parse, then
9338 destroy the semantic value before returning rather than leaking it.
9339 (yyresolveStates): If a user action cuts the parse and thus
9340 yyresolveValue fails, ignore the (unset) semantic value rather than
9341 corrupting the yyGLRState, and empty the semantic options list since
9342 the user actions should have called all necessary destructors.
9343 Simplify code with YYCHK.
9344 * tests/glr-regression.at (Corrupted semantic options if user action
9345 cuts parse): New test case.
9346 (Undesirable destructors if user action cuts parse): New test case.
9347 Before applying any of this patch, this test case never actually failed
9348 for me... but only because the corrupted semantic options usually
9349 masked this bug.
9350 (Leaked merged semantic value if user action cuts parse): New test
9351 case.
9352
6ec2c0f2
AD
93532006-01-05 Akim Demaille <akim@epita.fr>
9354
9355 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
9356
1b9c21fb
PE
93572006-01-04 Paul Eggert <eggert@cs.ucla.edu>
9358
9359 * data/c.m4 (b4_c_modern): New macro, with a new provision for
9360 _MSC_VER. Problem reported by Cenzato Marco.
9361 (b4_c_function_def): Use it.
9362 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
9363 b4_c_modern.
9364 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
9365 than rolling our own.
9366
84866159
AD
93672006-01-04 Akim Demaille <akim@epita.fr>
9368
9369 Also warn about non-used mid-rule values.
9370 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
9371 member.
9372 (symbol_list_new): Adjust.
9373 * src/reader.c (symbol_typed_p): New.
9374 (grammar_rule_check): Use it.
9375 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
9376 Check its rule.
9377 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
9378 Use it.
9379 * tests/actions.at (Exotic Dollars): Adjust.
9380
378f4bd8
AD
93812006-01-04 Akim Demaille <akim@epita.fr>
9382
9383 * src/reader.c (grammar_midrule_action): If $$ is set in a
9384 mid-rule, move the `used' bit to its lhs.
9385 * tests/input.at (Unused values): New.
9386 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
9387
e2a21b6f
PE
93882006-01-03 Paul Eggert <eggert@cs.ucla.edu>
9389
54662697
PE
9390 * doc/bison.texinfo (Bison Options): Say more accurately what
9391 --yacc does.
9392 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
9393 about declarations in the grammar when in Yacc mode, as POSIX does
9394 not require a diagnostic when the grammar uses extensions.
9395
9396 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
9397
073f9288
PE
9398 Warn about dubious constructions like "%token T T".
9399 Reported by twlevo.
9400 * src/symtab.h (struct symbol.declared): New member.
9401 * src/symtab.c (symbol_new): Initialize it to false.
9402 (symbol_class_set): New arg DECLARING, specifying whether
9403 this is a declaration that we want to warn about, if there
9404 is more than one of them. All uses changed.
9405
1221b78a
PE
9406 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
9407 Allow multiple %union directives, whose contents concatenate.
9408 * src/parse-gram.y (grammar_declaration): Likewise.
9409 Use muscle_code_grow, so that we don't need stype_line any more.
9410 All uses changed.
9411
9412 * src/muscle_tab.c (muscle_grow): Fix comment.
9413
e2a21b6f
PE
9414 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
9415 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
9416 Update copyright year to 2006.
9417
8f7e3cf9
AD
94182006-01-03 Akim Demaille <akim@epita.fr>
9419
9420 Have glr.cc pass (some of) the calc.at tests.
9421 * data/glr.cc (b4_parse_param_orig): New.
9422 (b4_parse_param): Improve its definition, and bound it more
9423 clearly in the skeleton.
9424 (b4_epilogue): Append, instead of prepending, in order to keep
9425 #line consistency.
9426 Simplify the generation of auxiliary functions: locations and
9427 purity are mandated.
9428 (b4_global_tokens_and_yystype): Honor it.
9429 * data/location.cc (c++.m4): Don't include it.
9430 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9431 and AT_SKEL_CC_IF.
9432 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9433 AT_LALR1_CC_IF.
9434 Be sure to initialize the first position's filename.
9435 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9436 mandated anyway.
9437 (AT_CHECK_CALC_GLR_CC): New.
9438 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9439
3953ed88
AD
94402006-01-02 Akim Demaille <akim@epita.fr>
9441
9442 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9443 c.m4.
0a96ba81 9444 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
9445 * data/glr.cc: Do not include stack.hh.
9446
9ecafbbf
AD
94472006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9448
9449 * data/glr.c: Reformat whitespace with tabs.
9450 (b4_lpure_formals): Remove this unused m4 macro.
9451 * tests/cxx-type.at: Reformat whitespace with tabs.
9452 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9453 since it's a member. Rename type to isNterm for clarity.
9454
c4d497a0
AD
94552005-12-29 Akim <akim@sulaco.local>
9456
9457 Let glr.cc catch up with symbol_value_print.
9458 * data/glr.cc (b4_yysymprint_generate): Replace by...
9459 (b4_yy_symbol_print_generate): this.
9460 (yy_symbol_print, yy_symbol_value_print): Declare them.
9461
4517da37
PE
94622005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9463
9464 * src/location.h (boundary): Note that a line or column equal
9465 to INT_MAX indicates an overflow.
9466 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9467 (rule_length_overflow, increment_rule_length, add_column_width):
9468 New functions.
9469 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9470 (<SC_BRACED_CODE>"}"):
9471 Use increment_rule_length rather than incrementing it by hand.
9472 (adjust_location, handle_syncline): Diagnose overflow.
9473 (handle_action_dollar, handle_action_at):
9474 Fix bug with monstrosities like $-2147483648.
9475 Remove now-unnecessary checks.
9476 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9477 (convert_ucn_to_byte): Verify assumptions.
9478 (handle_syncline): New arg LOC. All callers changed.
9479 Don't store through a value derived from char const * pointer.
9480
9481 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9482 GCC warnings.
9483
e3233bf6
PE
94842005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9485
9486 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9487 Remove unnecessary forward static decls.
9488
8f3596a6
AD
94892005-12-27 Akim Demaille <akim@epita.fr>
9490
9491 * src/reader.c (grammar_current_rule_check): Also check that $$
9492 is used.
9493 Take the rule to check as argument, hence rename as...
9494 (grammar_rule_check): this.
9495 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9496 Rename as...
9497 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9498 (grammar_midrule_action, grammar_symbol_append): Now static.
9499 * tests/torture.at (input): Don't rely on the default action
9500 being always performed.
9501 * tests/calc.at: "Set" $$ even when the action is "cut" with
9502 YYERROR or other.
9503 * tests/actions.at (Exotic Dollars): Instead of using unused
9504 values, check that the warning is issued.
9505
721be13c
PE
95062005-12-22 Paul Eggert <eggert@cs.ucla.edu>
9507
9508 * NEWS: Improve wording for unused-value warnings.
9509
a0af42fc
AD
95102005-12-22 Akim Demaille <akim@epita.fr>
9511
9512 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
9513 (b4_yysymprint_generate): Rename as...
9514 (b4_yy_symbol_print_generate): this.
9515 Generate yy_symbol_print instead of yysymprint.
9516 Generate also yy_symbol_value_print, and use it.
9517
affac613
AD
95182005-12-22 Akim Demaille <akim@epita.fr>
9519
721be13c 9520 * NEWS: Warn about unused values.
affac613
AD
9521 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
9522 a `used' member.
9523 (symbol_list_n_get, symbol_list_n_used_set): New.
9524 (symbol_list_n_type_name_get): Use symbol_list_n_get.
9525 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
9526 * src/reader.c (grammar_current_rule_check): Check that values are
9527 used.
9528 * src/symtab.c (symbol_print): Accept 0.
9529 * tests/existing.at: Remove the type information.
9530 Empty the actions.
9531 Remove useless actions (beware of mid-rule actions: perl -000
9532 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
9533 * tests/actions.at (Exotic Dollars): Use unused values.
9534 * tests/calc.at: Likewise.
9535 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9536 Likewise.
9537
9538 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
9539 rule_useful_p.
9540
9d9b8b70
PE
95412005-12-21 Paul Eggert <eggert@cs.ucla.edu>
9542
8bb4c753
PE
9543 Undo 2005-12-01 tentative license wording change. The wording is
9544 still being reviewed by the lawyers, and we don't want to wait for
9545 them before publishing a test release. For now, revert to the
9546 previous wording.
9547 * NEWS: Undo 2005-12-01 change.
9548 * data/glr.c: Revert to previous license wording.
9549 * data/glr.cc: Likewise.
9550 * data/lalr1.cc: Likewise.
9551 * data/location.cc: Likewise.
9552 * data/yacc.c: Likewise.
9553
9d9b8b70
PE
9554 * NEWS: Reword %destructor vs YYABORT etc.
9555 * data/glr.c: Use American spacing, for consistency.
9556 * data/glr.cc: Likewise.
9557 * data/lalr1.cc: Likewise.
9558 * data/yacc.c: Likewise.
9559 * data/yacc.c: Reformat comments slightly.
9560 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
9561 for consistency. Fix some spelling errors and reword recently-included
9562 text slightly.
9563 * tests/cxx-type.at: Cast results of malloc, for C++.
9564
2c3b392a
AD
95652005-12-21 Joel E. Denny <address@hidden>
9566
9567 * tests/cxx-type.at: Construct a tree, count the parents of shared
9568 nodes, and free each node once and only once. Previously, the memory
9569 for semantic values was leaked instead.
9570
d6cff4dc
AD
95712005-12-21 Joel E. Denny <address@hidden>
9572
9573 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
9574 (yylval, yylloc): If pure, #define to yystackp->yyval and
9575 yystackp->yyloc similar to yychar and yynerrs.
9576 (yyparse): If pure, remove local yylval and yylloc. Add local
9577 yystackp to accommodate pure definitions of yylval and yylloc.
9578 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
9579 yylvalp and yyllocp to &yylval and &yylloc.
9580 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
9581 namespace. Previously, nerrs and char were missing, but lval and lloc
9582 weren't necessary.
9583 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
9584 yylvalp and yyllocp parameters since, if pure, these are now always
9585 accessible through yystackp. If not pure, they are still accessible
9586 globally.
9587 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
9588 `if (YYID (N))' to pacify lint.
9589
a85284cf
AD
95902005-12-21 Akim Demaille <akim@epita.fr>
9591
9592 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
9593 destroy the RHS symbols of a rule.
9594 * data/yacc.c (yylen): Initialize to 0.
9595 Keep its value to the number of items to possibly shift.
9596 In particular, a regular successful parse that ends on YYFINAL by
9597 a (internal) YYACCEPT must not have yylen != 0.
9598 (yyerrorlab, yyreturn): Pop the RHS.
9599 Reorder a bit to emphasize the `shifting' bits of code.
9600 (YYPOPSTACK): Now accept a number of items to pop.
9601 * data/lalr1.cc: Likewise.
9602 * data/glr.c: Formatting changes.
9603 Use goto instead of fall through.
9604 * doc/bison.texinfo (Destructor Decl): Complete.
9605
d508c281
JMG
96062005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9607
9608 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9609 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
9610 * djgpp/config.bat: Replace every occurence of the file name
9611 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9612 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9613 * djgpp/config.sed: Replace every occurence of the file name
9614 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9615 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9616 * djgpp/djunpack.bat: DJGPP specific file.
9617 * djgpp/fnchange.lst: DJGPP specific file.
9618 * djgpp/README.in: Add new information about how to unpack the bison
9619 source on MSDOS and other systems which have 8.3 file name restrictions
9620 using djunpack.bat and fnchange.lst.
9621
3e7a2cd9
PE
96222005-12-12 Paul Eggert <eggert@cs.ucla.edu>
9623
9624 * bootstrap (build_cvs_prefix): Remove; unused.
9625 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
9626 when getting gnulib.
9627
96282005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
9629
9630 * data/glr.c: Reorder typedef declarations for structs to match order
9631 of struct declarations.
9632 Rename yystack everywhere to yystackp except in yyparse where it's not
9633 a pointer.
9634 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
9635 consistency.
9636 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
9637 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
9638 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
9639 lint.
9640
877519f8
PE
96412005-12-09 Paul Eggert <eggert@cs.ucla.edu>
9642
0eca5a39
PE
9643 * tests/sets.at (Accept): Fix typos in regular expression used to
9644 sed out the final state number.
9645
2cec9080
PE
9646 Work around portability problem on Solaris 10: flex-generated
9647 files include <stdio.h> before <config.h>, which messes up
9648 because the latter defines __EXTENSIONS__. Address the problem
9649 by creating two new little files that include <config.h> first,
9650 then include the flex-generated files. Rewrite everyone else
9651 to include <config.h> first, as well.
9652 * lib/timevar.c: Always include "config.h".
9653 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
9654 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
9655 (EXTRA_bison_SOURCES): New macro.
9656 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9657 * src/system.h: Don't include config.h.
9658 * src/LR0.c: Include <config.h> first.
9659 * src/assoc.c: Likewise.
9660 * src/closure.c: Likewise.
9661 * src/complain.c: Likewise.
9662 * src/conflicts.c: Likewise.
9663 * src/derives.c: Likewise.
9664 * src/files.c: Likewise.
9665 * src/getargs.c: Likewise.
9666 * src/gram.c: Likewise.
9667 * src/lalr.c: Likewise.
9668 * src/location.c: Likewise.
9669 * src/main.c: Likewise.
9670 * src/muscle_tab.c: Likewise.
9671 * src/nullable.c: Likewise.
9672 * src/output.c: Likewise.
9673 * src/parse-gram.y: Likewise.
9674 * src/print.c: Likewise.
9675 * src/print_graph.c: Likewise.
9676 * src/reader.c: Likewise.
9677 * src/reduce.c: Likewise.
9678 * src/relation.c: Likewise.
9679 * src/state.c: Likewise.
9680 * src/symlist.c: Likewise.
9681 * src/symtab.c: Likewise.
9682 * src/tables.c: Likewise.
9683 * src/uniqstr.c: Likewise.
9684 * src/vcg.c: Likewise.
9685
877519f8
PE
9686 * src/parse-gram.y: Fix minor problems uncovered by lint.
9687 (current_lhs, current_lhs_location): Now static.
9688 (current_assoc): Remove unused variable.
9689
9690 Cleanups so that Bison-generated parsers have less lint.
9691 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9692 Prepend /*ARGSUSED*/, for lint's sake.
9693 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9694 definition if 'lint' is defined.
9695 (YYID): New macro (or function, if lint).
9696 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9697 * data/yacc.c: Likewise.
9698 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9699 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9700 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9701 is C++ only.
9702 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9703 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9704 Use YYID(0) rather than 0, for lint.
9705 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9706 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9707
f5228370
PE
97082005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9709
9710 * tests/glr-regression.at
9711 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9712 Close memory leak reported by twlevo.
9713
69ce078b
PE
97142005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9715
6ff99711
PE
9716 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9717 all stacks.
9718 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
9719 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9720 New test case.
9721 (Duplicated user destructor for lookahead): This test now is expected
9722 to succeed.
9723
af3412cd
PE
97242005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9725
32b5b719 9726 * NEWS: Document the following change.
af3412cd
PE
9727 * data/yacc.c: Say "parser skeleton" rather than "file", since
9728 it's no longer just a file.
9729 * data/glr.c: Grant a special exception for C GLR parsers, that
9730 reads like the already-existing exception for C LALR(1) parsers.
9731 * data/glr.cc: Likewise.
9732 * data/lalr1.cc: Likewise.
9733 * data/location.cc: Likewise.
9734 * data/yacc.c: Reword the "written by" statement to clarify that
9735 it was the parser skeleton, not the entire output file.
9736 * data/glr.c: Written by Paul Hilfinger.
9737 * data/glr.cc: Written by Akim Demaille.
9738 * data/lalr1.cc: Likewise.
9739
035aa4a0
PE
97402005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9741
d9963c85
PE
9742 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9743 Fix typos in previous change that broke 'make check'.
9744 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9745 supported in C.
9746 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9747 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9748 We can revert this once things settle down.
9749
035aa4a0
PE
9750 * src/conflicts.c (conflicts_print): Don't print file name twice
9751 when %expect fails because there were no conflicts.
9752 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9753 change.
9754 * tests/conflicts.at (%expect not enough, %expect too much):
9755 (%expect with reduce conflicts): Adjust to new behavior.
9756
97572005-11-18 Akim Demaille <akim@epita.fr>
9758
9759 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9760 errors.
9761 * NEWS: Document this.
9762 * doc/bison.texinfo (Expect Decl): Likewise.
9763
d1ff7a7c
AD
97642005-11-16 Akim Demaille <akim@epita.fr>
9765
9766 Generalize the display of semantic values and locations in traces.
9767 * data/glr.c (yy_reduce_print): Fix indices (again).
9768 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9769 literal integers.
9770 * data/lalr1.cc (yyreduce_print): Rename as...
9771 (yy_reduce_print): this.
9772 Display values and locations.
9773 * data/yacc.c (yy_reduce_print): Likewise.
9774 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9775 (yysymprint): Move higher to be visible from yy_reduce_print).
9776 (yyparse): Adjust.
9777 * tests/calc.at: Adjust the expected length of the traces.
9778
6de5398d
AD
97792005-11-14 Akim Demaille <akim@epita.fr>
9780
9781 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9782 from 1 to N, while values and location start at 0.
9783 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9784
a1373f55
AD
97852005-11-14 Akim Demaille <akim@epita.fr>
9786
9787 * data/glr.c (yy_reduce_print): Fix the $ number.
9788
613d8952
AD
97892005-11-14 Akim Demaille <akim@epita.fr>
9790
9791 "Use" parse parameters.
9792 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9793 * data/glr.c, data/glr.cc: Use them.
9794 * data/glr.c (YYUSE): Have a C++ definition that supports
9795 non-pointer types.
9796
b2741627
AD
97972005-11-14 Akim Demaille <akim@epita.fr>
9798
9799 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9800
5059b5c8
AD
98012005-11-14 Akim Demaille <akim@epita.fr>
9802
42249483
AD
9803 * data/glr.cc: New.
9804 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 9805
4626a15d
AD
98062005-11-12 Akim Demaille <akim@epita.fr>
9807
9808 Let position and location be PODs.
9809 * data/location.cc (position::initialize, location::initialize): New.
9810 (position::position, location::location): Define only if
9811 b4_location_constructors is defined.
9812 * data/lalr1.cc (b4_location_constructors): Define it for backward
9813 compatibility.
9814 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9815
98162005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
9817
9818 * data/lalr1.cc: Move the body of the ctor and dtor into the
9819 parser file (instead of the header).
9820 Wrap the implementations in a "namespace yy".
9821
98222005-11-12 Akim Demaille <akim@epita.fr>
9823
9824 Have glr.c include its header file when created.
9825 * data/glr.c (b4_shared_declarations): New.
9826 Output them verbatim in the parser if !%defines, otherwise
9827 output then in the header file, and include it instead.
9828
1989d947
AD
98292005-11-11 Akim Demaille <akim@epita.fr>
9830
9831 * data/glr.c: Comment changes.
9832
98332005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
9834
9835 When yydebug, report semantic and location values for reductions.
9836 * data/glr.c (yy_reduce_print): Report the semantic values and the
9837 locations.
9838 (YY_REDUCE_PRINT): Adjust.
9839 (yyglrReduce): Use them.
9840 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9841 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9842 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9843 traces.
9844
02998094
AD
98452005-11-10 Akim Demaille <akim@epita.fr>
9846
9847 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9848 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9849 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
9850
5210672f
PE
98512005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
9852
9853 * m4/cxx.m4, examples/Makefile.am: Don't build
9854 examples/calc++ if no C++ compiler is available. (trivial change)
9855
a8991a1d
AD
98562005-11-09 Akim Demaille <akim@epita.fr>
9857
9858 * src/scan-skel.l: Use a couple of asserts.
9859
36b5e963
AD
98602005-11-03 Akim Demaille <akim@epita.fr>
9861
9862 In some (weird) cases, the final state number is incorrect.
9863 Reported by Alexandre Duret-Lutz.
9864 * src/LR0.c (state_list_append): Remove the computation of
9865 final_state.
9866 (save_reductions): Do it here.
9867 (get_state): Alpha conversion.
9868 (generate_states): Use a for loop.
9869 * src/gram.h (item_number_is_rule_number)
9870 (item_number_is_symbol_number): New.
9871 * src/state.c: Use assert.
9872 * src/system.h: Include assert.h.
9873 * tests/sets.at (Accept): New.
9874
44e7ead1
PH
98752005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9876
9877 * data/glr.c (yyfill): Adjust comment.
36b5e963 9878 (yyresolveAction): Initialize default location properly
44e7ead1
PH
9879 for empty right-hand sides.
9880 (yydoAction): Ditto.
9881 Add comment explaining apparently dead code.
36b5e963
AD
9882 * tests/glr-regression.at
9883 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 9884 New test.
36b5e963 9885
e10a80ee
PE
98862005-10-30 Paul Eggert <eggert@cs.ucla.edu>
9887
9888 * bootstrap (cleanup_gnulib): New function. Use it to clean up
9889 gnulib when interrupted. This fixes some race conditions and
9890 works around some portability problems (one noted by Paul
9891 Hilfinger).
9892
067b32ee
AD
98932005-10-22 Akim <akim@epita.fr>
9894
9895 * Makefile.cfg: Adjust to config -> build-aux.
9896 Reported by twledo.
9897
4b367315
AD
98982005-10-21 Akim Demaille <akim@epita.fr>
9899
9900 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
9901 the %parse-params.
9902 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
9903 * data/yacc.c (b4_Pure_if): Rename as...
9904 (b4_yacc_pure_if): this.
9905 (YY_SYMBOL_PRINT, yyparse): Adjust.
9906 * doc/bison.texinfo: Formatting changes.
9907
24cc23d9
AD
99082005-10-21 Akim Demaille <akim@epita.fr>
9909
9910 Finish the transition config -> build-aux.
9911 * configure.ac, Makefile.am: Use build-aux.
9912 * config/prev-version, config/announce-gen, config/Makefile.am:
9913 Move to...
9914 * build-aux/prev-version, build-aux/announce-gen,
9915 * build-aux/Makefile.am: here.
9916
d4476375
AD
99172005-10-14 Akim Demaille <akim@epita.fr>
9918
9919 * examples/calc++/test: Use set -x only when VERBOSE.
9920
302c0aee
PE
99212005-10-13 Paul Eggert <eggert@cs.ucla.edu>
9922
9923 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
9924 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
9925
7625ec2c
AD
99262005-10-13 Akim Demaille <akim@epita.fr>
9927
9928 * src/scan-skel.l: Output the base name parts of the parser and
9929 header file names.
302c0aee 9930 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
9931 additional checks.
9932 Use this to exercise C++ outputs in subdirs.
9933 Reported by Oleg Smolsky.
9934
ba0fe3c7
PE
99352005-10-12 Paul Eggert <eggert@cs.ucla.edu>
9936
9937 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
9938 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
9939 Problem reported by John P. Hartmann.
9940 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
9941 already defined it.
9942
9b8a5ce0
AD
99432005-10-12 Akim Demaille <akim@epita.fr>
9944
9945 * src/parse-gram.y (version_check): Exit 63 to please missing
9946 (stands for "version mismatch).
9947 * tests/input.at, doc/bison.texinfo: Adjust.
9948
4f6e011e
PE
99492005-10-10 Paul Eggert <eggert@cs.ucla.edu>
9950
9951 Work around portability problems with Visual Age C compiler
9952 (xlc and xlC_r) reported by John P. Hartmann.
9953 * data/location.cc (initial_column, initial_line): Remove.
9954 All uses replaced by 0 and 1.
9955 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
9956 that xlc complains about.
9957 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 9958 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 9959 as __STDC__.
4d7aa45e
PE
9960 * data/yacc.c (YYMODERN_C): New macro, which also looks at
9961 __STDC_VERSION__. Use it everywhere instead of looking at
9962 __STDC__ and __cplusplus.
4f6e011e 9963
a1b3bf8c
AD
99642005-10-10 Akim Demaille <akim@epita.fr>
9965
9966 * examples/calc++/test: Be quiet unless VERBOSE.
9967
412e44aa
PE
99682005-10-05 Paul Eggert <eggert@cs.ucla.edu>
9969
2a4647a3
PE
9970 * data/c.m4 (yydestruct, yysymprint):
9971 Use YYUSE instead of casting to void.
9972 * data/glr.c (YYUSE): New macro.
9973 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
9974 Use it instead of rolling our own.
9975 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9976 (YYCHK1):
9977 Use /*CONSTCOND*/ to suppress lint warnings.
9978 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
9979 (YY_STACK_PRINT): Use 'false' not '0'.
9980 (YYUSE): New macro.
9981 (yysymprint_, yydestruct_): Use it instead of rolling our own.
9982 * data/yacc.c (YYUSE): New macro.
9983 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
9984 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
9985 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
9986
9987
412e44aa
PE
9988 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
9989 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
9990
88c6637f
PE
99912005-10-04 Paul Eggert <eggert@cs.ucla.edu>
9992
2f4f028d
PE
9993 Undo the parts of the unlocked-I/O change that substituted
9994 putc or puts for printf. This might hurt performance a bit,
9995 but some people prefer the printf style.
9996 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
9997 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
9998 All uses replaced by YYFPRINTF and YYDPRINTF.
9999 * data/yacc.c: Likewise.
10000 * lib/bitset.c (bitset_print): Likewise.
10001 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10002 putc and puts.
10003 * lib/lbitset.c (debug_lbitset): Likewise.
10004 * src/closure.c (print_firsts, print_fderives): Likewise.
10005 * src/gram.c (grammar_dump): Likewise.
10006 * src/lalr.c (look_ahead_tokens_print): Likewise.
10007 * src/output.c (escaped_output): Likewise.
10008 (user_actions_output): Break apart two printfs.
10009 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10010 * src/reduce.c (reduce_print): Likewise.
10011 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10012 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10013
88c6637f
PE
10014 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10015 Use assignments rather than casts-to-void to suppress
10016 unused-variable warnings. This pacifies 'lint'.
10017 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10018 unused-variable warnings.
10019
fb32e373
JMG
100202005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10021
10022 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10023
edb8f44f
PE
100242005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10025
fb9c0b33
PE
10026 Use unlocked I/O for a minor performance improvement on hosts like
10027 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10028 is to use the gnlib unlocked-io module, and to prefer putc and
10029 puts to printf when either will work (since the latter doesn't
10030 come in an unlocked flavor).
10031 * bootstrap (gnulib_modules): Add unlocked-io.
10032 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10033 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10034 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10035 and similarly for puts and putc and printf.
10036 * data/yacc.c: Likewise.
10037 * lib/bitset.c (bitset_print): Likewise.
10038 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10039 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10040 to printf.
10041 * lib/lbitset.c (debug_lbitset): Likewise.
10042 * src/closure.c (print_firsts, print_fderives): Likewise.
10043 * src/gram.c (grammar_dump): Likewise.
10044 * src/lalr.c (look_ahead_tokens_print): Likewise.
10045 * src/output.c (escaped_output): Likewise.
10046 (user_actions_output): Coalesce two printfs.
2f4f028d 10047 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
10048 * src/reduce.c (reduce_print): Likewise.
10049 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 10050 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 10051
edb8f44f
PE
10052 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10053 this confuses xgettext.
10054
b50d2359
AD
100552005-10-02 Akim Demaille <akim@epita.fr>
10056
10057 * bootstrap (gnulib_modules): Add strverscmp.
10058 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10059 * m4/.cvsignore: Add strverscmp.m4.
10060 * src/parse-gram.y (%require): New token, new rule.
10061 (version_check): New.
10062 * src/scan-gram.l (%require): Adjust.
10063 * tests/input.at (AT_REQUIRE): New.
10064 Use it.
10065 * doc/bison.texinfo (Require Decl): New.
10066 (Calc++ Parser): Use %require.
10067
21667f64
AD
100682005-10-02 Akim Demaille <akim@epita.fr>
10069
10070 * data/location.cc: New.
10071
2b81e969
AD
100722005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10073 Akim Demaille <akim@epita.fr>
10074
10075 Make sure -odir/foo.cc creates dir/location.hh etc.
10076 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10077 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10078 (spec_defines_file): Now const.
10079 (dir_prefix): New.
10080 (short_base_name): Remove.
10081 * src/files.c: Adjust.
10082 (dirname.h): Include.
10083 (base_name): Don't prototype it.
10084 (finput): Remove, duplicates gram_in.
10085 (full_base_name, short_base_name): Replace by...
10086 (all_but_ext, all_but_tab_ext): these.
10087 (compute_base_names): Rename as...
10088 (compute_file_name_parts): this.
10089 Update to compute the new variables, including dir_prefix.
10090 Adjust dependencies.
10091 * src/output.c (prepare): Output them.
10092 * src/reader.c: Adjust to use gram_in, not finput.
10093 * src/scan-skel.l (@dir_prefix@): New.
10094
ad6a9b97
JMG
100952005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10096
10097 * lib/subpipe.c: New function end_of_output_subpipe() added
10098 to allow support for non-posix systems. This is a no-op function
10099 for posix systems.
10100
10101 * lib/subpipe.h: New function end_of_output_subpipe() added
10102 to allow support for non-posix systems. This is a no-op function
10103 for posix systems.
10104
10105 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10106 handle the lack of pipe/fork functionality on non-posix systems.
10107
10108 * djgpp/Makefile.maint: DJGPP specific file.
10109
10110 * djgpp/README.in: DJGPP specific file.
10111
10112 * djgpp/config.bat: DJGPP specific configuration file.
10113
10114 * djgpp/config.sed: DJGPP specific configuration file.
10115
10116 * djgpp/config.site: DJGPP specific configuration file.
10117
10118 * djgpp/config_h.sed: DJGPP specific configuration file.
10119
10120 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
10121
10122 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
10123
fc695704
AD
101242005-10-02 Akim Demaille <akim@epita.fr>
10125
10126 * data/location.cc: New, extract from...
10127 * data/lalr1.cc: here.
10128 (location.hh): Include it after the user prologue, in case the
10129 filename type is defined by the user.
10130 Forward declation location and position before the pre-prologue.
10131 (yyresult_): Rename as...
10132 (yyresult): this, it's a local variable, not an attribute.
10133 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
10134
101352005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
10136
10137 * examples/extexi: Restore the #line generation.
10138
fb9712a9
AD
101392005-09-30 Akim Demaille <akim@epita.fr>,
10140 Alexandre Duret-Lutz <adl@gnu.org>
10141
10142 Move the token type and YYSTYPE in the parser class.
10143 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
10144 (parser::token): New, from the moved free definition of tokens.
10145 (parser::semantic_value): Now a full definition instead of an
10146 indirection to YYSTYPE.
10147 (b4_post_prologue): No longer included in the header file, but
10148 in the implementation file.
10149 * doc/bison.texi (C+ Language Interface): Update.
10150 * src/parse-gram.y: Support unary %define.
10151 * tests/actions.at: Define global_tokens_and_yystype for backward
10152 compatibility until we update the tests.
10153 * tests/calc.at: Idem.
10154 (first_line, first_column, last_line, last_column): Define for lalr1.cc
10155 to simplify the code.
10156
55f0c7b1
PE
101572005-09-29 Paul Eggert <eggert@cs.ucla.edu>
10158
10159 Port to SunOS 4.1.4, which lacks strtoul and strerror.
10160 Ah, the good old days! Problem reported by Peter Klein.
10161 * bootstrap (gnulib_modules): Add strerror, strtoul.
10162 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
10163 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
10164
fb9712a9 101652005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
10166
10167 * data/c.m4 (b4_error_verbose_if): New.
10168 * data/lalr1.cc: Use it.
10169 (YYERROR_VERBOSE_IF): Remove.
10170 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
10171 parser members, replaced by...
10172 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
10173 local variables.
10174 (yysyntax_error_): Takes the state number as argument.
10175 (yyreduce_print_): Use the argument yyrule, not the former
10176 attribute yyn_.
10177
8a6f72f3
PE
101782005-09-26 Paul Eggert <eggert@cs.ucla.edu>
10179
10180 * bootstrap (gnulib_modules): Add verify.
10181 * lib/.cvsignore: Add verify.h.
10182 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
10183 * src/system.h (verify): Remove.
10184 Include verify.h instead.
10185 * src/tables.c (tables_generate): Use new API for 'verify'.
10186
0d50976f
PE
101872005-09-21 Paul Eggert <eggert@cs.ucla.edu>
10188
ebc3737e
PE
10189 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
10190 local variables whose names begin with 'yy'.
10191 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10192 Trivial changes from Joel E. Denny.
10193
0d50976f
PE
10194 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
10195 it itself.
10196 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
10197 don't use alloca any more.
10198
10199 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
10200 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 10201 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
10202 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
10203 to match yacc.c, to test more hosts.
10204
a05b79df
PE
102052005-09-20 Paul Eggert <eggert@cs.ucla.edu>
10206
55289366
PE
10207 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
10208 doesn't affect behavior.
10209 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
10210 Solaris, AIX, MSC.
10211 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
10212 This works a bit better with glibc, if user code has already included
10213 stdlib.h.
10214 * doc/bison.texinfo (Bison Parser): Document that users can't
10215 arbitrarily use malloc and free for other purposes. Document
10216 that <alloca.h> and <malloc.h> might be included.
10217 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
10218 user must declare alloca.
10219
a05b79df
PE
10220 * HACKING (release): Forwarn the Translation Project about
10221 stable releses.
10222
3ab2ca22
AD
102232005-09-20 Akim Demaille <akim@epita.fr>
10224
10225 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
10226
a9739e7c
PE
102272005-09-19 Paul Eggert <eggert@cs.ucla.edu>
10228
a702593e
PE
10229 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
10230 (YYSTACK_ALLOC_MAXIMUM): Use it.
10231 (yysyntax_error): New function.
10232 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
10233 multiple syntax errors are reported, and alloca is being used.
10234 Instead, reallocate buffers twice as big each time, so that
10235 we waste at most half the allocated memory. Start with a small
10236 (128-byte) buffer that will suffice in most cases anyway.
10237 Use yysyntax_error to do most of the work.
10238
10239 * doc/bison.texinfo (Error Reporting, Table of Symbols):
10240 yynerrs is the number of errors reported, not the number of
10241 errors encountered.
10242
a9739e7c
PE
10243 * tests/glr-regression.at (Duplicated user destructor for lookahead):
10244 Mark it as expected to fail.
10245 Cast result of malloc; problem reported by twlevo@xs4all.nl.
10246 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
10247 Don't start user-code symbols with "yy", to avoid name space problems.
10248
f479c6c6
AD
102492005-09-19 Akim Demaille <akim@epita.fr>
10250
10251 Remove the traits, failed experiment.
10252 It never proved useful, and anyway because of the current
10253 definition, it was not possible to have several specialization of
10254 this traits, making it useless.
10255 * data/lalr1.cc (yy:traits): Remove.
10256 Inline its definitions in the parser class.
10257
e2586f82
AD
102582005-09-19 Akim Demaille <akim@epita.fr>
10259
10260 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
10261 least Mac OSX with a /usr/local install of gettext.
10262
2e8cf949
AD
102632005-09-19 Akim Demaille <akim@epita.fr>
10264
10265 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
10266 and yytoken for similarity with the other skeletons.
10267
c7fb0b90
AD
102682005-09-19 Akim Demaille <akim@epita.fr>
10269
4e26c69e 10270 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 10271
1bd0deda
PE
102722005-09-16 Paul Eggert <eggert@cs.ucla.edu>
10273
10274 * NEWS: Version 2.1.
10275
10276 * NEWS: Remove notice of yytname change, since it was never in an
10277 official release.
10278 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
10279 diagnostic.
10280 * src/output.c (prepare): Likewise.
10281 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
10282 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
10283 is not defined. This is an awful hack, but it's enough for now.
10284 All callers changed.
10285 * tests/glr-regression-at (make_value): Args are const pointers now,
10286 to avoid GCC warning.
10287 (Duplicated user destructor for lookahead): New test. Currently
10288 skipped. It fails on my host but I'm not sure it'll always fail.
10289
102902005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
10291
10292 * src/symtab.h (struct symbol): Declare the printer and destructor
10293 as const, to avoid accidental calls to free.
10294 (symbol_destructor_set, symbol_printer_set): Adjust.
10295 * src/symtab.c: Adjust.
10296
1bd0deda 102972005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
10298
10299 * data/c.m4 (b4_token_enums): New.
10300 (b4_token_defines): Rename as...
10301 (b4_token_enums_defines): this.
10302 (b4_token_defines): New, output only the #defines.
10303 * data/yacc.c, data/glr.c: Adjust.
10304 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
10305 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
10306 as default values.
10307
dbcdae2d
AD
103082005-09-16 Akim Demaille <akim@epita.fr>
10309
10310 * data/lalr1.cc (yylex_): Remove, inline its code.
10311 (yyreport_syntax_error_): Remove, replaced by...
10312 (yysyntax_error_): this which returns a string and leaves to the
10313 caller the call to the users' error function.
10314 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
10315 Move from members of the parser object...
10316 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
10317 to local variables of the parse function.
10318
70d8f291
AD
103192005-09-16 Akim Demaille <akim@epita.fr>
10320
10321 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
10322 since it's in Bison's name space.
10323
b47dbebe
PE
103242005-09-15 Paul Eggert <eggert@cs.ucla.edu>
10325
ae199bf1
PE
10326 * data/glr.c (yyresolveValue): Add default case to pacify
10327 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
10328
b47dbebe
PE
10329 * NEWS: Document when yyparse started to return 2.
10330 * doc/bison.texinfo (Parser Function): Document when yyparse
10331 returns 2.
10332
10333 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
10334 (b4_filename_type): Renamed back from b4_file_name_type. All uses
10335 changed.
10336 (class position): file_name -> filename (reverting). All uses changed.
10337
103382005-09-14 Paul Eggert <eggert@cs.ucla.edu>
10339
10340 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
10341 do anything if $@ exists. This reverts part of the 2005-07-07
10342 patch.
10343
00292f66
PE
103442005-09-11 Paul Eggert <eggert@cs.ucla.edu>
10345
10346 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
10347 contains obsolete information and isn't worth distributing as a
10348 separate file anyway.
10349 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
10350 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
10351 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
10352 (yyparse): Abort if user code uses longjmp to throw an unexpected
10353 value.
10354
a420f962
PE
103552005-09-09 Paul Eggert <eggert@cs.ucla.edu>
10356
00292f66
PE
10357 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
10358 Suggested by twlevo@xs4all.nl.
10359
127287e9
PE
10360 * data/glr.c (YYCHK1): Do not assume YYE is in range.
10361 This avoids a diagnostic from gcc -Wswitch-enum.
10362 Problem reported by twlevo@xs4all.nl.
10363
a420f962
PE
10364 * doc/bison.texinfo: Don't use "filename", as per GNU coding
10365 standards. Use "file name" or "file" or "name", depending on
10366 the context.
10367 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
10368 not to hack/foo.tab.c.
10369 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
10370 * data/glr.c: b4_filename -> b4_file_name.
10371 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
10372 All uses changed.
10373 (class position): filename -> file_name. All uses changed.
10374 * data/yacc.c: b4_filename -> b4_file_name.
10375 * lib/bitset.h: filename -> file_name in local vars.
10376 * lib/bitset_stats.c: Likewise.
10377 * src/files.c: Likewise.
10378 * src/scan-skel.l ("@output ".*\n): Likewise.
10379 * src/files.c (file_name_split): Renamed from filename_split.
10380 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
10381
103822005-09-08 Paul Eggert <eggert@cs.ucla.edu>
10383
10384 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
10385 to accommodate latest gnulib.
10386
10387 * tests/glr-regression.at (Duplicate representation of merged trees):
10388 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
10389
10390 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
10391 needed.
10392
42a6501d
PE
103932005-08-26 Paul Eggert <eggert@cs.ucla.edu>
10394
10395 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
10396 All uses changed. Invoke user destructor after an error during a
10397 split parse (trivial change from Joel E. Denny).
10398
10399 * tests/glr-regression.at
10400 (User destructor after an error during a split parse): New test case.
10401 Problem reported by Joel E. Denny in:
10402 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
10403
ef9a1faf
PE
104042005-08-25 Paul Eggert <eggert@cs.ucla.edu>
10405
5b4aaf78
PE
10406 * README-cvs: Give URLs for recommended tools.
10407 Mention Gzip version problem, and bootstrapping issues.
10408 Remove troubleshooting section, as it's somewhat obsolete.
10409
b5240ba5
PE
10410 * bootstrap (no_cache): New var, to accommodate different wget
10411 variants. Use it instead of '-C off'. Problem reported by
10412 twlevo@xs4all.nl.
10413
ef9a1faf
PE
10414 * data/glr.c (yydestroyStackItem): New function.
10415 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
10416 debugging information. Problem reported by Joel E. Denny.
10417
e6efa9da
AD
104182005-08-25 Akim Demaille <akim@epita.fr>
10419
10420 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
10421
adc90f13
PE
104222005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10423
10424 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10425 Don't invoke destructor on unresolved entries.
10426 * tests/glr-regression.at
10427 (User destructor for unresolved GLR semantic value): New test case.
10428 Problem reported by Joel E. Denny in:
10429 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10430
f9315de5
PE
104312005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10432
15d29c1f
PE
10433 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10434 Add strnlen.c.
10435 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10436 lib-prefix.m4, po.m4.
10437
dd5f2af2
PE
10438 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10439 in yydestruct diagnostic, since it might not be an error.
10440 Problem reported by Joel Denny near end of
10441 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 10442 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
10443 * data/yacc.c (yyreturn): Likewise.
10444 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10445
10446 * src/files.c: Remove obsolete FIXME comment.
10447
10448 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10449 with the other templates, and to fix bogus run-on messages such
10450 as the one reported at the end of
10451 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10452 All callers changed to avoid the newline.
10453 (yyprocessOneStack): Output two lines rather than one, to accommodate
10454 the above change. This changes the debug output format slightly.
10455
f9315de5
PE
10456 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10457 reported by Joel E. Denny in
10458 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10459 (trivial change).
10460 * tests/glr-regression.at (Duplicate representation of merged trees):
10461 New test, from Joel E. Denny in:
10462 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10463 * THANKS: Add Joel E. Denny.
10464
10465 * configure.ac (AC_INIT): Bump to 2.0c.
10466
04098407
PE
104672005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10468
10469 * NEWS: Version 2.0b.
10470
ca5d2013
PE
10471 * Makefile.am (SUBDIRS): Put examples before tests, so that
10472 "make check" doesn't finish with "All 1 tests passed".
10473
3d54b576
PE
10474 * tests/regression.at (Token definitions): Don't rely on
10475 AT_PARSER_CHECK for data that contains backslashes. It currently
10476 uses 'echo', and 'echo' isn't portable if its argument contains
10477 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10478 that the byte '\0xff' is not printable in the C locale; it is,
10479 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10480 not printable, so use '\0x81' to test.
10481
d53ae497
PE
10482 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10483 version of GCC, since the macro is used with non-GCC compilers.
10484
fc01665e
PE
10485 Fix core dump reported by Pablo De Napoli in
10486 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10487 * tests/regression.at (Invalid inputs with {}): New test.
10488 * src/parse-gram.y (token_name): Translate type before using
10489 it as an index.
10490
04098407
PE
10491 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10492 the user's name space. All uses changed to __attribute__
10493 ((__unused__)).
10494 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10495 Add __attribute__ ((__noreturn__)).
10496
10497 * etc/clcommit: Remove. We weren't using it, and it failed
10498 "make maintainer-distcheck".
10499 * Makefile.maint: Merge from coreutils.
10500 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10501 (syntax-check-rules): Change list of rules as described below.
10502 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10503 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10504 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10505 (sc_trailing_space): New rules.
10506 (sc_xalloc_h_in_src): Remove.
10507 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
10508 (sc_space_tab, sc_error_exit_success, sc_changelog):
10509 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
10510 (makefile-check, po-check, author_mark_check):
10511 (makefile_path_separator_check, copyright-check):
10512 Use grep -n, to make it easier to find violations.
10513 Use CVS_LIST and CVS_LIST_EXCEPT.
10514 (header_regexp, h_re): Remove.
10515 (dd_c): New macro.
10516 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
10517 (my-distcheck): Use more-modern GCC flags.
10518 (signatures, %.asc): Remove.
10519 (rel-files, announcement): Remove signatures.
10520 Restore old updating code, even though we don't use it, so
10521 that we're the same as coreutils.
10522 (alpha, beta, major): Depend on news-date-check.
10523 Make the upload commands.
10524
10525 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
10526 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
10527 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
10528 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
10529 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
10530 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
10531 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
10532 * tests/sets.at: Likewise.
10533
10534 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
10535 we comment out the Autoconf version number.
10536 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
10537 it's error-prone and "make maintainer-distcheck" rejects it.
10538
10539 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
10540 Indent calls to "error" to pacify "make maintainer-distcheck",
10541 when the calls are not intended to be translated.
10542 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
10543
10544 * src/Makefile.am (DEFS): Use +=, to pacify
10545 "make maintainer-distcheck".
10546 (bison_SOURCES): Add scan-skel.h.
10547 (sc_tight_scope): New rule, from coreutils.
10548
10549 * src/files.c (src_extension, header_extension):
10550 Now static, not extern.
10551 * src/getargs.c (short_options): Likewise.
10552 * src/muscle_tab.c (muscle_table): Likewise.
10553 * src/parse-gram.y (current_class, current_type, current_prec):
10554 Likewise.
10555 * src/reader.c (grammar_end, previous_rule_end): Likewise.
10556 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
10557 * src/main.c (main): Cast bindtextdomain and textdomain calls to
10558 void, to avoid warning when NLS is disabled.
10559 * src/output.c: Include scan-skel.h.
10560 (scan_skel): Remove decl, since scan-skel.h does this.
10561 (output_skeleton):
10562 Indent calls to "error" to pacify "make maintainer-distcheck".
10563 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
10564 * src/reader.h (gram_end, gram_lineno): New decls to pacify
10565 "make maintainer-distcheck".
10566 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
10567 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
10568 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
10569 (skel_lex_destroy, scan_skel): Move these decls to...
10570 * src/scan-skel.h: New file.
10571 * src/uniqstr.c (uniqstr_assert):
10572 Indent calls to "error" to pacify "make maintainer-distcheck".
10573
10574 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
10575 not @VAR@.
10576
10577 * tests/torture.at: Revamp to avoid misuse of atoi that
10578 "make maintainer-distcheck" complained about.
10579
10580 * examples/extexi (message): Don't print a message more than once,
10581 and omit line-number decoration that makes Emacs compile think
10582 that informative messages are worth worrying about.
10583
105842005-07-22 Paul Eggert <eggert@cs.ucla.edu>
10585
10586 * configure.ac: Update version number.
10587
10588 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
10589 accidentally.
10590 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
10591 autogenerated by the maintainer.
10592 * examples/calc++/.cvsignore: Add *.yy.
10593
10594 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
10595 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10596 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10597
10598 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
10599
10600 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
10601 from maintainer-distcheck about casting the argument of 'free'.
10602
10603 * NEWS: Mention recent yytname changes.
10604 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
10605
10606 * bootstrap: For translations that have not yet been upgraded to
10607 the new runtime-po domain, prime the pump by extracting the
10608 relevant strings from the obsolete translations. This code can be
10609 removed once the bison-runtime domain has been translated by each
10610 team.
10611
10612 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
10613 now that token names are already quoted.
10614
10615 Fix problem reported by Anthony Heading.
10616 * data/glr.c (YYTOKEN_TABLE): New macro.
10617 (yytname): Define if YYTOKEN_TABLE.
10618 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
10619 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
10620 (YYERROR_VERBOSE): Define the same way the other skeletons do.
10621 * src/output.c (prepare_symbols): Output token_table_flag.
10622
0ffda363
PE
106232005-07-21 Paul Eggert <eggert@cs.ucla.edu>
10624
10625 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
10626 again if the first call fails.
10627
10628 * data/glr.c (yytnamerr): New function.
10629 (yyreportSyntaxError): Use it to dequote most string literals.
10630 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
10631 with other skeletons. All uses changed.
10632 (yytnameerr_): New function.
10633 (yyreport_syntax_error): Use it to dequote most string literals.
10634 * data/yacc.c (yytnamerr): New function.
10635 (yyerrlab): Use it to decode most string literals.
10636 * doc/bison.texinfo (Decl Summary, Calling Convention):
10637 Clarify quoting convention of yytname.
10638 * src/output.c (prepare_symbols): Quote all names. This undoes
10639 the 2005-04-17 change, which is now accomplished (mostly) via
10640 changes in the parsers as described above.
10641 * tests/regression.at (Token definitions, Web2c Actions):
10642 Undo most 2005-04-17 change here, too.
10643
106442005-07-20 Paul Eggert <eggert@cs.ucla.edu>
10645
10646 Fix more problems reported by twlevo@xs4all.nl.
10647 * tests/cxx-type.at: Don't pipe output of ./types through sed to
10648 remove trailing spaces. This loses the exit status of ./types,
10649 and isn't needed since ./types shouldn't be emitting trailing
10650 spaces.
10651 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
10652 as the stack isn't valid in that case.
10653
10654 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10655 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10656 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10657 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10658 is used.
10659 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10660 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10661 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10662 Likewise.
10663
10664 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10665 overly-picky compilers that reject 'char *foo = "bar";'.
10666
10667 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10668 to FILE * parameter, not to stderr. This fixes a typo introduced
10669 in the 2005-07-12 change.
10670
10671 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10672 warnings from GCC 4.
10673
10674 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10675 (yyglrShiftDefer, yysplitStack):
10676 Remove unused parameters b4_pure_formals. All uses changed.
10677 (yyglrShift): Remove unused parameters b4_user_formals.
10678 All uses changed.
10679 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10680
6100a9aa
PE
106812005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10682
258b75ca
PE
10683 Destructor cleanups and regularization among the three skeletons.
10684 * NEWS: Document the behavior changes.
10685 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10686 stack before failing, as the cleanup code will do it for us now.
10687 * data/lalr1.cc (yyerrlab): Likewise.
10688 * data/glr.c (yyparse): Pop everything off the stack before
10689 freeing it, so that destructors get called properly.
10690 * data/lalr1.cc (yyreturn): Likewise.
10691 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10692 This is more consistent.
10693 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10694 why destructors might be called. 1.875 -> 2.1.
10695 (Destructor Decl, Decl Summary, Table of Symbols):
10696 Some English-language cleanups for %destructor.
10697 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10698 Add output line for destructor of start symbol.
10699 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10700 because of that same extra output line.
10701
1a059451
PE
10702 * NEWS: Document minor wording changes in diagnostics of
10703 Bison-generated parsers.
10704 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10705 Remove unused formals. All uses changed.
10706 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10707 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10708 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10709 Rename yyoverflowab to yyexhaustedlab.
10710 When memory exhaustion occurs during syntax-error reporting,
10711 report it separately rather than in a single diagnostic; this
10712 eases translation.
10713 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10714 (Memory Exhausted): Renamed from Parser Stack Overflow.
10715 Revamp wording slightly to prefer "memory exhaustion".
10716 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10717
97460c78
PE
10718 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10719
30757c8c
PE
10720 Add i18n support to the GLR skeleton. Partially fix the C++
10721 skeleton; a C++ expert needs to finish this. Remove debugging
10722 msgids; there's little point to having them translated, since they
10723 can be understood only by someone who can read the
10724 (English-language) source code.
10725
10726 Generate runtime-po/bison-runtime.pot automatically, so that we
10727 don't have to worry about garbage getting in that file. We'll
10728 make sure after the next official release that old msgids don't
10729 get lost. See
10730 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10731
10732 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10733 Now auto-generated.
10734 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10735 Fix typos in explanations of the runtime file.
10736 * bootstrap: Change gettext keyword from YYI18N to YY_.
10737 Use standard Makefile.in.in in runtime-po, since we'll arrange
10738 for backward-compatible bison-runtime.po files in a different way.
10739 * data/glr.c (YY_): New macro, from yacc.c.
10740 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10741 Translate messages intended for users.
10742 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10743 the wording in the other skeletons. We don't know that the memory
10744 is virtual.
10745 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10746 Use same method that yacc.c uses.
10747 Don't translate debugging messages.
10748 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10749 it doesn't work (yet), and requires C++ expertise to fix.
10750 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10751 Move defn to a more logical place, to be consistent with other
10752 skeletons.
10753 Don't translate debugging messages.
10754 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10755 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10756 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10757 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10758
ac8c5689
PE
10759 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10760 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10761 void, not int.
10762 * tests/glr-regression.at (Badly Collapsed GLR States):
10763 Likewise.
10764 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10765 yylex should return 0 at EOF rather than aborting.
10766
6100a9aa
PE
10767 Improve tests for stack overflow in GLR parser.
10768 Problem reported by twlevo@xs4all.nl.
10769 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10770 All uses removed.
10771 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10772 can handle the problem.
10773 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10774 (yyparse): New local variable yyresult to record the result.
10775 Use result of setjmp to set it, rather than storing itinto
10776 struct.
10777 (yyDone): Remove label.
10778 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10779 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10780 if YYABORT is used).
10781 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10782 yyparse status; put status > 1 into diagnostic.
10783 Check that status==2 works.
10784 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10785 Use exit status 3 for failure to open (which shouldn't happen).
10786
15f40952
PE
107872005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10788
67fd79c4
PE
10789 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10790 1 on syntax error; just let yyparse do its thing.
10791 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10792 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10793 (Exploding the Stack Size with Alloca):
10794 (Exploding the Stack Size with Malloc):
10795 Expect exit status 2, not 1, since the parser is supposed to blow
10796 its stack. Problem reported by twlevo@xs4all.nl.
10797
15f40952
PE
10798 * data/glr.c (yyparse): Don't assume that the initial calls
10799 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10800 Print a stack-overflow message and fail instead.
10801 Initialize the line-number information before creating the stack,
10802 so that the stack-overflow message can report line zero safely.
10803
f32c66b5
PE
108042005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10805
a22ff96f 10806 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
10807 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10808 (yyuserMerge): Provide a default case if b4_mergers is empty.
10809 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10810 * tests/glr-regression.at
10811 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 10812 Add casts to pacify C++ compilers.
1beb0b24
PE
10813 * tests/glr-regression.at (Improper merging of GLR delayed action
10814 sets): Declare yylex before using it.
f32c66b5 10815 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
10816 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10817 test for valgrind; valgrind is independent of g++.
10818 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10819 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10820 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10821 Use a destructor, so that we can expand the stack. Change
10822 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 10823
d741bd1b
PE
108242005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10825
10826 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10827 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10828
0410a6e0
PE
108292005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10830
10831 * PACKAGING: New file, suggested by Bruno Haible and taken from
10832 similar wording in gettext's PACKAGING file.
10833 * NEWS: Mention PACKAGING.
10834 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10835
f7ab6a50
PE
108362005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10837
baf785db 10838 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
10839 * bootstrap: Get runtime translations into runtime-po.
10840 Create runtime-po files automatically, if possible.
10841 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10842 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10843 does not infringe on the user's name space.
10844 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10845 * doc/bison.texinfo (Internationalization): Revamp the English
10846 and Texinfo syntax a bit, to try to make it clearer.
10847 (Bison Options, Option Cross Key): Mention --print-localedir.
10848 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10849 YYENABLE_NLS. Quote a bit more.
10850 * runtime-po/.cvsignore: New file.
10851 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
10852 * runtime-po/Rules-quot: Remove; now created by bootstrap.
10853 * runtime-po/quot.sed: Likewise.
10854 * runtime-po/boldquot.sed: Likewise.
10855 * runtime-po/en@quot.header: Likewise.
10856 * runtime-po/en@boldquot.header: Likewise.
10857 * runtime-po/insert-header.sin: Likewise.
10858 * runtime-po/remove-potcdate.sin: Likewise.
10859 * runtime-po/Makevars: Likewise.
10860 * runtime-po/LINGUAS: Likewise.
10861 * runtime-po/de.po: Likewise; we will rely on the translation project
10862 to maintain this, so "bootstrap" should get it.
0410a6e0 10863 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
10864 its value.
10865 * src/main.c (main): Bind the bison-runtime domain, too.
10866
108672005-07-12 Bruno Haible <bruno@clisp.org>
10868
10869 * data/yacc.c: Include <libintl.h> when NLS is enabled.
10870 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
10871 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
10872 * runtime-po: New directory.
10873 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
10874 $(DOMAIN).pot-update rule, so that old messages are never dropped.
10875 * runtime-po/Rules-quot: New file, copied from po/.
10876 * runtime-po/quot.sed: Likewise.
10877 * runtime-po/boldquot.sed: Likewise.
10878 * runtime-po/en@quot.header: Likewise.
10879 * runtime-po/en@boldquot.header: Likewise.
10880 * runtime-po/insert-header.sin: Likewise.
10881 * runtime-po/remove-potcdate.sin: Likewise.
10882 * runtime-po/Makevars: New file.
10883 * runtime-po/POTFILES.in: New file.
10884 * runtime-po/LINGUAS: New file.
10885 * runtime-po/bison-runtime.pot: New file.
10886 * runtime-po/de.po: New file.
10887 * m4/bison.m4: New file.
10888 * Makefile.am (SUBDIRS): Add runtime-po.
10889 (aclocaldir, aclocal_DATA): New variables.
10890 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
10891 Define aclocaldir.
10892 * src/getargs.c (usage): Document --print-localedir option.
10893 (PRINT_LOCALEDIR_OPTION): New enum item.
10894 (long_options): Add --print-localedir option.
10895 (getargs): Handle --print-localedir option.
10896 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
10897 (Internationalization): New section.
10898
22dda0f0
AD
108992005-07-12 Akim Demaille <akim@epita.fr>
10900
10901 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
10902 for consistency with the rest of the code.
10903 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
10904 Add separators.
10905
82b248ad
AD
109062005-07-12 Akim Demaille <akim@epita.fr>
10907
10908 * src/parse-gram.y: Use %printer instead of YYPRINT.
10909
fa0e9314
AD
109102005-07-12 Akim Demaille <akim@epita.fr>
10911
867a3e00
AD
10912 * src/symtab.h, src/symtab.c (symbol_print): New.
10913 * src/symlist.h, src/symlist.c (symbol_list_print): New.
10914 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
10915
109162005-07-12 Akim Demaille <akim@epita.fr>
10917
10918 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
10919 b4_at_dollar and b4_dollar_dollar.
10920
e054b190
PE
109212005-07-11 Paul Eggert <eggert@cs.ucla.edu>
10922
10923 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
10924 and Pennello's paper.
10925
34160ec4
PE
109262005-07-09 Paul Eggert <eggert@cs.ucla.edu>
10927
407d4a75
PE
10928 * data/yacc.c (yyparse): Undo previous patch. Instead,
10929 set yylsp[0] and yyvsp[0] only if the initial action
10930 sets yylloc and yylval, respectively.
10931
34160ec4
PE
10932 * data/yacc.c (yyparse): In the initial action, set
10933 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
10934 This avoids the use of undefined variables if the initial
10935 action does not set yylloc and/or yylval.
10936
c3d5a4a7
PE
109372005-07-07 Paul Eggert <eggert@cs.ucla.edu>
10938
b34d96c1
PE
10939 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
10940 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
10941 Remove from CVS. These files are automatically generated.
10942 * examples/extexi: Clarify that this file is now part of Bison,
10943 not GNU M4, and that it works with any POSIX-compatible Awk.
10944 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
10945 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
10946 so that we also get calc++-parser.yy. Geneate it.
10947 Use $(AWK), not gawk, since any conforming Awk will do.
10948 Put comment before action, since older 'make' can't handle comment
10949 in action.
10950 $(BUILT_SOURCES): List all built sources, not just some of them.
10951 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
10952 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
10953 $($(calc_sources_generated)): Remove unnecessary test for existence
10954 of target. (This had a shell syntax error anyway; a stray "x".)
10955 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
10956 calc++-parser.yy.
10957 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
10958
c3d5a4a7
PE
10959 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
10960 implied by the other modules.
10961
828c373b
AD
109622005-07-06 Akim Demaille <akim@epita.fr>
10963
10964 Bind examples/calc++ to the package.
10965 * examples/calc++/Makefile: Remove, replaced by...
10966 * examples/calc++/Makefile.am: ... this new file.
10967 * examples/calc++/test: Remove input.
10968 * examples/calc++/compile: Remove.
10969 * examples/Makefile.am: New.
10970 * configure.ac, Makefile.am: Adjust.
10971 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
10972
63cb01d6
PE
109732005-07-05 Paul Eggert <eggert@cs.ucla.edu>
10974
fd2df2ed
PE
10975 * data/glr.c (yyFail): Drastically simplify; since the format argument
10976 never had any % directives, we can simply pass it to yyerror.
10977 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
10978 be modified later, as that is the usual style in glr.c.
10979 Problems reported by Paul Hilfinger.
10980
63cb01d6
PE
10981 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
10982 and size overflow errors.
10983 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
10984 in case the user prolog sets feature-test macros like _GNU_SOURCE.
10985 (YYSIZEMAX): New macro.
10986 (yystpcpy): New function, taken from yacc.c.
10987 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
10988 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
10989 so that we don't have to maintain their signatures.
10990 (yyFail): Check for buffer overflow, by using vsnprintf rather
10991 than vsprintf. Allocate a bigger buffer if possible.
10992 Report an error if buffer allocation fails.
10993 (yyStackOverflow): New function.
10994 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
10995 the initialization was successful. It might fail if storage was
10996 exhausted.
10997 (yyexpandGLRStack): Add more checks for storage allocation failure.
10998 Use yyStackOverflow to report failures.
10999 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11000 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11001 Don't assume stack number fits in int.
11002 (yysplitStack): Check for storage allocation failure.
11003 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11004 can print diagnostics on storage allocation failure. All callers
11005 changed.
11006 (yyresolveValue): Use yybool for boolean.
11007 (yyreportSyntaxError): Check for size-calculation overflow.
11008 This code is taken from yacc.c.
11009 (yyparse): Check for storage allocation errors when allocating
11010 the initial stack.
11011
1c59e0a1
AD
110122005-07-05 Akim Demaille <akim@epita.fr>
11013
11014 Extract calc++ from the documentation.
11015 * doc/bison.texinfo (Calc++): Add the extraction marks.
11016 * examples/extexi: New, from the aborted GNU Programming 2E.
11017 Separate the different paragraph of a file with empty lines.
11018 * examples/Makefile: Use it to extract the whole calc++ example.
11019
8a0adb01
AD
110202005-06-24 Akim Demaille <akim@epita.fr>
11021
11022 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11023 class typedefs.
11024
12545799
AD
110252005-06-22 Akim Demaille <akim@epita.fr>
11026
11027 * doc/bison.texinfo (C++ Language Interface): First stab.
11028 (C++ Parsers): Remove.
11029
99be0235
AD
110302005-06-22 Akim Demaille <akim@epita.fr>
11031
11032 * data/lalr1.cc (yylex_): Honor %lex-param.
11033
0ffd4fd1
AD
110342005-06-22 Akim Demaille <akim@epita.fr>
11035
11036 Start a set of simple examples.
11037 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11038 * examples/calc++/calc++-driver.hh,
11039 * examples/calc++/calc++-parser.yy,
11040 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11041 * examples/calc++/compile, examples/calc++/test: New.
11042
0925ebb4
PE
110432005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11044
11045 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11046 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11047 which stems from the 2005-05-27 patch.
11048
43d3b664
PH
110492005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11050
11051 * data/glr.c: Modify treatment of unused parameters to permit use
11052 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11053
3062864d
PE
110542005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11055
11056 Fix infringement on user name space reported by Janos Zoltan Szabo.
11057 * data/yacc.c (yyparse): strlen -> yystrlen.
11058
989b5b8e
AD
110592005-05-30 Akim Demaille <akim@epita.fr>
11060
11061 * data/lalr1.cc (_): New.
11062 Translate the various messages.
11063
bedf57f5
PE
110642005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11065
11066 Fix infringement on user name space reported by Bruno Haible.
11067 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11068 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11069 the user's name space.
11070 (alloca): Include <stdlib.h> to get it, if it's not built in.
11071 (YYMALLOC, YYFREE): Define only if needed.
11072 (malloc, free): Declare, but only if needed, as this infringes on
11073 the user name space.
11074
4d1801f1
PE
110752005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11076
11077 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11078 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11079 with %d format.
11080 * lib/ebitset.c (min, max): Undef before defining.
11081 * lib/vbitset.c (min, max): Likewise.
11082 * lib/subpipe.c (create_subpipe): Save local variables in case
11083 vfork clobbers them.
11084
110852005-05-24 Bruno Haible <bruno@clisp.org>
11086
11087 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11088 error message syntax used by gcc-4.0.
11089
b94a9e1e
PE
110902005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11091
85ac3861
PE
11092 * README: Mention m4 1.4.3. Remove obsolete advice about
11093 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11094
b94a9e1e
PE
11095 * bootstrap: Remove workaround for problem I encountered with
11096 gettext 0.14.1; it seems to be fixed now.
11097
51c30d21
PE
110982005-05-22 Paul Eggert <eggert@cs.ucla.edu>
11099
009ce67d
PE
11100 * NEWS: Version 2.0a.
11101
f2a97c62
PE
11102 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
11103 the previous change.
11104
c8775f93
PE
11105 Various maintainer cleanups.
11106 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11107 conftest*, for benefit of CVS commands run at the same time as
11108 "configure". Add build-aux, since "bootstrap" now creates it and
11109 its subfiles.
11110 * Makefile.cfg (move_if_change): Remove.
11111 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11112 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11113 (po_repo, do-po-update, po-update, wget_files, get-targets):
11114 (config.guess-url_prefix, config.sub-url_prefix):
11115 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11116 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11117 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
11118 Remove.
11119 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
11120 this is now the recommended name.
11121 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
11122 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
11123 ylwrap. These files now go into build-aux.
11124 * config/move-if-change: Remove.
11125 * config/prev-version.txt: Bump from 1.75 to 2.0.
11126
3ea5f0ec
PE
11127 * bootstrap: Add stdio-safer, unistd-safer modules.
11128 Remove m4/glibc2.m4 (introduced by latest gnulib, but
11129 we don't need it).
11130 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
11131 fopen-safer.c, stdio-safer.h, unistd-safer.h.
11132 * lib/subpipe.c: Include "unistd-safer.h".
11133 (create_subpipe): Make sure all the newly-created
11134 file descriptors are > 2, so that diagnostics don't
11135 get sent down them (which might cause Bison to hang, in theory).
11136 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
11137 * src/files.c (xfopen): Use fopen_safer, not fopen.
11138
51c30d21
PE
11139 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
11140 yesterday's yacc.c fix.
11141
cea1469d
PE
111422005-05-21 Paul Eggert <eggert@cs.ucla.edu>
11143
3ea5f0ec
PE
11144 * data/glr.c, data/lalr1.cc: Update copyright date.
11145
cea1469d
PE
11146 Fix a destructor bug reported by Wolfgang Spraul in
11147 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
11148 * data/yacc.c (yyabortlab): Don't call destructor, and
11149 don't set yychar to EMPTY.
11150 (yyoverflowlab): Don't call destructor.
11151 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
11152 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
11153 since we no longer output the message "discarding lookahead token
11154 end of input ()".
11155
5e6f62f2
PH
111562005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11157
11158 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
11159 fix a small glitch in debugging output.
11160 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
11161 after YY_SYMBOL_PRINT where needed.
11162
11163 (struct yyGLRState): Add some comments.
11164 (struct yySemanticOption): Add some comments.
11165 (union yyGLRStackItem): Add comment.
11166
11167 (yymergeOptionSets): Correct this to properly perform the union,
11168 avoiding infinite reported by Michael Rosien.
11169 Update comment.
11170
11171 * tests/glr-regression.at: Add test for GLR merging error reported
11172 by M. Rosien.
cea1469d 11173
0fb669f9
PE
111742005-05-13 Paul Eggert <eggert@cs.ucla.edu>
11175
11176 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
11177 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
11178 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
11179 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
11180 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
11181 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
11182 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
11183 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
11184 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
11185 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
11186 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
11187 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
11188 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
11189 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
11190 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
11191 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
11192 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
11193 src/derives.h, src/files.c, src/files.h, src/getargs.c,
11194 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
11195 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
11196 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
11197 src/output.h, src/parse-gram.c, src/parse-gram.h,
11198 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
11199 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
11200 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
11201 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
11202 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
11203 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
11204 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
11205 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
11206 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
11207 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
11208 tests/reduce.at, tests/regression.at, tests/sets.at,
11209 tests/synclines.at, tests/testsuite.at, tests/torture.at:
11210 Update FSF postal mail address.
11211
51f4735e
PE
112122005-05-11 Paul Eggert <eggert@cs.ucla.edu>
11213
11214 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
11215 Problem reported by Ralf Menzel.
11216
80ce3401
PE
112172005-05-01 Paul Eggert <eggert@cs.ucla.edu>
11218
11219 * tests/actions.at: Test that stack overflow invokes destructors.
11220 From Marcus Holland-Moritz.
11221 * data/yacc.c (yyerrlab): Move the code that destroys the stack
11222 from here....
11223 (yyreturn): to here. That way, destructors are called properly
11224 even if the stack overflows, or the user calls YYACCEPT or
11225 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
11226 (yyoverflowlab): Destroy the lookahead.
11227
112282005-04-24 Paul Eggert <eggert@cs.ucla.edu>
11229
11230 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
11231
72f000b0
PE
112322005-04-17 Paul Eggert <eggert@cs.ucla.edu>
11233
11234 * NEWS: Bison-generated C parsers no longer quote literal strings
11235 associated with tokens.
11236 * src/output.c (prepare_symbols): Don't escape strings,
11237 since users don't want to see C escapes.
11238 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
11239 in diagnostics.
c19683bb 11240 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
11241 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
11242
1094323f
PE
112432005-04-16 Paul Eggert <eggert@cs.ucla.edu>
11244
11245 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
11246 the data size is known to be too small and we can't increase it.
11247 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
11248
ca407bdf
PE
112492005-04-15 Paul Eggert <eggert@cs.ucla.edu>
11250
11251 * src/parse-gram.y: Include quotearg.h.
11252 (string_as_id): Quote $1 before using it as a key, since the
11253 lexer no longer quotes it for us.
11254 (string_content): Don't strip quotes, since lexer no longer
11255 quotes it for us.
11256 * src/scan-gram.l: Include quotearg.h.
11257 ("\""): Omit quote.
11258 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
11259 a key, since the rest of the lexer doesn't quote it.
11260 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
11261 * tests/regression.at (Token definitions): Check for backslashes
11262 in token strings.
11263
11264 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
11265 (YYSIZE_T): Define to unsigned long int when using an older compiler.
11266 (yyparse): Revamp code to generate long syntax error message, to
11267 make it easier to translate, and to avoid problems with arithmetic
11268 overflow. Change "virtual memory" to "memory" in diagnostic, since
11269 we don't know whether the memory is virtual.
11270
1ce59070
PE
112712005-04-13 Paul Eggert <eggert@cs.ucla.edu>
11272
11273 * NEWS: Bison-generated C parsers now use the _ macro to
11274 translate strings.
11275 * data/yacc.c (_) [!defined _]: New macro.
11276 All English strings wrapped inside this macro.
11277 * doc/bison.texinfo (Bison Parser): Document _.
11278 * po/POTFILES.in: Include src/parse-gram.c, since it now
11279 includes translateable strings that parse-gram.y doesn't.
11280
a749a695
PE
112812005-04-12 Paul Eggert <eggert@cs.ucla.edu>
11282
11283 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
11284 reverting the 2004-10-11 change to this function.
11285 (symbol_check_alias_consistency): Don't call symbol_type_set
11286 if the type name is already correct.
11287 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
11288
8fb1053b
PE
112892005-03-25 Paul Eggert <eggert@cs.ucla.edu>
11290
11291 * tests/regression.at (Token definitions): Don't use a token named
11292 c, as that generates a "#define c ..." that runs afoul of buggy
11293 stdlib.h that uses the identifier c as a member of struct
11294 drand48_data. Problem reported by Horst Wente.
11295
ff498c4a
PE
112962005-03-21 Paul Eggert <eggert@cs.ucla.edu>
11297
11298 * bootstrap: Change translation URL from
11299 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
11300 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
11301 redirection glitches. Problem reported by twlevo@xs4all.nl.
11302
65211d70
PE
113032005-03-20 Paul Eggert <eggert@cs.ucla.edu>
11304
11305 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
11306 after operands; POSIX says this isn't portable for the c99 command.
11307
9577fb1f
PE
113082005-03-18 Paul Eggert <eggert@cs.ucla.edu>
11309
11310 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
11311 immediately if a data overrun has occurred; this may help us track
11312 down what may be a spurious failure on MacOS.
11313
78b178f7
PE
113142005-03-17 Paul Eggert <eggert@cs.ucla.edu>
11315
a2599d0f
PE
11316 Respond to problems reported by twlevo@xs4all.nl.
11317
11318 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
11319
78b178f7
PE
11320 * src/vcg.h: Comment fix.
11321 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
11322 (G_CMAX): Change to -1 instead of INT_MAX.
11323
11324 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 11325
7296e729
PE
113262005-03-15 Paul Eggert <eggert@cs.ucla.edu>
11327
11328 * src/tables.c (state_number_to_vector_number): Put it inside an
11329 "#if 0", since it's not currently used. Problem reported by
11330 Roland McGrath.
11331
05ac60f3
PE
113322005-03-06 Paul Eggert <eggert@cs.ucla.edu>
11333
11334 * src/output.c (escaped_output): Renamed from
11335 escaped_file_name_output, since we now use it for symbol tags as
11336 well. All uses changed.
11337 (symbol_destructors_output, symbol_printers_output):
11338 Escape symbol tags too.
11339 Problem reported by Matyas Forstner in
11340 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
11341
11342 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
11343 not needed.
11344 * src/output.c (user_actions_output, token_definitions_output,
11345 symbol_destructors_output, symbol_printers_output): Likewise.
11346 * src/reader.c (prologue_augment): Likewise.
11347 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
11348
11349 * src/vcg.c (output_edge): Don't quote linestyle arg.
11350 Problem reported by twlevo@xs4all.nl.
11351
7eb453ac
PE
113522005-02-28 Paul Eggert <eggert@cs.ucla.edu>
11353
11354 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
11355 example, reported by Derek M Jones. Also, make the example even
11356 more outrageous, to better illustrate how bad the problem is.
11357
4c04c52a
PE
113582005-02-24 Paul Eggert <eggert@cs.ucla.edu>
11359
11360 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
11361 putsym. Typo reported by Sebastian Piping.
11362
a61e1620
PE
113632005-02-23 Paul Eggert <eggert@cs.ucla.edu>
11364
11365 * doc/bison.texinfo (Language and Grammar): some -> same
11366 (Epilogue): int he -> in the
11367 Typos reported by Sebastian Piping via Justin Pence.
11368
9ec93868
PE
113692005-02-07 Paul Eggert <eggert@cs.ucla.edu>
11370
11371 * tests/glr-regression.at (Improper handling of embedded actions
11372 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
11373 embedded actions and $-N in GLR parsers", work around an Autoconf bug
11374 with dollar signs in test names.
11375 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
11376 for a similar reason.
11377
73ce7e7e
PE
113782005-01-28 Paul Eggert <eggert@cs.ucla.edu>
11379
11380 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
11381 wants to redefine G_VIEW.
11382
2e72b98e
PE
113832005-01-27 Paul Eggert <eggert@cs.ucla.edu>
11384
11385 * src/vcg.c (get_view_str): Remove case for normal_view.
11386 Problem reported by twlevo@xs4all.nl.
11387
e0d634e5
PE
113882005-01-24 Paul Eggert <eggert@cs.ucla.edu>
11389
ccf830a4
PE
11390 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
11391 Problem reported by twlevo@xs4all.nl.
11392
e0d634e5
PE
11393 * doc/bison.texinfo: Change @dircategory from "GNU programming
11394 tools" to "Software development". Requested by Richard Stallman
11395 via Karl Berry.
11396
7bbc8cb0
PE
113972005-01-23 Paul Eggert <eggert@cs.ucla.edu>
11398
11399 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
11400 Problem reported by twlevo@xs4all.nl.
11401
08b770bc
PE
114022005-01-21 Paul Eggert <eggert@cs.ucla.edu>
11403
11404 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
11405 keyword; it's not needed with modern compilers, and it doesn't
11406 affect correctness with older compilers. Suggested by
11407 twlevo@xs4all.nl.
11408
95f22ad2
PE
114092005-01-17 Paul Eggert <eggert@cs.ucla.edu>
11410
11411 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
11412 gcc -Wswitch-default.
11413 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11414 * data/yacc.c (yyparse): Likewise.
11415
d229d15c
PE
114162005-01-12 Paul Eggert <eggert@cs.ucla.edu>
11417
11418 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
11419 already. Let config.h define any nonstandard values.
11420
ecadd90f
PE
114212005-01-10 Paul Eggert <eggert@cs.ucla.edu>
11422
11423 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11424 for the benefit of slower hosts. Problem reported by
11425 Nelson H. F. Beebe.
11426
213744b5
PE
114272005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11428
11429 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11430 being defined and not used.
11431 * data/lalr1.cc (yyparse): Likewise.
11432 Use "if (false)" rather than "if (0)".
11433
249d3236
PE
114342005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11435
11436 * TODO: Mention that we should allow NUL bytes in tokens.
11437
987cc1fb
PE
114382005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11439
11440 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11441 Problem reported by Hans Aberg.
11442
08fe02d9
PE
114432005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11444
11445 * src/getargs.c (version): Happy new year; update overall
11446 program copyright date from 2004 to 2005.
11447
11448 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11449 Problem reported by Hans Aberg.
11450 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11451 (Output file names.): Add a test for the case when standard output
11452 is closed.
11453
010c0266
PE
114542004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11455
11456 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11457 to fix an oversight in the Bison 2.0 manual.
11458
da12206a
PE
114592004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11460
11461 * NEWS: Version 2.0. Reformat the existing news items since
11462 1.875, so that related items are grouped together.
3a4734aa 11463 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
11464 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11465
c935d934
PE
11466 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11467 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11468 otherwise, we're not testing alloca. Unfortunately there's no
11469 simple way to consult HAVE_ALLOCA here.
11470
da12206a
PE
11471 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11472 for yymsg, too.
11473
11474 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11475 hand. This avoids a warning about comparing int to size_t when
11476 GCC warnings are enabled.
11477
0a2c5137
PE
114782004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11479
d7e14fc0
PE
11480 * NEWS: Bison-generated parsers no longer default to using the
11481 alloca function (when available) to extend the parser stack, due
11482 to widespread problems in unchecked stack-overflow detection.
11483 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11484 responsibility to set it to a positive value. This lets the user
11485 specify a value that is not a preprocessor constant.
11486 * data/yacc.c (YYMAXDEPTH): Likewise.
11487 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11488 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11489 to be a compile-time constant. However, explain the constraints on it.
11490 Also, explain the constraints on YYINITDEPTH.
11491 (Table of Symbols): Explain that alloca is no longer the default.
11492 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11493 to 1.
11494
0a2c5137
PE
11495 * doc/bison.texinfo (Location Default Action): Mention that n must
11496 be zero when k is zero. Suggested by Frank Heckenbach.
11497
e019c247
AD
114982004-12-22 Akim Demaille <akim@epita.fr>
11499
11500 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11501 (parser::state_type, parser::semantic_type, parser::location_type):
11502 Private, not public.
11503 (parser::parse): Return ints, not bool.
11504 Returning a bool introduces a problem: 0 corresponds to false, and
11505 it seems weird to return false on success. Returning true changes
11506 the conventions for yyparse.
11507 Alternatively we could return void and send an exception.
11508 There is no clear consensus (yet?).
11509 (state_stack, semantic_stack, location_stack): Rename as...
11510 (state_stack_type, semantic_stack_type, location_stack_type): these.
11511 Private, not public.
11512 * tests/c++.at: New.
11513 * tests/testsuite.at, tests/Makefile.am: Adjust.
11514
72731bb7
AD
115152004-12-21 Akim Demaille <akim@epita.fr>
11516
11517 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
11518
9a0d8bec
AD
115192004-12-21 Akim Demaille <akim@epita.fr>
11520
11521 Don't impose std::string for filenames.
11522
11523 * data/lalr1.cc (b4_filename_type): New.
11524 (position::filename): Use it.
11525 (parser.hh): Move the inclusion of stack.hh and location.hh below
11526 the user code, so that needed headers for the filename type can be
11527 included first.
72731bb7
AD
11528 Forward declare them before the user code.
11529 * tests/Makefile.am (check-local, installcheck-local): Pass
11530 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 11531
99880de5
AD
115322004-12-20 Akim Demaille <akim@epita.fr>
11533
11534 Use more STL like names: my_class instead of MyClass.
11535
11536 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
11537 (SemanticStack, SemanticType, StateStack, StateType)
11538 (TokenNumberType, Stack, Slice, Traits, Parser::location)
11539 (Parser::value): Rename as...
11540 (location_stack, location_type, rhs_number_type, semantic_stack)
11541 (semantic_type, state_stack, state_type, token_number_type, stack)
11542 (slice, traits, parser::yylloc, parser::yylval): these.
11543
11544 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
11545
9bec482e
PE
115462004-12-19 Paul Eggert <eggert@cs.ucla.edu>
11547
11548 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
11549 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11550
f6fbd3da
PE
115512004-12-17 Paul Eggert <eggert@cs.ucla.edu>
11552
11553 Remove uses of 'short int' and 'unsigned short int'. This raises
11554 some arbitrary limits. It uses more memory but nowadays that's
11555 not much of an issue.
11556
11557 This change does not affect the generated parsers; that's a different
11558 task, as some users will want to conserve memory there.
11559
11560 Ideally we should use size_t to represent all object counts, and
11561 something like ptrdiff_t to represent signed differences of object
11562 counts; but that will require more code-cleanup than I have the
11563 time to do right now.
11564
11565 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
11566 Use size_t, not int or short int, to count objects.
11567 * src/closure.c (nritemset, closure): Likewise.
11568 * src/closure.h (nritemset, closure): Likewise.
11569 * src/nullable.c (nullable_compute): Likewise.
11570 * src/print.c (print_core): Likewise.
11571 * src/print_graph.c (print_core): Likewise.
11572 * src/state.c (state_compare, state_hash): Likewise.
11573 * src/state.h (struct state): Likewise.
11574 * src/tables.c (default_goto, goto_actions): Likewise.
11575
11576 * src/gram.h (rule_number, rule): Use int, not short int.
11577 * src/output.c (prepare_rules): Likewise.
11578 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
11579 errs, reductions): Likewise.
11580 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
11581 Likewise.
11582 * src/tables.c (vector_number, tally, action_number,
11583 ACTION_NUMBER_MINIMUM): Likewise.
11584 * src/output.c (muscle_insert_short_int_table): Remove.
11585
efeed023
AD
115862004-12-17 Akim Demaille <akim@epita.fr>
11587
11588 * data/lalr1.cc: Extensive Doxygenation.
11589 (error_): Rename as...
11590 (error): this, since it is visible to the user.
11591 Adjust callers.
11592 (Parser::message): Now an automatic variable from...
11593 (Parser::yyreport_syntax_error_): here.
11594 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
11595 Parser::error.
11596 * tests/input.at: Escape $.
11597
bc82c5a5
PE
115982004-12-16 Paul Eggert <eggert@cs.ucla.edu>
11599
11600 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
11601 Parenthesize rhs to avoid obscure problems with mistakes like
11602 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
11603 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11604 b4_rhs_location): Likewise.
11605 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11606 b4_rhs_location): Likewise.
11607
fd19f271
AD
116082004-12-16 Akim Demaille <akim@epita.fr>
11609
11610 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
11611 yacc.c: be sure to stay within yycheck_.
11612 * tests/actions.at: Re-enable C++ tests.
11613
10454ea4
AD
116142004-12-16 Akim Demaille <akim@epita.fr>
11615
11616 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
11617 real.
11618
c5b95ccf
AD
116192004-12-16 Akim Demaille <akim@epita.fr>
11620
11621 Use #define to handle the %name-prefix.
11622
11623 * data/glr.c, data/yacc.c: Comment changes.
11624 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
11625 so that one can refer to yylex in the parser file, and have it
11626 renamed, as is the case with other skeletons.
11627
617a8f12
AD
116282004-12-16 Akim Demaille <akim@epita.fr>
11629
11630 Move lalr1.cc internals into yy*.
11631
11632 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
11633 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
11634 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
11635 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
11636 (empty_, final_, terror_, errcode_, ntokens_)
11637 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
11638 (looka_, ilooka_, error_range_, nerrs_):
11639 Rename as...
11640 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
11641 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
11642 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
11643 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
11644 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
11645 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
11646 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
11647 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
11648 these.
11649
1e547e6e
PE
116502004-12-15 Paul Eggert <eggert@cs.ucla.edu>
11651
11652 Fix some problems reported by twlevo at xs4all.
11653 * src/symtab.c (symbol_new): Report an error if the input grammar
11654 contains too many symbols. This is better than calling abort() later.
11655 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
11656 (struct node, struct graph):
11657 Rename member expand to stretch. All uses changed.
11658 (struct graph): Remove member layoutalgorithm. All uses removed.
11659 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11660 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11661 All uses changed.
11662 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11663
735d6bd4
AD
116642004-12-15 Akim Demaille <akim@epita.fr>
11665
11666 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11667 Add more Doxygen comments.
11668 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11669 (report_syntax_error_, translate_): Rename as...
11670 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11671 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11672
2e1f5829
AD
116732004-12-15 Akim Demaille <akim@epita.fr>
11674
11675 * data/lalr1.cc (lex_): Rename as...
11676 (yylex_): this.
11677 Move the trace here.
11678 Take the %name-prefix into account.
11679 Reported by Alexandre Duret-Lutz.
11680
a3cb6248
AD
116812004-12-15 Akim Demaille <akim@epita.fr>
11682
11683 Simplify the C++ parser constructor.
11684
11685 * data/lalr1.cc (debug_): Rename as...
11686 (yydebug_): so that the parser's internals are always in the yy*
11687 pseudo namespace.
11688 Adjust uses.
11689 (b4_parse_param_decl): Remove the leading comma as it is now only
11690 called as unique argument list.
11691 (Parser::Parser): Remove the constructor accepting a location and
11692 an initial debugging level.
11693 Remove from the other ctor the argument for the debugging level.
11694 (debug_level_type, debug_level, set_debug_level): New.
11695
11696 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11697 constructor calls.
11698
07fed891
AD
116992004-12-15 Akim Demaille <akim@epita.fr>
11700
11701 Remove b4_root related material: failure experiment
a3cb6248 11702 (which goal was to allow to derive from a class).
07fed891
AD
11703
11704 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11705 definitions and uses.
11706
e603eaa5
PE
117072004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11708
11709 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11710 not 2, since it's not portable to subtract 1 from the start of an
11711 array. The new item 0 is never set or used. All uses changed.
11712
11713 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11714 the default definition of YYLLOC_DEFAULT. Problem reported
11715 by Frank Heckenbach.
11716
fafb007d
PE
117172004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11718
11719 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11720 the normal case and one for the error case. Just use the
11721 first one uniformly. Problem reported by Frank Heckenbach.
11722 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11723 use exactly the same macro in both places.
11724 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11725 so that the normal-case YYRHSLOC works for the error case too.
11726 All uses changed.
11727 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11728 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11729 * doc/bison.texinfo (Location Default Action): Don't claim that
11730 we have an array of locations. Use the same macro for both glr
11731 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11732 the index is 0.
11733
48814dcd
PE
117342004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11735
a4e1a53b
PE
11736 * HACKING: Update email addresses to send announcements to.
11737
48814dcd
PE
11738 * configure.ac (AC_INIT): Bump version to 1.875f.
11739
337116ba
PE
117402004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11741
11742 * NEWS: Version 1.875e.
11743 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11744
11745 * src/scan-skel.l: Include "complain.h", for "fatal".
11746
11747 * src/relation.h (relation_print, relation_digraph):
11748 Relation sizes are of type relation_node, not size_t (this is
11749 merely a doc fix, since the two types are equivalent).
11750 (relation_transpose): Relation sizes are of type relation_node,
11751 not int.
11752 * src/relation.c: Likewise.
11753 (top, infinity): Now of type relation_node, not int.
11754 (traverse, relation_transpose): Use relation_node, not int.
11755
11756 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11757 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11758 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11759
11760 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 11761 specifying whether the test should be skipped. Use it tp
337116ba 11762 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 11763 fail on some hosts, and should be skipped.
337116ba 11764
da2a7671
PE
117652004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11766
11767 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11768 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11769 unless otherwise specified below.
11770
11771 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11772 to allocate kernel_base, kernel_items, kernel_size, since
11773 they needn't be initialized to 0.
11774 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11775 * src/closure.c (new_closure): Likewise, for itemset.
11776 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11777 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11778 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11779 (build_relations): Likewise for edge, states1, includes.
11780 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11781 * src/reader.c (packgram): Likewise, for ritem, rules.
11782 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11783 * src/relation.c (relation_digraph): Likewise for VERTICES.
11784 (relation_transpose): Likewise for new_R, end_R.
11785 * src/symtab.c (symbols_token_translations_init): Likewise for
11786 token_translations.
11787 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11788 (token_actions): Likewise for yydefact, actrow, conflrow,
11789 conflict_list.
11790 (save_column): Likewise for froms[symno], tos[symno].
11791 (goto_actions): Likewise for state_count.
11792 (pack_table): Likewise for base, pos, check.
11793 (tables_generate): Likewise for width.
11794
11795 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11796 for initial core. Just have a separate core, so we needn't worry
11797 about whether kernel_size and kernel_base are initialized.
11798
11799 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11800 kernel_size, kernel_items): Remove unnecessary initialization.
11801 * src/conflicts.c (conflicts): Likewise.
11802 * src/derives.c (derives): Likewise.
11803 * src/muscle_tablc (muscle_insert): Likewise.
11804 * src/relation.c (relation_digraph): Likewise.
11805 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11806 conflrow, conflict_table, conflict_list, table, check):
11807 Likewise.
11808
11809 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11810 This is because all callers pass unsigned int.
11811 * src/closure.h (new_closure): Likewise.
11812
11813 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11814 (build_relations): Initialize includes[i] in all cases.
11815 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11816 and rules[ruleno].precsym. Initialize members in order.
11817 * src/relation.c (relation_transpose): Always initialize new_R[i]
11818 and end_R[i].
11819 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11820
11821 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11822 conflict_list[0] was always 0, but now it isn't initialized.
11823
11824 * src/table.c (table_grow): When conflict_table grew, the grown
11825 area wasn't cleared. Fix this.
11826
11827 * lib/.cvsignore: Add strdup.c, strdup.h.
11828 * m4/.cvsignore: Add strdup.m4.
11829
00baeeac
PE
118302004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11831
11832 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11833 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11834 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11835 ngotos + 1 without checking for overflow.
11836 (build_relations): Use END_NODE, not -1, to denote end of edges.
11837 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11838 build_relations): Use goto_number, not int, for goto numbers.
11839 * src/tables.c (save_column, default_goto): Likewise.
11840
be3d9d42
AD
118412004-11-23 Akim Demaille <akim@epita.fr>
11842
11843 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11844 of #defining from yystype.
11845 Don't typedef yystype, C++ does not need it.
11846 This lets it possible to forward declare it as union.
11847
78e526d5
PE
118482004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11849
11850 * bootstrap (gnulib_modules): Add extensions.
11851 Problem reported by Jim Meyering.
11852
afbb696d
PE
118532004-11-22 Paul Eggert <eggert@cs.ucla.edu>
11854
11855 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
11856 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
11857 src/system.h, src/tables.c: XFREE -> free, to accommodate
11858 recent change to gnulib xalloc.h.
78e526d5 11859 Problem reported by Jim Meyering.
afbb696d 11860
c1f8f16a
AD
118612004-11-17 Akim Demaille <akim@epita.fr>
11862
11863 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
11864
db7e5eb5 118652004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
11866 Alexandre Duret-Lutz <adl@gnu.org>
11867
11868 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
11869 changes.
11870 (YYCDEBUG): Adjust.
11871 Use it instead of cdebug_.
11872 (Parser::debug_stream, Parser::set_debug_stream): New.
11873 (Parser::symprint_): Define cdebug_ for temporary backward
11874 compatibility.
11875 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
11876 debug_stream ().
11877
68e11668
AD
118782004-11-17 Akim Demaille <akim@epita.fr>
11879
11880 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
11881 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
11882 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
11883 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
11884
97cbc73e
PE
118852004-10-27 Paul Eggert <eggert@cs.ucla.edu>
11886
11887 * data/glr.c (yyloc_default): Remove; not used.
11888 Problem reported by Frank Heckenbach.
11889
e342c3be
AD
118902004-10-25 Akim Demaille <akim@epita.fr>
11891
11892 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
11893 Introduce another definition to address simple location arrays.
11894 (yyGLRStack): New member: yyerror_range.
11895 (yyrecoverSyntaxError, yyparse): Update it.
11896 (yyrecoverSyntaxError): Use it when shifting the error token to
11897 have an accurate range, equivalent to the one computed by both
11898 yacc.c and lalr1.cc.
11899 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
11900 that column numbers start at column 0, as per GNU Coding
11901 Standards, the others tests, and the doc.
11902 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
11903 Adjust to the above change (first column is 0).
11904 And adjust the location of the "<error>", now covering the whole
11905 line.
11906
93602feb 119072004-10-22 Akim Demaille <akim@epita.fr>
04098407 11908 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
11909
11910 Remove some arbitrary limits on goto numbers and relations.
11911 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
11912 initial values, since they're never used.
11913 (set_goto_map): ngotos is now unsigned, so test for overflow
11914 by seeing whether it wraps around to zero.
11915 * src/lalr.h (goto_number): Now size_t, not short int.
11916 (GOTO_NUMBER_MAXIMUM): Remove.
11917 * src/relation.c (relation_print, traverse, relation_transpose):
11918 Check for END_NODE rather than looking at sign.
11919 * src/relation.h (END_NODE): New macro.
11920 (relation_node): Now size_t, not short int.
11921
dba08b04
PE
119222004-10-22 Paul Eggert <eggert@cs.ucla.edu>
11923
11924 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
11925 keyword, not an identifier. Problem reported by Baron Schwartz in
11926 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
11927
df09ef2e
AD
119282004-10-11 Akim Demaille <akim@epita.fr>
11929
11930 * src/symtab.c (symbol_check_alias_consistency): Also check
11931 type names, destructors, and printers.
11932 Reported by Alexandre Duret-Lutz.
11933 Recode the handling of associativity and precedence in terms
11934 of symbol_precedence_set.
11935 Accept no redeclaration at all, not even equal to the previous
11936 value.
11937 (redeclaration): New.
11938 Use it to factor redeclaration complaints.
11939 (symbol_make_alias): Don't set the type of the alias, let
11940 symbol_check_alias_consistency do it as for other features.
11941 * src/symtab.h (symbol): Add new member prec_location, and
11942 type_location.
11943 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
11944 * tests/input.at (Incompatible Aliases): New.
11945
146bc99d
PE
119462004-10-09 Paul Eggert <eggert@cs.ucla.edu>
11947
11948 .cvsignore fixes to accommodate gnulib changes,
11949 and the practice of naming build directories "_build".
11950 * .cvsignore: Add "_*". Sort.
11951 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
11952 * m4/.cvsignore: Add "*_gl.m4".
11953
e503aa60
AD
119542004-10-06 Akim Demaille <akim@epita.fr>
11955
11956 * src/parse-gram.y (add_param): Fix the truncation of trailing
11957 spaces.
11958
b4a20338
AD
119592004-10-05 Akim Demaille <akim@epita.fr>
11960
11961 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
11962 whether the reducion was empty or not. This leaves room to
11963 improve the use of YYLLOC_DEFAULT in such a case.
11964 lalr1.cc is still experimental, so changing this is acceptable.
11965 And finally, there are probably not many users who changed the
11966 handling of locations in GLR, so changing is admissible too.
11967
11968 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
11969 empty reduction, set @$ to an empty location ending the previously
11970 stacked symbol.
11971 Adjust uses to make sure the code is triggered on empty
11972 reductions.
11973 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
11974 expected output: empty reductions have empty locations.
11975
f85a5e6f
AD
119762004-09-29 Akim Demaille <akim@epita.fr>
11977
11978 * data/lalr1.cc: Move towards a more standard C++ coding style
11979 for templates: Class < T > -> Class<T>.
11980
b203fc2c
AD
119812004-09-29 Akim Demaille <akim@epita.fr>
11982
11983 * data/lalr1.cc: Reinstall the former ctor, for sake of
11984 compatibility, but warn it will be removed.
11985 Move towards a more standard C++ coding style (i.e., type *var ->
11986 type* var).
11987
5b7e1e73
PE
119882004-09-27 Paul Eggert <eggert@cs.ucla.edu>
11989
3fee967f
PE
11990 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
11991 since it's less likely to work if NULs are involved in the future.
5b7e1e73 11992
0dcca5c2
AD
119932004-09-27 Akim Demaille <akim@epita.fr>
11994
11995 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
11996
6dde1c82
AD
119972004-09-27 Akim Demaille <akim@epita.fr>
11998
11999 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 12000 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
12001 and argument names.
12002 (b4_cc_constructor_call): Likewise.
12003
b233d555
AD
120042004-09-24 Akim Demaille <akim@epita.fr>
12005
12006 * src/parse-gram.y (add_param): Strip the leading and trailing
12007 blanks from a formal argument declaration.
12008 (YY_LOCATION_PRINT): New.
12009
619404e3
AD
120102004-09-24 Akim Demaille <akim@epita.fr>
12011
12012 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12013 after the location.
12014
dd8d9022
AD
120152004-09-24 Akim Demaille <akim@epita.fr>
12016
12017 * doc/bison.texinfo (Table of Symbols): Sort.
12018
0092f063
AD
120192004-09-21 Akim Demaille <akim@epita.fr>
12020
12021 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12022 the useless parentheses.
12023 Suggested by Paul Eggert.
12024
451364ed
AD
120252004-09-20 Akim Demaille <akim@epita.fr>
12026
12027 Let the initial-action act on the look-ahead, and use it for the
12028 "initial push" (corresponding to an hypothetical beginning-of-file).
12029 And let lalr1.cc honor %initial-action.
12030
12031 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12032 example.
12033 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12034 (Parser::Parser): Remove the ctor that used to initialize it.
12035 (Parser::parse): Like in the other skeletons, issue the "starting
12036 parse" message before any action.
12037 Honor %initial-action.
12038 Initialize the stacks with the lookahead.
12039 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12040 look-ahead.
12041 Push them in the stacks.
12042 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12043
18d192f0
AD
120442004-09-20 Akim Demaille <akim@epita.fr>
12045
12046 * doc/bison.texinfo (Initial Action Decl): New.
12047
b8458aa5
AD
120482004-09-20 Akim Demaille <akim@epita.fr>
12049
12050 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12051 clearer criterion to define it.
12052 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12053 When reducing on an empty RHS, use the latest stacked location as
12054 location.
12055 yylloc is not always available.
12056 * data/glr.c: Likewise.
12057 Also, honor initial-actions.
12058
3fc16193
AD
120592004-09-20 Akim Demaille <akim@epita.fr>
12060
12061 * data/yacc.c (YY_LOCATION_PRINT): New.
12062 Define when we know YYLTYPE's structure, i.e., when the default
12063 YYLLOC_DEFAULT is used.
12064 * data/c.m4 (b4_yysymprint_generate): Use it.
12065 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12066 value of the result.
12067 (error_start_): Replace with...
12068 (error_range_): this location array.
12069 This allows to replace code relying on the implementation of
12070 locations by portable code.
12071 * data/yacc.c (yylerrsp): Replace with...
12072 (yyerror_range): this.
12073 Every time a token is popped, update yyerror_range[0], to have an
12074 accurate location for the error token.
12075 * data/glr.c (YY_LOCATION_PRINT): New.
12076 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12077 deference a pointer.
12078 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12079 report the location in %printers.
12080
12081 * src/scan-skel.l: Instead of abort, report error messages to ease
12082 understanding skeleton scanning failures.
12083
ecfe33e7
AD
120842004-09-16 Akim Demaille <akim@epita.fr>
12085
12086 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12087 (iterator, const_iterator): these, to be more in the C++ spirit.
12088 Also, return reverse iterators so that when displaying the stack
12089 we display its bottom first.
12090 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12091 from yacc.c.
12092 We should probably use vector here though.
12093
1576d44d
AD
120942004-09-16 Akim Demaille <akim@epita.fr>
12095
12096 Have more complete shift traces.
12097
12098 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
12099 to report Shifts instead of ad hoc YYDPRINTF invocations,
12100 including for the error token.
12101 * data/lalr1.cc (symprint_): Output the location.
12102 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
12103 output the location within the %printer.
12104 Activate GLR tests, at least to make sure they compile properly.
12105 They still don't pass though.
12106 * tests/calc.at: Adjust expect verbose output, since now "Entering
12107 state..." is on a different line than the "Shifting" message.
12108
9c66f418
AD
121092004-09-08 Akim Demaille <akim@epita.fr>
12110
12111 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12112 Bison directive from the Bison file to the invocation of this
12113 macro, so that these directives are passed to
12114 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12115 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12116 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12117 the extra Bison directives instead of the whole series.
12118 Change the grammar so that there are recoverable errors, and
12119 unrecoverable errors. Now we can have the parser give up before
12120 consuming the whole input. As a result we now can observe that
12121 the lookahead is freed when needed.
12122 Change the parser source to parse argv[1] instead of a hard coded
12123 string.
12124 Simplify yylex, and give a value and location to EOF.
12125 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
12126 passed directives already coded in the file.
12127 Add some tests to check the location of "error".
12128 For some tests, the C++ parser is correct, and not yacc.c.
12129 For other tests, they provide different, but unsatisfying, values,
12130 so keep the C++ value so that at least one parser is "correct"
12131 according to the test suite.
12132 (Actions after errors): Remove, this is subsumed by the
12133 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
12134
52d5733f
AD
121352004-09-06 Akim Demaille <akim@epita.fr>
12136
12137 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 12138 (Parser::pop): New.
52d5733f
AD
12139 Use it.
12140
a0e68930
AD
121412004-09-06 Akim Demaille <akim@epita.fr>
12142
12143 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
12144 argument, an informative message.
12145 Call YY_SYMBOL_PRINT.
12146 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
12147 * data/lalr1.cc (destruct_): Likewise.
12148 In addition, no longer depend on b4_yysymprint_generate and
12149 b4_yydestruct_generate to generate these functions, do it "by
12150 hand".
12151
e757bb10
AD
121522004-09-03 Akim Demaille <akim@epita.fr>
12153
12154 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
12155 invoked, yydestruct the lookahead.
12156 * tests/calc.at (Calculator $1): Update the expected lengths of
12157 traces: there is an added line for the discarded lookahead.
12158 * doc/bison.texinfo (Destructor Decl): Some rewording.
12159 Define "discarded" symbols.
12160
0fe1f06d
AD
121612004-09-02 Akim Demaille <akim@epita.fr>
12162
12163 * data/lalr1.cc (translate_, destruct_): No reason to be static.
12164
284acc8b
AD
121652004-09-02 Akim Demaille <akim@epita.fr>
12166
12167 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
12168 (YYDSYMPRINTF): Rename as...
12169 (YY_SYMBOL_PRINT): this.
12170 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
12171 two.
12172 Use it instead of direct symprint_ calls.
12173 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
12174 one.
12175
a5eb1ed2
AD
121762004-09-02 Akim Demaille <akim@epita.fr>
12177
b7c72fe1
AD
12178 * data/lalr1.cc (b4_yysymprint_generate): New.
12179 (symprint_): New member function, defined when YYDEBUG.
12180 Use it consistently instead of token/nterm debugging output by
12181 hand.
a5eb1ed2
AD
12182 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
12183 %printer calls to use cdebug_ when using lalr1.cc.
12184
417141dd
AD
121852004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
12186
12187 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
12188 with #ifdef YYDEBUG.
12189
2fa09258
AD
121902004-08-26 Akim Demaille <akim@epita.fr>
12191
12192 * doc/bison.texinfo (Implementing Loops): Rename as...
12193 (Implementing Gotos/Loops): this.
12194
9378b508
PE
121952004-08-13 Paul Eggert <eggert@cs.ucla.edu>
12196
12197 Adjust to latest gnulib.
12198 * bootstrap (gnulib_modules): Add xalloc-die.
12199 Set LC_ALL=C so that file names sort consistently.
12200 Prefer the gnulib copies of gettext.m4, glibc21.m4,
12201 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
12202 uintmax_t.m4, ulonglong.m4.
12203 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
12204 po.m4 since we are now using _gl.m4 instead.
12205
87a8ad5c
PE
122062004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
12207
12208 * src/scan-action.l: Remove. Scanning of semantic actions is
12209 handled in scan-gram.l.
12210
dca81a78
PE
122112004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
12212
12213 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
12214
12215 * src/location.h (struct): The file member is a uniqstr.
12216 (equal_boundaries): Use UNIQSTR_EQ for comparison.
12217
c9cbf7c5
PE
122182004-07-22 Paul Eggert <eggert@cs.ucla.edu>
12219
12220 Fix bug with non-%union parsers that have printers or destructors,
12221 which led to a Bison core dump. Reported by Peter Fales in
12222 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 12223
c9cbf7c5
PE
12224 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
12225 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
12226 not to our own type.
12227 * src/output.c (symbol_destructors_output, symbol_printers_output):
12228 Don't assume %union.
12229 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
12230 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
12231 UNION-FLAG. All callers changed.
12232 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
12233 Use type char, not unsigned int, when declaring an array of char;
12234 this lets us remove a cast.
12235 (Printers and Destructors): Add non-%union test cases.
12236
fa7e68c3
PE
122372004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12238
12239 * doc/bison.texinfo: Minor editorial changes, mostly to the new
12240 GLR writeups. E.g., avoid frenchspacing and the future tense,
12241 change "lookahead" to "look-ahead", and change "wrt" to "with
12242 respect to".
2fa09258 12243
fa7e68c3
PE
122442004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12245
12246 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
12247 New sections, split off from the GLR Parsers section. Put the new
12248 Simple GLR Parser near the start of the GLR section, for clarity.
12249 Rewrite connective text.
12250
99a9344e
PE
122512004-06-21 Frank Heckenbach <frank@g-n-u.de>
12252
12253 * doc/bison.texinfo (Simple GLR Parsers): New section.
12254
8dd162d3
PE
122552004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12256
12257 * NEWS, TODO, doc/bison.texinfo:
12258 Use "look-ahead" instead of "lookahead", to be consistent.
12259 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
12260 while we're fixing "look-ahead".
12261 * src/conflicts.c (shift_set): Renamed from shiftset.
12262 (look_ahead_set): Renamed from lookaheadset.
12263 * src/print.c: Likewise.
12264 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
12265 name for "lookahead".
12266 (report_types, usage): Likewise.
12267 * src/getargs.h (report_look_ahead_tokens): Renamed from
12268 report_lookaheads.
12269 * src/lalr.c (compute_look_ahead_tokens): Renamed from
12270 compute_lookaheads.
12271 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
12272 (look_ahead_tokens_print): Renamed from lookaheads_print.
12273 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
12274 state_rule_lookaheads_print.
12275 * src/state.h: Likewise.
12276 (reductions.look_ahead_tokens): Renamed from lookaheads.
12277 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
12278 AT_DATA_LOOKAHEADS_GRAMMAR.
12279
57a90331
PE
122802004-06-03 Paul Eggert <eggert@cs.ucla.edu>
12281
12282 * README: Update location of patched M4 distribution.
12283
8ed3234a
PE
122842004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
12285
12286 Don't assume the C++ compiler takes the same arguments as the C compiler
12287 (trivial change).
12288 * configure.ac (O0CXXFLAGS): New var.
12289 * tests/atlocal.in (CXXFLAGS): Use it.
12290
07971983
PE
122912004-05-29 Paul Eggert <eggert@cs.ucla.edu>
12292
12293 Fix some "make check" problems with C++ reported by
12294 Albert Chin-A-Young for Tru64 C++ in this thread:
12295 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
12296
12297 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
12298 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12299 Output to a .cc file for C++, not to a .c file.
12300 * tests/calc.at (AT_CHECK_CALC): Likewise.
12301 * tests/regression.at (AT_CHECK_DANCER): Likewise.
12302 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
12303
29058652
PE
123042004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
12305
12306 * tests/calc.at, tests/actions.at: Workaround for SGI
12307 C++ compiler. (trivial change)
12308
62cb8a99
PE
123092004-05-27 Paul Eggert <eggert@cs.ucla.edu>
12310
fd418816
PE
12311 Spent a few hours checking out which prerequisite versions the
12312 current sources actually require. I went all the way back to
12313 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
12314 a seemingly endless set of combinations of versions more recent
12315 than that. The bottom line is that the current sources require
12316 fairly recent versions of the build tools, and it'll be some work
12317 to change this.
12318 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
12319 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
12320 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
12321 Add comments explaining why those particular versions are
12322 currently needed.
2fa09258 12323
62cb8a99
PE
12324 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
12325 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 12326 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
12327
12328 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
12329 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
12330
caa52c10
PE
123312004-05-26 Paul Eggert <eggert@cs.ucla.edu>
12332
12333 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
12334 0.11.5. Suggested by Bruno Haible.
12335 * bootstrap: Remove gettext version checking.
12336
12337 * doc/bison.texinfo (Decl Summary): Also mention that %union
12338 can depend on prerequisite types. Problem reported by Tim
12339 Van Holder.
12340
4bfd5e4e
PE
123412004-05-25 Paul Eggert <eggert@cs.ucla.edu>
12342
2cef3017
PE
12343 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
12344 * README-alpha: Don't tell people not to package this.
12345
b9c85d5c
PE
12346 * bootstrap: Don't assume $(...) works; use `...` instead.
12347 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
12348 gettext better.
12349
4bfd5e4e
PE
12350 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
12351 put into the -d output file, and mention what to do if YYSTYPE is
12352 defined as a macro.
12353
6a36ff94
PE
123542004-05-24 Paul Eggert <eggert@cs.ucla.edu>
12355
6712933e
PE
12356 Undo change made earlier today: it caused autopoint to not bring
12357 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
12358 autopoint's.
12359
12360 * bootstrap: Check that gettext version matches what's in
12361 configure.ac. Warn users to ignore robots.txt ERROR 404.
12362 * bootstrap: Undo today's earlier change (logged below).
12363 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 12364
6a36ff94
PE
12365 The gettext version checking is causing more trouble than it's
12366 curing; remove it. Problem reported by Paul Hilfinger.
12367
12368 * bootstrap: Issue a warning that one can expect a message
12369 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
12370 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
12371
209ea708
PE
123722004-05-23 Paul Eggert <eggert@cs.ucla.edu>
12373
12374 Ensure that the C++ compiler used for testing actually works on a
12375 simple test program; if not, skip the C++-related tests. Problem
12376 reported by Vin Shelton in:
161a71f3 12377 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
12378
12379 * m4/cxx.m4: New file.
12380 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
12381 * tests/atlocal.in (BISON_CXX_WORKS): Add.
12382 * tests/local.at (AT_COMPILE_CXX): Use it.
12383
41ca2549
PE
123842004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12385
383e69dc
PE
12386 * data/glr.c (yylloc): Output this macro even if locations are not
12387 being generated, as the GLR parser needs it even in that case.
12388 Problem reported by Troy A. Johnson
12389 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
12390
41ca2549
PE
12391 * configure.ac (AC_INIT): Update to 1.875e.
12392
e476c87d
PE
123932004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12394
12395 * NEWS: Version 1.875d.
12396 * configure.ac (AC_INIT): Likewise.
12397 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
12398
12399 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
12400 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
12401 lalr1.cc runs afoul of the first, and the last two are no longer
12402 supported by GCC 3.4.0.
12403 * README: Mention GNU m4 1.4 or later; mention m4 patches.
12404 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
12405
233a88ad
PE
124062004-05-06 Paul Eggert <eggert@cs.ucla.edu>
12407
12408 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
12409 unsigned int, for compatibility with latest gnulib hash module.
12410 * src/state.c (state_hash, state_hasher): Likewise.
12411 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
12412 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 12413
12ffdd28
PE
124142004-05-03 Paul Eggert <eggert@cs.ucla.edu>
12415
12416 * NEWS: Unescaped newlines are no longer allowed in char & strings.
12417
12418 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
12419 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
12420 character and string literals.
12421 (unexpected_end): New function.
12422 (unexpected_eof): Use it.
12423 (unexpected_newline): New function.
12424 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12425 actions.
e476c87d 12426
12ffdd28
PE
12427 * NEWS: Document %expect-rr.
12428
12429 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12430 Fix typo by replacing $1 with $option.
12431 Remove more 'intl'-related files.
9668e2be 12432 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
12433
12434 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12435 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12436 strtoul.c.
12437 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12438 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12439 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12440 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12441 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12442 * src/.cvsignore: Add *.output.
12443
12444 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12445 gets copied to the output file.
e476c87d 12446
1f65350a
PE
124472004-04-28 Paul Eggert <eggert@twinsun.com>
12448
12449 Get files from the gnulib and po repositories, instead of relying
12450 on them being in our CVS. Upgrade to latest versions of gnulib
12451 and Automake.
12452
12453 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12454 * bootstrap: Bootstrap from gnulib and po repositories.
12455 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12456 * README-cvs: Document these changes. Remove version numbers from
12457 mentions of build tools, since they change so often. Mention Flex.
12458
12459 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12460 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
12461 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12462 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 12463 does this for us.
12ffdd28
PE
12464 (AC_ISC_POSIX): Remove; we no longer support this
12465 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
12466 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12467 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12468 Do not check for C89 headers, except for locale.h which is used
12469 by the Yacc library and must port to K&R hosts.
12470 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12471 Do not check for C89 functions, except for setlocale which is
12472 used by the Yacc library.
12473 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12474 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12475 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12476 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12477 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12478 AM_GNU_GETTEXT): Remove; now done by:
12479 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12480 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12481 for us.
12482
12483 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12484 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12485 Define to empty, as gnulib.mk will do the rest for us.
12486 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12487 for us.
12488 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12489 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12490
12491 * src/files.c: Include gnulib's xstrndup.h.
12492
12493 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12494 (REALLOC): Use xnrealloc, for likewise.
12495 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12496 (strnlen, memrchr): Remove decls; functions no longer used.
12497 Include <stpcpy.h>.
12498
12499 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12500 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12501 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12502 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12503 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12504 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12505 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12506 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
12507 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
12508 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
12509 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
12510 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12511 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
12512 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
12513 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
12514 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
12515 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
12516 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
12517 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
12518 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
12519 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
12520 Remove, as these files are now generated automatically
12521 by bootstrap or automake.
12522
12523 * po/ChangeLog: Remove: all but one entry was a duplicate
12524 of this file, and I moved that 2000-11-02 entry here.
12525
12526 * config/.cvsignore: Add Makefile, depcomp, install-sh.
12527 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
12528 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
12529 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
12530 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
12531 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
12532 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
12533 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
12534 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
12535 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
12536 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
12537 xstrndup.h.
12538 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
12539 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
12540 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
12541 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
12542 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
12543 * src/.cvsignore: Remove *_.c.
12544
12545
12546 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
12547 support it. (The latest stable gzip doesn't.)
12548
125492004-04-27 Paul Eggert <eggert@twinsun.com>
12550
12551 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
12552 case, as stos_ is now used by destructors due to the 2004-02-09
12553 change.
12554
12555 Remove more K&R C support.
12556 * lib/libiberty.y (PARAMS): Remove. All uses removed.
12557 * lib/subpipe.c (errno): Remove decl.
12558 Include <stdlib.h> unconditionally.
12559 (EXIT_FAILURE): Remove macro.
12560 * src/complain.c (vfprintf, strerror): Remove.
12561 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
12562 unconditionally.
12563 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
12564 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
12565 (strchr, strspn, memchr): Remove decls.
12566 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
12567 unconditionally. Do not declare perror.
12568 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
12569 unconditionally.
12570
12571 * src/complain.c (_): Remove useless defn, as system.h defines this.
12572
12573 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
12574 with latest obstack.h.
12575 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
12576 to procedure types, as obstack.h now does that for us.
12577 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
12578
12579 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
12580 so that this include file can stand alone.
12581 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
12582 does this now. Include subpipe.h first after config.h, to
12583 test whether it can stand alone.
12584
12585 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
12586 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
12587 unused declaration.
12588
12589 * tests/synclines.at (%union synch line): Put a dummy member in
12590 the union, because empty unions aren't allowed in C. Caught
12591 by GCC 3.4.0.
12592
4f16766c
PE
125932004-04-13 Jim Meyering <jim@meyering.net>
12594
12595 * src/conflicts.c (conflicts_print): Correct format string typo:
12596 use `%%' to produce literal `%'. (trivial change)
12597
779e7ceb
PE
125982004-03-30 Paul Eggert <eggert@twinsun.com>
12599
12600 * src/getargs.c (version): Update copyright year to 2004.
12601
12602 * data/c.m4 (b4_int_type): Use 'short int' rather than
12603 'short', and similarly for 'long', 'unsigned', etc.
12604 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
12605 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
12606 yy_yypstack, yydumpstack): Likewise.
12607 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
12608 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
12609 Likewise.
12610 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
12611 yy_stack_print, yyparse): Likewise.
12612 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
12613 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
12614 * lib/bitset.c (bitset_print): Likewise.
12615 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
12616 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12617 * lib/bitsetv.c (bitsetv_dump): Likewise.
12618 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
12619 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
12620 Likewise.
12621 * src/LR0.c (allocate_itemsets): Likewise.
12622 * src/gram.h (rule_number, rule): Likewise.
12623 * src/lalr.h (goto_number): Likewise.
12624 * src/nullable.c (nullable_compute): Likewise.
12625 * src/output.c (prepare_rules): Likewise.
12626 * src/relation.c (relation_print, relation_digraph): Likewise.
12627 * src/relation.h (relation_node): Likewise.
12628 * src/state.h (state_number, transitions, errs, reductions,
12629 struct state): Likewise.
12630 * src/symtab.h (symbol_number, struct symbol): Likewise.
12631 * src/tables.c (vector_number, tally, action_number,
12632 default_goto, goto_actions): Likewise.
12633 * tests/existing.at (GNU Cim Grammar): Likewise.
12634 * tests/regression.at (Web2c Actions): Likewise.
12635
12636 * src/output.c (muscle_insert_short_int_table): Renamed from
12637 muscle_insert_short_table. All uses changed.
12638
d6328241
PH
126392004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12640
12641 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
12642 (declaration): Replace expected_conflicts with expected_sr_conflicts.
12643 Add %expect-rr rule.
4f16766c 12644
d6328241
PH
12645 * src/scan-gram.l: Recognize %expect-rr.
12646
4f16766c 12647 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 12648 expected_conflicts.
4f16766c 12649 (expected_rr_conflicts): Declare.
d6328241
PH
12650
12651 * src/conflicts.c (expected_sr_conflicts): Rename from
12652 expected_conflicts.
12653 (expected_rr_conflicts): Define.
12654 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
12655 for GLR parsers.
12656 Use expected_sr_conflicts in place of expected_conflicts.
12657 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 12658
d6328241 12659 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 12660
1452af69
PE
126612004-03-08 Paul Eggert <eggert@gnu.org>
12662
12663 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 12664 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
12665
12666 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12667 in lalr1.cc.
12668 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12669 * src/scan-gram.l (scan_integer): New function.
12670 ({int}): Use it.
12671 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12672 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12673 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12674 Say "long int", not "long", for uniformity with GNU style.
12675
006d217d
PE
126762004-02-25 Paul Eggert <eggert@twinsun.com>
12677
12678 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12679 compilers. This fixes a problem with Intel's C++ compiler being
12680 chatty, reported by Guido Trentalancia in
161a71f3 12681 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 12682
c2729758
ADL
126832004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12684
12685 Support %destructor and merge error locations in lalr1.cc.
12686
12687 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12688 (Parser::stos_): Define unconditionally.
12689 (Parser::destruct_): New method. Generate its body with
12690 b4_yydestruct_generate.
12691 (Parser::error_start_): New attribute.
12692 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12693 token which are discarded.
12694 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12695 error_start_ when erroneous token are discarded.
12696 (Parser::parse) <yyerrlab1>: Compute the location of the error
12697 token so that it covers all the discarded tokens.
12698 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12699 it can be called with `%skeleton "lalr1.cc"', and do that.
12700
dd0e0635
PE
127012004-02-02 Paul Eggert <eggert@twinsun.com>
12702
12703 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12704 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12705 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12706 There's no need to mention top_builddir since Automake does that
12707 for us.
12708 (INCLUDES): Remove, as Automake says it's obsolescent.
12709 Contents migrated into AM_CPPFLAGS as described above.
12710 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12711
127122004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12713
12714 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12715 (yyreportSyntaxError): Handle case where lookahead token is
12716 YYEMPTY.
12717
be16239b
PH
127182004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12719
12720 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12721 resulting parsers are compilable with C++.
12722
5fa90832
PE
127232003-12-23 Paul Eggert <eggert@twinsun.com>
12724
12725 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12726 * src/output.c (output_skeleton): Rename local var.
12727 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12728 Bison tokens, as this runs afoul of the 2003-10-07 change that
12729 disallowed NUL bytes in character constants or string literals.
12730
12731 * tests/local.at: Require Autoconf 2.59's Autotest.
12732 * tests/testsuite.at: Don't include local.at, since we now assume
12733 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12734 including it.
12735 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12736 multiple inclusion warnings.
dd0e0635 12737
b165c324
AD
127382003-12-02 Akim Demaille <akim@epita.fr>
12739
12740 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12741 conditions.
12742 From Bruno Haible.
12743
26e06a21
ADL
127442003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12745
12746 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12747
92ac3705
PE
127482003-10-07 Paul Eggert <eggert@twinsun.com>
12749
6a5ecb38
PE
12750 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12751 if testsuite doesn't exist.
12752
92ac3705
PE
12753 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12754 literals, unfortunately.
12755 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12756 Complain about NUL bytes in character constants or string literals.
12757
91d2c560
PE
127582003-10-05 Paul Eggert <eggert@twinsun.com>
12759
12760 * NEWS: Don't document %no-default-prec, as it's still
12761 too experimental.
12762 * doc/bison.texinfo: Document %no-default-prec only if
12763 the defaultprec flag is set. Normally it's not.
12764
0cc3da3a
PE
127652003-10-04 Paul Eggert <eggert@twinsun.com>
12766
12767 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12768 non-modifiable lvalue, instead of a modifiable one.
12769 * doc/bison.texinfo (Actions): Document that $$ can
12770 be assigned to. Do not claim that $$ and $N are
12771 array element references: user code should not rely on this.
12772
22fccf95
PE
127732003-10-01 Paul Eggert <eggert@twinsun.com>
12774
12775 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12776 (grammar_declaration): Use it.
12777 * src/scan-gram.l: New token %no-default-prec.
12778 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12779 * NEWS, doc/bison.texinfo: Document the above.
12780
fc8f2965
AD
127812003-10-01 Akim Demaille <akim@epita.fr>
12782
12783 VCG no longer supports long_straight_phase.
12784
12785 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12786 * src/print_graph.c (print_graph): Adjust.
12787
39a06c25
PE
127882003-09-30 Frank Heckenbach <frank@g-n-u.de>
12789 and Paul Eggert <eggert@twinsun.com>
12790
12791 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12792 Table of Symbols): Document %default-prec.
12793 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12794 (grammar_declaration): Set default_prec on %default-prec.
12795 * src/scan-gram.l (%default-prec): New token.
12796 * src/reader.h (default_prec): New flag.
12797 * src/reader.c: Likewise.
12798 (packgram): Handle it.
12799 * tests/conflicts.at (%default-prec without %prec,
12800 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 12801
39a06c25
PE
128022003-09-30 Paul Eggert <eggert@twinsun.com>
12803
12804 * tests/testsuite.at: Include local.at, not input.at, fixing
12805 a typo in the 2003-08-25 patch.
12806
62b6aef9
AD
128072003-08-27 Akim Demaille <akim@epita.fr>
12808
12809 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12810 GCC warnings.
12811
89e1cc61
AD
128122003-08-26 Akim Demaille <akim@epita.fr>
12813
12814 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12815 "<\#" to avoid magic from Gnus when posting parts of this script.
12816
a08460b0
AD
128172003-08-26 Akim Demaille <akim@epita.fr>
12818
12819 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12820 (Parser::parse): here.
12821 Adjust: nerrs and errstatus is now replaced by...
12822 (Parser::nerrs_, Parser::errstatus_): New.
12823
603f1cfd
AD
128242003-08-25 Akim Demaille <akim@epita.fr>
12825
12826 * config/announce-gen, Makefile.cfg: New.
12827 * Makefile.am: Adjust.
12828 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12829 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12830
cd3684cf
AD
128312003-08-25 Akim Demaille <akim@epita.fr>
12832
12833 When reducing initial empty rules, Bison parser read an initial
12834 location that is not defined. This results in garbage, and that
12835 affects Bison's own parser. Therefore we need (i) to extend Bison
12836 to support a means to initialize this location, and (ii) to use
12837 this CVS Bison to fix CVS Bison's parser.
12838
12839 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12840 with...
12841 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12842 * src/parse-gram.y: Adjust.
12843 (%initial-action): New.
12844 (%error-verbose): Since we require CVS Bison, there is no reason
12845 not to use it.
12846 * src/scan-gram.l: Adjust.
12847 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12848 * data/yacc.c (yyparse): Use b4_initial_action.
12849
4e03e201
AD
128502003-08-25 Akim Demaille <akim@epita.fr>
12851
12852 * doc/bison.texinfo: Don't promote stdout for error messages.
12853
8c182d05
AD
128542003-08-25 Akim Demaille <akim@epita.fr>
12855
12856 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
12857 From Alexandre Duret-Lutz.
12858
6a60c4cf
PE
128592003-08-25 Akim Demaille <akim@epita.fr>
12860
12861 Version 1.875c.
12862
25f66e1a
AD
128632003-08-25 Akim Demaille <akim@epita.fr>
12864
12865 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
12866 Use them.
12867
5348bfbe
AD
128682003-08-25 Akim Demaille <akim@epita.fr>
12869
12870 * data/lalr1.cc (Parser::reduce_print_): New.
12871 Use it.
12872
47301314
AD
128732003-08-25 Akim Demaille <akim@epita.fr>
12874
12875 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
12876 error recovery loops. This patch is based on
161a71f3 12877 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
12878 Also, augment the similarity between lalr1.cc and yacc.c.
12879 Note: the locations of error recovery rules are not correct yet.
12880
12881 * data/lalr1.cc: Comment changes to augment the similarity between
12882 lalr1.cc and yacc.c.
12883 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
12884 (yyerrlab1): Remove, but where it used to be (now the bottom part of
12885 yyerrlab), when hitting EOF, pop the whole stack here instead of
12886 merely falling thru the default error handling mechanism.
12887 (yyerrorlab): New label, with the old contents of YYERROR,
12888 plus the following change: pop the stack of rhs corresponding
12889 to the production that invoked YYERROR. That is how Yacc
12890 behaves (required by POSIX).
12891 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
12892 fail.
12893
1f7a61ff
AD
128942003-08-25 Akim Demaille <akim@epita.fr>
12895
12896 Tune local.at so that people can "autom4te -l autotest calc.at -o
12897 calc" for instance, to extract a sub test suite.
12898
12899 * tests/testsuite.at: Move the initialization, Autotest version
12900 requirement, and AT_TESTED invocation into...
12901 * tests/local.at: here.
12902 * tests/testsuite.at: Include it for compatibility with Autoconf
12903 2.57.
12904 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
12905 be ignore.
12906
327b5b56
PE
129072003-08-04 Paul Eggert <eggert@twinsun.com>
12908
12909 Rework code slightly to avoid gcc -Wtraditional warnings.
12910 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
12911 The returned value is now stored in *YY0. All callers changed.
12912 * src/output.c (merge_output): Adjust to the above change.
12913
0051e3ed
PE
129142003-07-26 Paul Eggert <eggert@twinsun.com>
12915
12916 * data/glr.c (YYASSERT): New macro.
12917 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
12918 yyresolveStates, yyprocessOneStack):
12919 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
12920 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 12921
137437c6
PE
129222003-07-25 Paul Eggert <eggert@twinsun.com>
12923
5b620e06
PE
12924 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
12925 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 12926 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
12927 by Frank Heckenbach, though I have omitted the structure-initialization
12928 part of his glr-knr.diff patch since I recall that the Portable
12929 C Compiler didn't require that change.
12930
137437c6
PE
12931 Let the user specify how to allocate and free memory.
12932 Derived from a suggestion by Frank Heckenbach in
161a71f3 12933 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
12934 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
12935 All uses of free, malloc, realloc changed to use these macros,
12936 and unnecessary casts removed.
12937 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
12938
ddb85ca5
PE
129392003-07-06 Matthias Mann <MatthiasMann@gmx.de>
12940
12941 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
12942 use s.empty() rather than s == "" to test for empty string; see
161a71f3 12943 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
12944 (trivial change)
12945
39910e09
AD
129462003-06-25 Akim Demaille <akim@epita.fr>
12947
12948 * config/depcomp, config/install-sh: Update from masters.
12949
0ae99356
PE
129502003-06-20 Paul Eggert <eggert@twinsun.com>
12951
12952 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
12953 and return properly parenthesized result.
12954 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
12955 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
12956 Remove unnecessary parentheses from uses.
12957 * doc/bison.texinfo (Location Default Action): Describe the
12958 conventions for parentheses.
12959
cd05d13c
PE
129602003-06-19 Paul Eggert <eggert@twinsun.com>
12961
81fd08ca
PE
12962 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
12963 yyreportTree): Do not assume that size_t is the same width as int,
12964 when printing sizes. Print sizes using an unsigned format.
12965 Problem reported by Frank Heckenbach in
161a71f3 12966 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 12967
cd05d13c
PE
12968 Port to Forte Developer 7 C compiler.
12969 * data/glr.c (struct YYLTYPE): If locations are not being used,
12970 declare a single dummy member, as empty structs do not conform
12971 to the C standard.
12972 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
12973 the Forte Developer 7 C compiler complains that end-of-loop
12974 code is not reached.
12975
4dcf140b
PE
129762003-06-17 Paul Eggert <eggert@twinsun.com>
12977
12978 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
12979 avoid warnings from picky compilers about redefinition of PARAMS.
12980
8dd76bee
PE
129812003-06-17 Paul Eggert <eggert@twinsun.com>
12982
12983 Version 1.875b.
12984
12985 * NEWS: Document 1.875b.
12986
12987 * lib/bbitset.h: Do not include config.h; that's the includer's job.
12988 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
12989 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
12990 Don't use 'index' in comments, as it's a builtin fn on some hosts.
12991 * lib/bitset_stats.c: Include gettext.h unconditionally, as
12992 per recent gettext manual's suggestion.
12993 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
12994 Use prototypes, not old-style definitions.
12995 * lib/lbitset.c (lbitset_unused_clear): Likewise.
12996 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
12997 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
12998 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
12999 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13000 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13001 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13002 vbitset_or_and_cmp, vbitset_copy): Likewise.
13003
13004 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13005 Do not include <stdlib.h>.
13006 (PARAMS): Define unconditionally for C89.
13007 (ATTRIBUTE_NORETURN): Remove.
13008 (ATTRIBUTE_UNUSED): Define unconditionally.
13009
13010 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 13011 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
13012 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13013 * lib/vbitset.c, lib/vbitset.h: New files.
13014 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13015 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13016 from libbitset.
13017
13018 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13019 `How Can I Reset @code{yyparse}', since texinfo does not allow
13020 arbitrary @ in node names.
13021
13022 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13023 shouldn't be needed according to the gettext 0.12.1 documentation
13024 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 13025 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 13026 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 13027 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 13028
8dd76bee
PE
13029 * lib/.cvsignore: Add stdbool.h.
13030 * m4/.cvsignore: Add nls.m4, po.m4.
13031
13032 Upgrade to CVS gnulib.
13033 * stdbool_.h: File renamed from stdbool.h.in.
13034 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13035 AC_HEADER_STDBOOL.
13036 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13037 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13038 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13039 (MOSTLYCLEANFILES): New var.
13040 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13041 (stdbool.h): New rule.
13042 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13043 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13044 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13045 m4/quote.m4: Upgrade to today's gnulib.
13046
13047 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13048 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13049 the tests right now.
13050 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13051 yyerror are declared before use; C99 requires this.
13052
25005f6a
PH
130532003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13054
13055 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13056 first.
13057 (yyrecoverSyntaxError): Correct the logic for setting and testing
13058 yyerrState.
13059 Correct comment on handling EOF.
13060 Allow states with only a default reduction, rather than failing
8dd76bee 13061 (I can't quite reconstruct why these were not allowed before).
25005f6a 13062
137437c6 13063 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 13064 buffer overruns, corrupting state.
8dd76bee
PE
13065
13066 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
13067 definition.
13068 * src/reader.h (max_left_semantic_context): New variable declaration.
13069 * src/scan-gram.l (max_left_semantic_context): Define.
13070 (handle_action_dollar): Update max_left_semantic_context.
13071 * data/glr.c (YYMAXLEFT): New definition.
13072 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13073 (yyresolveAction): Ditto.
13074
13075 Fixes to problems with location handling in GLR parsers reported by
13076 Frank Heckenbach (2003/06/05).
13077
13078 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13079 (YYRHSLOC): Add parentheses, and define only if locations used.
13080 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13081 locations not used.
13082 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13083 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 13084
25005f6a
PH
13085 * tests/cxx-type.at: Exercise location information; update tests
13086 to differentiate output with and without locations.
8dd76bee 13087 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
13088 because default YYLTYPE not yet defined.
13089 Change semantic actions to compute strings, rather than printing
13090 them directly (to test proper passing of semantics values). Change
13091 output to prefix notation and update test data and expected results.
13092 (yylex): Track locations.
13093 (stmtMerge): Return value rather than printing, and include arguments
13094 in value.
8dd76bee 13095
711f40b7
PE
130962003-06-03 Paul Eggert <eggert@twinsun.com>
13097
13098 Avoid warnings generated by GCC 2.95.4 when Bison is
13099 configured with --enable-gcc-warnings.
13100 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
13101 yy::]b4_parser_class_name[::translate_,
13102 yy::Stack::operator[] (unsigned),
13103 yy::Stack::operator[] (unsigned) const,
13104 yy::Slice::operator[] (unsigned),
13105 yy::Slice::operator[] (unsigned) const):
13106 Rename local vars to avoid warnings.
13107 * tests/glr-regression.at (Improper handling of embedded actions
13108 and $-N in GLR parsers): Remove unused local variable from yylex.
13109 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13110 (void) as arg when not pure, since we now assume C89 when building
13111 Bison. Pacify GCC by using parameter.
13112
ac695f7d
PE
131132003-06-02 Paul Eggert <eggert@twinsun.com>
13114
13115 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13116 yy::Location::lines, yy::Location::columns): Rename arguments
13117 to avoid shadowing; this removes a warning generated by GCC 3.3.
13118
26ec81e0
PE
131192003-06-01 Paul Eggert <eggert@twinsun.com>
13120
13121 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
13122 to g++, as GCC 3.3 complains if you do it.
13123 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
13124 everything that WARNING_CFLAGS has, except omit warnings
13125 not suitable for C++.
13126 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
13127 * tests/atlocal.in (CXXFLAGS): New var.
13128 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
13129
13130 Fix a GLR parser bug I reported in February; see
161a71f3 13131 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
13132 The problem was that GLR parsers did not conform to the C standard,
13133 because actions like { $1 = $2 + $3; } expanded to expressions
13134 that invoked YYFILL in separate subexpressions, and YYFILL assigned
13135 to a local variable. The C standard says that expressions
13136 like (var = f ()) + (var = f ()) have undefined behavior.
13137 Another problem was that GCC sometimes issues warnings that
13138 yyfill and its parameters are unused.
13139
13140 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
13141 as possibly unused.
13142 (yyfill): New function.
13143 (YYFILL): Use it.
13144 (yyuserAction): Change type of yynormal to bool, so that it matches
13145 the new yyfill signature. Mark it as possibly unused.
13146
13147
13148 Follow up on a bug I reported in February, where a Bison-generated
13149 parser can loop. Provide a test case and a fix for yacc.c. I
13150 don't have a fix for lalr1.cc or for glr.c, unfortunately.
13151 The original bug report is in:
161a71f3 13152 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
13153
13154 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
13155 macro's size was becoming unwieldy.
13156 (yyerrlab): Do not discard an empty lookahead symbol, as this
13157 might destroy garbage.
13158 (yyerrorlab): New label, with the old contents of YYERROR,
13159 plus the following change: pop the stack of rhs corresponding
13160 to the production that invoked YYERROR. That is how Yacc
13161 behaves, and POSIX requires this behavior.
13162 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
13163 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
13164 Define 'alarm' to do nothing if unistd.h is not available.
13165 Add a new rule "exp: '-' error;" to test the above change to
13166 data/yacc.c. Use 'alarm' to abort any test taking longer than
13167 10 seconds, as it's probably looping.
13168 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
13169 Also, the new yacc.c generates two fewer diagnostics for an
13170 existing test.
13171
d0829076
PE
131722003-05-24 Paul Eggert <eggert@twinsun.com>
13173
c6ae27df
PE
13174 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
13175 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
13176 This fixes a problem reported by John Bowman when the Compaq/HP
13177 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
13178 -ansi -Wall -gall).
13179 * data/yacc.c (union yyalloc): Likewise.
13180 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 13181
d0829076
PE
13182 Switch from 'int' to 'bool' where that makes sense.
13183
13184 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
13185 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
13186 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
13187 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
13188 Return or accept bool, not int. All callers changed.
13189 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
13190 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
13191 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
13192 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
13193 bitset_or_and_cmp_): Likewise.
13194 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
13195 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
13196 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
13197 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
13198 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
13199 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
13200 bitset_stats_or_and_cmp): Likewise.
13201 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
13202 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
13203 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
13204 ebitset_xor_cmp): Likewise.
13205 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
13206 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
13207 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
13208 lbitset_xor_cmp): Likewise.
13209 * lib/bbitset.h: Include <stdbool.h>.
13210 (struct bitset_vtable): The following members now return bool, not
13211 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
13212 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
13213 or_and_cmp).
13214 * src/conflicts.c (count_rr_conflicts): Likewise.
13215 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
13216 All uses changed.
13217 * lib/ebitset.c (ebitset_obstack_init): Likewise.
13218 * lib/lbitset.c (lbitset_obstack_init): Likewise.
13219 * src/getargs.c (debug_flag, defines_flag, locations_flag,
13220 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13221 graph_flag): Likewise.
13222 * src/getargs.h (debug_flag, defines_flag, locations_flag,
13223 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13224 graph_flag): Likewise.
13225 * src/output.c (error_verbose): Likewise.
13226 * src/output.h (error_verbose): Likewise.
13227 * src/reader.c (start_flag, typed): Likewise.
13228 * src/reader.h (typed): Likewise.
13229 * src/getargs.c (LOCATIONS_OPTION): New constant.
13230 (long_options, getargs): Use it.
13231 * src/lalr.c (build_relations): Use bool, not int.
13232 * src/nullable.c (nullable_compute): Likewise.
13233 * src/print.c (print_reductions): Likewise.
13234 * src/tables.c (action_row, pack_vector): Likewise.
13235 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
13236 * src/output.c (prepare): Use it.
13237 * src/output.c (token_definitions_output,
13238 symbol_destructors_output, symbol_destructors_output): Use string,
13239 not boolean integer, to keep track of whether to output separator.
13240 * src/print_graph.c (print_core): Likewise.
13241 * src/state.c (state_rule_lookaheads_print): Likewise.
13242
13243 * config/install-sh: Sync from automake 1.7.5.
13244
6b2584b7
PE
132452003-05-14 Paul Eggert <eggert@twinsun.com>
13246
13247 * src/parse-gram.y (rules_or_grammar_declaration): Require a
13248 semicolon after a grammar declaration, in the interest of possible
13249 future changes to the Bison input language.
13250 Do not allow a stray semicolon at the start of the grammar.
13251 (rhses.1): Allow one or more semicolons after any rule, including
13252 just before "|" as required by POSIX.
13253 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
13254 grammar.
13255
caf37a36
ADL
132562003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
13257
13258 %parse-param support for lalr1.cc.
13259
13260 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
13261 b4_cc_constructor_calls, b4_cc_constructor_call,
13262 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
13263 definitions.
13264 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
13265 parse-param arguments.
13266 (yy::b4_parser_class_name): Declare instance variables to
13267 hold parse-param arguments.
13268 * tests/calc.at: s/value/semantic_value/ because value clashes
13269 with a member of yy::b4_parser_class_name. Adjust C++ code
13270 to handle %parse-param. Enable %parse-param test in C++.
13271
3ab37077
PE
132722003-05-12 Paul Eggert <eggert@twinsun.com>
13273
13274 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
13275 English a bit. Fix fclose typo. Change "const char" to "char
13276 const", and use ANSI C rather than K&R for "main". Suggest
13277 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
13278 and suggest yy_switch_to_buffer.
13279
132802003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
13281
13282 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
13283 C89. This avoids a diagnostic on compilers that define __STDC__
13284 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 13285 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 13286
e743727f
PE
132872003-05-03 Paul Eggert <eggert@twinsun.com>
13288
13289 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
13290 Do not overrun array bounds.
13291 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 13292 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 13293
916708d5
AD
132942003-04-29 Akim Demaille <akim@epita.fr>
13295
13296 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
13297 * src/getargs.c, src/getargs.h: here, as bool, not int.
13298 (nondeterministic_parser): New.
13299 * src/parse-gram.y, src/scan-gram.l: Support
13300 %nondeterministic-parser.
13301 * src/output.c (prepare): Use nondeterministic_parser instead
13302 of glr_parser where appropriate.
13303 * src/tables.c (conflict_row, action_row, save_row)
13304 (token_actions, token_actions, pack_vector): Ditto.
13305
a06ea4aa
AD
133062003-04-29 Akim Demaille <akim@epita.fr>
13307
13308 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
13309
211074ca
AD
133102003-04-29 Akim Demaille <akim@epita.fr>
13311
13312 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
13313 with %pure-parser and %locations to exercise the patch from Yakov
13314 Markovitch below.
13315
6175ffe3
PE
133162003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
13317
13318 * data/yacc.c: (b4_lex_param): Corrected for the case where
13319 %lex-param is provided and %pure-parser isn't.
13320
b1e95857
PE
133212003-04-27 Paul Eggert <eggert@twinsun.com>
13322
13323 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 13324 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
13325 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
13326 if it is not defined.
13327 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
13328
acda9df6
PE
133292003-04-26 Paul Eggert <eggert@twinsun.com>
13330
3470c57b
PE
13331 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
13332 Declare to be of type suitable for the ninf value itself, not of
13333 type suitable for the corresponding table, since the latter might
13334 be unsigned but the ninf value might be negative. This fixes a
13335 bug reported by Alexandre Duret-Lutz in
161a71f3 13336 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 13337
acda9df6
PE
13338 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
13339 invokes it. We shouldn't invoke it twice because it will attempt
13340 to put error.o in the archive twice. This fixes a glitch reported
13341 by Martin Mokrejs in
161a71f3 13342 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 13343
b5250f26
PE
133442003-04-21 Paul Eggert <eggert@twinsun.com>
13345
13346 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
13347 to gnulib.
13348
089ac0f1
PE
133492003-04-21 Yakov Markovitch <Markovitch@iso.ru>
13350
13351 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
13352 Fix obvious typo that results in uncompilable GLR parsers
13353 when both %pure-parser and %locations are used. (trivial change)
13354
5ededac6
PE
133552003-04-17 Paul Eggert <eggert@twinsun.com>
13356
1b8f2fff
PE
13357 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
13358 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
13359 Do not insert the expected token via unput, as this runs afoul
13360 of a POSIX-compatibility bug in flex 2.5.31.
13361 All uses changed to BEGIN the parent state,
13362 since we no longer insert the expected token via unput.
13363 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
13364 that is no longer emitted after the above change.
13365
5ededac6
PE
13366 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
13367 the first one. This change is from Paul Hilfinger, and it fixes
13368 regression reported by Werner Lemberg in
161a71f3 13369 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
13370
13371 (resolve_sr_conflict): Don't invoke state_errs_set
13372 unless one or more tokens have been explicitly made errors.
13373 Otherwise, the above change causes Bison to abort.
13374
13375 * tests/existing.at (GNU pic Grammar): New test case, taken from
13376 Lemberg's email.
13377
b8be9132
AD
133782003-03-31 Akim Demaille <akim@epita.fr>
13379
13380 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
13381
d423d460
AD
133822003-03-31 Akim Demaille <akim@epita.fr>
13383
13384 * src/output.c (prepare_symbols): Avoid trailing spaces in the
13385 output.
13386
c7e441b4
AD
133872003-03-31 Akim Demaille <akim@epita.fr>
13388
13389 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
13390 From Paul Hilfinger.
13391
231897ad
AD
133922003-03-29 Akim Demaille <akim@epita.fr>
13393
13394 * m4/error.m4: Do not put under dynamic conditions some code which
13395 expansion is under static control.
13396
5b066063
AD
133972003-03-29 Akim Demaille <akim@epita.fr>
13398
13399 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
13400
22a74fec
AD
134012003-03-29 Akim Demaille <akim@epita.fr>
13402
13403 * doc/bison.texinfo (Strings are Destroyed): New.
13404
0eee27e7
PE
134052003-03-13 Paul Eggert <eggert@twinsun.com>
13406
13407 * .cvsignore: Add configure.lineno.
13408 * src/.cvsignore: Add yacc.
13409 * tests/.cvsignore: Add testsuite.log.
13410 * doc/fdl.texi: Sync with latest FSF version.
13411
f61aad93
PE
134122003-03-12 Paul Eggert <eggert@twinsun.com>
13413
537636c7
PE
13414 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
13415 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
13416 cursor, instead of leaving it undefined. This fixes a bug
13417 reported by Tim Van Holder in
161a71f3 13418 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
13419 * tests/input.at (Torturing the Scanner): Test the scanner on
13420 an empty input file, which was Tim Van Holder's test case.
13421
13422 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13423 <sys/resource.h> can be included, include sys/time.h and
13424 sys/times.h first, if available. This works around the SunOS
13425 4.1.4 porting bug reported by Bruce Becker in
161a71f3 13426 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
13427
13428 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13429 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13430 AC_HEADER_SYS_WAIT.
13431
f61aad93
PE
13432 Merge changes from gnulib. This was prompted because the CVS
13433 snapshot didn't build on Solaris 7 due to strnlen problems.
13434
13435 These changes need to be merged back into gnulib:
13436 * lib/hash.c: Include <stdbool.h> unconditionally.
13437 * m4/onceonly.m4 (m4_quote): New macro.
13438 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13439 Quote AC_FOREACH variable-expansions properly.
13440 The 2003-01-03 obstack.h change also needs merging.
13441 {end of changes requiring merging}
5b066063 13442
f61aad93
PE
13443 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13444 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13445 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13446 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13447 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13448 New files, imported from gnulib.
13449 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13450 above.
13451
13452 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13453 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13454 gnulib sources.
13455
13456 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13457 Add.
13458 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13459 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13460 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13461 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13462 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13463 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13464 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13465 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13466 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13467 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13468 (jm_PREREQ_ARGMATCH): Remove.
13469 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13470 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13471
13472 * src/system.h: Include <stdbool.h> unconditionally.
13473
13474 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13475 assuming at least C89 in the bitset code for some time now.
13476
d2ffe116
AD
134772003-03-03 Akim Demaille <akim@epita.fr>
13478
13479 * ro.po: New.
13480
052826fd
AD
134812003-03-02 Akim Demaille <akim@epita.fr>
13482
13483 * doc/bison.texinfo (Table of Symbols): Reactivate the
13484 documentation for %lex-param, and %parse-param.
13485
c4749565
AD
134862003-03-02 Akim Demaille <akim@epita.fr>
13487
13488 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13489 generate verbose error messages.
13490 Use the number of tokens as an upper bound in yytname, as it
13491 cannot be a non terminal.
13492
d5286af1
AD
134932003-03-02 Akim Demaille <akim@epita.fr>
13494
13495 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13496 message.
13497
22e304a6
AD
134982003-03-02 Akim Demaille <akim@epita.fr>
13499
22e304a6
AD
13500 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13501 Use them to exercise yycheck overrun.
13502 Based on Andrew Suffield's grammar.
13503
67a25fed
AD
135042003-03-02 Akim Demaille <akim@epita.fr>
13505
13506 Create tests/local.at for Bison generic testing macros.
13507
13508 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
13509 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
13510 This new file.
13511 * tests/calc.at (AT_CHECK_CALC): Adjust.
13512 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
13513 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
13514 * tests/local.at: here.
13515 (AT_COMPILE_CXX): Tags the tests using it as c++.
13516 Ignore the test if CXX is not functional.
13517
9c2b381f
PE
135182003-03-01 Paul Eggert <eggert@twinsun.com>
13519
13520 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
13521 not loc->end, since loc->end might contain garbage and this leads
13522 to undefined behavior on some platforms.
13523 (id_loc, token_start): Use (IF_LINTed) initial values that do not
13524 depend on *loc, so that the reader doesn't give the the false
13525 impression that *loc is initialized.
13526 (<INITIAL>"%%"): Do not bother setting code_start, since its value
13527 does not survive the return.
13528
0433ba88
AD
135292003-03-01 Akim Demaille <akim@epita.fr>
13530
13531 * src/scan-gram.l (code_start): Always initialize it when entering
13532 into yylex, as SC_EPILOGUE is activated *before* the corresponding
13533 yylex invocation. An alternative would be making it static, but
13534 then it starts with the second %%'s beginning, instead of its end.
13535
b305ea69
PE
135362003-02-28 Paul Eggert <eggert@twinsun.com>
13537
13538 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
13539 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 13540 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 13541
c3d25e01
PE
135422003-02-26 Paul Eggert <eggert@twinsun.com>
13543
13544 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
13545 Remove Sequent/Pyramid discussion (nobody uses them any more).
13546 Merge VMS and MS-DOS discussion; these ports may well be dead
13547 but let's keep mentioning them for now. Put <> around email
13548 addresses. Add copyright notice.
13549
c267ffbc
PE
135502003-02-24 Paul Eggert <eggert@twinsun.com>
13551
13552 * data/glr.c (yy_reduce_print): yylineno -> yylno,
13553 to avoid collision with flex use of yylineno.
13554 Problem reported by Bruce Lilly in
161a71f3 13555 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
13556 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13557 * data/yacc.c (yy_reduce_print): Likewise.
13558
13559 * config/depcomp: Sync with Automake 1.7.3.
13560
f939fc12
AD
135612003-02-21 Akim Demaille <akim@epita.fr>
13562
13563 * data/lalr1.cc: Use temporary variables instead of casts to
13564 change integer types.
13565 Suggested by Paul Eggert.
13566
95923bd6
AD
135672003-02-21 Akim Demaille <akim@epita.fr>
13568
13569 * doc/bison.texinfo: Use "location" consistently to refer to @n,
13570 to avoid confusions with lalr1.cc's notion of Position.
13571 Suggested by Paul Eggert.
13572
2cdc240e
AD
135732003-02-20 Akim Demaille <akim@epita.fr>
13574
13575 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
13576 before initial_columns.
13577 (location.hh): Use consistent variable names when defining the
13578 operator<<.
13579 Use "last" so that we subtract from Positions, not from unsigned.
13580
5d003116
AD
135812003-02-20 Akim Demaille <akim@epita.fr>
13582
13583 * data/lalr1.cc (position.hh): New subfile, including the extended
13584 and Doxygen'ed documentation of class Position.
13585 (location.hh): Use it.
13586 Document a` la Doxygen.
ba1ecc07 13587 With the help of Benoit Perrot.
5d003116 13588
d02b25f9
AD
135892003-02-20 Akim Demaille <akim@epita.fr>
13590
13591 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
13592 AT_YACC_IF.
13593 Redefine AT_YYERROR_SEES_LOC_IF using it.
13594 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
13595 not defined.
13596 Don't use the location in yy::Parser::error_ and
13597 yy::Parser::print_ when not %locations.
13598 Activate more lalr1.cc tests.
13599
0d1c3a04
AD
136002003-02-19 Akim Demaille <akim@epita.fr>
13601
13602 * data/lalr1.cc: When displaying a line number, be sure to make it
13603 an int.
13604
60a777aa
AD
136052003-02-19 Akim Demaille <akim@epita.fr>
13606
13607 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
13608 Remove, useless.
13609 (YYABORT, YYACCEPT, YYERROR): New.
13610 * tests/calc.at: Renable the lalr1.cc test.
13611
0b86fc41
AD
136122003-02-19 Akim Demaille <akim@epita.fr>
13613
13614 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
13615 error recovery, mixing with/without pops and discarding of the
13616 lookahead.
13617 Exercise YYERROR.
13618 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
13619
da99a5dc
PE
136202003-02-17 Paul Eggert <eggert@twinsun.com>
13621
13622 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
13623 * tests/testsuite.at (AT_COMPILE): Use them.
13624 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 13625 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 13626
93b8c255
PE
136272003-02-12 Paul Eggert <eggert@twinsun.com>
13628
13629 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
13630 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 13631 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
13632 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
13633 Check for malloc failure, for consistency with yacc.c.
13634 (yytname_size): Remove, for consistency with yacc.c.
13635
13636 The bug still remains in data/lalr1.cc, as I didn't have time
13637 to fix it there.
13638
7548fed2
AD
136392003-02-06 Akim Demaille <akim@epita.fr>
13640
13641 * configure.ac (GXX): Rename as...
13642 (CXX): this, to keep the original Autoconf semantics.
13643 Require 2.57.
13644 * data/lalr1.cc: Fix b4_copyright invocations.
13645 If YYDEBUG is not defined, don't depend upon name_ being defined.
13646 (location.hh): Include string and iostream.
13647 (Position::filename): New member.
13648 (Position::Position ()): New.
13649 (operator<< (Position)): New.
13650 (operator- (Position, int)): New.
13651 (Location::first, Location::last): Rename as...
13652 (Location::begin, Location::end): these, to mock the conventional
13653 iterator names.
13654 (operator<< (Location)): New.
13655 * tests/atlocal.in (CXX): New.
13656 * tests/testsuite.at (AT_COMPILE_CXX): New.
13657 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13658 locations in a more synthetic way.
13659 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13660 lalr1.cc is used.
13661 Adjust the C locations to match those from Emacs: first column is
13662 column 0.
13663 Change all the expected results.
13664 Conform to the GCS: simplify the locations when applicable.
13665 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13666 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13667 these CPP macros with the m4 macros new defined by...
13668 (AT_CHECK_PUSHDEFS): this, i.e.:
13669 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 13670 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
13671 New macros.
13672 (AT_CHECK_POPDEFS): Undefine them.
13673 (AT_CHECK_CALC_LALR1_CC): New.
13674 Use it for the first lalr1.cc test.
13675
43a176ef
AD
136762003-02-04 Akim Demaille <akim@epita.fr>
13677
13678 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13679 Location as is defined.
13680
fc049e9c
AD
136812003-02-04 Akim Demaille <akim@epita.fr>
13682
13683 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13684 name_ being defined.
13685
a737b216
PE
136862003-02-03 Paul Eggert <eggert@twinsun.com>
13687
13688 * src/gram.h (start_symbol): Remove unused decl.
13689
13690 Use more-consistent naming conventions for local vars.
13691
13692 * src/derives.c (derives_compute): Change type of local var from
13693 int to rule_number.
13694 * src/gram.c (grammar_rules_partial_print): Likewise.
13695 * src/print.c (print_core): Likewise.
13696 * src/reduce.c (reduce_grammar_tables): Likewise.
13697
13698 * src/gram.c (grammar_dump): Change name of item_number *
13699 local var from r to rp.
13700 * src/nullable.c (nullable_compute): Likewise.
13701
13702 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13703
13704 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13705 for symbol or symbol_number var.
13706 * src/reader.c (grammar_start_symbol_set): Likewise.
13707 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13708 Likewise.
13709 * src/state.c (transitions_to): Likewise.
13710 * src/state.h: Likewise.
13711 * src/tables.c (symbol_number_to_vector_number): Likewise.
13712
13713 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13714 char * var.
13715
13716 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13717 var.
13718
13719 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13720 var.
13721
13722 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13723 Use str, not s, for char * var. Use ch, not c, for character var.
13724 Use size for size var.
13725
13726 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13727 char * var.
13728 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13729 uniqstr var.
13730 * src/uniqstr.h: Likewise.
13731
13732 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13733 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13734 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13735 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13736 param to have same name as that of enum, so that we don't use
13737 "s" to stand for a non-state.
13738
68e93ad5
AD
137392003-02-02 Akim Demaille <akim@epita.fr>
13740
13741 * src/scan-skel.l: Scan more than one inert character per yylex
13742 invocation.
13743
92898986
PE
137442003-02-01 Paul Eggert <eggert@twinsun.com>
13745
13746 Version 1.875a.
13747
1d9d5d71
PE
13748 * po/LINGUAS: Add ms.
13749
0435d061
AD
137502003-01-30 Akim Demaille <akim@epita.fr>
13751
13752 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13753
6029a57f
PH
137542003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13755
13756 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13757 of $1.
0435d061
AD
13758
13759 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 13760 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 13761 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 13762
6029a57f
PH
13763 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13764 (b4_rhs_location): Ditto.
0435d061 13765 (yyfill): New function to copy from stack tree into array
6029a57f 13766 incrementally.
0435d061
AD
13767 (yyuserAction): Modify to allow incremental move of semantic values
13768 to rhs array when in GLR mode.
13769 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
13770 as needed.
13771 Remove dummy use of yystack, as there is now a guaranteed use.
13772 (yydoAction): Modify to allow incremental move of semantic values
13773 to rhs array when in GLR mode.
13774 (yyresolveAction): Ditto.
13775 (yyglrShiftDefer): Update comment.
0435d061 13776 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
13777 (yyglrReduce): Ditto.
13778 (yydoAction): Ditto
0435d061 13779
6029a57f
PH
13780 * tests/glr-regr1.at: Rename to ...
13781 * tests/glr-regression.at: Add new regression test for the problems
13782 described above (adapted from S. Eken).
13783 Update copyright notice.
13784 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13785 * tests/Makefile.am: Ditto.
13786
6cee6297
PE
137872003-01-28 Paul Eggert <eggert@twinsun.com>
13788
13789 * data/lalr1.cc: Do not use @output_header_name@ unless
13790 b4_defines_flag is set. This fixes two bugs reported by
13791 Tim Van Holder in
161a71f3
PE
13792 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13793 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 13794
b2a836b5
PE
137952003-01-21 Paul Eggert <eggert@twinsun.com>
13796
13797 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13798 we don't need to worry about yyerrlab1 being reported as an
13799 "unused label" by non-GCC C compilers. The downside is that if
13800 locations are used then a couple of statements are duplicated each
13801 time YYERROR is invoked, but the upside is that the warnings
13802 should vanish.
13803 (yyerrlab1): Move code to YERROR.
13804 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13805 This reverts some of the 2002-12-27 change.
13806
4196b931
PE
138072003-01-17 Paul Eggert <eggert@twinsun.com>
13808
13809 * src/output.c (symbol_printers_output): Fix typo that led
13810 to core dump. Problem reported by Antonio Rus in
161a71f3 13811 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 13812
3ae831b4
AD
138132003-01-13 Akim Demaille <akim@epita.fr>,
13814 Quoc Peyrot <chojin@lrde.epita.fr>,
13815 Robert Anisko <anisko_r@lrde.epita.fr>
13816
13817 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13818 when the stacks contain one element, as the loop would otherwise
13819 free the last state, and then use the top state (the one we just
13820 popped). This means that the initial elements will not be freed
13821 explicitly, as is the case in yacc.c; it is not a problem, as
13822 these elements have fake values.
13823
e3aa65c5
PE
138242003-01-11 Paul Eggert <eggert@twinsun.com>
13825
13826 * NEWS: %expect-violations are now just warnings, reverting
13827 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13828 bootstrapping problem reported by Matthias Klose; see
161a71f3 13829 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
13830 * src/conflicts.c (conflicts_print): Likewise.
13831 * tests/conflicts.at (%expect not enough, %expect too much,
13832 %expect with reduce conflicts): Likewise.
13833 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13834 that the warning is enabled if the number of conflicts changes
13835 (not necessarily increases).
13836
13837 * src/getargs.c (version): Update copyright year.
13838
f0057011
AD
138392003-01-09 Akim Demaille <akim@epita.fr>
13840
13841 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13842
1ee6d2a0
PE
138432003-01-08 Paul Eggert <eggert@twinsun.com>
13844
13845 * Makefile.maint (WGETFLAGS):
13846 New macro, containing "-C off" to disable proxy caches.
13847 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13848 (rel-check): Use $(WGET) instead of wget.
13849
d4fd77c4
PE
138502003-01-06 Paul Eggert <eggert@twinsun.com>
13851
13852 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
13853 the GLR paper of Scott, Johnstone and Hussain.
13854
464c6927
PE
138552003-01-04 Paul Eggert <eggert@twinsun.com>
13856
d600ee67
PE
13857 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
13858 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
13859 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
13860 (EXTRA_LIBRARIES): New var, for liby.a.
13861 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
13862 (EXTRA_SCRIPTS): New var, for yacc.
13863
464c6927
PE
13864 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
13865 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
13866 Problem reported by Nelson H. F. Beebe.
13867
138682003-01-03 Paul Eggert <eggert@twinsun.com>
13869
13870 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
13871 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
13872 when compiling Bison 1.875's `bitset bset = obstack_alloc
13873 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
13874
13875 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
13876 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
13877 grow to a huge size with typical invocation.
d600ee67 13878
464c6927
PE
13879 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
13880 Use the pattern recommended by Autoconf 2.57, except also protect
13881 against double-definition.
13882 * src/system.h: Likewise.
13883 Portability issues reported by Nelson H. F. Beebe.
d600ee67 13884
464c6927
PE
13885 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
13886 All uses changed. Provide a definition in both C and C++.
13887 (yytrue, yyfalse): Define even if defined (__cplusplus).
13888
13889 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
13890 Reported by Nelson H. F. Beebe.
d600ee67 13891
464c6927
PE
13892 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
13893
0f42c7d5
PE
138942003-01-02 Paul Eggert <eggert@twinsun.com>
13895
13896 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
13897 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
13898 Bug reported by Nelson H. F. Beebe.
13899
dc546b0f
PE
139002003-01-01 Paul Eggert <eggert@twinsun.com>
13901
13902 * Version 1.875.
13903
2c09b6a7
PE
139042002-12-30 Paul Eggert <eggert@twinsun.com>
13905
13906 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
13907 Moved here from...
13908 (<INITIAL>","): Here. This causes stray "," to be treated
13909 more uniformly.
13910
dc546b0f 13911 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
13912 last brace in braced code when not in Yacc mode, for compatibility
13913 with Bison 1.35. This resurrects the 2001-12-15 patch to
13914 src/reader.c.
13915
13916 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
13917 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
13918
535c0f63
PE
139192002-12-28 Paul Eggert <eggert@twinsun.com>
13920
13921 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
13922 that of SYM's type. This fixes Debian bug 168069, reported by
13923 Thomas Olsson.
d600ee67 13924
963fcc17
PE
139252002-12-28 Paul Eggert <eggert@twinsun.com>
13926
13927 Version 1.75f.
13928
13929 Switch back to the Yacc style of conflict reports, undoing some
13930 of the 2002-07-30 change.
13931 * doc/bison.texinfo (Understanding): Use Yacc style for
13932 conflict reports. Also, use new way of locating rules.
13933 * src/conflicts.c (conflict_report):
13934 Renamed from conflict_report_yacc, removing the old
13935 'conflict_report'. Translate the entire conflict report at once,
13936 so that we don't assume that "," has the same interpretation in
13937 all languages.
13938 (conflicts_output): Use Yacc-style conflict report for each state,
13939 instead of our more-complicated style.
13940 (conflicts_print): Use Yacc-style conflict report, except print
13941 the input file name when not emulating Yacc.
13942 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
13943 Conflicted Reduction, %expect not enough, %expect too much,
13944 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
13945 * tests/existing.at (GNU Cim Grammar): Likewise.
13946 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
13947
13948 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
13949 fatal): Don't invoke fflush; it's not needed and it might even be
13950 harmful for stdout, as stdout might not be open.
13951 * src/reduce.c (reduce_print): Likewise.
13952
b1efe548
PE
139532002-12-27 Paul Eggert <eggert@twinsun.com>
13954
13955 Fix a bug where error locations were not being recorded correctly.
13956 This problem was originally reported by Paul Hilfinger in
161a71f3 13957 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
13958
13959 * data/yacc.c (yyparse): New local var yylerrsp, to record the
13960 top of the location stack's error locations.
13961 (yyerrlab): Set it. When discarding a token, push its location
13962 onto yylerrsp so that we don't lose track of the error's end.
13963 (yyerrlab1): Now is only the target of YYERROR, so that we can
13964 properly record the location of the action that failed. For GCC
13965 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
13966 GCC warning about yyerrlab1 being unused if YYERROR is unused.
13967 (yyerrlab2): New label, which yyerrlab now falls through to.
13968 Compute the error's location by applying YYLLOC_DEFAULT to
13969 the locations of all the symbols that went into the error.
13970 * doc/bison.texinfo (Location Default Action): Mention that
13971 YYLLOC_DEFAULT is also invoked for syntax errors.
13972 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
13973 Error locations include the locations of all the tokens that were
13974 discarded, not just the last token.
d600ee67 13975
983c5c2c
PE
139762002-12-26 Paul Eggert <eggert@twinsun.com>
13977
b1efe548
PE
13978 * src/files.c: Include quote.h.
13979 (compute_output_file_names): Warn if we detect conflicting
13980 outputs to the same file. This should catch the misunderstanding
13981 exemplified by Debian Bug 165349, reported by Bruce Stephens..
13982
13983 * src/conflicts.c (conflicts_print): If the user specifies
13984 "%expect N", report an error if there are any reduce/reduce
13985 conflicts. This is what the manual says should happen.
13986 This fixes Debian bug 130890, reported by Anthony DeRobertis.
13987 * tests/conflicts.at (%expect with reduce conflicts): New test.
13988
983c5c2c
PE
13989 Don't use m4_include on relative file names, as it doesn't work as
13990 desired if there happens to be a file with that name under ".".
d600ee67 13991
983c5c2c
PE
13992 * m4sugar/version.m4: Remove; it was included but it wasn't used.
13993 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
13994 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
13995 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
13996 * src/output.c (output_skeleton): Use full path names when
13997 specifying a file to include; don't rely on include path, as
13998 it's unreliable when the working file contains a file with
13999 that name.
d600ee67 14000
983c5c2c
PE
140012002-12-25 Paul Eggert <eggert@twinsun.com>
14002
14003 Remove obsolete references to bison.simple and bison.hairy.
14004 Problem mentioned by Aubin Mahe in
161a71f3 14005 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
14006 * data/glr.c: Comment fix.
14007 * doc/bison.1: Remove references. Also, mention "yacc".
14008
14009 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14010 with -g option.
14011
14012 * src/parse-gram.y (declaration): Use enum "report_states" rather
14013 than its numeric value 1.
14014
14015 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14016 opening a new one. This fixes Debian bug 165349, reported by
14017 Bruce Stephens.
14018
23f2d9dc
PE
140192002-12-24 Paul Eggert <eggert@twinsun.com>
14020
14021 Version 1.75e.
14022
14023 * Makefile.maint (cvs-update): Don't assume that the shell
14024 supports $(...), as Solaris sh doesn't.
14025
14026 * src/parse-gram.y (lloc_default): Remove test for empty
14027 nonterminals at the end, since it didn't change the result.
14028
140292002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
14030
14031 If the user does not define YYSTYPE as a macro, Bison now declares it
14032 using typedef instead of defining it as a macro. POSIX requires this.
14033 For consistency, YYLTYPE is also declared instead of defined.
14034
14035 %union directives can now have a tag before the `{', e.g., the
14036 directive `%union foo {...}' now generates the C code
14037 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14038 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14039 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14040 instead of `yyltype'.
14041
14042 `yystype' and `yyltype' are now obsolescent macros instead of being
14043 typedefs or tags; they are no longer documented and will be
14044 withdrawn in a future release.
14045
14046 * data/glr.c (b4_location_type): Remove.
14047 (YYSTYPE): Renamed from yystype.
14048 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14049 (struct YYLTYPE): Renamed from struct yyltype.
14050 (YYLTYPE): Renamed from yyltype.
14051 (yyltype, yystype): New (and obsolescent) macros,
14052 for backward compatibility.
14053 * data/yacc.c: Likewise.
14054
14055 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14056 does not specify a union tag. This is for compatibility with
14057 Solaris 9 yacc.
14058
14059 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14060 const *, since it is now modified by stripping surrounding { }.
14061 (current_braced_code): Remove.
14062 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14063 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14064 trailing " {...}". Now of type <chars>.
14065 (grammar_declaration): Adjust to bundled tokens.
14066 (code_content): Remove; stripping is now done by add_param.
14067 (print_token_value): Print contents of bundled tokens.
14068 (token_name): New function.
14069
14070 * src/reader.h (braced_code, current_braced_code): Remove.
14071 (token_name): New decl.
14072
14073 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14074 token_type, not braced_code code_kind. All uses changed.
14075 (SC_PRE_CODE): New state, for scanning after a keyword that
14076 has (or usually has) an immediately-following braced code.
14077 (token_type): New local var, to keep track of which token type
14078 to return when scanning braced code.
14079 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 14080 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
14081 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14082 instead of returning a token type immediately.
14083 (<INITIAL>"{"): Set token type.
14084 (<SC_BRACED_CODE>"}"): Use it.
14085 (handle_action_dollar, handle_action_at): Now returns bool
14086 indicating success. Fail if ! current_rule; this prevents a core dump.
14087 (handle_symbol_code_dollar, handle_symbol_code_at):
14088 Remove; merge body into caller.
14089 (handle_dollar, handle_at): Complain in invalid contexts.
14090
14091 * NEWS, doc/bison.texinfo: Document the above.
14092 * NEWS: Fix years and program names in copyright notice.
14093
879ca4f8
PE
140942002-12-17 Paul Eggert <eggert@twinsun.com>
14095
14096 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
14097 Reporting, Table of Symbols): Omit mentions of %lex-param and
14098 %parse-param from the documentation for now.
14099
1c5fe69d
PE
141002002-12-15 Paul Eggert <eggert@twinsun.com>
14101
14102 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
14103 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
14104 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
14105 disagreed with the Bison documentation. Bug
14106 reported by Andrew Walrond.
d600ee67 14107
1c5fe69d
PE
14108 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14109 as the caller now does that.
14110 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14111 (YYEMPTY): Parenthesize right hand side, since others use it.
14112 (yyparse): Don't assume that our generated code is the only code
14113 that sets yychar.
14114
d1de5372
PE
141152002-12-13 Paul Eggert <eggert@twinsun.com>
14116
14117 Version 1.75d.
14118
14119 POSIX requires a "yacc" command.
14120 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
14121 (MOSTLYCLEANFILES): Add yacc.
14122 (yacc): New rule.
1c5fe69d 14123 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
14124 as an alias for bison y.
14125
14126 * po/LINGUAS: Add da.
d600ee67 14127
d1de5372
PE
14128 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
14129 problem with latest <getopt.h>.
14130 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
14131
14132 * doc/fdl.texi: Upgrade to 1.2.
14133 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
14134 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
14135 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
14136 gnulib.
14137 * config/install-sh: Sync with autotools.
14138
14139 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 14140 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
14141 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
14142 locations are requested.
14143 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
14144 locations are requested.
14145
d0f3fe23
PE
141462002-12-12 Paul Eggert <eggert@twinsun.com>
14147
14148 Remove unportable casts and storage allocation tricks.
14149 While we're at it, remove almost all casts, since they
14150 usually aren't needed and are a sign of trouble.
14151
14152 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
14153
14154 * src/derives.c (derives_compute): Do not subtract NTOKENS from
14155 the pointer DSET returned by malloc; this isn't portable.
14156 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
14157 Similarly for DERIVES.
14158 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
14159 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
14160 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
14161
14162 * src/derives.c (derives_compute): Do not bother invoking
14163 int_of_rule_number, since rule numbers are integers.
14164
14165 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
14166 rather than XMALLOC (char, N).
14167
14168 * src/files.c (filename_split): Rewrite to avoid cast.
14169
14170 * src/gram.h (symbol_number_as_item_number,
14171 item_number_as_symbol_number, rule_number_as_item_number,
14172 item_number_as_rule_number):
14173 Now inline functions rather than macros, to avoid casts.
14174 * src/state.h (state_number_as_int): Likewise.
14175 * src/tables.c (state_number_to_vector_number,
14176 symbol_number_to_vector_number): Likewise.
14177
14178 * src/gram.h (int_of_rule_number): Remove; no longer used.
14179
14180 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
14181 since the resulting storage is always stored into.
14182
14183 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
14184 where it's needed.
14185
14186 * src/muscle_tab.c (muscle_m4_output):
14187 Now inline. Return bool, not int.
14188 * src/state.c (state_compare): Likewise.
14189 * src/symtab.c (symbol_check_defined,
14190 symbol_check_alias_consistency, symbol_pack, symbol_translation,
14191 hash_compare_symbol, hash_symbol):
14192 Likewise.
14193 * src/uniqstr.c (uniqstr_print): Likewise.
14194 * src/muscle_tab.c (muscle_m4_output_processor):
14195 New function, to avoid casts.
14196 * src/state.c (state_comparator, stage_hasher): Likewise.
14197 * src/symtab.c (symbol_check_defined_processor,
14198 symbol_check_alias_consistency_processor, symbol_pack_processor,
14199 symbol_translation_processor, hash_symbol_comparator,
14200 hash_symbol_hasher): Likewise.
14201 * src/uniqstr.c (uniqstr_print_processor): Likewise.
14202 * src/muscle_tab.c (muscles_m4_output):
14203 Use new functions instead of casting old functions unportably.
14204 * src/state.c (state_hash_new): Likewise.
14205 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
14206 symbols_token_translations_init):
14207 Likewise.
14208 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
14209
14210 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
14211 var instead of casting to long, to avoid casts.
14212 (prepare_states): Use MALLOC rather than alloca, so that we don't
14213 have to worry about alloca.
14214 * src/state.c (state_hash_lookup): Likewise.
14215
14216 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
14217 local var instead of casting to unsigned char, to avoid casts.
14218
14219 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
14220 STATE_ALLOC): Remove.
14221 (transitions_new, errs_new, reductions_new, state_new): Use malloc
14222 rather than calloc, and use offsetof to avoid allocating slightly
14223 too much storage.
14224 (state_new): Initialize all members.
14225
14226 * src/state.c (state_hash): Use unsigned accumulator, not signed.
14227
14228 * src/symtab.c (symbol_free): Remove; unused.
14229 (symbol_get): Remove cast in lhs of assignment.
14230 (symbols_do): Now static. Accept generic arguments, not
14231 hashing-related ones.
14232
14233 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
14234 (symbol_processor): Remove.
14235 (symbols_do): Remove decl; now static.
14236
14237 * src/system.h (alloca): Remove; decl no longer needed.
14238 (<stddef.h>): Include, for offsetof.
14239 (<inttypes.>, <stdint.h>): Include if available.
14240 (uintptr_t): New type, if system lacks it.
14241 (CALLOC, MALLOC, REALLOC): New macros.
14242 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
14243 new macros.
14244
14245 * src/tables.c (table_size): Now int, to pacify GCC.
14246 (table_grow, table_ninf_remap): Use signed table size.
14247 (save_row): Don't bother initializing locals when not needed.
14248 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
14249 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
14250
14251 * src/vcg.h: Correct misspellings.
14252
14253 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
14254
14255
14256 * src/getargs.c (getargs): Don't assume EOF == -1.
14257
26b4a969
PE
142582002-12-09 Paul Eggert <eggert@twinsun.com>
14259
14260 Change identifier spellings to avoid collisions with names
14261 that are reserved by POSIX.
14262
14263 Don't use names ending in _t, since POSIX reserves them.
14264 For consistency, remove _e and _s endings -- they're weren't
14265 needed to remove ambiguity. All uses changed.
14266 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
14267 turn was just renamed from struniq_t.
14268 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
14269 which in turn was just renamed from struniq_processor_t.
14270 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
14271 in turn was renamed from hash_compare_struniq_t.
14272 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
14273 (state_list): Renamed from state_list_t.
14274 * src/assoc.h (assoc): Renamed from assoc_t.
14275 * src/conflicts.c (enum conflict_resolution): Renamed from
14276 enum conflict_resolution_e.
14277 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
14278 (rule_list): Renamed from rule_list_t.
14279 * src/getargs.h (enum trace): Renamed from enum trace_e.
14280 (enum report): Renamed from enum report_e.
14281 * src/gram.h (item_number): Renamed from item_number_t.
14282 (rule_number): Renamed from rule_number_t.
14283 (struct rule_s): Remove the "rule_s" part; not used.
14284 (rule): Renamed from rule_t.
14285 (rule_filter): Renamed from rule_filter_t.
14286 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
14287 (goto_list): Renamed from goto_list_t.
14288 * src/lalr.h (goto_number): Renamed from goto_number_t.
14289 * src/location.h (location): Renamed from location_t.
14290 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
14291 and moved here from:
14292 * src/muscle_tab.h (muscle_entry_t): here.
14293 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
14294 (rule_list): Renamed from rule_list_t.
14295 * src/print_graph.c (static_graph): Renamed from graph.
14296 * src/reader.h (braced_code): Renamed from braced_code_t.
14297 Remove brace_code_e tag.
14298 * src/relation.h (relation_node): Renamed from relation_node_t.
14299 (relation_nodes): Renamed from relation_nodes_t.
14300 (relation): Renamed from relation_t.
14301 * src/state.h (state_number): Renamed from state_number_t.
14302 (struct state): Renamed from struct state_s.
14303 (state): Renamed from state_t.
14304 (transitions): Renamed from transitions_t. Unused (and
14305 misspelled) transtion_s tag removed.
14306 (errs): Renamed from errs_t. Unused errs_s tag removed.
14307 (reductions): Renamed from reductions_t. Unused tag
14308 reductions_s removed.
14309 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
14310 (struct symbol_list): Renamed from struct symbol_list_s.
14311 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
14312 (struct symbol): Renamed from struct symbol_s.
14313 (symbol): Renamed from symbol_t.
14314 * src/tables.c (vector_number): Renamed from vector_number_t.
14315 (action_number): Renamed from action_t.
14316 * src/tables.h (base_number): Renamed from base_t.
14317 * src/vcg.h (enum color): Renamed from enum color_e.
14318 (enum textmode): Renamed from enum textmode_e.
14319 (enum shape): Renamed from enum shape_e.
14320 (struct colorentry): Renamed from struct colorentry_s.
14321 (struct classname): Renamed from struct classname_s.
14322 (struct infoname): Renamed from struct infoname_s.
14323 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
14324 (enum decision): Renamed from enum decision_e.
14325 (enum orientation): Renamed from enum orientation_e.
14326 (enum alignment): Renamed from enum alignment_e.
14327 (enum arrow_mode): Renamed from enum arrow_mode_e.
14328 (enum crossing_type): Renamed from enum crossing_type_e.
14329 (enum view): Renamed from enum view_e.
14330 (struct node): Renamed from struct node_s.
14331 (node): Renamed from node_t.
14332 (enum linestyle): Renamed from enum linestyle_e.
14333 (enum arrowstyle): Renamed from enum arrowstyle_e.
14334 (struct edge): Renamed from struct edge.
14335 (edge): Renamed from edge_t.
14336 (struct graph): Renamed from struct graph_s.
14337 (graph): Renamed from graph_t.
14338 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
14339 Rename value_t -> value.
14340 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
14341 value_t_as_yystype -> value_as_yystype.
14342
14343 Don't include <errno.h> in the mainstream code, since it
14344 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
14345 * lib/get-errno.c, lib/get-errno.h: New files.
14346 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
14347 get-errno.c.
14348 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
14349 * src/output.c (output_skeleton): Likewise.
14350 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
14351 instead of errno.
14352 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
14353 Likewise.
14354 (handle_action_dollar, handle_action_at): Likewise.
14355 * src/system.h: Do not include <errno.h>.
14356 (TAB_EXT): Renamed from EXT_TAB.
14357 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
14358
14359 Avoid str[a-z]*, since <string.h> reserves that name space.
14360 Change all instances of "struniq" in names to "uniqstr", and
14361 likewise for "STRUNIQ" and "UNIQSTR".
14362 * src/uniqstr.c: Renamed from src/struniq.c.
14363 * src/uniqstr.h: Renamed from src/struniq.h.
14364 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
14365 * src/files.c (strsuffix): Remove; unused.
14366 (concat2): Renamed from stringappend. Now static.
14367 * src/files.h (strsuffix, stringappend): Remove; unused.
14368 * src/parse-gram.y (<chars>): Renamed from <string>.
14369 (<uniqstr>): Renamed from <struniq>.
14370 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
14371 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
14372 (struct graph_s.expand): Renamed from struct graph_s.stretch.
14373 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
14374 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
14375 (N_EXPAND): Renamed from N_STRETCH.
14376
14377 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
14378 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
14379 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
14380 Remove; unused.
14381 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
14382 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
14383 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
14384 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
14385 (BASE_MAXIMUM): Renamed from BASE_MAX.
14386 (BASE_MINIMUM): Renamed from BASE_MIN.
14387 (ACTION_MAX): Remove; unused.
14388 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
14389 Unnecessary casts removed from above defines.
14390
14391
14392 Fix misspelling in names.
14393 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
14394 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
14395 G_NODE_ALIGNEMENT.
14396
14397
14398 * lib/timevar.c (timevar_report): Renamed from time_report,
14399 for consistency with other names.
14400 * lib/timevar.h (timevar_report): New decl.
14401 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
14402
14403
14404 Sort include-file uses.
14405
14406 Reorder all include files under src to be in the order "system.h".
14407 then the ../lib include files in angle brackets (alphabetized),
14408 then the . include files in double-quotes (alphabetized). Fix
14409 dependency breakages encountered in this process, as follows:
14410 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
14411 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
14412 * src/state.h: Include "symtab.h".
14413
996b1c7e
PE
144142002-12-08 Paul Eggert <eggert@twinsun.com>
14415
14416 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
14417 since this causes problems when __file__ contains character
14418 sequences like "@" that are treated specially by src/scan-skel.l.
14419 Instead, just use the file's basename. This fixes the bug
14420 reported by Martin Mokrejs in
161a71f3 14421 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 14422
e19c4e5d
PE
144232002-12-06 Paul Eggert <eggert@twinsun.com>
14424
14425 Add support for rules that do not have trailing semicolons, as
14426 POSIX requires. Improve the quality of locations in Bison
14427 diagnostics.
26b4a969 14428
e19c4e5d
PE
14429 * src/location.c: Include <quotearg.h>.
14430 (empty_location): Now const.
14431 (location_print): New function. Follow the recommendation of the
14432 GNU Coding Standards for locations that span file boundaries.
14433 * src/location.h: Do not include <quotearg.h>; no longer needed.
14434 (boundary): New type.
14435 (location_t): Use it. This allows locations to span file boundaries.
14436 All member uses changed: file -> start.file or end.file (as needed),
14437 first_line -> start.line, first_column -> start.column,
14438 last_line -> end.line, last_column -> end.column.
14439 (equal_boundaries): New function.
14440 (LOCATION_RESET, LOCATION_STEP): Remove.
14441 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14442 (empty_location): Now const.
14443 (location_print): New decl.
14444 * src/parse-gram.y (lloc_default): New function, which handles
14445 empty locations more accurately.
14446 (YYLLOC_DEFAULT): Use it.
14447 (%token COLON): Remove.
14448 (%token ID_COLON): New token.
26b4a969 14449 (rules): Use it.
e19c4e5d
PE
14450 (declarations, rules): Remove trailing semicolon.
14451 (declaration, rules_or_grammar_declaration):
14452 Allow empty (";") declaration.
14453 (symbol_def): Remove empty actions; no longer needed.
14454 (rules_or_grammar_declaration): Remove trailing semicolon.
14455 (semi_colon.opt): Remove.
14456 * src/reader.h: Include location.h.
14457 (scanner_cursor): New decl.
14458 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14459 rolling our own.
14460 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14461 of *loc.
14462 (STEP): Remove. No longer needed, now that adjust_location does
14463 the work. All uses removed.
14464 (scanner_cursor): New var.
14465 (adjust_location): Renamed from extend_location. It now sets
14466 *loc and adjusts the scanner cursor. All uses changed.
14467 Don't bother testing for CR.
14468 (handle_syncline): Remove location arg; now updates scanner cursor.
14469 All callers changed.
14470 (unexpected_end_of_file): Now accepts start boundary of token or
14471 comment, not location. All callers changed. Update scanner cursor,
14472 not the location.
14473 (SC_AFTER_IDENTIFIER): New state.
14474 (context_state): Renamed from c_context. All uses changed.
14475 (id_loc, code_start, token_start): New local vars.
14476 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14477 processing of Yacc white space and equivalents here.
14478 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14479 instead of returning ID immediately, since we need to search for
14480 a subsequent colon.
14481 (<INITIAL>"'", "\""): Save token_start.
14482 (<INITIAL>"%{", "{", "%%"): Save code_start.
14483 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14484 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14485 BEGIN context_state at end, not INITIAL.
14486 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14487 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14488 Return correct token start.
14489 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14490 the start of a character, string or multiline comment is found.
14491 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14492 Reduction): Adjust reported locations to match the more-precise
14493 results now expected.
14494 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14495 * tests/reduce.at (Useless Rules, Reduced Automaton,
14496 Underivable Rules): Likewise.
14497 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14498 or "|"' now that so many other tokens are allowed by the new grammar.
14499
14500 * src/complain.h (current_file): Remove duplicate decl;
14501 current_file is now owned by files.h.
14502 * src/complain.c, src/scan-gram.l: Include files.h.
14503
145042002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 14505
e19c4e5d
PE
14506 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
14507 promotes to int; it might be unsigned int.
14508 * data/yacc.c (yy_reduce_print): Likewise.
14509
14510 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
14511 be #defined in the prologue, not in the Bison declarations.
14512 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 14513
b64755e3
PE
145142002-12-02 Paul Eggert <eggert@twinsun.com>
14515
14516 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
14517 * lib/strtoul.c: New file, from gnulib.
14518 This fixes a porting bug reported by Peter Klein in
161a71f3 14519 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 14520
6e746484
PE
145212002-11-30 Paul Eggert <eggert@twinsun.com>
14522
b64755e3
PE
14523 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
14524 and put only a forward declaration in the prologue. This is for
14525 consistency with the other scanner helper functions.
14526
6ba55592
PE
14527 Type clashes now generate warnings, not errors, since it
14528 appears that POSIX may allow some grammars with type clashes.
14529 * src/reader.c (grammar_current_rule_check): Warn about
14530 type clashes instead of complaining.
14531 * tests/input.at (Type Clashes): Expect warnings, not complaints.
14532
6e746484
PE
14533 Add Yacc library, since POSIX requires it.
14534 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
14535 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
14536 * lib/main.c, lib/yyerror.c: New files.
14537
14538 gram_error can be static; it need not be extern.
14539 * src/reader.h (gram_error): Remove decl.
14540 * src/parse-gram.y (gram_error): Now static. Add static decl.
14541 (print_token_value): Omit parameter names from forward decl,
14542 for consistency.
14543
88510f9c
PE
145442002-11-29 Paul Eggert <eggert@twinsun.com>
14545
6e746484
PE
14546 * doc/bison.texinfo: Emphasize that yylex and yyerror must
14547 be declared before being used. E.g., one should typically
14548 declare them in the prologue. Use GNU coding style in examples.
14549 Put "const" consistently after the type it modifies. Mention
14550 that C99 supports "inline". Mention that yyerror traditionally
14551 returns "int".
14552
88510f9c
PE
14553 %parse-param and %lex-param now take just one argument, the
14554 declaration; the argument name is deduced from the declaration.
14555
14556 * doc/bison.texinfo (Parser Function, Pure Calling, Error
14557 Reporting, Table of Symbols): Document this.
14558 * src/parse-gram.y (add_param): New function.
14559 (COMMA): Remove.
14560 (declaration): Implement new rule for %parse-param and %lex-param.
14561 * src/scan-gram.l: "," now elicits a warning, rather than being
14562 a token; this is more compatible with byacc.
14563 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
14564
bb92250c
PE
145652002-11-27 Paul Eggert <eggert@twinsun.com>
14566
14567 Rename identifiers to avoid real and potential collisions.
14568
14569 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
14570 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 14571 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
14572 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
14573 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
14574 * src/parse-gram.y (print_token_value): Renamed from yyprint.
14575 All uses changed.
14576 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
14577 The name "yycontrol" violates the name space rules, and this stuff
14578 wasn't being used anyway.
14579 (input): Remove action; this stuff wasn't being used.
14580 (gram_error): Rename local variable yylloc -> loc.
14581 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
14582 (YY_DECL): Don't use "yy" at start of local variables.
14583 All uses changed, e.g., yylloc -> loc.
14584 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
14585 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
14586 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
14587 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
14588
14589 * src/parse-gram.y (gram_error): loc is now const *.
14590 * src/reader.h (gram_error): Likewise.
14591
3af4feb2
PE
145922002-11-24 Paul Eggert <eggert@twinsun.com>
14593
14594 Version 1.75c.
14595
14596 * tests/actions.at (Actions after errors): Use an output format
14597 more similar to that of the Printers and Destructors test.
14598 Test the position of the ';' token too.
14599 (Printers and Destructors): Likewise.
14600 (Printers and Destructors: %glr-parser): Remove for now, to avoid
14601 unnecessarily alarming people when the test fails.
14602
14603 * data/yacc.c (yyerrlab1): Move this label down, so that the
14604 parser does not discard the lookahead token if the user code
14605 invokes YYERROR. This change is required for POSIX conformance.
14606
14607 * lib/error.c: Sync with gnulib.
14608
146092002-11-22 Paul Eggert <eggert@twinsun.com>
14610
14611 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
14612 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
14613 * lib/xmalloc.c: Likewise.
26b4a969 14614
58004308
PE
146152002-11-20 Paul Eggert <eggert@twinsun.com>
14616
14617 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
14618
146192002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 14620
58004308
PE
14621 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
14622 should use `if (! x) abort ();' rather than `assert (x);', and
14623 anyway it's one less thing to worry about configuring.
14624
14625 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
14626 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
14627 and replace all instances of assert with abort.
14628 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
14629 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
14630
14631 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
14632 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
14633 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
14634 hash_find_entry, hash_rehash, hash_insert): Likewise.
14635 * src/conflicts.c (resolve_sr_conflict): Likewise.
14636 * src/lalr.c (set_goto_map, map_goto): Likewise.
14637 * src/nullable.c (nullable_compute): Likewise.
14638 * src/output.c (prepare_rules, token_definitions_output): Likewise.
14639 * src/reader.c (packgram, reader): Likewise.
14640 * src/state.c (state_new, state_free, state_transitions_set,
14641 state_reduction_find): Likewise.
14642 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
14643 symbol_pack): Likewise.
14644 * src/tables.c (conflict_row, pack_vector): Likewise.
14645 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14646 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14647 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
14648 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
14649
14650 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
14651 (ARGMATCH_CONSTRAINT): New macro.
14652 (ARGMATCH_ASSERT): Use it.
14653
14654 * src/system.h (verify): New macro.
14655 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
14656 rather than assert.
14657 * src/tables.c (tables_generate): Likewise.
14658
14659 * src/struniq.c (struniq_assert): Now returns void, and aborts
14660 if the assertion is false.
14661 (struniq_assert_p): Remove.
14662 * src/struniq.h: Likewise.
14663
76ae8198
PE
146642002-11-18 Paul Eggert <eggert@twinsun.com>
14665
14666 * data/glr.c (yygetLRActions): Replace `yyindex' with
14667 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14668 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 14669 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 14670
d3c4e709
AD
146712002-11-18 Akim Demaille <akim@epita.fr>
14672
14673 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14674 space.
14675 From Tim Van Holder.
14676
8d8a7238
PE
146772002-11-17 Paul Eggert <eggert@twinsun.com>
14678
14679 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14680 to "SyntaxError" for consistency with my 2002-11-15 change.
14681
14682 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14683 not define to {}, since this breaks the common use of `YYDPRINTF
14684 ((...));' if a single statement is desired (e.g. before `else').
14685 Work around GCC warnings by surrounding corresponding calls with
14686 {} if needed.
14687 (yyhasResolvedValue): Remove unused function.
14688 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14689 loop body.
14690 (yyreportSyntaxError): Renamed from yyreportParseError.
14691 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14692 All uses changed.
14693 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14694 extern when possible. Remove unused initializations.
14695
b0937b22
AD
146962002-11-16 Akim Demaille <akim@epita.fr>
14697
14698 Augment the similarity between GLR and LALR traces.
14699
14700 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14701 (YY_REDUCE_PRINT): New.
14702 (yyparse): Use them.
14703 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14704 YYDPRINT here.
14705 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14706 state reached after the reduction/recovery, since...
14707 (yyparse, yyprocessOneStack): Report the state we are entering in.
14708
c5e3e510
AD
147092002-11-16 Akim Demaille <akim@epita.fr>
14710
14711 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14712 Add support for --trace=skeleton.
14713 * src/scan-skel.l: %option debug.
14714 Scan strings of non-@ or \n instead of character by character.
14715 (scan_skel): Handle trace_skeleton.
14716 (QPUTS): New.
14717 (@output_parser_name@, @output_header_name@): ``Restore'' their
14718 support (used to be M4 macros).
14719 * data/yacc.c: Quote larger chunks, a la glr.c.
14720 * data/lalr1.cc: Likewise.
14721 The header guards are no longer available, so use some other
14722 string than `YYLSP_NEEDED'.
14723
4c6cc1db
AD
147242002-11-16 Akim Demaille <akim@epita.fr>
14725
14726 Make the ``Printers and Destructors'' test more verbose, taking
14727 `yacc.c''s behavior as (possibly wrong) reference.
14728
14729 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14730 instead of fprint on stdout.
14731 Set and report the last_line of the symbols.
14732 Consistently display values and locations.
14733
6d9e8019
PE
147342002-11-16 Paul Eggert <eggert@twinsun.com>
14735
14736 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14737
6e649e65
PE
147382002-11-15 Paul Eggert <eggert@twinsun.com>
14739
b25d88f6
PE
14740 * tests/actions.at (Actions after errors): New test case.
14741
6e649e65
PE
14742 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14743 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14744 tests/action.at, tests/calc.at, tests/conflicts.at,
14745 tests/cxx-type.at, tests/regression.at:
14746 "parse error" -> "syntax error" for POSIX compatibility.
14747 "parsing stack overflow..." -> "parser stack overflow" so
14748 that code matches Bison documentation.
14749
0f39aab9
AD
147502002-11-15 Akim Demaille <akim@epita.fr>
14751
14752 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14753 take two BRACED_CODE, not two string_content.
14754 Free the scanner's obstack when we are done.
14755 (code_content): New.
14756 * tests/calc.at: Adjust.
14757 * doc/bison.texinfo: Adjust.
14758 Also, make sure to include the `,' for these declarations.
14759
761c1926
AD
147602002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14761
14762 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14763 definition; avoids potential autoreconf problems.
14764
b0f98b10
AD
147652002-11-15 Akim Demaille <akim@epita.fr>
14766
14767 Always check the value returned by yyparse.
14768
14769 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14770 returned by yyparse.
14771 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14772 Adjust calls.
14773 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14774 returned by yyparse.
14775
970785f1
PH
147762002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14777
14778 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14779 on input.at test.
14780
8fcc7db1
PE
147812002-11-14 Paul Eggert <eggert@twinsun.com>
14782
7ec1b48e
PE
14783 * src/output.c (output_skeleton): Call xfopen instead of
14784 duplicating xfopen's body.
14785
cfff7583 14786 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 14787 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 14788
8fcc7db1
PE
14789 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14790 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14791 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14792 file twice in the grammar, as an extra check.
14793
14794 * tests/input.at (Torturing the Scanner): Surround the
14795 backslash-newline tests with "#if 0", to make it less likely that
14796 we'll run into compiler bugs. Bring back solitary \ inside
14797 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 14798 test backslash-newline in C character constant.
8fcc7db1 14799
4e8d992c
AD
148002002-11-14 Akim Demaille <akim@epita.fr>
14801
14802 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14803 status of the compiler.
f32b346d 14804 Calling `exit 1' is no longer needed.
4e8d992c
AD
14805 Reported by Nelson H. F. Beebe.
14806
9501dc6e
AD
148072002-11-14 Akim Demaille <akim@epita.fr>
14808
14809 * tests/atlocal.in (CPPFLAGS): We have config.h.
14810 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14811 New.
14812 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14813 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14814 * tests/regression.at, tests/torture.at: Use them for all the
14815 grammars that are to be compiled.
14816 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14817 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14818 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14819
18b519c0
AD
148202002-11-14 Akim Demaille <akim@epita.fr>
14821
14822 * doc/bison.texinfo: Various formatting changes (alignments in
14823 samples, additional @group/@end group, GCS in samples.
14824 Use @deffn instead of simple @table to define the directives,
14825 macros, variables etc.
14826
9a86cdb9
PE
148272002-11-13 Paul Eggert <eggert@twinsun.com>
14828
daa33def 14829 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 14830 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 14831
daa33def 14832 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 14833 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
14834 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14835 * tests/headers.at (export YYLTYPE): Likewise.
14836
14837 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 14838 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 14839
9a86cdb9
PE
14840 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14841 comments, since they're not portable. Use GNU coding style.
14842
9c1e26bd
AD
148432002-11-13 Akim Demaille <akim@epita.fr>
14844
14845 * data/yacc.c: Leave bigger chunks of quoted text.
14846 (YYDSYMPRINTF): New.
14847 Use it to report symbol activities.
14848 * data/glr.c (YYDSYMPRINTF): New.
14849 Use it.
14850
87f721cc
PE
148512002-11-12 Paul Eggert <eggert@twinsun.com>
14852
14853 Version 1.75b.
14854
14855 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
14856 (yyglrReduce): Return yyok, not 0.
14857 This should avoid the enumerated-type warnings reported
464c6927 14858 by Nelson H. F. Beebe in
161a71f3 14859 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
14860
14861 * lib/bbitset.h (BITSET_INLINE): Remove.
14862 * lib/bitset.h [! BITSET_INLINE]: Remove.
14863 (bitset_set, bitset_reset, bitset_test): Rename local vars
14864 to avoid shadowing warnings by GCC.
14865
14866 * data/glr.c (inline): Remove #define. It's the user's
14867 responsibility to #define it away, just like 'const'.
464c6927 14868 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 14869 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 14870
87f721cc
PE
14871 * Makefile.maint (po-check): Scan .l and .y files instead of the
14872 .c and the .h files that they generate. This fixes the bug
14873 reported by Tim Van Holder in:
161a71f3 14874 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
14875 Look for N_ as well as for _. Try to avoid matching #define for
14876 N_ and _.
14877 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
14878 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
14879 * src/scan-gram.l: Revamp regular expressions so that " and '
14880 do not confuse xgettext.
14881
14882 * src/struniq.h (struniq_new): Do not declare the return type
14883 to be 'const'; this violates the C standard.
14884 * src/struniq.c (struniq_new): Likewise.
14885
be14ade5
AD
148862002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
14887
14888 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
14889 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
14890 linker.
14891
05291fbc
AD
148922002-11-12 Akim Demaille <akim@epita.fr>
14893
14894 * Makefile.maint: Sync with Autoconf:
14895 (local_updates): New.
14896
1f5fd52e
AD
148972002-11-12 Akim Demaille <akim@epita.fr>
14898
14899 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
14900
283f1e64
AD
149012002-11-12 Akim Demaille <akim@epita.fr>
14902
14903 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
14904 locations.
14905
886b69d1
AD
149062002-11-12 Akim Demaille <akim@epita.fr>
14907
14908 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
14909 not yyvalue.
14910
3df37415
AD
149112002-11-12 Akim Demaille <akim@epita.fr>
14912
14913 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
14914 Use it to test the GLR parser.
14915
7bd6c77e
AD
149162002-11-12 Akim Demaille <akim@epita.fr>
14917
14918 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
14919 defines it.
14920 * data/glr.c (yystos): New.
14921 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
14922 (YYDSYMPRINT): New.
14923 (yyval): Don't define it, it is handled via M4.
14924 (yyrecoverParseError): Free verbosely the discarded symbols.
14925 * data/yacc.c (yysymprint): Remove, rather...
14926 (b4_yysymprint_generate): invoke.
14927 * data/c.m4 (b4_yysymprint_generate): New.
14928 Accept pointers as arguments, as opposed to the version from
14929 yacc.c.
14930 (b4_yydestruct_generate): Likewise.
14931 * tests/cations.at (Printers and Destructors): Use Bison directives
14932 instead of CPP macros.
14933 Don't rely on internal details.
14934
b0400cc6
AD
149352002-11-12 Akim Demaille <akim@epita.fr>
14936
14937 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
14938 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
14939 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
14940 it against YYEMPTY and so forth), work on yytoken (i.e., set
14941 it to YYEMPTY etc.).
14942 (yydestruct): Replace with a b4_yydestruct_generate invocation.
14943 (b4_symbol_actions): Remove.
14944 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
14945 for 0, end-of-input.
14946
72f889cc
AD
149472002-11-12 Akim Demaille <akim@epita.fr>
14948
14949 * doc/bison.texinfo (Destructor Decl): New.
14950
b1ae9233
AD
149512002-11-12 Akim Demaille <akim@epita.fr>
14952
14953 * src/tables.c (tables_generate): Use free for pointers that
14954 cannot be NULL, not XFREE.
14955 (pack_vector): Use assert, not fatal, for bound violations.
14956 * src/state.c (state_new): Likewise.
14957 * src/reader.c (reader): Likewise.
14958 * src/lalr.c (set_goto_map): Likewise.
72f889cc 14959 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
14960 the file name.
14961
7ec2d4cd
AD
149622002-11-12 Akim Demaille <akim@epita.fr>
14963
14964 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
14965 Restore.
14966 * src/scan-gram.l (last_string): Is global to the file, not to
14967 yylex.
14968 * src/parse-gram.y (input): Don't append the epilogue here,
14969 (epilogue.opt): do it here, and free the scanner's obstack.
14970 * src/reader.c (epilogue_set): Rename as...
14971 (epilogue_augment): this.
14972 * data/c.m4 (b4_epilogue): Defaults to empty.
14973
573a6cd3
AD
149742002-11-12 Akim Demaille <akim@epita.fr>
14975
14976 * src/getargs.c (long_options): Remove duplicates.
14977 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
14978 Remove.
14979 * doc/bison.rnh: Remove.
14980 * doc/bison.texinfo (VMS Invocation): Remove.
14981
95612cfa
AD
149822002-11-12 Akim Demaille <akim@epita.fr>
14983
14984 * src/struniq.h, src/struniq.c (struniq_t): Is const.
14985 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
14986
14987 Use struniq for symbols.
14988
14989 * src/symtab.h (symbol_t): The tag member is a struniq.
14990 (symbol_type_set): Adjust.
14991 * src/symtab.c (symbol_new): Takes a struniq.
14992 (symbol_free): Don't free the tag member.
14993 (hash_compare_symbol_t, hash_symbol_t): Rename as...
14994 (hash_compare_symbol, hash_symbol): these.
14995 Use the fact that tags as struniqs.
14996 (symbol_get): Use struniq_new.
14997 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
14998 Returns a strniq.
14999 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15000 and type members are struniqs.
15001 * src/reader.c (get_merge_function)
15002 (grammar_current_rule_merge_set): Adjust.
15003 (TYPE, current_type): Are struniq.
15004
15005 Use struniq for file names.
15006
15007 * src/files.h, src/files.c (infile): Split into...
15008 (grammar_file, current_file): these.
15009 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15010 * src/reduce.c (reduce_print): Likewise.
15011 * src/getargs.c (getargs): Likewise.
15012 * src/complain.h, src/complain.c: Likewise.
15013 * src/main.c (main): Call struniqs_new early enough to use it for
15014 file names.
15015 Don't free the input file name.
15016
3e6656f9
AD
150172002-11-12 Akim Demaille <akim@epita.fr>
15018
15019 * src/symtab.c (symbol_free): Remove dead deactivated code:
15020 type_name are properly removed.
15021 Don't use XFREE to free items that cannot be NULL.
15022 * src/struniq.h, src/struniq.c: New.
15023 * src/main.c (main): Initialize/free struniqs.
15024 * src/parse-gram.y (%union): Add astruniq member.
15025 (yyprint): Adjust.
15026 * src/scan-gram.l (<{tag}>): Return a struniq.
15027 Free the obstack bit that used to store it.
15028 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15029
7672019c
PE
150302002-11-11 Paul Eggert <eggert@twinsun.com>
15031
15032 Revamp to fix many (but not all) of the C- and M4-related quoting
15033 problems. Among other things, this fixes the Bison bug reported
15034 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 15035 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
15036
15037 Use new @ escapes consistently. Represent brackets with @{ and @}
15038 rather than @<:@ and @:>@, since this works a bit better with dumb
15039 editors like vi. Represent @ with @@, since @ is now consistently
15040 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15041 __ofile__, to avoid unexpected expansions. Similarly, use @output
15042 rather than #output.
15043
15044 * data/c.m4 (b4_copyright): Omit file name from comment, since
15045 the file name could contain "*/".
15046 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15047 be quoted. All uses changed.
15048
15049 * data/glr.c: Use new @ escapes consistently.
15050 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15051 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15052 Remove, since they couldn't handle arbitrary characters in file
15053 names.
15054 * data/lalr1.cc: Likewise.
15055 * data/yacc.c: Likewise.
15056
15057 * src/files.c (output_infix): Remove; all uses removed.
15058 * src/files.h: Likewise.
15059
15060 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15061 mishandled funny characters in file names, and anyway it isn't
15062 needed any more.
15063 * data/yacc.c: Likewise.
15064 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15065
15066 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15067 * data/yacc.c: Likewise.
15068
15069 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15070 strings now.
15071 (muscle_init): Quote filename as a C string.
15072 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15073 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15074 * src/output.c (escaped_file_name_output): New function.
15075 (prepare_symbols): Quote tokens for M4.
15076 (prepare): Don't insert output_infix, output_prefix,
15077 output_parser_name, output_header_name; this is now down by scan-skel.
15078 Insert skeleton as a C string.
15079
15080 * src/output.c (user_actions_output, symbol_destructors_output,
15081 symbol_printers_output): Quote filenames for C and M4.
15082 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15083
15084 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15085 escapes other than \\ and \'; this simplifies the code.
15086 (<SC_STRING>): Likewise, for \\ and \".
15087 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15088 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15089 Use new escapes @{ and @} for [ and ].
15090
15091 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15092 them with auto vars.
15093 Switch to new escape scheme, where @ is the escape character uniformly.
15094 Abort if a stray escape character is found. Avoid unbounded input
15095 buffer when parsing non-escaped text.
15096
15097 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
15098 __oline__, #output, $@, and @{ do not have unintended meanings.
15099
acea4f3b
PE
151002002-11-09 Paul Eggert <eggert@twinsun.com>
15101
15102 Fix the test failure due to GCC warnings described in
161a71f3 15103 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
15104 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15105 evaluate to 0 if it's impossible for NINF to be in the respective
15106 table.
15107 (yygetLRActions, yyrecoverParseError): Use them.
15108
15109 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15110 counted in the token inserted at end of file. Now takes
15111 location_t *, not location_t, so that the location can be
15112 adjusted. All uses changed.
15113
15114 * tests/regression.at (Invalid inputs): Adjust wording in
15115 diagnostic to match the new behavior.
15116
15117 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
15118 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
15119 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
15120 abort ();'. This reduces the runtime of the "Many lookaheads"
15121 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
15122 GCC 3.2.
15123
20ef1ad5
PE
151242002-11-07 Paul Eggert <eggert@twinsun.com>
15125
15126 * src/parse-gram.y (CHARACTER): Remove unused token.
15127 All uses removed.
15128
15129 * src/scan-gram.l: Remove stack option. We no longer use the
15130 stack, since the stack was never deeper than 1; instead, use the
15131 new auto var c_context to record the stacked value.
15132
15133 Remove nounput option. At an unexpected end of file, we now unput
15134 the minimal input necessary to end cleanly; this simplifies the
15135 code.
15136
15137 Avoid unbounded token sizes where this is easy.
15138
15139 (unexpected_end_of_file): New function.
15140 Use it to systematize the error message on unexpected EOF.
15141 (last-string): Now auto, not static.
15142 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
15143 (scanner_last_string_free): Remove; not used.
15144 (percent_percent_count): Move decl to just before use.
15145 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
15146 not the (never otherwised-used) CHARACTER.
15147
93724f13
AD
151482002-11-07 Akim Demaille <akim@epita.fr>
15149
15150 Let yyerror always receive the msg as last argument, so that
15151 yyerror can be variadic.
15152
15153 * data/yacc.c (b4_yyerror_args): New.
15154 Use it when calling yyerror.
15155 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
15156 Use it when calling yyerror.
15157 * doc/bison.texinfo (Error Reporting): Adjust.
15158 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
15159 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
15160
6e40b4eb
AD
151612002-11-06 Akim Demaille <akim@epita.fr>
15162
15163 #line should have quoted strings.
15164 Ideally, this should be done by m4_quotearg.
15165
15166 * src/scan-skel.l: Include quotearg.h.
15167 Quote __ofile__.
15168 * src/output.c (symbol_printers_output)
15169 (symbol_destructors_output): Quote the file name.
15170
2dfbfc12
AD
151712002-11-06 Akim Demaille <akim@epita.fr>
15172
15173 * tests/regression.at (Invalid inputs): Adjust to the recent
15174 messages.
15175
437c2d80
AD
151762002-11-06 Akim Demaille <akim@epita.fr>
15177
15178 Restore --no-lines.
15179 Reported by Jim Kent.
15180
15181 * data/c.m4 (b4_syncline): New.
15182 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
15183 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
15184 * src/output.c (user_actions_output): Likewise.
15185 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 15186 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 15187
900c5db5
AD
151882002-11-06 Akim Demaille <akim@epita.fr>
15189
15190 * src/main.c (main): Free `infile'.
15191 * src/scan-gram.l (handle_syncline): New.
15192 Recognize `#line'.
15193 * src/output.c (user_actions_output, symbol_destructors_output)
15194 (symbol_printers_output): Use the location's file name, not
15195 infile.
15196 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15197
e183b123 151982002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 15199
e183b123 15200 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 15201 either has GLR conflict entries.
e183b123 15202
193eb6b7
PE
152032002-11-05 Paul Eggert <eggert@twinsun.com>
15204
e183b123
PE
15205 * src/scan-gram.l: Use more accurate diagnostics, e.g.
15206 "integer out of range" rather than "invalid value".
15207 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
15208 accordingly.
15209
193eb6b7
PE
15210 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
15211 Also, remove one static variable in the scanner.
15212
15213 * src/scan-gram.l (braces_level): Now auto, not static.
15214 Initialize to zero if the compiler is being picky.
15215 (INITIAL): Clear braces_level instead of incrementing it.
15216 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
15217 as POSIX 1003.1-2001 requires.
15218 * src/system.h (IF_LINT): New macro, taken from coreutils.
15219 * configure.ac: Define "lint" if --enable-gcc-warnings.
15220
29c01725
AD
152212002-11-05 Akim Demaille <akim@epita.fr>
15222
15223 * src/scan-gram.l: When it starts with `%', complain about the
15224 whole directive, not just that `invalid character: %'.
15225
8aeac3ca
AD
152262002-11-04 Akim Demaille <akim@epita.fr>
15227
15228 * Makefile.maint: Update from Autoconf.
15229 (update, cvs-update, po-update, do-po-update): New.
15230
793a58bb
AD
152312002-11-04 Akim Demaille <akim@epita.fr>
15232
15233 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
15234 and yyerror.
15235 Have yyerror `use' its arguments.
15236 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
15237 returns true when location & yacc & pure & parse-param.
15238 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
15239
c4d720cd
AD
152402002-11-04 Akim Demaille <akim@epita.fr>
15241
15242 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
15243 clashes.
15244 * src/scan-gram.l: Use [\'] instead of ['] to pacify
15245 font-lock-mode.
15246 Use complain_at.
15247 Use quote, not quote_n since LOCATION_PRINT no longer uses the
15248 slot 0.
15249
613a0dc5
PE
152502002-11-03 Paul Eggert <eggert@twinsun.com>
15251
15252 * src/reader.c (get_merge_function, grammar_current_rule_check):
15253 Use consistent diagnostics for reporting type name clashes.
15254 Quote the types with <>, for consistency with Yacc.
15255 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
15256
2a8d363a
AD
152572002-11-03 Akim Demaille <akim@epita.fr>
15258
15259 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
15260 New.
15261 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
15262 (b4_parse_param): Remove.
15263 Use b4_identification.
15264 Propagate b4_pure_args where needed to pass them to yyerror.
15265 * data/glr.m4 (b4_parse_param): Remove.
15266 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
15267 (b4_lpure_formals): New.
15268 Use b4_identification.
15269 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
15270 b4_user_formals and b4_user_args.
15271 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
15272 (yyreportAmbiguity): When using a pure parser, also need
15273 the location, and the parse-params.
15274 Adjust callers.
15275 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
15276 When using a pure parser, also need the parse-params.
15277 Adjust callers.
15278 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
15279 (%pure-parser + %parse-param) LALR and GLR parsers.
15280 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
15281 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
15282 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
15283 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
15284 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
15285 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
15286 * doc/bison.texinfo: Untabify the whole file.
15287 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
15288 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
15289 (Error Reporting): Adjust to these new directives.
15290 Document %error-verbose, deprecate YYERROR_VERBOSE.
15291
9e32add8
AD
152922002-11-03 Akim Demaille <akim@epita.fr>
15293
15294 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
15295 AT_CHECK_CALC_GLR invocations to use % directives, instead of
15296 command line options.
15297 * tests/cxx-type.at: Formatting changes.
15298
b02d90a5
PE
152992002-11-03 Paul Eggert <eggert@twinsun.com>
15300
15301 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
15302 to count columns correctly, and to check for invalid inputs.
9e32add8 15303
b02d90a5
PE
15304 Use mbsnwidth to count columns correctly. Account for tabs, too.
15305 Include mbswidth.h.
15306 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
15307 (extend_location): New function.
15308 (YY_LINES): Remove.
15309
15310 Handle CRLF in C code rather than in Lex code.
15311 (YY_INPUT): New macro.
15312 (no_cr_read): New function.
15313
15314 Scan UCNs, even though we don't fully handle them yet.
15315 (convert_ucn_to_byte): New function.
15316
15317 Handle backslash-newline correctly in C code.
15318 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
15319 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
15320 all uses changed.
15321 (tag, splice): New EREs. Do not allow NUL or newline in tags.
15322 Use {splice} wherever C allows backslash-newline.
15323 YY_STEP after space, newline, vertical-tab.
15324 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 15325
b02d90a5
PE
15326 (letter, id): Don't assume ASCII; e.g., spell out a-z.
15327
15328 ({int}, handle_action_dollar, handle_action_at): Check for integer
15329 overflow.
9e32add8 15330
b02d90a5
PE
15331 (YY_STEP): Omit trailing semicolon, so that it's more like C.
15332
15333 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
15334 as well as \000. Check for UCHAR_MAX, not 255.
15335 Allow \x with an arbitrary positive number of digits, as in C.
15336 Check for overflow here.
15337 Allow \? and UCNs, for compatibility with C.
15338
15339 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
15340 with quote slot used by complain_at.
15341
15342 * tests/input.at: Add tests for backslash-newline, m4 quotes
15343 in symbols, long literals, and funny escapes in strings.
15344
15345 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
15346 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
15347 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
15348 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
15349 * m4/mbswidth.m4: New file, from GNU coreutils.
15350
15351 * doc/bison.texinfo (Grammar Outline): Document // comments.
15352 (Symbols): Document that trigraphs have no special meaning in Bison,
15353 nor is backslash-newline allowed.
15354 (Actions): Document that trigraphs have no special meaning.
15355
15356 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
15357 no longer used.
15358
153592002-11-02 Paul Eggert <eggert@twinsun.com>
15360
15361 * src/reader.c: Don't include quote.h; not needed.
15362 (get_merge_function): Reword warning to be consistent with
15363 type clash diagnostic in grammar_current_rule_check.
15364
15365 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
15366 bug in trigraph handling.
15367
15368 * src/output.c (prepare_symbols): When printing token names,
15369 escape "[" as "@<:@" and likewise for "]".
15370
15371 * src/system.h (errno): Remove declaration, as we are now
15372 assuming C89 or better, and C89 guarantees errno.
15373
762b212b
PE
153742002-10-30 Paul Eggert <eggert@twinsun.com>
15375
15376 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
15377 Check for close failures.
15378 * src/files.h (xfclose): Return void, not int, since it always
15379 returned zero.
15380 * src/files.c (xfclose): Likewise. Report I/O error if ferror
15381 indicates one.
15382 * src/output.c (output_skeleton): Use xfclose rather than fclose
15383 and ferror. xfclose now checks ferror.
15384
15385 * data/glr.c (YYLEFTMOST_STATE): Remove.
15386 (yyreportTree): Use a stack-based leftmost state. This avoids
15387 our continuing battles with bogus warnings about initializers.
15388
56100c60
AD
153892002-10-30 Akim Demaille <akim@epita.fr>
15390
15391 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
15392 #if.
15393
51b4a04c
PH
153942002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15395
15396 * tests/glr-regr1.at: New test for reported regressions.
15397 * tests/testsuite.at: Add glr-regr1.at test.
15398 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 15399
bf1ebda2
PE
154002002-10-24 Paul Eggert <eggert@twinsun.com>
15401
5c16c6b1
PE
15402 Version 1.75a.
15403
bf1ebda2
PE
15404 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
15405 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
15406 we use malloc. Don't assume 'A' through 'Z' are contiguous.
15407 Don't assume strdup exists; POSIX says its an XSI extension.
15408 Check for buffer overflow on input.
15409
b526ee61
AD
154102002-10-24 Akim Demaille <akim@epita.fr>
15411
15412 * src/output.c (output_skeleton): Don't disable M4sugar comments
15413 too soon: it results in comments being expanded.
15414 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
15415 first output.
15416
f1886bb2
AD
154172002-10-24 Akim Demaille <akim@epita.fr>
15418
15419 * data/yacc.c (m4_int_type): New.
15420 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
15421 char' as only yacc.c wants K&R portability.
15422 * data/glr.c (yysigned_char): Remove.
15423 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15424 Reported by Quoc Peyrot.
15425
c5576256
PE
154262002-10-23 Paul Eggert <eggert@twinsun.com>
15427
15428 * src/main.c (main): With --trace=time, report times even if a
15429 non-fatal error occurs. Formerly, the times were reported in some
15430 such cases but not in others.
15431 * src/reader.c (reader): Just return if a complaint has been issued,
15432 instead of exiting, so that 'main' can report times.
15433
27b0ffea
AD
154342002-10-22 Akim Demaille <akim@epita.fr>
15435
15436 * src/system.h: Include sys/types.
15437 Reported by Bert Deknuydt.
15438
223a7883
PE
154392002-10-23 Paul Eggert <eggert@twinsun.com>
15440
15441 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15442 Suggested by Art Haas.
15443
154442002-10-22 Paul Eggert <eggert@twinsun.com>
15445
15446 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15447 decl; not needed any more.
15448 * src/main.c (main): Use return to exit, undoing yesterday's change.
15449 The last OS that we could find where this wouldn't work is
15450 SunOS 3.5, and that's too old to worry about now.
15451
15452 * data/glr.c (struct yyltype): Define members even when not
15453 doing locations. This is more consistent with yacc.c, and it
15454 works around the following bug reports:
161a71f3
PE
15455 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15456 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 15457
223a7883
PE
15458 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15459 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15460 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15461
8b76775a
AD
154622002-10-22 Akim Demaille <akim@epita.fr>
15463
15464 * data/README: New.
15465
6db10d14
PE
154662002-10-21 Paul Eggert <eggert@twinsun.com>
15467
15468 Be consistent about 'bool'; the old code used an enum in one
15469 module and an int in another, and this violates the C standard.
15470 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15471 * configure.ac (AC_HEADER_STDBOOL): Add.
15472 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15473 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15474 * src/symtab.c (hash_compare_symbol_t): Likewise.
15475 * src/system.h (bool, false, true): Use a definition consistent
15476 with ../lib/hash.c. All uses changed.
15477
15478 * src/complain.c (warning_issued): Renamed from warn_message_count,
15479 so that we needn't worry about integer overflow (!).
15480 Now of type bool. All uses changed.
15481 (complaint_issued): Renamed from complain_message_count; likewise.
15482
15483 * src/main.c (main): Use exit to exit with failure.
27b0ffea 15484
6db10d14
PE
15485 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15486 rather than 1 and 0.
15487 * src/main.c (main): Likewise.
15488 * src/getargs.c (getargs): Likewise.
15489 * src/reader.c (reader): Likewise.
15490
15491 * src/getarg.c (getargs): Remove duplicate code for
15492 "Try `bison --help'".
15493
15494 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15495 What was that "2" for?
15496
15497 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15498 * src/getargs.c (usage): Likewise.
15499
15500 * src/getargs.c (getargs): When there are too few operands, report
15501 the last one. When there are too many, report the first extra
15502 one. This is how diffutils does it.
15503
92a060fd
PE
155042002-10-20 Paul Eggert <eggert@twinsun.com>
15505
15506 Remove K&R vestiges.
15507 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
15508 * src/complain.c (VA_START): Remove. Assume prototypes.
15509 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
15510 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
15511 fatal): Assume prototypes.
15512 * src/complain.h: Assume prototypes.
15513 * src/system.h (PARAMS): Remove.
15514 Include <limits.h> unconditionally, since it's guaranteeed even
15515 for a freestanding C89 compiler.
15516 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
15517 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 15518
e7cb57c0
AD
155192002-10-20 Akim Demaille <akim@epita.fr>
15520
15521 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
15522 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
15523 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
15524 (yyresolveStates, yyresolveAction, yyresolveStack)
15525 (yyprocessOneStack): Use them.
15526 (yy_reduce_print): New.
15527 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
15528
0245f82d
AD
155292002-10-20 Akim Demaille <akim@epita.fr>
15530
15531 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
15532 arguments and output `void'.
15533 (b4_c_function): Rename as...
15534 (b4_c_function_def): this.
15535 (b4_c_function_decl, b4_c_ansi_function_def)
15536 (b4_c_ansi_function_decl): New.
15537 Change the interpretation of the arguments: before `int, foo', now
15538 `int foo, foo'.
15539 * data/yacc.c (yyparse): Prototype and define thanks to these.
15540 Adjust b4_c_function_def uses.
15541 * data/glr.c (yyparse): Likewise, but ANSI only.
15542
39912f52
AD
155432002-10-20 Akim Demaille <akim@epita.fr>
15544
15545 * src/output.c (prepare): Move the definition of `tokens_number',
15546 `nterms_number', `undef_token_number', `user_token_number_max'
15547 to...
15548 (prepare_tokens): Here.
15549 (prepare_tokens): Rename as...
15550 (prepare_symbols): this.
15551 (prepare): Move the definition of `rules_number' to...
15552 (prepare_rules): here.
15553 (prepare): Move the definition of `last', `final_state_number',
15554 `states_number' to...
15555 (prepare_states): here.
15556 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
15557
20c1e2ad
AD
155582002-10-20 Akim Demaille <akim@epita.fr>
15559
15560 * src/tables.h, src/tables.c, src/output.c: Comment changes.
15561
21964f43
AD
155622002-10-20 Akim Demaille <akim@epita.fr>
15563
15564 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
15565 * data/c.m4: here.
15566
66d30cd4
AD
155672002-10-20 Akim Demaille <akim@epita.fr>
15568
15569 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
15570 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
15571 `pair'.
15572 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
15573 `name' to...
15574 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
15575 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
15576 These.
15577
95f2c9fe
PE
155782002-10-19 Paul Eggert <eggert@twinsun.com>
15579
15580 Do not create a temporary file, as that involves security and
15581 cleanup headaches. Instead, use a pair of pipes.
15582 Derived from a suggestion by Florian Krohm.
15583 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
15584 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
15585 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
15586 (BISON_PREREQ_SUBPIPE): Add.
15587 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
15588 Add subpipe.h, subpipe.c.
15589 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
15590 * po/POTFILES.in: Add lib/subpipe.c.
15591 * src/output.c: Include "subpipe.h".
15592 (m4_invoke): Remove decl.
15593 (scan_skel): New decl.
15594 (output_skeleton): Use pipe rather than temporary file for m4 input.
15595 Check that m4sugar.m4 is readable, to avoid deadlock.
15596 Check for pipe I/O error.
15597 * src/scan-skel.l (readpipe): Remove decl.
15598 (scan_skel): New function, to be used in place of m4_invoke.
15599 Read from stream rather than file.
66d30cd4 15600
95f2c9fe
PE
15601 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
15602 float, as this generates a warning on Solaris 8 + GCC 3.2 with
15603 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
15604 this generates a more-accurate value anyway.
15605
15606 * lib/timevar.c (timervar_accumulate): Rename locals to
15607 avoid confusion with similarly-named more-global.
15608 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
15609
15610 * src/output.c (prepare): Use xstrdup to convert char const *
15611 to char *, to avoid GCC warning.
15612
c19988b7
AD
156132002-10-19 Akim Demaille <akim@epita.fr>
15614
15615 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
15616 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
15617 Use them to have `calc.y' ready for %pure-parser.
15618 * data/yacc.c (YYLEX): Pass a yylex return type to
15619 b4_c_function_call.
15620
ae7453f2
AD
156212002-10-19 Akim Demaille <akim@epita.fr>
15622
15623 Prototype support of %lex-param and %parse-param.
15624
15625 * src/parse-gram.y: Add the definition of the %lex-param and
15626 %parse-param tokens, plus their rules.
15627 Drop the `_' version of %glr-parser.
15628 Add the "," token.
15629 * src/scan-gram.l (INITIAL): Scan them.
15630 * src/muscle_tab.c: Comment changes.
15631 (muscle_insert, muscle_find): Rename `pair' as `probe'.
15632 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
15633 (muscle_entry_s): The `value' member is no longer const.
15634 Adjust all dependencies.
15635 * src/muscle_tab.c (muscle_init): Adjust: use
15636 MUSCLE_INSERT_STRING.
15637 Initialize the obstack earlier.
15638 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
15639 (muscle_pair_list_grow): New.
15640 * data/c.m4 (b4_c_function_call, b4_c_args): New.
15641 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
15642 * tests/calc.at: Use %locations, not --locations.
15643 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
15644
0e575721
AD
156452002-10-19 Akim Demaille <akim@epita.fr>
15646
15647 * src/getargs.c (usage): Take status as argument and exit
15648 accordingly.
15649 Report the traditional `Try ... --help' message when status != 0.
15650 (usage, version): Don't take a FILE * as arg, it is pointless.
15651 (getargs): When there is an incorrect number of arguments, make it
15652 an error, and report it GNUlically thanks to `usage ()'.
15653
724ce7f5
PE
156542002-10-18 Paul Eggert <eggert@twinsun.com>
15655
3a781eb2
PE
15656 * data/glr.c (yyreportParseError): Don't assume that sprintf
15657 yields the length of the printed string, as this is not true
15658 on SunOS 4.1.4. Reported by Peter Klein.
15659
724ce7f5
PE
15660 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15661 * tests/conflicts.at (%nonassoc and eof): Likewise.
15662 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15663
473d0a75
AD
156642002-10-17 Akim Demaille <akim@epita.fr>
15665
15666 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15667 * src/getargs.c (trace_types, trace_args): Adjust.
15668 * src/reader.c (grammar_current_rule_prec_set)
15669 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15670 Standardize error messages.
15671 And s/@prec/%prec/!
15672 (reader): Use trace_flag to enable scanner/parser debugging,
15673 instead of an adhoc scheme.
15674 * src/scan-gram.l: Remove trailing debugging code.
15675
e76d2469
PE
156762002-10-16 Paul Eggert <eggert@twinsun.com>
15677
93e2236a
PE
15678 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15679 MUSCLE_TAB_H.
15680
e76d2469
PE
15681 * NEWS: Officially drop support for building Bison with K&R C,
15682 since it didn't work anyway and it's not worth worrying about.
15683 * Makefile.maint (wget_files): Remove ansi2knr.c.
15684 (ansi2knr.c-url_prefix): Remove.
15685 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15686 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15687 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15688
5bd1c419
PE
156892002-10-15 Paul Eggert <eggert@twinsun.com>
15690
15691 Stop using the "enum_" trick for K&R-style function definitions;
15692 it confused me, and I was the author! Instead, assume that people
15693 who want to use K&R C compilers (when using these modules in GCC,
15694 perhaps?) will run ansi2knr.
15695
15696 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15697 All uses of "enum_" changed to "enum ".
15698 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15699 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 15700
5bd1c419
PE
15701 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15702 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15703 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15704 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15705 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15706 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15707 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15708 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15709 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15710 Use function prototypes; this removes the need for declaring
15711 static functions simply to provide their prototypes.
15712 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15713 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15714 bitset_count_, bitset_create, bitset_dump, bitset_first,
15715 bitset_free, bitset_init, bitset_last, bitset_next,
15716 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15717 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15718 bitset_print, bitset_release_memory, bitset_toggle_,
15719 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15720 debug_bitset): Likewise.
15721 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15722 * lib/bitset_stats.c (bitset_log_histogram_print,
15723 bitset_percent_histogram_print, bitset_stats_and,
15724 bitset_stats_and_cmp, bitset_stats_and_or,
15725 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15726 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15727 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15728 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15729 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15730 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15731 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15732 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15733 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15734 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15735 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15736 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15737 bitset_stats_zero): Likewise.
15738 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15739 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15740 bitsetv_dump, debug_bitsetv): Likewise.
15741 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15742 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15743 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15744 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15745 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15746 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15747 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15748 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15749 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15750 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15751 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15752 Likewise.
15753 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15754 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15755 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15756 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15757 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15758 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15759 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15760 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15761 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15762 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15763 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 15764
ae26e1f0
AD
157652002-10-14 Akim Demaille <akim@epita.fr>
15766
15767 Version 1.75.
15768
d43baf71
AD
157692002-10-14 Akim Demaille <akim@epita.fr>
15770
15771 * tests/Makefile.am (maintainer-check-posix): New.
15772
7ebc83e3
AD
157732002-10-14 Akim Demaille <akim@epita.fr>
15774
15775 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15776 member.
15777
05846dae
AD
157782002-10-14 Akim Demaille <akim@epita.fr>
15779
15780 * src/tables.c (table_ninf_remap): base -> tab.
15781 Reported by Matt Rosing.
15782
1318e37d
PE
157832002-10-14 Paul Eggert <eggert@twinsun.com>
15784
447fbb17
PE
15785 * tests/action.at, tests/calc.at, tests/conflicts.at,
15786 tests/cxx-type.at, tests/headers.at, tests/input.at,
15787 tests/regression.at, tests/synclines.at, tests/torture.at:
15788 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15789 so that the tests still work even if POSIXLY_CORRECT is set.
15790 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 15791
1318e37d
PE
15792 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15793 for portability to K&R hosts. Fix typo: signed char is guaranteed
15794 only to 127, not to 128.
15795 * data/glr.c (yysigned_char): New type.
15796 * data/yacc.c (yysigned_char): Likewise.
15797 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15798
cc0f0794
PE
157992002-10-13 Paul Eggert <eggert@twinsun.com>
15800
5038f418
PE
15801 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15802 true due to limited range of data type" warning from GCC.
15803
cc0f0794
PE
15804 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15805 by wrapping enum yytokentype's definition inside #ifndef
15806 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15807
6fed0802
AD
158082002-10-13 Akim Demaille <akim@epita.fr>
15809
15810 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15811 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15812
32f0598d
AD
158132002-10-13 Akim Demaille <akim@epita.fr>
15814
15815 * Makefile.maint: Update from Autoconf 2.54.
15816 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15817
7ea9a33f
AD
158182002-10-13 Akim Demaille <akim@epita.fr>
15819
15820 * src/print.c (print_state): Separate the list of solved conflicts
15821 from the other items.
15822 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15823
ea99527d
AD
158242002-10-13 Akim Demaille <akim@epita.fr>
15825
15826 Let nondeterministic skeletons be usable with deterministic
15827 tables.
15828
15829 With the patch, GAWK compiled by GCC without -O2 passes its test
15830 suite using a GLR parser driven by LALR tables. It fails with -O2
15831 because `struct stat' gives two different answers on my machine:
15832 88 (definition of an auto var) and later 96 (memset on this var).
15833 Hence the stack is badly corrumpted. The headers inclusion is to
15834 blame: if I move the awk.h inclusion before GLR's system header
15835 inclusion, the two struct stat have the same size.
15836
15837 * src/tables.c (pack_table): Always create conflict_table.
15838 (token_actions): Always create conflict_list.
15839 * data/glr.c (YYFLAG): Remove, unused.
15840
f377f69f
AD
158412002-10-13 Akim Demaille <akim@epita.fr>
15842
15843 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15844 (O0FLAGS): New.
15845 (VALGRIND, GXX): New.
15846 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15847 * tests/bison.in: Run $PREBISON a pre-command.
15848 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15849 (maintainer-check-g++): New.
15850 * Makefile.am (maintainer-check): New.
15851
2a1fe6ed
AD
158522002-10-13 Akim Demaille <akim@epita.fr>
15853
15854 * data/glr.c: Formatting changes.
15855 Tweak some trace messages to match yacc.c's.
15856
f50adbbd
AD
158572002-10-13 Akim Demaille <akim@epita.fr>
15858
15859 GLR parsers sometimes raise parse errors instead of performing the
15860 default reduction.
15861 Reported by Charles-Henry de Boysson.
15862
15863 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 15864 check the length of the traces when %glr.
f50adbbd
AD
15865 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
15866 GLR's traces.
15867 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
15868 Test GLR parsers.
15869 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
15870 (yyltype): Remove the yy prefix from the member names.
15871 (yytable): Complete its comment.
15872 (yygetLRActions): Map error action number from YYTABLE from
15873 YYTABLE_NINF to 0.
15874 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
15875 (which was a bug: it should have been YYTABEL_NINF, and yet it was
15876 not satisfying as we could compare an YYACTION computed from
15877 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
15878 only value for error actions.
15879 (yyreportParseError): In verbose parse error messages, don't issue
15880 `error' in the list of expected tokens.
15881 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
15882 next action to perform to match glr.c's decoding.
15883 (yytable): Complete its comment.
15884
bcbad5b9
PE
158852002-10-13 Paul Eggert <eggert@twinsun.com>
15886
15887 Fix problem reported by Henrik Grubbstroem in
161a71f3 15888 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
15889 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
15890 because the Bison parser reads the second action before reducing
15891 the first one.
15892 * src/scan-gram.l (rule_length): New static var.
15893 Use it to keep track of the rule length in the scanner, since
15894 we can't expect the parser to be in lock-step sync with the scanner.
15895 (handle_action_dollar, handle_action_at): Use this var.
15896 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 15897
14904b89
PE
158982002-10-12 Paul Eggert <eggert@twinsun.com>
15899
1fe611e5
PE
15900 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
15901 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
15902 Include <sys/time.h> when checking for clock_t and struct tms.
15903 Use same include order as source.
15904 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 15905 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 15906
1fe611e5
PE
15907 * lib/timevar.c: Update copyright date and clarify comments.
15908 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 15909
1fe611e5
PE
15910 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
15911 GCC version as of today, then merge Bison's changes.
15912 Change "GCC" to "Bison" in copyright notice. timevar.def's
15913 author is Akim, so change that too.
15914
98194095
PE
15915 * src/reader.c (grammar_current_rule_check):
15916 Don't worry about the default action if $$ is untyped.
15917 Prevents bogus warnings reported by Jim Gifford in
161a71f3 15918 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 15919
14904b89
PE
15920 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
15921 * data/glr.c, data/lalr1.cc, data/yacc.c:
15922 Output token definitions before the first part of user declarations.
15923 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 15924 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 15925
ff6dca18
PE
159262002-10-11 Paul Eggert <eggert@twinsun.com>
15927
15928 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
15929 (yyparse): here. This undoes some of the 2002-07-25 change.
15930 Compatibility problem reported by Ralf S. Engelschall with
15931 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
15932
eb714592
AD
159332002-10-11 Akim Demaille <akim@epita.fr>
15934
15935 * tests/regression.at Characters Escapes): New.
15936 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
15937 characters.
15938 Reported by Jan Nieuwenhuizen.
15939
b7195100
AD
159402002-10-11 Akim Demaille <akim@epita.fr>
15941
15942 * po/id.po: New.
15943
f28a0f2d
PE
159442002-10-10 Paul Eggert <eggert@twinsun.com>
15945
15946 Portability fixes for bitsets; this also avoids several GCC
15947 warnings.
15948
15949 * lib/abitset.c: Include <stddef.h>, for offsetof.
15950 * lib/lbitset.c: Likewise.
15951
15952 * lib/abitset.c (abitset_bytes): Return a size that is aligned
15953 properly for vectors of objects. Do not assume that adding a
15954 header size to a multiple of a word size yields a value that is
15955 properly aligned for the whole union.
15956 * lib/bitsetv.c (bitsetv_alloc): Likewise.
15957
15958 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
15959 unique names for structures.
15960 * lib/ebitset.c (ebitset_bytes): Likewise.
15961 * lib/lbitset.c (lbitset_bytes): Likewise.
15962
15963 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
15964 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
15965 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
15966 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
15967 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
15968 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
15969 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
15970 to improve the type-checking that GCC can do.
15971 * lib/bitset.c (bitset_op4_cmp): Likewise.
15972 * lib/bitset_stats.c (bitset_stats_count,
15973 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
15974 bitset_stats_copy, bitset_stats_disjoint_p,
15975 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
15976 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
15977 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
15978 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
15979 bitset_stats_and_or_cmp, bitset_stats_andn_or,
15980 bitset_stats_andn_or_cmp, bitset_stats_or_and,
15981 bitset_stats_or_and_cmp): Likewise.
15982 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
15983 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
15984 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
15985 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
15986
15987 * lib/abitset.h: Include bitset.h, not bbitset.h.
15988 * lib/ebitset.h: Likewise.
15989 * lib/lbitset.h: Likewise.
15990
15991 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
15992 All instances of parameters of type enum bitset_opts are now of
15993 type enum_bitset_opts, to conform to the C Standard, and similarly
15994 for enum_bitset_type.
15995 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15996 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15997
15998 Do not use "struct bitset_struct" to mean different things in
15999 different modules. Not only is this confusing, it violates
16000 the C Standard, which requires that structure types in different
16001 modules must be compatible if one is to be passed to the other.
16002 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16003 All instances of "struct bitset_struct *" replaced with "bitset".
16004 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16005 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16006 struct lbitset_struct, struct bitset_stats_struct): New types.
16007 All uses of struct bitset_struct changed to union bitset_union,
16008 etc.
ba0fe3c7 16009 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
16010 struct bitset_struct): Remove.
16011 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16012 struct bitset_struct): Remove.
16013 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16014 bitset_struct): Remove.
16015 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16016 Likewise.
16017
16018 Do not call a function of type T using a call that assumes the
16019 function is of a different type U. Standard C requires that a
16020 function must be called with a type that is compatible with its
16021 definition.
16022 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16023 New decls.
16024 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16025 New functions.
16026 * lib/ebitset.c (PFV): Remove.
16027 * lib/lbitset.c (PFV): Likewise.
16028 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16029 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16030 decls.
16031 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16032 (ebitset_vtable): Use them.
16033 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16034 lbitset_xor): New functions.
16035 (lbitset_vtable): Use them.
16036
16037 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16038 Declare.
16039
16040 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16041 GCC warning.
16042 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16043 Use offsetof, for simplicity.
16044
6fbe4984
PE
160452002-10-06 Paul Eggert <eggert@twinsun.com>
16046
16047 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16048 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 16049 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
16050 which was inadvertently undone by the 2002-09-30 patch.
16051 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16052 the same width as int.
16053
420f93c8
PE
160542002-10-04 Paul Eggert <eggert@twinsun.com>
16055
16056 Version 1.50.
16057
16058 * configure.ac (AC_INIT), NEWS: Increment version number.
16059
16060 * doc/bison.texinfo: Minor spelling, grammar, and white space
16061 fixes.
16062 (Symbols): Mention that any negative value returned from yylex
16063 signifies end-of-input. Warn about negative chars. Mention
16064 the portable Standard C character set.
16065
16066 The GNU coding standard says CFLAGS and YFLAGS are reserved
16067 for the installer to set.
16068 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16069 * src/Makefile.am (AM_CFLAGS): Likewise.
16070 (AM_YFLAGS): Renamed from YFLAGS.
16071
16072 Fix some MAX and MIN problems.
16073 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16074 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16075 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16076 * src/reader.c (reader): Use it.
16077
16078 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16079 POSIX 1003.1-2001 has removed fgrep.
16080
160812002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16082
16083 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16084 interpreted as signed.
16085 * lib/ebitset.c (ebitset_list): Fix bug.
16086
ff68026d
PE
160872002-10-01 Paul Eggert <eggert@twinsun.com>
16088
16089 More fixes for 64-bit hosts and large bitsets.
16090
16091 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16092 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16093 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16094 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
16095 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
16096 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
16097 bitset_count_): Likewise.
16098 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
16099 bitset_first, bitset_last): Likewise.
16100 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
16101 bitset_stats_list_reverse, bitset_stats_size,
16102 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
16103 Likewise.
16104 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16105 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16106 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16107 bitsetv_reflexive_transitive_closure): Likewise.
16108 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16109 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16110 Likewise.
16111 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16112 Likewise.
420f93c8 16113
ff68026d
PE
16114 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16115 Use size_t, not unsigned int, to count bytes.
16116 * lib/abitset.h (abitset_bytes): Likewise.
16117 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
16118 Likewise.
16119 * lib/bitset.h (bitset_bytes): Likewise.
16120 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
16121 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
16122 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16123 * lib/ebitset.c (ebitset_bytes): Likewise.
16124 * lib/ebitset.h (ebitset_bytes): Likewise.
16125 * lib/lbitset.c (lbitset_bytes): Likewise.
16126 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 16127
ff68026d
PE
16128 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
16129 abitset_subset_p, abitset_disjoint_p, abitset_and,
16130 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
16131 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
16132 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
16133 abitset_or_and, abitset_or_and_cmp):
16134 Use bitset_windex instead of unsigned int.
16135 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16136 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
16137 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
16138 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
16139 Likewise.
16140 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 16141
ff68026d
PE
16142 * lib/bitset.c (bitset_print):
16143 Use proper printf formats for widths of integer types.
16144 * lib/bitset_stats.c (bitset_percent_histogram_print,
16145 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
16146 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16147 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16148 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 16149
ff68026d
PE
16150 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
16151 BITSET_SIZE_MAX): New macros.
16152 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
16153 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
16154 to BITSET_WINDEX_MAX.
16155
16156 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
16157 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
16158 since we now return the bitset_bindex type (not int).
16159
16160 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
16161 when computing sizes.
16162 * lib/ebitset.c (ebitset_elts_grow): Likewise.
16163
16164 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
16165 and avoid cast to unsigned.
16166
6aa452a6
AD
161672002-09-30 Akim Demaille <akim@epita.fr>
16168
16169 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
16170 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
16171 Updates from Michael Hayes.
16172
927f7817
AD
161732002-09-30 Art Haas <ahaas@neosoft.com>
16174
16175 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
16176 invocations.
16177 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
16178 defined.
16179
9738f41e
AD
161802002-09-27 Akim Demaille <akim@epita.fr>
16181
16182 Version 1.49c.
16183
a5c75d7f
AD
161842002-09-27 Akim Demaille <akim@epita.fr>
16185
16186 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
16187 (Because of AC_LIBSOURCE).
16188
8280e179
AD
161892002-09-27 Akim Demaille <akim@epita.fr>
16190
16191 Playing with Autoscan.
16192
16193 * configure.ac: Remove the old LIBOBJ tweaks.
16194 (AC_REPLACE_FUNCS): Add strrchr and strtol.
16195 * lib/strrchr.c: New.
16196 * lib/strtol.c: New, from the Coreutils 4.5.1.
16197
ae64af35
AD
161982002-09-27 Akim Demaille <akim@epita.fr>
16199
16200 Playing with Autoscan.
16201
16202 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
16203 * lib/Makefile.am (libbison_a_SOURCES): No longer include
16204 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
16205 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
16206 Coreutils 4.5.1.
16207
d1a1114f
AD
162082002-09-24 Akim Demaille <akim@epita.fr>
16209
16210 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
16211 (Frequently Asked Questions, Parser Stack Overflow): New.
16212
b906441c
AD
162132002-09-13 Akim Demaille <akim@epita.fr>
16214
16215 Playing with autoscan.
16216
16217 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
16218 * src/files.c (skeleton_find): Remove, unused.
16219 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
16220 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
16221
bd701811
AD
162222002-09-13 Akim Demaille <akim@epita.fr>
16223
16224 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
16225 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
16226
e0a13e7b
AD
162272002-09-13 Akim Demaille <akim@epita.fr>
16228
16229 * configure.ac: Require 2.54.
16230 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
16231 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
16232 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
16233 Remove, provided by Autoconf macros.
16234
c97011bf
AD
162352002-09-12 Akim Demaille <akim@epita.fr>
16236
16237 * m4/prereq.m4: Update, from Coreutils 4.5.1.
16238
d862b1be
AD
162392002-09-12 Akim Demaille <akim@epita.fr>
16240
16241 * m4/prereq.m4: Update, from Fileutils 4.1.5.
16242 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
16243 Reported by Martin Mokrejs.
16244
3d38c03a
AD
162452002-09-10 Akim Demaille <akim@epita.fr>
16246
16247 * src/parse-gram.y: Associate a human readable string to each
16248 token type.
16249 * tests/regression.at (Invalid inputs): Adjust.
16250
b6347355
AD
162512002-09-10 Gary V. Vaughan <gary@gnu.org>
16252
16253 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
16254 with an Autoconf-2.5x style configure.ac.
16255
09ba4ab2
PE
162562002-09-06 Paul Eggert <eggert@twinsun.com>
16257
16258 * doc/bison.texinfo (Conditions): Make explicit that the GPL
16259 exception applies only to yacc.c. This is a modification of a
16260 patch originally suggested by Akim Demaille.
16261
21846f69
AD
162622002-09-06 Akim Demaille <akim@epita.fr>
16263
09ba4ab2
PE
16264 * data/c.m4 (b4_copyright): Move the GPL exception comment from
16265 here to...
16266 * data/yacc.c: here.
16267
21846f69
AD
16268 * data/lalr1.cc (struct yyltype): Don't define it, since we use
16269 LocationType.
16270 (b4_ltype): Default to yy::Location from location.hh.
16271
c0ad8bf3
AD
162722002-09-04 Jim Meyering <jim@meyering.net>
16273
16274 * data/yacc.c: Guard the declaration of yytoknum also with
16275 `#ifdef YYPRINT', so it is declared only when used.
16276
3a93251e
AD
162772002-09-04 Akim Demaille <akim@epita.fr>
16278
16279 * configure.in: Rename as...
16280 * configure.ac: this.
16281 Bump to 1.49c.
16282
427c0dda
AD
162832002-09-04 Akim Demaille <akim@epita.fr>
16284
16285 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
16286 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
16287 translate maintainer only messages.
16288
6a254321
PE
162892002-08-12 Paul Eggert <eggert@twinsun.com>
16290
645e30d1
PE
16291 Version 1.49b.
16292
6a254321
PE
16293 * Makefile.am (SUBDIRS): Remove intl.
16294 (DISTCLEANFILES): Remove.
16295 * NEWS: Mention that GNU M4 is now required. Clarify what is
16296 meant by "larger grammars". Mention the pt_BR translation.
16297 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
16298 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
16299 Bump version from 0.11.2 to 0.11.5.
16300 (BISON_PREREQ_STAGE): Remove.
16301 (AM_GNU_GETTEXT): Use external gettext.
16302 (AC_OUTPUT): Remove intl/Makefile.
16303
16304 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
16305
16306 * data/glr.c: Include string.h, for strlen.
16307 (yyreportParseError): Use size_t for yysize.
16308 (yy_yypstack): No longer nested inside yypstates, as nested
16309 functions are not portable. Do not assume size_t is the
16310 same width as int.
16311 (yypstates): Do not assume that ptrdiff_t is the same width
16312 as int, and similarly for yyposn and YYINDEX.
16313
16314 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
16315
16316 * lib/Makefile.am (INCLUDES): Do not include from the intl
16317 directory, which has been removed.
16318 * src/Makefile.am (INCLUDES): Likewise.
16319
16320 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
16321 (bitsets_sources, additional_bitsets_sources, timevars_sources):
16322 New vars.
16323
16324 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
16325 * tests/Makefile.am (EXTRA_DIST): Likewise.
16326
16327 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
16328 Do not assume that bitset_windex is the same width as unsigned.
16329
16330 * lib/abitset.c (abitset_unused_clear): Do not assume that
16331 bitset_word is the same width as int.
16332 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
16333 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
16334 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
16335 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
16336 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
16337
16338 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
16339 portability to one's complement hosts!).
16340 * lib/ebitset.c (ebitset_op1): Likewise.
16341 * lib/lbitset.c (lbitset_op1): Likewise.
16342
16343 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
16344 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
16345 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
16346 Sync with fileutils.
16347 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
16348 lib/gettext.h: Sync with diffutils.
16349
16350 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
16351 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
16352
16353 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
16354 PROTOTYPES to check for prototypes, and "defined __STDC__" to
16355 check for void *.
16356
16357 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
16358 size_t; the old version tried to do this but casted improperly.
16359 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
16360 (bitset_test): Now returns int, not unsigned long.
16361
16362 * lib/bitset_stats.c: Include "gettext.h".
16363 (_): New macro.
16364 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
16365 name locals "index", as it generates unnecessary warnings on some
16366 hosts that have an "index" function.
16367
16368 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
16369 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
16370 they need translation.
16371 * src/LR0.c (state_list_append, new_itemsets, get_state,
16372 append_states, generate_states): Likewise.
16373 * src/assoc.c (assoc_to_string): Likewise.
16374 * src/closure.c (print_closure, set_firsts, closure): Likewise.
16375 * src/gram.c (grammar_dump): Likewise.
16376 * src/injections.c (injections_compute): Likewise.
16377 * src/lalr.c (lookaheads_print): Likewise.
16378 * src/relation.c (relation_transpose): Likewise.
16379 * src/scan-gram.l: Likewise.
16380 * src/tables.c (table_grow, pack_vector): Likewise.
16381
16382 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
16383 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
16384 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
16385 * m4/mbstate_t.m4: Sync with fileutils.
16386 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
16387
16388 * po/LINGUAS: Add pt_BR.
16389 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
16390 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
16391 lib/timevar.c.
16392 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
16393 manual recommends.
16394 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
16395
16396 * src/complain.c (strerror_r): Remove decl; not needed.
16397 (strerror): Use same pattern as ../lib/error.c.
16398
16399 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
16400
16401 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
16402
16403 * src/main.c (main): Cast result of bindtextdomain and textdomain
16404 to void, to avoid a GCC warning when --disable-nls is in effect.
16405
16406 * src/scan-gram.l: Use strings rather than escapes when possible,
16407 to minimize the number of warnings from xgettext.
16408 (handle_action_dollar, handle_action_at): Don't use isdigit,
16409 as it mishandles negative chars and it may not work as expected
16410 outside the C locale.
16411
16412 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
16413 this is a GCC extension and is not portable to other compilers.
16414
16415 * src/system.h (alloca): Use same pattern as ../lib/error.c.
16416 Do not include <ctype.h>; no longer needed.
16417 Do not include <malloc.h>; no longer needed (and generates
16418 warnings on OpenBSD 3.0).
16419
16420 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
16421 it's not portable.
16422
16423 * tests/regression.at: Do not use 'cc -c input.c -o input';
16424 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16425
16426 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16427 exit status as failure, not just exit status 1. Sun C exits
16428 with status 2 sometimes.
16429
16430 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16431 Use it for the two large tests.
16432
c8f002c7
AD
164332002-08-02 Akim Demaille <akim@epita.fr>
16434
16435 * src/conflicts.c (conflicts_output): Don't output rules never
16436 reduced here, since anyway that computation doesn't work.
16437 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16438 (rule_useless_p, rule_never_reduced_p): New.
16439 (grammar_rules_partial_print): Use a filter instead of a range.
16440 Display the title only if needed.
16441 (grammar_rules_print): Adjust.
16442 (grammar_rules_never_reduced_report): New.
16443 * src/tables.c (action_row): Move the computation of rules never
16444 reduced to...
16445 (token_actions): here.
16446 * src/main.c (main): Make the parser before making the report, so
16447 that rules never reduced are computed.
16448 Call grammar_rules_never_reduced_report.
16449 * src/print.c (print_results): Report rules never reduced.
16450 * tests/conflicts.at, tests/reduce.at: Adjust.
16451
cd08e51e
AD
164522002-08-01 Akim Demaille <akim@epita.fr>
16453
16454 Instead of attaching lookaheads and duplicating the rules being
16455 reduced by a state, attach the lookaheads to the reductions.
16456
16457 * src/state.h (state_t): Remove the `lookaheads',
16458 `lookaheads_rule' member.
16459 (reductions_t): Add a `lookaheads' member.
16460 Use a regular array for the `rules'.
16461 * src/state.c (reductions_new): Initialize the lookaheads member
16462 to 0.
16463 (state_rule_lookaheads_print): Adjust.
16464 * src/state.h, src/state.c (state_reductions_find): New.
16465 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16466 (count_rr_conflicts): Adjust.
16467 * src/lalr.c (LArule): Remove.
16468 (add_lookback_edge): Adjust.
16469 (state_lookaheads_count): New.
16470 (states_lookaheads_initialize): Merge into...
16471 (initialize_LA): this.
16472 (lalr_free): Adjust.
16473 * src/main.c (main): Don't free nullable and derives too early: it
16474 is used by --verbose.
16475 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16476
bb0027a9
AD
164772002-08-01 Akim Demaille <akim@epita.fr>
16478
16479 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16480 `rule_number_t**'.
16481 (set_derives, free_derives): Rename as...
16482 (derives_compute, derives_free): this.
16483 Adjust all dependencies.
16484 * src/nullable.c (set_nullable, free_nullable): Rename as...
16485 (nullable_compute, nullable_free): these.
16486 (rule_list_t): Store rule_t *, not rule_number_t.
16487 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16488 pointers, instead of their numbers.
16489 * src/main.c (main): Call nullable_free, and derives_free earlier,
16490 as they were lo longer used.
16491
3325ddc4
AD
164922002-08-01 Akim Demaille <akim@epita.fr>
16493
16494 * lib/timevar.c (get_time): Include children time.
16495 * src/lalr.h (LA, LArule): Don't export them: used with the
16496 state_t.
16497 * src/lalr.c (LA, LArule): Static.
16498 * src/lalr.h, src/lalr.c (lalr_free): New.
16499 * src/main.c (main): Call it.
16500 * src/tables.c (pack_vector): Check whether loc is >= to the
16501 table_size, not >.
16502 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16503 (tables_generate): do it, since that's also it which allocates
16504 them.
16505 Don't free LA and LArule, main does.
16506
c6f1a33c
AD
165072002-07-31 Akim Demaille <akim@epita.fr>
16508
16509 Separate parser tables computation and output.
16510
16511 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
16512 (conflict_list, conflict_list_cnt, table, check, table_ninf)
16513 (yydefgoto, yydefact, high): Move to...
16514 * src/tables.h, src/tables.c: here.
16515 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16516 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16517 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
16518 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
16519 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
16520 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
16521 (action_row, save_row, token_actions, save_column, default_goto)
16522 (goto_actions, sort_actions, matching_state, pack_vector)
16523 (table_ninf_remap, pack_table, prepare_actions): Move to...
16524 * src/tables.c: here.
16525 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
16526 * src/output.c (token_actions, output_base, output_conflicts)
16527 (output_check): Merge into...
16528 (prepare_actions): this.
16529 (actions_output): Rename as...
16530 (user_actions_output): this.
16531 * src/main.c (main): Call tables_generate and tables_free.
16532
1509d42f
AD
165332002-07-31 Akim Demaille <akim@epita.fr>
16534
16535 Steal GCC's --time-report support.
16536
16537 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
16538 stolen/adjusted from GCC.
16539 * m4/stage.m4: Remove time related checks.
16540 * m4/timevar.m4: New.
16541 * configure.in: Adjust.
16542 * src/system.h: Adjust to using timevar.h.
16543 * src/getargs.h, src/getargs.c: Support trace_time for
16544 --trace=time.
16545 * src/main.c (stage): Remove.
16546 (main): Replace `stage' invocations with timevar calls.
16547 * src/output.c: Insert pertinent timevar calls.
16548
273a74fa
AD
165492002-07-31 Akim Demaille <akim@epita.fr>
16550
16551 Let --trace have arguments.
16552
16553 * src/getargs.h (enum trace_e): New.
16554 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
16555 (long_options, short_options): --trace/-T takes an optional
16556 argument.
16557 Change all the uses of trace_flag to reflect the new flags.
16558 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
16559
16560 Strengthen `stage' portability.
16561
16562 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
16563 * configure.in: Use it.
16564 Don't check for malloc.h and sys/times.h.
16565 * src/system.h: Include them when appropriate.
16566 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
16567 times and struct tms are available.
16568
217598da
AD
165692002-07-30 Akim Demaille <akim@epita.fr>
16570
16571 In verbose parse error message, don't report `error' as an
16572 expected token.
16573 * tests/actions.at (Printers and Destructors): Adjust.
16574 * tests/calc.at (Calculator $1): Adjust.
16575 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
16576 error message, do not report the parser accepts the error token in
16577 that state.
16578
52489d44
AD
165792002-07-30 Akim Demaille <akim@epita.fr>
16580
16581 Normalize conflict related messages.
16582
16583 * src/complain.h, src/complain.c (warn, complain): New.
16584 * src/conflicts.c (conflicts_print): Use them.
16585 (conflict_report_yacc): New, extracted from...
16586 (conflicts_print): here.
16587 * tests/conflicts.at, tests/existing.at: Adjust.
16588
e8832397
AD
165892002-07-30 Akim Demaille <akim@epita.fr>
16590
16591 Report rules which are never reduced by the parser: those hidden
16592 by conflicts.
16593
16594 * src/LR0.c (save_reductions): Don't make the final state too
16595 different: save its reduction (accept) instead of having a state
16596 without any action (no shift or goto, no reduce).
16597 Note: the final state is now a ``regular'' state, i.e., the
16598 parsers now contain `reduce 0' as default reduction.
16599 Nevertheless, since they decide to `accept' when yystate =
16600 final_state, they still will not reduce rule 0.
16601 * src/print.c (print_actions, print_reduction): Adjust.
16602 * src/output.c (action_row): Track reduced rules.
16603 (token_actions): Report rules never reduced.
16604 * tests/conflicts.at, tests/regression.at: Adjust.
16605
caf23d24
AD
166062002-07-30 Akim Demaille <akim@epita.fr>
16607
16608 `stage' was accidently included in a previous patch.
16609 Initiate its autoconfiscation.
16610
16611 * configure.in: Look for malloc.h and sys/times.h.
16612 * src/main.c (stage): Adjust.
16613 Report only when trace_flag.
16614
640748ee
AD
166152002-07-29 Akim Demaille <akim@epita.fr>
16616
16617 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
16618 state_number_t.
16619 (errs_t): symbol_t*, not symbol_number_t.
16620 (reductions_t): rule_t*, not rule_number_t.
16621 (FOR_EACH_SHIFT): New.
16622 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
16623 * src/print.c, src/print_graph.c: Adjust.
16624
88bce5a2
AD
166252002-07-29 Akim Demaille <akim@epita.fr>
16626
16627 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
16628
16629 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
16630 (endtoken, accept): these.
16631 * src/reader.c (reader): Set endtoken's default tag to "$end".
16632 Set undeftoken's tag to "$undefined" instead of "$undefined.".
16633 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
16634 Adjust.
16635
1bfb97db
AD
166362002-07-29 Akim Demaille <akim@epita.fr>
16637
16638 * src/reduce.c (reduce_grammar): When the language is empty,
16639 complain about the start symbol, not the axiom.
16640 Use its location.
16641 * tests/reduce.at (Empty Language): New.
16642
fc5734fe
AD
166432002-07-26 Akim Demaille <akim@epita.fr>
16644
16645 * src/reader.h, src/reader.c (gram_error): ... can't get
16646 yycontrol without making too strong assumptions on the parser
16647 itself.
16648 * src/output.c (prepare_tokens): Use the real 0th value of
16649 token_translations instead of `0'.
16650 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
16651 visible here.
16652 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
16653 for the time being: %locations ought to provide it to yyerror.
16654
3650b4b8
AD
166552002-07-25 Akim Demaille <akim@epita.fr>
16656
16657 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16658 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16659 * tests/regression.at (Web2c Actions): Adjust.
16660
4b3d3a8e
AD
166612002-07-25 Akim Demaille <akim@epita.fr>
16662
16663 Stop storing rules from 1 to nrules + 1.
16664
16665 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16666 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16667 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16668 Iterate from 0 to nrules.
16669 Use rule_number_as_item_number and item_number_as_rule_number.
16670 Adjust to `derive' now containing possibly 0.
16671 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16672 Handle the `- 1' part in rule numbers from/to item numbers.
16673 * src/conflicts.c (log_resolution): Fix the message which reversed
16674 shift and reduce.
16675 * src/output.c (action_row): Initialize default_rule to -1.
16676 (token_actions): Adjust.
16677 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16678 expected output.
16679 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16680
4a2a22f4
AD
166812002-07-25 Akim Demaille <akim@epita.fr>
16682
16683 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16684 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16685 (b4_c_knr_arg_decl): New.
16686 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16687 yyreport_parse_error.
16688
b8df3223
AD
166892002-07-25 Akim Demaille <akim@epita.fr>
16690
16691 * data/yacc.c (yyreport_parse_error): New, extracted from...
16692 (yyparse): here.
16693 (yydestruct, yysymprint): Move above yyparse.
16694 Be K&R compliant.
16695
a762e609
AD
166962002-07-25 Akim Demaille <akim@epita.fr>
16697
16698 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16699 replace...
16700 (b4_sint_type, b4_uint_type): these.
16701 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16702 * tests/regression.at (Web2c Actions): Adjust.
16703
12b0043a
AD
167042002-07-25 Akim Demaille <akim@epita.fr>
16705
16706 * src/gram.h (TIEM_NUMBER_MAX): New.
16707 (item_number_of_rule_number, rule_number_of_item_number): Rename
16708 as...
16709 (rule_number_as_item_number, item_number_as_rule_number): these.
16710 Adjust dependencies.
16711 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16712 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16713 (symbol_number_to_vector_number): New.
16714 (order): Of vector_number_t* type.
16715 (base_t, BASE_MAX, BASE_MIN): New.
16716 (froms, tos, width, pos, check): Of base_t type.
16717 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16718 (actrow): Of action_number_t type.
16719 (conflrow): Of unsigned int type.
16720 (table_ninf, base_ninf): New.
16721 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16722 (muscle_insert_int_table, muscle_insert_base_table)
16723 (muscle_insert_rule_number_table): New.
16724 (prepare_tokens): Output `toknum' as int_table.
16725 (action_row): Returns a rule_number_t.
16726 Use ACTION_MIN, not SHRT_MIN.
16727 (token_actions): yydefact is rule_number_t*.
16728 (table_ninf_remap): New.
16729 (pack_table): Use it for `base' and `table'.
16730 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16731 replaced with...
16732 (YYPACT_NINF, YYTABLE_NINF): these.
16733 (yypact, yytable): Compute their types instead of hard-coded
16734 `short'.
16735 * tests/regression.at (Web2c Actions): Adjust.
16736
5dde258a
AD
167372002-07-19 Akim Demaille <akim@epita.fr>
16738
16739 * src/scan-gram.l (id): Can start with an underscore.
16740
a945ec39
AD
167412002-07-16 Akim Demaille <akim@epita.fr>
16742
16743 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16744 Adjust all former `associativity' dependencies.
16745 * src/symtab.c (symbol_new): Default associativity is `undef', not
16746 `right'.
16747 (symbol_check_alias_consistence): Adjust.
16748
fae437e8
AD
167492002-07-09 Akim Demaille <akim@epita.fr>
16750
16751 * doc/bison.texinfo: Properly set the ``header'' part.
16752 Use @dircategory ``GNU programming tools'' as per Texinfo's
16753 documentation.
16754 Use @copying.
16755
1a715ef2
AD
167562002-07-09 Akim Demaille <akim@epita.fr>
16757
16758 * lib/quotearg.h: Protect against multiple inclusions.
16759 * src/location.h (location_t): Add a `file' member.
16760 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16761 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16762 `error_one_per_line' support.
16763
a5d50994
AD
167642002-07-09 Akim Demaille <akim@epita.fr>
16765
16766 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16767 * src/reader.c (lineno): Remove.
16768 Adjust all dependencies.
16769 (get_merge_function): Take a location and use complain_at.
16770 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16771 * tests/regression.at (Invalid inputs, Mixing %token styles):
16772 Adjust.
16773
b275314e
AD
167742002-07-09 Akim Demaille <akim@epita.fr>
16775
16776 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16777 recovery rule, and forbid extensions when --yacc.
16778 (gram_error): Use complain_at.
16779 * src/reader.c (reader): Exit if there were parse errors.
16780
865b9df1
AD
167812002-07-09 Akim Demaille <akim@epita.fr>
16782
16783 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16784 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16785 Reported by R Blake <blakers@mac.com>.
16786
c76e14da
AD
167872002-07-09 Akim Demaille <akim@epita.fr>
16788
16789 * data/yacc.c: Output the copyright notive in the header.
16790
7db2ed2d
AD
167912002-07-03 Akim Demaille <akim@epita.fr>
16792
16793 * src/output.c (froms, tos): Are state_number_t.
16794 (save_column): sp, sp1, and sp2 are state_number_t.
16795 (prepare): Rename `final' as `final_state_number', `nnts' as
16796 `nterms_number', `nrules' as `rules_number', `nstates' as
16797 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16798 unused.
16799 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16800 * data/lalr1.cc (nsym_): Remove, unused.
16801
e68e0410
AD
168022002-07-03 Akim Demaille <akim@epita.fr>
16803
16804 * src/lalr.h, src/lalr.c (goto_number_t): New.
16805 * src/lalr.c (goto_list_t): New.
16806 Propagate them.
16807 * src/nullable.c (rule_list_t): New.
16808 Propagate.
16809 * src/types.h: Remove.
16810
e1a4f3a4
AD
168112002-07-03 Akim Demaille <akim@epita.fr>
16812
16813 * src/closure.c (print_fderives): Use rule_rhs_print.
16814 * src/derives.c (print_derives): Use rule_rhs_print.
16815 (rule_list_t): New, replaces `shorts'.
16816 (set_derives): Add comments.
16817 * tests/sets.at (Nullable, Firsts): Adjust.
16818
536545f3
AD
168192002-07-03 Akim Demaille <akim@epita.fr>
16820
16821 * src/output.c (prepare_actions): Free `tally' and `width'.
16822 (prepare_actions): Allocate and free `order'.
16823 * src/symtab.c (symbols_free): Free `symbols'.
16824 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16825 * src/output.c (m4_invoke): Move to...
16826 * src/scan-skel.l: here.
16827 (<<EOF>>): Close yyout, and free its name.
16828
8b752b00
AD
168292002-07-03 Akim Demaille <akim@epita.fr>
16830
16831 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16832
16833 * src/LR0.c (new_state): Merge into...
16834 (state_list_append): this.
16835 (new_states): Merge into...
16836 (generate_states): here.
16837 (set_states): Don't ensure a proper `errs' state member here, do it...
16838 * src/conflicts.c (conflicts_solve): here.
16839 * src/state.h, src/state.c: Comment changes.
16840 (state_t): Rename member `shifts' as `transitions'.
16841 Adjust all dependencies.
16842 (errs_new): For consistency, also take the values as argument.
16843 (errs_dup): Remove.
16844 (state_errs_set): New.
16845 (state_reductions_set, state_transitions_set): Assert that no
16846 previous value was assigned.
16847 (state_free): New.
16848 (states_free): Use it.
16849 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
16850 temporary storage: use `errs' and `nerrs' as elsewhere.
16851 (set_conflicts): Allocate and free this `errs'.
16852
613f5e1a
AD
168532002-07-02 Akim Demaille <akim@epita.fr>
16854
16855 * lib/libiberty.h: New.
16856 * lib: Update the bitset implementation from upstream.
16857 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
16858 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
16859 * src/main.c: Adjust bitset stats calls.
16860
26e0cadc
PE
168612002-07-01 Paul Eggert <eggert@twinsun.com>
16862
16863 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
16864 char, so that negative chars don't collide with $.
16865
1154cced
AD
168662002-06-30 Akim Demaille <akim@epita.fr>
16867
16868 Have the GLR tests be `warning' checked, and fix the warnings.
16869
16870 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
16871 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
16872 (yyremoveDeletes): `yyi' and `yyj' are size_t.
16873 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
16874 (yyaddDeferredAction): static.
16875 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
16876 (yyreportParseError): yyprefix is const.
16877 yytokenp is used only when verbose.
16878 (yy__GNUC__): Replace with __GNUC__.
16879 (yypdumpstack): yyi is size_t.
16880 (yypreference): Un-yy local variables and arguments, to avoid
16881 clashes with `yyr1'. Anyway, we are not in the user name space.
16882 (yytname_size): be an int, as is compared with ints.
16883 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
16884 Use them.
16885 * tests/cxx-gram.at: Use quotation to protect $1.
16886 Use AT_COMPILE to enable warnings hunts.
16887 Prototype yylex and yyerror.
16888 `Use' argc.
16889 Include `string.h', not `strings.h'.
16890 Produce and prototype stmtMerge only when used.
16891 yylex takes a location.
16892
97650f4e
AD
168932002-06-30 Akim Demaille <akim@epita.fr>
16894
16895 We spend a lot of time in quotearg, in particular when --verbose.
16896
16897 * src/symtab.c (symbol_get): Store a quoted version of the key.
16898 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
16899 Adjust all callers.
16900
d2576365
AD
169012002-06-30 Akim Demaille <akim@epita.fr>
16902
16903 * src/state.h (reductions_t): Rename member `nreds' as num.
16904 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
16905 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
16906
ccaf65bc
AD
169072002-06-30 Akim Demaille <akim@epita.fr>
16908
16909 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
16910 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
16911 (shifts_to): Rename as...
16912 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
16913 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
16914 (TRANSITION_IS_DISABLED, transitions_to): these.
16915
87675353
AD
169162002-06-30 Akim Demaille <akim@epita.fr>
16917
16918 * src/print.c (print_shifts, print_gotos): Merge into...
16919 (print_transitions): this.
16920 (print_transitions, print_errs, print_reductions): Align the
16921 lookaheads columns.
16922 (print_core, print_transitions, print_errs, print_state,
16923 print_grammar): Output empty lines separator before, not after.
16924 (state_default_rule_compute): Rename as...
16925 (state_default_rule): this.
16926 * tests/conflicts.at (Defaulted Conflicted Reduction),
16927 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
16928 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
16929
ce4ccb4b
AD
169302002-06-30 Akim Demaille <akim@epita.fr>
16931
16932 Display items as we display rules.
16933
16934 * src/gram.h, src/gram.c (rule_lhs_print): New.
16935 * src/gram.c (grammar_rules_partial_print): Use it.
16936 * src/print.c (print_core): Likewise.
16937 * tests/conflicts.at (Defaulted Conflicted Reduction),
16938 (Unresolved SR Conflicts): Adjust.
16939 (Unresolved SR Conflicts): Adjust and rename as...
16940 (Resolved SR Conflicts): this, as was meant.
16941 * tests/regression.at (Web2c Report): Adjust.
16942
bc933ef1
AD
169432002-06-30 Akim Demaille <akim@epita.fr>
16944
16945 * src/print.c (state_default_rule_compute): New, extracted from...
16946 (print_reductions): here.
16947 Pessimize, but clarify the code.
16948 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
16949
53d4308d
AD
169502002-06-30 Akim Demaille <akim@epita.fr>
16951
16952 * src/output.c (action_row): Let default_rule be always a rule
16953 number.
16954
574fb2d5
AD
169552002-06-30 Akim Demaille <akim@epita.fr>
16956
16957 * src/closure.c (print_firsts, print_fderives, closure):
16958 Use BITSET_EXECUTE.
16959 * src/lalr.c (lookaheads_print): Likewise.
16960 * src/state.c (state_rule_lookaheads_print): Likewise.
16961 * src/print_graph.c (print_core): Likewise.
16962 * src/print.c (print_reductions): Likewise.
16963 * src/output.c (action_row): Likewise.
16964 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
16965
05811fd7
AD
169662002-06-30 Akim Demaille <akim@epita.fr>
16967
16968 * src/print_graph.c: Use report_flag.
16969
0e4d5753
AD
169702002-06-30 Akim Demaille <akim@epita.fr>
16971
16972 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
16973 to...
16974 * src/relation.h, src/relation.c (traverse, relation_digraph)
16975 (relation_print, relation_transpose): New.
16976
24c7d800
AD
169772002-06-30 Akim Demaille <akim@epita.fr>
16978
16979 * src/state.h, src/state.c (shifts_to): New.
16980 * src/lalr.c (build_relations): Use it.
16981
9222837b
AD
169822002-06-30 Akim Demaille <akim@epita.fr>
16983
16984 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
16985 (item_number_of_rule_number, rule_number_of_item_number): New.
16986 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
16987 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16988 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
16989 Propagate their use.
16990 Much remains to be done, in particular wrt `shorts' from types.h.
16991
260008e5
AD
169922002-06-30 Akim Demaille <akim@epita.fr>
16993
16994 * src/symtab.c (symbol_new): Initialize the `printer' member.
16995
8a731ca8
AD
169962002-06-30 Akim Demaille <akim@epita.fr>
16997
16998 * src/LR0.c (save_reductions): Remove, replaced by...
16999 * src/state.h, src/state.c (state_reductions_set): New.
17000 (reductions, errs): Rename as...
17001 (reductions_t, errs_t): these.
17002 Adjust all dependencies.
17003
32e1e0a4
AD
170042002-06-30 Akim Demaille <akim@epita.fr>
17005
17006 * src/LR0.c (state_list_t, state_list_append): New.
17007 (first_state, last_state): Now symbol_list_t.
17008 (this_state): Remove.
17009 (new_itemsets, append_states, save_reductions): Take a state_t as
17010 argument.
17011 (set_states, generate_states): Adjust.
17012 (save_shifts): Remove, replaced by...
17013 * src/state.h, src/state.c (state_shifts_set): New.
17014 (shifts): Rename as...
17015 (shifts_t): this.
17016 Adjust all dependencies.
17017 * src/state.h (state_t): Remove the `next' member.
17018
e5fb6710
AD
170192002-06-30 Akim Demaille <akim@epita.fr>
17020
17021 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17022 escaped in slot 0.
17023
c7ca99d4
AD
170242002-06-30 Akim Demaille <akim@epita.fr>
17025
17026 Use hash.h for the state hash table.
17027
17028 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17029 (allocate_storage): Use state_hash_new.
17030 (free_storage): Use state_hash_free.
17031 (new_state, get_state): Adjust.
17032 * src/lalr.h, src/lalr.c (states): Move to...
17033 * src/states.h (state_t): Remove the `link' member, no longer
17034 used.
17035 * src/states.h, src/states.c: here.
17036 (state_hash_new, state_hash_free, state_hash_lookup)
17037 (state_hash_insert, states_free): New.
17038 * src/states.c (state_table, state_compare, state_hash): New.
17039 * src/output.c (output_actions): Do not free states now, since we
17040 still need to know the final_state number in `prepare', called
17041 afterwards. Do it...
17042 * src/main.c (main): here: call states_free after `output'.
17043
df0e7316
AD
170442002-06-30 Akim Demaille <akim@epita.fr>
17045
17046 * src/state.h, src/state.c (state_new): New, extracted from...
17047 * src/LR0.c (new_state): here.
17048 * src/state.h (STATE_ALLOC): Move to...
17049 * src/state.c: here.
17050 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17051 * src/state.h, src/state.c: here.
17052
39f41916
AD
170532002-06-30 Akim Demaille <akim@epita.fr>
17054
17055 * src/reader.c (gensym): Rename as...
17056 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17057 (getsym): Rename as...
17058 (symbol_get): this.
17059
d57650a5
AD
170602002-06-30 Akim Demaille <akim@epita.fr>
17061
17062 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17063 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17064 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17065 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17066
5a08f1ce
AD
170672002-06-30 Akim Demaille <akim@epita.fr>
17068
17069 Make the test suite pass with warnings checked.
17070
17071 * tests/actions.at (Printers and Destructors): Improve.
17072 Avoid unsigned vs. signed issues.
17073 * tests/calc.at: Don't exercise the scanner here, do it...
17074 * tests/input.at (Torturing the Scanner): here.
17075
720623af
PH
170762002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17077
88e7e941 17078 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
17079 reorganize first lines parallel to yacc.c.
17080
fb8135fa
AD
170812002-06-28 Akim Demaille <akim@epita.fr>
17082
17083 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17084 (b4_token_enum, b4_token_defines): New, factored from...
17085 * data/lalr1.cc, data/yacc.c, glr.c: here.
17086
41442480
AD
170872002-06-28 Akim Demaille <akim@epita.fr>
17088
17089 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17090 unused variables.
17091 * src/output.c (merger_output): static.
17092
e0e5bf84
AD
170932002-06-28 Akim Demaille <akim@epita.fr>
17094
ba0fe3c7 17095 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
17096 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
17097 pacify GCC.
17098 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 17099
676385e2
PH
171002002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17101
17102 Accumulated changelog for new GLR parsing features.
17103
6a254321 17104 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
17105 conflicts_total_count.
17106 * src/conflicts.h: Ditto.
17107 * src/output.c (token_actions): Use the new name.
17108 (output_conflicts): Change conflp => conflict_list_heads, and
17109 confl => conflict_list for better readability.
17110 * data/glr.c: Use the new names.
17111 * NEWS: Add self to GLR announcement.
e0e5bf84 17112
676385e2
PH
17113 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17114
17115 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17116 Akim Demaille.
17117
17118 * data/bison.glr: Change name to glr.c
17119 * data/glr.c: Renamed from bison.glr.
17120 * data/Makefile.am: Add glr.c
e0e5bf84
AD
17121
17122 * src/getargs.c:
17123
676385e2 17124 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 17125 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 17126
676385e2
PH
17127 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17128
17129 * data/bison.glr: Be sure to restore the
17130 current #line when returning to the skeleton contents after having
17131 exposed the input file's #line.
17132
17133 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17134
17135 * data/bison.glr: Bring up to date with changes to bison.simple.
17136
17137 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17138
17139 * data/bison.glr: Correct definitions that use b4_prefix.
17140 Various reformatting.
17141 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
17142 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
17143 yytokenp argument; now part of stack.
17144 (yychar): Define to behave as documented.
17145 (yyclearin): Ditto.
e0e5bf84 17146
676385e2
PH
17147 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17148
17149 * src/reader.h: Add declaration for free_merger_functions.
17150
17151 * src/reader.c (merge_functions): New variable.
17152 (get_merge_function): New function.
17153 (free_merger_functions): New function.
17154 (readgram): Check for %prec that is not followed by a symbol.
17155 Handle %dprec and %merge declarations.
17156 (packgram): Initialize dprec and merger fields in rules array.
17157
17158 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
17159 conflict_list_cnt, conflict_list_free): New variables.
17160 (table_grow): Also grow conflict_table.
e0e5bf84 17161 (prepare_rules): Output dprec and merger tables.
676385e2 17162 (conflict_row): New function.
e0e5bf84 17163 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
17164 default reduction in conflicted states for GLR parser so that there
17165 are spaces for the conflict lists.
17166 (save_row): Also save conflict information.
17167 (token_actions): Allocate conflict list.
17168 (merger_output): New function.
17169 (pack_vector): Pack conflict table, too.
17170 (output_conflicts): New function to output yyconflp and yyconfl.
17171 (output_check): Allocate conflict_tos.
17172 (output_actions): Output conflict tables, also.
17173 (output_skeleton): Output b4_mergers definition.
17174 (prepare): Output b4_max_rhs_length definition.
17175 Use 'bison.glr' as default skeleton for GLR parsers.
17176
17177 * src/gram.c (glr_parser): New flag.
17178 (grammar_free): Call free_merger_functions.
17179
17180 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
17181 all pairs of conflicting reductions, rather than just all tokens
17182 causing conflicts. Needed to size conflict tables.
e0e5bf84 17183 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
17184 interface.
17185 (conflicts_print): Ditto.
17186 (count_total_conflicts): New function.
17187
17188 * src/reader.h (merger_list): New type.
17189 (merge_functions): New variable.
17190
17191 * src/lex.h (tok_dprec, tok_merge): New token types.
17192
17193 * src/gram.h (rule_s): Add dprec and merger fields.
17194 (glr_parser): New flag.
17195
17196 * src/conflicts.h (count_total_conflicts): New function.
17197
17198 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
17199
17200 * doc/bison.texinfo (Generalized LR Parsing): New section.
17201 (GLR Parsers): New section.
17202 (Language and Grammar): Mention GLR parsing.
17203 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
17204 Correct typo ("tge" -> "the").
17205
17206 * data/bison.glr: New skeleton for GLR parsing.
17207
17208 * tests/cxx-gram.at: New tests for GLR parsing.
17209
17210 * tests/testsuite.at: Include cxx-gram.at.
17211
17212 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 17213
676385e2
PH
17214 * src/parse-gram.y:
17215
17216 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
17217
17218 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 17219
b5480d74 172202002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
17221
17222 * src/options.h, src/options.c: Remove.
17223 * src/getargs.c (short_options, long_options): New.
17224
60491a94
AD
172252002-06-27 Akim Demaille <akim@epita.fr>
17226
17227 * data/bison.simple, data/bison.c++: Rename as...
17228 * data/yacc.c, data/lalr1.cc: these.
17229 * doc/bison.texinfo (Environment Variables): Remove.
17230
9be0c25b
AD
172312002-06-25 Raja R Harinath <harinath@cs.umn.edu>
17232
17233 * src/getargs.c (report_argmatch): Initialize strtok().
17234
1ae72863
AD
172352002-06-20 Akim Demaille <akim@epita.fr>
17236
17237 * data/bison.simple (b4_symbol_actions): New, replaces...
17238 (b4_symbol_destructor, b4_symbol_printer): these.
17239 (yysymprint): Be sure to call YYPRINT only for tokens, and using
17240 user token numbers.
17241
87542d29
AD
172422002-06-20 Akim Demaille <akim@epita.fr>
17243
17244 * data/bison.simple (yydestructor): Rename as...
17245 (yydestruct): this.
17246
1a31ed21
AD
172472002-06-20 Akim Demaille <akim@epita.fr>
17248
17249 * src/symtab.h, src/symtab.c (symbol_type_set)
17250 (symbol_destructor_set, symbol_precedence_set): The location is
17251 the last argument.
17252 Adjust all callers.
17253
e776192e
AD
172542002-06-20 Akim Demaille <akim@epita.fr>
17255
17256 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
17257 internals.
17258 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
17259 Takes a location.
17260 * src/symtab.h, src/symtab.c (symbol_class_set)
17261 (symbol_user_token_number_set): Likewise.
17262 Adjust all callers.
17263 Promote complain_at.
17264 * tests/input.at (Type Clashes): Adjust.
17265
5c1180b3
AD
172662002-06-20 Akim Demaille <akim@epita.fr>
17267
17268 * data/bison.simple (YYLEX): Fix the declaration when
17269 %pure-parser.
17270
e3170060
AD
172712002-06-20 Akim Demaille <akim@epita.fr>
17272
17273 * data/bison.simple (yysymprint): Don't print the token number,
17274 just its name.
17275 * tests/actions.at (Destructors): Rename as...
17276 (Printers and Destructors): this.
17277 Also exercise %printer.
17278
253862fd
AD
172792002-06-20 Akim Demaille <akim@epita.fr>
17280
17281 * data/bison.simple (YYDSYMPRINT): New.
17282 Use it to remove many of the #if YYDEBUG/if (yydebug).
17283
366eea36
AD
172842002-06-20 Akim Demaille <akim@epita.fr>
17285
17286 * src/symtab.h, src/symtab.c (symbol_t): printer and
17287 printer_location are new members.
17288 (symbol_printer_set): New.
17289 * src/parse-gram.y (PERCENT_PRINTER): New token.
17290 Handle its associated rule.
17291 * src/scan-gram.l: Adjust.
17292 (handle_destructor_at, handle_destructor_dollar): Rename as...
17293 (handle_symbol_code_at, handle_symbol_code_dollar): these.
17294 * src/output.c (symbol_printers_output): New.
17295 (output_skeleton): Call it.
17296 * data/bison.simple (yysymprint): New. Cannot be named yyprint
17297 since there are already many grammar files with a user `yyprint'.
17298 Replace the calls to YYPRINT to calls to yysymprint.
17299 * tests/calc.at: Adjust.
17300 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
17301 taking advantage of parser very internal details (stack size!).
17302
4f25ebb0
AD
173032002-06-20 Akim Demaille <akim@epita.fr>
17304
17305 * src/scan-gram.l: Complete the scanner with the missing patterns
17306 to pacify Flex.
17307 Use `quote' and `symbol_tag_get' where appropriate.
17308
93b68a0e
AD
173092002-06-19 Akim Demaille <akim@epita.fr>
17310
17311 * tests/actions.at (Destructors): Augment to test locations.
17312 * data/bison.simple (yydestructor): Pass it the current location
17313 if locations are enabled.
17314 Prototype only when __STDC__ or C++.
17315 Change the argument names to move into the yy name space: there is
17316 user code here.
17317
58612f1d
AD
173182002-06-19 Akim Demaille <akim@epita.fr>
17319
74310291
AD
17320 * data/bison.simple (b4_pure_if): New.
17321 Use it instead of #ifdef YYPURE.
17322
173232002-06-19 Akim Demaille <akim@epita.fr>
17324
17325 * data/bison.simple (b4_location_if): New.
58612f1d
AD
17326 Use it instead of #ifdef YYLSP_NEEDED.
17327
f25bfb75
AD
173282002-06-19 Akim Demaille <akim@epita.fr>
17329
17330 Prepare @$ in %destructor, but currently don't bind it in the
17331 skeleton, as %location use is not cleaned up yet.
17332
17333 * src/scan-gram.l (handle_dollar, handle_destructor_at)
17334 (handle_action_at): New.
17335 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
17336 a braced_code_t and a location as additional arguments.
17337 (handle_destructor_dollar): Instead of requiring `b4_eval', just
17338 unquote one when outputting `b4_dollar_dollar'.
17339 Adjust callers.
17340 * data/bison.simple (b4_eval): Remove.
17341 (b4_symbol_destructor): Adjust.
17342 * tests/input.at (Invalid @n): Adjust.
17343
c732d2c6
AD
173442002-06-19 Zack Weinberg <zack@codesourcery.com>
17345
17346 * doc/bison.texinfo: Document ability to have multiple
17347 prologue sections.
17348
8c165d89
AD
173492002-06-18 Akim Demaille <akim@epita.fr>
17350
17351 * src/files.c (compute_base_names): When computing the output file
17352 names from the input file name, strip the directory part.
17353
ca98bf57
AD
173542002-06-18 Akim Demaille <akim@epita.fr>
17355
17356 * data/bison.simple.new: Comment changes.
17357 Reported by Andreas Schwab.
17358
0bfb02ff
AD
173592002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
17360
17361 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
17362 there are no `label `yyoverflowlab' defined but not used' warnings
17363 when yyoverflow is defined.
17364
24c0aad7
AD
173652002-06-18 Akim Demaille <akim@epita.fr>
17366
17367 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
17368 new member.
17369 (symbol_destructor_set): Adjust.
17370 * src/output.c (symbol_destructors_output): Output the destructor
17371 locations.
17372 Output the symbol name.
17373 * data/bison.simple (b4_symbol_destructor): Adjust.
17374
5719c109
AD
173752002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
17376 and Akim Demaille <akim@epita.fr>
17377
17378 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
17379 what's left on the stack when the error recovery hits EOF.
17380 * tests/actions.at (Destructors): Complete to exercise this case.
17381
9280d3ef
AD
173822002-06-17 Akim Demaille <akim@epita.fr>
17383
17384 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
17385 arguments is really empty, not only equal to `[]'.
17386 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
17387 member.
17388 (symbol_destructor_set): New.
17389 * src/output.c (symbol_destructors_output): New.
17390 * src/reader.h (brace_code_t, current_braced_code): New.
17391 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
17392 (handle_dollar): Rename as...
17393 (handle_action_dollar): this.
17394 (handle_destructor_dollar): New.
17395 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
17396 (grammar_declaration): Use it.
17397 * data/bison.simple (yystos): Is always defined.
17398 (yydestructor): New.
17399 * tests/actions.at (Destructors): New.
17400 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
17401
dafdc66f
AD
174022002-06-17 Akim Demaille <akim@epita.fr>
17403
17404 * src/symlist.h, src/symlist.c (symbol_list_length): New.
17405 * src/scan-gram.l (handle_dollar, handle_at): Compute the
17406 rule_length only when needed.
17407 * src/output.c (actions_output, token_definitions_output): Output
17408 the full M4 block.
17409 * src/symtab.c: Don't access directly to the symbol tag, use
17410 symbol_tag_get.
17411 * src/parse-gram.y: Use symbol_list_free.
17412
56c47203
AD
174132002-06-17 Akim Demaille <akim@epita.fr>
17414
17415 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
17416 (symbol_list_prepend, get_type_name): Move to...
17417 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
17418 (symbol_list_prepend, symbol_list_n_type_name_get): here.
17419 Adjust all callers.
17420 (symbol_list_free): New.
17421 * src/scan-gram.l (handle_dollar): Takes a location.
17422 * tests/input.at (Invalid $n): Adjust.
17423
1e0bab92
AD
174242002-06-17 Akim Demaille <akim@epita.fr>
17425
17426 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17427 (symbol_list_prepend): New.
17428 * src/parse-gram.y (%union): `list' is a new member.
17429 (symbols.1): New, replaces...
17430 (terms_to_prec.1, nterms_to_type.1): these.
17431 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17432 Take a location as additional argument.
17433 Adjust all callers.
17434
04e60654
AD
174352002-06-15 Akim Demaille <akim@epita.fr>
17436
17437 * src/parse-gram.y: Move %token in the declaration section so that
17438 we don't depend upon CVS Bison.
17439
10e5b8bd
AD
174402002-06-15 Akim Demaille <akim@epita.fr>
17441
17442 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17443 * src/print.c (print_core): Use it.
17444
9801d40c
AD
174452002-06-15 Akim Demaille <akim@epita.fr>
17446
17447 * src/conflicts.c (log_resolution): Accept the rule involved in
17448 the sr conflicts instead of the lookahead number that points to
17449 that rule.
17450 (flush_reduce): Accept the current lookahead vector as argument,
17451 instead of the index in LA.
17452 (resolve_sr_conflict): Accept the current number of lookahead
17453 bitset to consider for the STATE, instead of the index in LA.
17454 (set_conflicts): Adjust.
17455 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17456
c0263492
AD
174572002-06-15 Akim Demaille <akim@epita.fr>
17458
17459 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17460 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17461 Adjust all dependencies.
17462 * src/lalr.c (initialize_lookaheads): Split into...
17463 (states_lookaheads_count, states_lookaheads_initialize): these.
17464 (lalr): Adjust.
17465
9757c359
AD
174662002-06-15 Akim Demaille <akim@epita.fr>
17467
17468 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17469 out of...
17470 (grammar_rules_print): here.
17471 * src/reduce.c (reduce_output): Use it.
17472 * tests/reduce.at (Useless Rules, Reduced Automaton)
17473 (Underivable Rules): Adjust.
17474
6b98e4b5
AD
174752002-06-15 Akim Demaille <akim@epita.fr>
17476
17477 Copy BYacc's nice way to report the grammar.
17478
17479 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17480 New.
17481 Don't print the rules' location, it is confusing and useless.
17482 (rule_print): Use grammar_rhs_print.
17483 * src/print.c (print_grammar): Use grammar_rules_print.
17484
6b98e4b5
AD
174852002-06-15 Akim Demaille <akim@epita.fr>
17486
17487 Complete and rationalize `useless thing' warnings.
17488
17489 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17490 (symbol_tag_print): New.
17491 Use them everywhere in place of accessing directly the tag member.
17492 * src/gram.h, src/gram.c (rule_print): New.
17493 Use it where a rule used to be printed `by hand'.
17494 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17495 (reduce_grammar_tables): Report the useless rules.
17496 (reduce_print): Useless things are a warning, not an error.
17497 Report it as such.
17498 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17499 (Reduced Automaton, Underivable Rules): Adjust.
17500 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17501 * tests/conflicts.at (Unresolved SR Conflicts)
17502 (Solved SR Conflicts): Adjust.
17503
ee000ba4
AD
175042002-06-15 Akim Demaille <akim@epita.fr>
17505
17506 Let symbols have a location.
17507
17508 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
17509 (getsym): Adjust.
17510 Adjust all callers.
17511 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
17512 Use location_t, not int.
17513 * src/symtab.c (symbol_check_defined): Take advantage of the
17514 location.
17515 * tests/regression.at (Invalid inputs): Adjust.
17516
8efe435c
AD
175172002-06-15 Akim Demaille <akim@epita.fr>
17518
17519 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
17520 (input): Don't try to initialize yylloc here, do it in the
17521 scanner.
17522 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
17523 * src/gram.h (rule_t): Change line and action_line into location
17524 and action_location, of location_t type.
17525 Adjust all dependencies.
17526 * src/location.h, src/location.c (empty_location): New.
17527 * src/reader.h, src/reader.c (grammar_start_symbol_set)
17528 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
17529 (grammar_current_rule_symbol_append)
17530 (grammar_current_rule_action_append): Expect a location as argument.
17531 * src/reader.c (grammar_midrule_action): Adjust to attach an
17532 action's location as dummy symbol location.
17533 * src/symtab.h, src/symtab.c (startsymbol_location): New.
17534 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
17535 the line numbers.
17536
1921f1d7
AD
175372002-06-14 Akim Demaille <akim@epita.fr>
17538
17539 Grammar declarations may be found in the grammar section.
17540
17541 * src/parse-gram.y (rules_or_grammar_declaration): New.
17542 (declarations): Each declaration may end with a semicolon, not
17543 just...
17544 (grammar_declaration): `"%union"'.
17545 (grammar): Branch to rules_or_grammar_declaration.
17546
4515534c
AD
175472002-06-14 Akim Demaille <akim@epita.fr>
17548
17549 * src/main.c (main): Invoke scanner_free.
17550
f958596b
AD
175512002-06-14 Akim Demaille <akim@epita.fr>
17552
17553 * src/output.c (m4_invoke): Extracted from...
17554 (output_skeleton): here.
17555 Free tempfile.
17556
2c569025
AD
175572002-06-14 Akim Demaille <akim@epita.fr>
17558
17559 * src/parse-gram.y (directives, directive, gram)
17560 (grammar_directives, precedence_directives, precedence_directive):
17561 Rename as...
17562 (declarations, declaration, grammar, grammar_declaration)
17563 (precedence_declaration, precedence_declarator): these.
17564 (symbol_declaration): New.
17565
592e8d4d
AD
175662002-06-14 Akim Demaille <akim@epita.fr>
17567
17568 * src/files.c (action_obstack): Remove, unused.
17569 (output_obstack): Remove it, and all its dependencies, as it is no
17570 longer needed.
17571 * src/reader.c (epilogue_set): Build the epilogue in the
17572 muscle_obstack.
17573 * src/output.h, src/output.c (muscle_obstack): Move to...
17574 * src/muscle_tab.h, src/muscle_tab.h: here.
17575 (muscle_init): Initialize muscle_obstack.
17576 (muscle_free): New.
17577 * src/main.c (main): Call it.
17578
0c15323d
AD
175792002-06-14 Akim Demaille <akim@epita.fr>
17580
17581 * src/location.h: New, extracted from...
17582 * src/reader.h: here.
17583 * src/Makefile.am (noinst_HEADERS): Merge into
17584 (bison_SOURCES): this.
17585 Add location.h.
17586 * src/parse-gram.y: Use location_t instead of Bison's.
17587 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
17588 Use location_t instead of ints.
17589
e96c9728
AD
175902002-06-14 Akim Demaille <akim@epita.fr>
17591
17592 * data/bison.simple, data/bison.c++: Be sure to restore the
17593 current #line when returning to the skeleton contents after having
17594 exposed the input file's #line.
17595
75d1fe16
AD
175962002-06-12 Akim Demaille <akim@epita.fr>
17597
17598 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
17599 eager.
17600 * tests/actions.at (Exotic Dollars): New.
17601
6c35d22c
AD
176022002-06-12 Akim Demaille <akim@epita.fr>
17603
17604 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
17605 ['"/] too eagerly.
17606 * tests/input.at (Torturing the Scanner): New.
17607
1d6412ad
AD
176082002-06-11 Akim Demaille <akim@epita.fr>
17609
17610 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
17611 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
17612 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
17613 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
17614 * src/reader.c (reader): Use it.
17615
4cdb01db
AD
176162002-06-11 Akim Demaille <akim@epita.fr>
17617
17618 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
17619 Adjust all callers.
17620 (scanner_last_string_free): New.
17621
44995b2e
AD
176222002-06-11 Akim Demaille <akim@epita.fr>
17623
17624 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
17625 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
17626 (last_string, YY_OBS_FREE): New.
17627 Use them when returning an ID.
17628
e9955c83
AD
176292002-06-11 Akim Demaille <akim@epita.fr>
17630
17631 Have Bison grammars parsed by a Bison grammar.
17632
17633 * src/reader.c, src/reader.h (prologue_augment): New.
17634 * src/reader.c (copy_definition): Remove.
17635
17636 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
17637 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
17638 (grammar_current_rule_prec_set, grammar_current_rule_check)
17639 (grammar_current_rule_symbol_append)
17640 (grammar_current_rule_action_append): Export.
17641 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
17642 (symbol_list_action_append): Remove.
17643 Hook the routines from reader.
17644 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17645 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
17646
17647 * src/reader.c (read_declarations): Remove, unused.
17648
17649 * src/parse-gram.y: Handle the epilogue.
17650 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
17651 (grammar_start_symbol_set): this.
17652 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
17653 * src/reader.c (readgram): Remove, unused.
17654 (reader): Adjust to insert eoftoken and axiom where appropriate.
17655
17656 * src/reader.c (copy_dollar): Replace with...
17657 * src/scan-gram.h (handle_dollar): this.
17658 * src/parse-gram.y: Remove `%thong'.
17659
17660 * src/reader.c (copy_at): Replace with...
17661 * src/scan-gram.h (handle_at): this.
17662
17663 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17664 New.
17665
17666 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17667 time being.
17668
17669 * src/reader.h, src/reader.c (grammar_rule_end): New.
17670
17671 * src/parse.y (current_type, current_class): New.
17672 Implement `%nterm', `%token' support.
17673 Merge `%term' into `%token'.
17674 (string_as_id): New.
17675 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17676 type name.
17677
17678 * src/parse-gram.y: Be sure to handle properly the beginning of
17679 rules.
17680
17681 * src/parse-gram.y: Handle %type.
17682 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17683
17684 * src/parse-gram.y: More directives support.
17685 * src/options.c: No longer handle source directives.
17686
17687 * src/parse-gram.y: Fix %output.
17688
17689 * src/parse-gram.y: Handle %union.
17690 Use the prologue locations.
17691 * src/reader.c (parse_union_decl): Remove.
17692
17693 * src/reader.h, src/reader.c (epilogue_set): New.
17694 * src/parse-gram.y: Use it.
17695
17696 * data/bison.simple, data/bison.c++: b4_stype is now either not
17697 defined, then default to int, or to the contents of %union,
17698 without `union' itself.
17699 Adjust.
17700 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17701
17702 * src/output.c (actions_output): Don't output braces, as they are
17703 already handled by the scanner.
17704
17705 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17706 characters to themselves.
17707
17708 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17709 that the epilogue has a proper #line.
17710
17711 * src/parse-gram.y: Handle precedence/associativity.
17712
17713 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17714 a terminal.
17715 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17716 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17717 at all to define terminals that cannot be emitted.
17718
17719 * src/scan-gram.l: Escape M4 characters.
17720
17721 * src/scan-gram.l: Working properly with escapes in user
17722 strings/characters.
17723
17724 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17725 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17726 grammar.
17727 Use more modest sizes, as for the time being the parser does not
17728 release memory, and therefore the process swallows a huge amount
17729 of memory.
17730
17731 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17732 stricter %token grammar.
17733
17734 * src/symtab.h (associativity): Add `undef_assoc'.
17735 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17736 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17737
17738 * tests/regression.at (Invalid %directive): Remove, as it is now
17739 meaningless.
17740 (Invalid inputs): Adjust to the new error messages.
17741 (Token definitions): The new grammar doesn't allow too many
17742 eccentricities.
17743
17744 * src/lex.h, src/lex.c: Remove.
17745 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17746 (copy_character, copy_string2, copy_string, copy_identifier)
17747 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17748 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17749 (parse_action): Remove.
17750 * po/POTFILES.in: Adjust.
17751
2e047461
AD
177522002-06-11 Akim Demaille <akim@epita.fr>
17753
cd05d13c 17754 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
17755 rule's action member: return the action as a string.
17756 Don't require `rule_length' as an argument: compute it.
17757 (grammar_current_rule_symbol_append)
17758 (grammar_current_rule_action_append): New, eved out from
17759 (readgram): here.
17760 Remove `action_flag', `rulelength', unused now.
17761
9af3fbce
AD
177622002-06-11 Akim Demaille <akim@epita.fr>
17763
17764 * src/reader.c (grammar_current_rule_prec_set).
17765 (grammar_current_rule_check): New, eved out from...
17766 (readgram): here.
17767 Remove `xaction', `first_rhs': useless.
17768 * tests/input.at (Type clashes): New.
17769 * tests/existing.at (GNU Cim Grammar): Adjust.
17770
1485e106
AD
177712002-06-11 Akim Demaille <akim@epita.fr>
17772
17773 * src/reader.c (grammar_midrule_action): New, Eved out from
17774 (readgram): here.
17775
da4160c3
AD
177762002-06-11 Akim Demaille <akim@epita.fr>
17777
17778 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17779 New.
17780 (readgram): Use them as replacement of inlined code, crule and
17781 crule1.
17782
f6d0f937
AD
177832002-06-11 Akim Demaille <akim@epita.fr>
17784
17785 * src/reader.c (grammar_end, grammar_symbol_append): New.
17786 (readgram): Use them.
17787 Make the use of `p' as local as possible.
17788
69078d4b
AD
177892002-06-10 Akim Demaille <akim@epita.fr>
17790
17791 GCJ's parser requires the tokens to be defined before the prologue.
17792
17793 * data/bison.simple: Output the token definition before the user's
17794 prologue.
17795 * tests/regression.at (Braces parsing, Duplicate string)
17796 (Mixing %token styles): Check the output from bison.
17797 (Early token definitions): New.
17798
5e424082
AD
177992002-06-10 Akim Demaille <akim@epita.fr>
17800
17801 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17802 assigning twice the same user number to a token, so that we can
17803 use it in...
17804 * src/lex.c (lex): here.
17805 Also use `symbol_class_set' instead of hand written code.
17806 * src/reader.c (parse_assoc_decl): Likewise.
17807
44536b35
AD
178082002-06-10 Akim Demaille <akim@epita.fr>
17809
17810 * src/symtab.c, src/symtab.c (symbol_class_set)
17811 (symbol_user_token_number_set): New.
17812 * src/reader.c (parse_token_decl): Use them.
17813 Use a switch instead of ifs.
17814 Use a single argument.
17815
8b9f2372
AD
178162002-06-10 Akim Demaille <akim@epita.fr>
17817
17818 Remove `%thong' support as it is undocumented, unused, duplicates
17819 `%token's job, and creates useless e-mail traffic with people who
17820 want to know what it is, why it is undocumented, unused, and
17821 duplicates `%token's job.
17822
17823 * src/reader.c (parse_thong_decl): Remove.
17824 * src/options.c (option_table): Remove "thong".
17825 * src/lex.h (tok_thong): Remove.
17826
3ae2b51f
AD
178272002-06-10 Akim Demaille <akim@epita.fr>
17828
17829 * src/symtab.c, src/symtab.c (symbol_type_set)
17830 (symbol_precedence_set): New.
17831 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17832 (value_components_used): Remove, unused.
17833
2f1afb73
AD
178342002-06-09 Akim Demaille <akim@epita.fr>
17835
17836 Move symbols handling code out of the reader.
17837
17838 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17839 (axiom): Move to...
17840 * src/symtab.h, src/symtab.c: here.
17841
17842 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17843 * src/reader.c (startval): Rename as...
17844 * src/symtab.h, src/symtab.c (startsymbol): this.
17845 * src/reader.c: Adjust.
17846
17847 * src/reader.c (symbol_check_defined, symbol_make_alias)
17848 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17849 (token_translations_init)
17850 Move to...
17851 * src/symtab.c: here.
17852 * src/reader.c (packsymbols): Move to...
17853 * src/symtab.h, src/symtab.c (symbols_pack): here.
17854 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
17855 argument.
17856
e9bca3ad
AD
178572002-06-03 Akim Demaille <akim@epita.fr>
17858
17859 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
17860 then statements.
17861
86eff183
AD
178622002-06-03 Akim Demaille <akim@epita.fr>
17863
17864 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
17865 structs with non literals.
17866 * src/scan-skel.l: never-interactive.
17867 * src/conflicts.c (enum conflict_resolution_e): No trailing
17868 comma.
17869 * src/getargs.c (usage): Split long literal strings.
17870 Reported by Hans Aberg.
17871
717be197
AD
178722002-05-28 Akim Demaille <akim@epita.fr>
17873
17874 * data/bison.c++: Use C++ ostreams.
17875 (cdebug_): New member.
17876
670ddffd
AD
178772002-05-28 Akim Demaille <akim@epita.fr>
17878
17879 * src/output.c (output_skeleton): Be sure to allocate enough room
17880 for `/' _and_ for `\0' in full_skeleton.
17881
769b430f
AD
178822002-05-28 Akim Demaille <akim@epita.fr>
17883
17884 * data/bison.c++: Catch up with bison.simple:
17885 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17886 and Paul Eggert <eggert@twinsun.com>: `error' handing.
17887 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
17888 and popping traces.
17889
7067cb36
PH
178902002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17891
17892 * src/output.c (output_skeleton): Put an explicit path in front of
17893 the skeleton file name, rather than relying on the -I directory,
17894 to partially alleviate effects of having a skeleton file lying around
17895 in the current directory.
769b430f 17896
4a713ec2
PH
178972002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17898
769b430f 17899 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
17900 obstack_printf should be obstack_fgrow1.
17901
b408954b
AD
179022002-05-26 Akim Demaille <akim@epita.fr>
17903
17904 * src/state.h (state_t): `solved_conflicts' is a new member.
17905 * src/LR0.c (new_state): Set it to 0.
17906 * src/conflicts.h, src/conflicts.c (print_conflicts)
17907 (free_conflicts, solve_conflicts): Rename as...
17908 (conflicts_print, conflicts_free, conflicts_solve): these.
17909 Adjust callers.
17910 * src/conflicts.c (enum conflict_resolution_e)
17911 (solved_conflicts_obstack): New, used by...
17912 (log_resolution): this.
17913 Adjust to attach the conflict resolution to each state.
17914 Complete the description with the precedence/associativity
17915 information.
17916 (resolve_sr_conflict): Adjust.
17917 * src/print.c (print_state): Output its solved_conflicts.
17918 * tests/conflicts.at (Unresolved SR Conflicts)
17919 (Solved SR Conflicts): Exercise --report=all.
17920
a49aecd5
AD
179212002-05-26 Akim Demaille <akim@epita.fr>
17922
17923 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
17924 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
17925 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
17926 (token_number_t, item_number_as_token_number)
17927 (token_number_as_item_number, muscle_insert_token_number_table):
17928 Rename as...
17929 (symbol_number_t, item_number_as_symbol_number)
17930 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
17931 these, since it is more appropriate.
17932
5504898e
AD
179332002-05-26 Akim Demaille <akim@epita.fr>
17934
17935 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
17936 `Error:' lines.
17937 * data/bison.simple (yystos) [YYDEBUG]: New.
17938 (yyparse) [YYDEBUG]: Display the symbols which are popped during
17939 error recovery.
17940 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
17941
ec3bc396
AD
179422002-05-25 Akim Demaille <akim@epita.fr>
17943
17944 * doc/bison.texinfo (Debugging): Split into...
17945 (Tracing): this new section, its former contents, and...
17946 (Understanding): this new section.
17947 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
17948 by...
17949 (report_flag): this.
17950 Adjust all dependencies.
17951 (report_args, report_types, report_argmatch): New.
17952 (usage, getargs): Report/support -r, --report.
17953 * src/options.h
17954 (struct option_table_struct): Rename as..,
17955 (struct option_table_s): this.
17956 Rename the `set_flag' member to `flag' to match with getopt_long's
17957 struct.
17958 * src/options.c (option_table): Split verbose into an entry for
17959 %verbose, and another for --verbose.
17960 Support --report/-r, so remove -r from the obsolete --raw.
17961 * src/print.c: Attach full item sets and lookaheads reports to
17962 report_flag instead of trace_flag.
17963 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
17964
78df8250
PE
179652002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17966 and Paul Eggert <eggert@twinsun.com>
769b430f 17967
78df8250
PE
17968 * data/bison.simple (yyparse): Correct error handling to conform to
17969 POSIX and yacc. Specifically, after syntax error is discovered,
17970 do not reduce further before shifting the error token.
17971 Clean up the code a bit by removing the labels yyerrdefault,
17972 yyerrhandle, yyerrpop.
17973 * NEWS: Document the above.
17974
c0c9ea05
PH
179752002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17976
17977 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
17978 type; it isn't always big enough, since it doesn't necessarily
17979 include non-terminals.
769b430f 17980 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
17981 the latter can be removed.
17982 (yy_token_number_type): Remove, only one use.
17983 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
17984 don't use TokenNumberType as element type.
769b430f 17985
c0c9ea05
PH
17986 * tests/regression.at: Modify expected output to agree with change
17987 to yyr1 and yytranslate.
769b430f 17988
6390a83f
FK
179892002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
17990
17991 * src/reader.c (parse_action): Use copy_character instead of
17992 obstack_1grow.
17993
db7c8e9a
AD
179942002-05-13 Akim Demaille <akim@epita.fr>
17995
17996 * tests/regression.at (Token definitions): Prototype yylex and
17997 yyerror.
17998
fcc61800
PH
179992002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18000
158c687b 18001 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
18002 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18003 32-bit arithmetic.
18004 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18005
5683e9b2
AD
180062002-05-07 Akim Demaille <akim@epita.fr>
18007
18008 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18009 avoid GCC warnings.
18010
0c2d3f4c
AD
180112002-05-07 Akim Demaille <akim@epita.fr>
18012
18013 Kill GCC warnings.
18014
18015 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18016 over the RHS of each rule.
18017 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18018 * src/state.h (state_t): Member `nitems' is unsigned short.
18019 * src/LR0.c (get_state): Adjust.
18020 * src/reader.c (packgram): Likewise.
18021 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18022 `Type'.
18023 (muscle_insert_int_table): Remove, unused.
18024 (prepare_rules): Remove `max'.
18025
1565b720
AD
180262002-05-06 Akim Demaille <akim@epita.fr>
18027
18028 * src/closure.c (print_firsts): Display of the symbol tags.
18029 (bitmatrix_print): Move to...
18030 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18031 here.
18032 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18033
cfaee611
AD
180342002-05-06 Akim Demaille <akim@epita.fr>
18035
18036 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18037 hash_do_for_each.
18038
458be8e0
AD
180392002-05-06 Akim Demaille <akim@epita.fr>
18040
18041 * src/LR0.c (new_state, get_state): Instead of using the global
18042 `kernel_size' and `kernel_base', have two new arguments:
18043 `core_size' and `core'.
18044 Adjust callers.
18045
a900a624
AD
180462002-05-06 Akim Demaille <akim@epita.fr>
18047
18048 * src/reader.c (packgram): No longer end `ritem' with a 0
18049 sentinel: it is not used.
18050
d4e7d3a1
AD
180512002-05-05 Akim Demaille <akim@epita.fr>
18052
18053 New experimental feature: display the lookaheads in the report and
18054 graph.
18055
18056 * src/print (print_core): When --trace-flag, display the rules
18057 lookaheads.
18058 * src/print_graph.c (print_core): Likewise.
18059 Swap the arguments.
18060 Adjust caller.
18061
39ceb25b
AD
180622002-05-05 Akim Demaille <akim@epita.fr>
18063
18064 * tests/torture.at (Many lookaheads): New test.
18065
5372019f
AD
180662002-05-05 Akim Demaille <akim@epita.fr>
18067
18068 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18069 (GENERATE_MUSCLE_INSERT_TABLE): this.
18070 (output_int_table, output_unsigned_int_table, output_short_table)
18071 (output_token_number_table, output_item_number_table): Replace with...
18072 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18073 (muscle_insert_short_table, muscle_insert_token_number_table)
18074 (muscle_insert_item_number_table): these.
18075 Adjust all callers.
18076 (prepare_tokens): Don't free `translations', since...
18077 * src/reader.h, src/reader.c (grammar_free): do it.
18078 Move to...
18079 * src/gram.h, src/gram.c (grammar_free): here.
18080 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18081 b4_translate_max.
18082
5df5f6d5
AD
180832002-05-05 Akim Demaille <akim@epita.fr>
18084
18085 * src/output.c (output_unsigned_int_table): New.
18086 (prepare_rules): `i' is unsigned.
18087 `prhs', `rline', `r2' are unsigned int.
18088 Rename muscle `rhs_number_max' as `rhs_max'.
18089 Output muscles `prhs_max', `rline_max', and `r2_max'.
18090 Free rline and r1.
18091 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18092 to compute types instead of constant types.
18093 * tests/regression.at (Web2c Actions): Adjust.
18094
b87f8b21
AD
180952002-05-04 Akim Demaille <akim@epita.fr>
18096
18097 * src/symtab.h (SALIAS, SUNDEF): Rename as...
18098 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
18099 Adjust dependencies.
18100 * src/output.c (token_definitions_output): Be sure not to output a
18101 `#define 'a'' when fed with `%token 'a' "a"'.
18102 * tests/regression.at (Token definitions): New.
18103
8bb936e4
PE
181042002-05-03 Paul Eggert <eggert@twinsun.com>
18105
18106 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18107 for K&R C.
18108
181092002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18110
18111 * Makefile.am (SUBDIRS): Remove intl.
18112 (EXTRA_DIST): Add config/config.rpath.
18113
53c71a12
AD
181142002-05-03 Akim Demaille <akim@epita.fr>
18115
18116 * data/bison.simple (m4_if): Don't output empty enums.
18117 And actually, output valid enum definitions :(.
18118
289dd0cf
AD
181192002-05-03 Akim Demaille <akim@epita.fr>
18120
18121 * configure.bat: Remove, completely obsolete.
18122 * Makefile.am (EXTRA_DIST): Adjust.
18123 Don't distribute config.rpath...
18124 * config/Makefile.am (EXTRA_DIST): Do it.
18125
db85e524
AD
181262002-05-03 Akim Demaille <akim@epita.fr>
18127
18128 * configure.in (GETTEXT_VERSION): New.
18129 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
18130
83ccf991
AD
181312002-05-03 Akim Demaille <akim@epita.fr>
18132
18133 * data/bison.simple (b4_token_enum): New.
18134 (b4_token_defines): Use it to output tokens both as #define and
18135 enums.
18136 Suggested by Paul Eggert.
18137 * src/output.c (token_definitions_output): Don't output spurious
18138 white spaces.
18139
1f418995
AD
181402002-05-03 Akim Demaille <akim@epita.fr>
18141
18142 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18143
45119f04
RA
181442002-05-02 Robert Anisko <robert@lrde.epita.fr>
18145
18146 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
18147 Update the stack class, give a try to deque as the default container.
18148
b2d52318
AD
181492002-05-02 Akim Demaille <akim@epita.fr>
18150
18151 * data/bison.simple (yyparse): Do not implement @$ = @1.
18152 (YYLLOC_DEFAULT): Adjust to do it.
18153 * doc/bison.texinfo (Location Default Action): Fix.
18154
3a8b4109
AD
181552002-05-02 Akim Demaille <akim@epita.fr>
18156
18157 * src/reader.c (parse_braces): Merge into...
18158 (parse_action): this.
18159
84614e13
AD
181602002-05-02 Akim Demaille <akim@epita.fr>
18161
18162 * configure.in (ALL_LINGUAS): Remove.
18163 * po/LINGUAS, hr.po: New.
18164
fdbcd8e2
AD
181652002-05-02 Akim Demaille <akim@epita.fr>
18166
18167 Remove the so called hairy (semantic) parsers.
18168
18169 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
18170 * src/gram.h, src/gram.c (semantic_parser): Remove.
18171 (rule_t): Remove the guard and guard_line members.
18172 * src/lex.h (token_t): remove tok_guard.
18173 * src/options.c (option_table): Remove %guard and %semantic_parser
18174 support.
18175 * src/output.c, src/output.h (guards_output): Remove.
18176 (prepare): Adjust.
18177 (token_definitions_output): Don't output the `T'
18178 tokens (???).
18179 (output_skeleton): Don't output the guards.
18180 * src/files.c, src/files.c (attrsfile): Remove.
18181 * src/reader.c (symbol_list): Remove the guard and guard_line
18182 members.
18183 Adjust dependencies.
18184 (parse_guard): Remove.
18185 * data/bison.hairy: Remove.
18186 * doc/bison.texinfo (Environment Variables): Remove occurrences of
18187 BISON_HAIRY.
18188
82b6cb3f
AD
181892002-05-02 Akim Demaille <akim@epita.fr>
18190
18191 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
18192 (parse_guard): Rename the formal argument `stack_offset' as
18193 `rule_length', which is more readable.
18194 Adjust callers.
18195 (copy_at, copy_dollar): Instead of outputting the hard coded
18196 values of $$, $n and so forth, output invocation to b4_lhs_value,
18197 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
18198 Note: this patch partially drops `semantic-parser' support: it
18199 always does `rule_length - n', where semantic parsers ought to
18200 always use `-n'.
82b6cb3f
AD
18201 * data/bison.simple, data/bison.c++ (b4_lhs_value)
18202 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
18203
6cbfbcc5
AD
182042002-05-02 Akim Demaille <akim@epita.fr>
18205
18206 * configure.in (AC_INIT): Bump to 1.49b.
18207 (AM_INIT_AUTOMAKE): Short invocation.
18208
b8548114
AD
182092002-05-02 Akim Demaille <akim@epita.fr>
18210
18211 Version 1.49a.
18212
c20cd1fa
AD
182132002-05-01 Akim Demaille <akim@epita.fr>
18214
18215 * src/skeleton.h: Remove.
18216
8a9566d4
AD
182172002-05-01 Akim Demaille <akim@epita.fr>
18218
18219 * src/skeleton.h: Fix the #endif.
18220 Reported by Magnus Fromreide.
18221
8c6d399a
PE
182222002-04-26 Paul Eggert <eggert@twinsun.com>
18223
18224 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
18225 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 18226 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 18227
2b7ed18a
RA
182282002-04-25 Robert Anisko <robert@lrde.epita.fr>
18229
18230 * src/scan-skel.l: Postprocess quadrigraphs.
18231
18232 * src/reader.c (copy_character): New function, used to output
18233 single characters while replacing `[' and `]' with quadrigraphs, to
18234 avoid troubles with M4 quotes.
18235 (copy_comment): Output characters with copy_character.
18236 (read_additionnal_code): Likewise.
18237 (copy_string2): Likewise.
18238 (copy_definition): Likewise.
18239
18240 * tests/calc.at: Exercise M4 quoting.
18241
34a89c50
AD
182422002-04-25 Akim Demaille <akim@epita.fr>
18243
18244 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
18245 between `!' and the command.
18246 Reported by Paul Eggert.
18247
0dd1580a
RA
182482002-04-24 Robert Anisko <robert@lrde.epita.fr>
18249
18250 * tests/calc.at: Exercise prologue splitting.
18251
18252 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
18253 `b4_post_prologue' instead of `b4_prologue'.
18254
18255 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
18256 muscles.
18257 (output): Free pre_prologue_obstack and post_prologue_obstack.
18258 * src/files.h, src/files.c (attrs_obstack): Remove.
18259 (pre_prologue_obstack, post_prologue_obstack): New.
18260 * src/reader.c (copy_definition): Add a parameter to specify the
18261 obstack to fill, instead of using attrs_obstack unconditionally.
18262 (read_declarations): Pass pre_prologue_obstack to copy_definition if
18263 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
18264
83c1796f
PE
182652002-04-23 Paul Eggert <eggert@twinsun.com>
18266
18267 * data/bison.simple: Remove unnecessary commentary and white
18268 space differences from 1_29-branch.
18269 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
18270
18271 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
18272 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
18273 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
18274 constructors or destructors.
18275
18276 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
18277
1207eeac
AD
182782002-04-23 Akim Demaille <akim@epita.fr>
18279
18280 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
18281 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
18282 location with columns.
18283 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
18284 All reported by Paul Eggert.
18285
78ab8f67
AD
182862002-04-22 Akim Demaille <akim@epita.fr>
18287
18288 * src/reduce.c (dump_grammar): Move to...
18289 * src/gram.h, src/gram.c (grammar_dump): here.
18290 Be sure to separate long item numbers.
18291 Don't read the members of a rule's prec if its nil.
18292
133c20e2
AD
182932002-04-22 Akim Demaille <akim@epita.fr>
18294
18295 * src/output.c (table_size, table_grow): New.
18296 (MAXTABLE): Remove, replace uses with table_size.
18297 (pack_vector): Instead of dying when the table is too big, grow it.
18298
9515e8a7
AD
182992002-04-22 Akim Demaille <akim@epita.fr>
18300
18301 * data/bison.simple (yyr1): Its type is that of a token number.
18302 * data/bison.c++ (r1_): Likewise.
18303 * tests/regression.at (Web2c Actions): Adjust.
18304
23c5a174
AD
183052002-04-22 Akim Demaille <akim@epita.fr>
18306
18307 * src/reader.c (token_translations_init): 256 is now the default
18308 value for the error token, i.e., it will be assigned another
18309 number if the user assigned 256 to one of her tokens.
18310 (reader): Don't force 256 to error.
18311 * doc/bison.texinfo (Symbols): Adjust.
18312 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
18313 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
18314 etc. instead of 10, 20, 30 (which was used to `jump' over error
18315 (256) and undefined (2)).
18316
5fbb0954
AD
183172002-04-22 Akim Demaille <akim@epita.fr>
18318
18319 Propagate more token_number_t.
18320
18321 * src/gram.h (token_number_as_item_number)
18322 (item_number_as_token_number): New.
18323 * src/output.c (GENERATE_OUTPUT_TABLE): New.
18324 Use it to create output_item_number_table and
18325 output_token_number_table.
18326 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18327 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
18328 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
18329 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
18330
4f940944
AD
183312002-04-22 Akim Demaille <akim@epita.fr>
18332
18333 * src/output.h, src/output.c (get_lines_number): Remove.
18334
3ded9a63
AD
183352002-04-19 Akim Demaille <akim@epita.fr>
18336
18337 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
18338 as Lex/Flex'.
18339 (Debugging): More details about enabling the debugging features.
18340 (Table of Symbols): Describe $$, $n, @$, and @n.
18341 Suggested by Tim Josling.
18342
e0c471a9
AD
183432002-04-19 Akim Demaille <akim@epita.fr>
18344
18345 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
18346
fecc10cd
AD
183472002-04-10 Akim Demaille <akim@epita.fr>
18348
18349 * src/system.h: Rely on HAVE_LIMITS_H.
18350 Suggested by Paul Eggert.
18351
51dec47b
AD
183522002-04-09 Akim Demaille <akim@epita.fr>
18353
18354 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
18355 full stderr, and strip it according to the bison options, instead
18356 of composing the error message from different bits.
18357 This makes it easier to check for several error messages.
18358 Adjust all the invocations.
18359 Add an invocation exercising the error token.
18360 Add an invocation demonstrating a stupid error message.
18361 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
18362 Adjust the tests.
18363 Error message are for stderr, not stdout.
18364
007a50a4
AD
183652002-04-09 Akim Demaille <akim@epita.fr>
18366
18367 * src/gram.h, src/gram.c (error_token_number): Remove, use
18368 errtoken->number.
18369 * src/reader.c (reader): Don't specify the user token number (2)
18370 for $undefined, as it uselessly prevents using it.
18371 * src/gram.h (token_number_t): Move to...
18372 * src/symtab.h: here.
18373 (state_t.number): Is a token_number_t.
18374 * src/print.c, src/reader.c: Use undeftoken->number instead of
18375 hard coded 2.
18376 (Even though this 2 is not the same as above: the number of the
18377 undeftoken remains being 2, it is its user token number which
18378 might not be 2).
18379 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
18380 `user_token_number_max'.
18381 Output `undef_token_number'.
18382 * data/bison.simple, data/bison.c++: Use them.
18383 Be sure to map invalid yylex return values to
18384 `undef_token_number'. This saves us from gratuitous SEGV.
18385
18386 * tests/conflicts.at (Solved SR Conflicts)
18387 (Unresolved SR Conflicts): Adjust.
18388 * tests/regression.at (Web2c Actions): Adjust.
18389
06446ccf
AD
183902002-04-08 Akim Demaille <akim@epita.fr>
18391
18392 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
18393 Adding #line.
18394 Remove the duplicate `typedefs'.
18395 (RhsNumberType): Fix the declaration and various other typos.
18396 Use __ofile__.
18397 * data/bison.simple: Use __ofile__.
18398 * src/scan-skel.l: Handle __ofile__.
18399
62a3e4f0
AD
184002002-04-08 Akim Demaille <akim@epita.fr>
18401
18402 * src/gram.h (item_number_t): New, the type of item numbers in
18403 RITEM. Note that it must be able to code symbol numbers as
18404 positive number, and the negation of rule numbers as negative
18405 numbers.
18406 Adjust all dependencies (pretty many).
18407 * src/reduce.c (rule): Remove this `short *' pointer: use
18408 item_number_t.
18409 * src/system.h (MINSHORT, MAXSHORT): Remove.
18410 Include `limits.h'.
18411 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
18412 (shortcpy): Remove.
18413 (MAXTABLE): Move to...
18414 * src/output.c (MAXTABLE): here.
18415 (prepare_rules): Use output_int_table to output rhs.
18416 * data/bison.simple, data/bison.c++: Adjust.
18417 * tests/torture.at (Big triangle): Move the limit from 254 to
18418 500.
18419 * tests/regression.at (Web2c Actions): Ajust.
18420
18421 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
18422 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18423 passes, but produces negative #line number, once fixed, GCC is
18424 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18425 C), it passes.
18426 * src/state.h (state_h): Code input lines on ints, not shorts.
18427
bb88b0fc
AD
184282002-04-08 Akim Demaille <akim@epita.fr>
18429
18430 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18431 and then the grammar.
18432
9a636f47
AD
184332002-04-08 Akim Demaille <akim@epita.fr>
18434
18435 * src/system.h: No longer using strndup.
18436
680e8701
AD
184372002-04-07 Akim Demaille <akim@epita.fr>
18438
18439 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18440 * src/output.c (output_table_data): Return the longest number.
18441 (prepare_tokens): Output `token_number_max').
18442 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18443 New.
18444 Use them to define yy_token_number_type/TokenNumberType.
18445 Use this type for yytranslate.
18446 * tests/torture.at (Big triangle): Push the limit from 124 to
18447 253.
18448 * tests/regression.at (Web2c Actions): Adjust.
18449
817e9f41
AD
184502002-04-07 Akim Demaille <akim@epita.fr>
18451
18452 * tests/torture.at (Big triangle): New.
18453 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18454 * tests/existing.at: here.
18455
5123689b
AD
184562002-04-07 Akim Demaille <akim@epita.fr>
18457
18458 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18459 nritems.
18460 Adjust dependencies.
18461
f3849179
AD
184622002-04-07 Akim Demaille <akim@epita.fr>
18463
18464 * src/reader.c: Normalize increments to prefix form.
18465
bd02036a
AD
184662002-04-07 Akim Demaille <akim@epita.fr>
18467
18468 * src/reader.c, symtab.c: Remove debugging code.
18469
db8837cb
AD
184702002-04-07 Akim Demaille <akim@epita.fr>
18471
18472 Rename all the `bucket's as `symbol_t'.
18473
18474 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18475 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18476 * src/symtab.c, src/symtab.h (bucket): Rename as...
18477 (symbol_t): this.
18478 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18479 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18480 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18481 (buckets_new, buckets_free, buckets_do): Rename as...
18482 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18483 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18484 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18485 (symbols_new, symbols_free, symbols_do): these.
18486
72a23c97
AD
184872002-04-07 Akim Demaille <akim@epita.fr>
18488
18489 Use lib/hash for the symbol table.
18490
18491 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18492 EOF.
18493 * src/lex.c (lex): Set the `number' member of new terminals.
18494 * src/reader.c (bucket_check_defined, bucket_make_alias)
18495 (bucket_check_alias_consistence, bucket_translation): New.
18496 (reader, grammar_free, readgram, token_translations_init)
18497 (packsymbols): Adjust.
18498 (reader): Number the predefined tokens.
18499 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18500 for predefined tokens.
18501 * src/symtab.h (bucket): Remove all the hash table related
18502 members.
18503 * src/symtab.c (symtab): Replace by...
18504 (bucket_table): this.
18505 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18506 (buckets_new, buckets_do): New.
18507
280a38c3
AD
185082002-04-07 Akim Demaille <akim@epita.fr>
18509
18510 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
18511 (start_symbol, max_user_token_number, semantic_parser)
18512 (error_token_number): Initialize.
18513 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
18514 Initialize.
18515 (reader): Don't.
18516 (errtoken, eoftoken, undeftoken, axiom): Extern.
18517
03b31c0c
AD
185182002-04-07 Akim Demaille <akim@epita.fr>
18519
18520 * src/gram.h (rule_s): prec and precsym are now pointers
18521 to the bucket giving the priority/associativity.
18522 Member `associativity' removed: useless.
18523 * src/reduce.c, src/conflicts.c: Adjust.
18524
8b3df748
AD
185252002-04-07 Akim Demaille <akim@epita.fr>
18526
18527 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
18528 Properly escape the symbols' TAG when outputting them.
18529
e601aa1d
AD
185302002-04-07 Akim Demaille <akim@epita.fr>
18531
18532 * src/lalr.h (LA): Is a bitsetv, not bitset*.
18533
b0299a2e
AD
185342002-04-07 Akim Demaille <akim@epita.fr>
18535
18536 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
18537 (LArule): this, which is an array to rule_t*.
18538 * src/print.c, src/conflicts.c: Adjust.
18539
d7e1f00c
AD
185402002-04-07 Akim Demaille <akim@epita.fr>
18541
18542 * src/gram.h (rule_t): Rename `number' as `user_number'.
18543 `number' is a new member.
18544 Adjust dependencies.
18545 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
18546
cc9305dd
AD
185472002-04-07 Akim Demaille <akim@epita.fr>
18548
18549 As a result of the previous patch, it is no longer needed
18550 to reorder ritem itself.
18551
18552 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
18553
b0940840
AD
185542002-04-07 Akim Demaille <akim@epita.fr>
18555
18556 Be sure never to walk through RITEMS, but use only data related to
18557 the rules themselves. RITEMS should be banished.
18558
18559 * src/output.c (output_token_translations): Rename as...
18560 (prepare_tokens): this.
18561 In addition to `translate', prepare the muscles `tname' and
18562 `toknum', which were handled by...
18563 (output_rule_data): this.
18564 Remove, and move the remainder of its outputs into...
18565 (prepare_rules): this new routines, which also merges content from
18566 (output_gram): this.
18567 (prepare_rules): Be sure never to walk through RITEMS.
18568 (output_stos): Rename as...
18569 (prepare_stos): this.
18570 (output): Always invoke prepare_states, after all, just don't use it
18571 in the output if you don't need it.
18572
643a5994
AD
185732002-04-07 Akim Demaille <akim@epita.fr>
18574
18575 * src/LR0.c (new_state): Display `nstates' as the name of the
18576 newly created state.
18577 Adjust to initialize first_state and last_state if needed.
18578 Be sure to distinguish the initial from the final state.
18579 (new_states): Create the itemset of the initial state, and use
18580 new_state.
18581 * src/closure.c (closure): Now that the initial state has its
18582 items properly set, there is no need for a special case when
18583 creating `ruleset'.
18584
18585 As a result, now the rule 0, reducing to $axiom, is visible in the
18586 outputs. Adjust the test suite.
18587
18588 * tests/conflicts.at (Solved SR Conflicts)
18589 (Unresolved SR Conflicts): Adjust.
18590 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
18591 * tests/conflicts.at (S/R in initial): New.
18592
b4c4ccc2
AD
185932002-04-07 Akim Demaille <akim@epita.fr>
18594
18595 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
18596 the RHS of the rules.
18597 * src/output.c (output_gram): Likewise.
18598
bba97eb2
AD
185992002-04-07 Akim Demaille <akim@epita.fr>
18600
18601 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
18602 bucket.
18603 Adjust all dependencies.
18604 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
18605 `number' of the buckets too.
18606 * src/gram.h: Include `symtab.h'.
18607 (associativity): Move to...
18608 * src/symtab.h: here.
18609 No longer include `gram.h'.
18610
c3b407f4
AD
186112002-04-07 Akim Demaille <akim@epita.fr>
18612
18613 * src/gram.h, src/gram.c (rules_rhs_length): New.
18614 (ritem_longest_rhs): Use it.
18615 * src/gram.h (rule_t): `number' is a new member.
18616 * src/reader.c (packgram): Set it.
18617 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
18618 the end of `rules', and count them out of `nrules'.
18619 (reduce_output, dump_grammar): Adjust.
18620 * src/print.c (print_grammar): It is no longer needed to check for
18621 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
18622 * tests/reduce.at (Reduced Automaton): New test.
18623
11652ab3
AD
186242002-04-07 Akim Demaille <akim@epita.fr>
18625
18626 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
18627 lacking `+ 1' to nrules, Bison reported as useless a token if it
18628 was used solely to set the precedence of the last rule...
18629
26b23c1a
AD
186302002-04-07 Akim Demaille <akim@epita.fr>
18631
18632 * data/bison.c++, data/bison.simple: Don't output the current file
18633 name in #line, to avoid useless diffs between two identical
18634 outputs under different names.
18635
18bcecb0
AD
186362002-04-07 Akim Demaille <akim@epita.fr>
18637
18638 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
18639 Normalize loops to using `< nrules + 1', not `<= nrules'.
18640
fa770c86
AD
186412002-04-07 Akim Demaille <akim@epita.fr>
18642
18643 * TODO: Update.
18644
d9b739c3
AD
186452002-04-07 Akim Demaille <akim@epita.fr>
18646
18647 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
18648 bucket.value as bucket.number.
18649
99013900
AD
186502002-04-07 Akim Demaille <akim@epita.fr>
18651
18652 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
18653 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18654 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
18655 RHS, instead of being an index in RITEMS.
18656
e966383b
PE
186572002-04-04 Paul Eggert <eggert@twinsun.com>
18658
18659 * doc/bison.texinfo: Update copyright date.
18660 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18661 (Symbols): Warn about running Bison in one character set,
18662 but compiling and/or running in an incompatible one.
18663 Warn about character code 256, too.
18664
186652002-04-03 Paul Eggert <eggert@twinsun.com>
18666
18667 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18668 YYERROR_VERBOSE is nonzero, not whether it is defined.
18669
18670 Merge changes from bison-1_29-branch.
c307773e 18671
8d6c48b9
PE
186722002-03-20 Paul Eggert <eggert@twinsun.com>
18673
18674 Merge fixes from Debian bison_1.34-1.diff.
18675
18676 * configure.in (AC_PREREQ): 2.53.
18677
e53c6322
AD
186782002-03-20 Akim Demaille <akim@epita.fr>
18679
18680 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18681
9ffbeca7
PE
186822002-03-19 Paul Eggert <eggert@twinsun.com>
18683
21db0b2a
PE
18684 * src/bison.simple (YYCOPY): New macro.
18685 (YYSTACK_RELOCATE): Use it.
18686 Remove Type arg; no longer needed. All callers changed.
18687 (yymemcpy): Remove; no longer needed.
18688
9ffbeca7
PE
18689 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18690 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18691
642cb8f8
AD
186922002-03-19 Akim Demaille <akim@epita.fr>
18693
18694 Test and fix the #line outputs.
18695
18696 * tests/atlocal.at (GCC): New.
18697 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 18698 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
18699 (Action synch line, Epilogue synch line): New tests.
18700 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18701 * data/bison.simple, data/bison.c++: Use it.
18702
3c31a486
AD
187032002-03-19 Akim Demaille <akim@epita.fr>
18704
18705 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18706 (Solved SR Conflicts, %expect not enough, %expect right)
18707 (%expect too much): Move to...
18708 * tests/conflicts.at: this new file.
18709
0d8bed56
AD
187102002-03-19 Akim Demaille <akim@epita.fr>
18711
18712 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18713 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18714 that we can move to enums for instance.
18715 * src/output.c (token_definitions_output): Output a list of
18716 `token-name, token-number' instead of the #define.
18717 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18718
9208d17f
AD
187192002-03-14 Akim Demaille <akim@epita.fr>
18720
18721 Use Gettext 0.11.1.
18722
af27eacb
RA
187232002-03-09 Robert Anisko <robert@lrde.epita.fr>
18724
18725 * data/bison.c++: Make the user able to add members to the generated
18726 parser by subclassing.
18727
9101a310
RA
187282002-03-05 Robert Anisko <robert@lrde.epita.fr>
18729
18730 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18731 a character.
18732 Reported by Nicolas Tisserand and Nicolas Burrus.
18733
fff9bf0b
RA
187342002-03-04 Robert Anisko <robert@lrde.epita.fr>
18735
18736 * src/reader.c: Warn about lacking semi-colons, do not complain.
18737
64dba31e
RA
187382002-03-04 Robert Anisko <robert@lrde.epita.fr>
18739
18740 * data/bison.c++: Remove a debug line.
18741
374f5a14
RA
187422002-03-04 Robert Anisko <robert@lrde.epita.fr>
18743
18744 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18745 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18746 provide a default implementation.
18747
bfcf1f3a
AD
187482002-03-04 Akim Demaille <akim@epita.fr>
18749
18750 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18751 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18752 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18753 * tests/semantic.at (Parsing Guards): Similarly.
18754 * src/reader.at (readgram): Complain if the last rule is not ended
18755 with a semi-colon.
18756
65ccf9fc
AD
187572002-03-04 Akim Demaille <akim@epita.fr>
18758
18759 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18760 * src/closure.c: here.
18761 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18762 RTC.
18763 * src/warshall.h, src/warshall.c: Remove.
18764 * tests/sets.at (Broken Closure): Adjust.
18765
d0039cbc
AD
187662002-03-04 Akim Demaille <akim@epita.fr>
18767
18768 * src/output.c (output_skeleton): tempdir is const.
18769 bytes_read is unused.
18770
345cea78
AD
187712002-03-04 Akim Demaille <akim@epita.fr>
18772
18773 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18774 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18775 Update.
18776 From Michael Hayes.
18777
564801f7
AD
187782002-03-04 Akim Demaille <akim@epita.fr>
18779
18780 * src/closure.c (closure): `r' is unused.
18781
e5352bc7
AD
187822002-03-04 Akim Demaille <akim@epita.fr>
18783
18784 * tests/sets.at (Broken Closure): Add the ending `;'.
18785 * src/reader.at (readgram): Complain if a rule is not ended with a
18786 semi-colon.
18787
914feea9
AD
187882002-03-04 Akim Demaille <akim@epita.fr>
18789
18790 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18791 (count_sr_conflicts): Use bitset_count.
18792 * src/reduce.c (inaccessable_symbols): Ditto.
18793 (bits_size): Remove.
18794 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18795
f0250de6
AD
187962002-03-04 Akim Demaille <akim@epita.fr>
18797
18798 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18799 * src/reduce.c: Remove the `bitset_zero's following the
18800 `bitset_create's, as now it is performed by the latter.
18801
ef017502
AD
188022002-03-04 Akim Demaille <akim@epita.fr>
18803
18804 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18805 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18806 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18807 latest sources from Michael.
18808
76514394
AD
188092002-03-04 Akim Demaille <akim@epita.fr>
18810
18811 * src/output.c (output): Don't free the grammar.
18812 * src/reader.c (grammar_free): New.
18813 * src/main.c (main): Call it and don't free symtab here.
18814
55024580
AD
188152002-03-04 Akim Demaille <akim@epita.fr>
18816
18817 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18818 before returning.
18819 Reported by Benoit Perrot.
18820
f9abaa2c
AD
188212002-03-04 Akim Demaille <akim@epita.fr>
18822
18823 Use bitset operations when possible, not loops over bits.
18824
18825 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18826 bitset_or.
18827 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18828 * src/reduce.c (useless_nonterminals): Formatting changes.
18829 * src/warshall.c (TC): Use bitset_or.
18830
0e721e75
AD
188312002-03-04 Akim Demaille <akim@epita.fr>
18832
18833 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18834 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18835 Ditto.
18836
0fb1ffb1
AD
188372002-03-04 Akim Demaille <akim@epita.fr>
18838
18839 * src/lalr.c (F): Now a bitset*.
18840 Adjust all dependencies.
18841
b86796bf
AD
188422002-03-04 Akim Demaille <akim@epita.fr>
18843
18844 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18845 Adjust all dependencies.
18846
602bbf31
AD
188472002-03-04 Akim Demaille <akim@epita.fr>
18848
18849 * src/L0.c, src/LR0.h (nstates): Be size_t.
18850 Adjust comparisons (signed vs unsigned).
18851 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
18852 bitset*.
18853 Adjust all dependencies.
18854
d8a0245c
AD
188552002-03-04 Akim Demaille <akim@epita.fr>
18856
18857 * src/closure.c (firsts): Now, also a bitset.
18858 Adjust all dependencies.
18859 (varsetsize): Remove, now unused.
18860 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
18861
34ba9743
AD
188622002-03-04 Akim Demaille <akim@epita.fr>
18863
18864 * src/print.c: Convert to use bitset.h, not hand coded iterations
18865 over ints.
18866
ed86e78c
AD
188672002-03-04 Akim Demaille <akim@epita.fr>
18868
18869 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
18870
dfdb1797
AD
188712002-03-04 Akim Demaille <akim@epita.fr>
18872
18873 * src/closure.c (ruleset): Be a bitset.
18874 (rulesetsize): Remove.
18875
7086e707
AD
188762002-03-04 Akim Demaille <akim@epita.fr>
18877
18878 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18879 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
18880 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
18881 * src/closure.c (fderives): Be an array of bitsets.
18882
98254360
RA
188832002-02-28 Robert Anisko <robert@lrde.epita.fr>
18884
18885 * data/bison.c++: Merge the two generated headers. Insert a copyright
18886 notice in each output file.
18887
a75c057f
AD
188882002-02-28 Akim Demaille <akim@epita.fr>
18889
18890 * data/bison.c++: Copy the prologue of bison.simple to fetch
18891 useful M4 definitions, such as b4_header_guard.
18892
06b00abc
AD
188932002-02-25 Akim Demaille <akim@epita.fr>
18894
18895 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
18896 translator friendly scheme for the bgr
18897 copyright notice.
06b00abc 18898
70e7d534
AD
188992002-02-25 Akim Demaille <akim@epita.fr>
18900
18901 * src/output.c (header_output): Remove, now handled completely via
18902 M4.
18903
abe017f6
AD
189042002-02-25 Akim Demaille <akim@epita.fr>
18905
18906 * m4/m4.m4: New, from CVS Autoconf.
18907 * configure.in: Invoke it.
18908 * src/output.c (output_skeleton): Use its result instead of the
18909 hard coded name.
18910
381fb12e
AD
189112002-02-25 Akim Demaille <akim@epita.fr>
18912
18913 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
18914 Fileutils 4.1.5.
18915 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
18916 * src/output.c (output_skeleton): Use mkstemp to create a real
18917 temporary file.
18918 Move the filling of `skeleton' and its muscle to...
18919 (prepare): here.
18920 (output): Move the definition of the prologue muscle to...
18921 (prepare): here.
18922 * src/system.h (DEFAULT_TMPDIR): New.
18923
6f38107f
PE
189242002-02-14 Paul Eggert <eggert@twinsun.com>
18925
18926 Remove the support for C++ namespace cleanliness; it was
18927 causing more problems than it was curing, since it didn't work
18928 properly on some nonstandard C++ compilers. This can wait
18929 for a proper C++ parser.
18930
18931 * NEWS: Document this.
18932 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
18933 of C++, as it's treated like C now.
18934 * src/bison.simple (YYSTD): Remove.
18935 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
18936 Treat C++ just like Standard C instead of trying to support
18937 namespace cleanliness.
18938
80cce3da
AD
189392002-02-14 Akim Demaille <akim@epita.fr>
18940
18941 * tests/regression.at (else): Adjust to Andreas' change.
18942
842e8679
AD
189432002-02-14 Akim Demaille <akim@epita.fr>
18944
18945 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
18946
4bda3f10
AD
189472002-02-13 Andreas Schwab <schwab@suse.de>
18948
18949 * src/output.c (output_rule_data): Don't output NULL, it might
18950 not be defined yet.
18951
4162fa07 189522002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 18953
4162fa07
RA
18954 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
18955 (Copyright notice): Update.
b418ecd8 18956
bd16a5dc
AD
189572002-02-11 Akim Demaille <akim@epita.fr>
18958
18959 * tests/regression.at (%nonassoc and eof): Don't include
18960 nonportable headers.
18961
8d69a1a3
RA
189622002-02-08 Robert Anisko <robert@lrde.epita.fr>
18963
18964 * data/bison.c++: Correct error recovery. Make the user able to
18965 initialize the starting location.
18966
9b2d0677
AD
189672002-02-07 Akim Demaille <akim@epita.fr>
18968
18969 * tests/input.at: New.
18970
69e2658b
RA
189712002-02-07 Robert Anisko <robert@lrde.epita.fr>
18972
18973 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 18974 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
18975 directives around tables only needed for debugging.
18976
4aacc3a7
RA
189772002-02-07 Robert Anisko <robert@lrde.epita.fr>
18978
18979 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
18980 C++ parsers.
18981 (yy::b4_name::parse): Use print_.
18982
762a801e
RA
189832002-02-07 Robert Anisko <robert@lrde.epita.fr>
18984
18985 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
18986
4bb2bc3f
RA
189872002-02-07 Robert Anisko <robert@lrde.epita.fr>
18988
18989 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
18990 C++ parsers.
18991 (yy::b4_name::parse): Build verbose error messages, and use error_.
18992
6b45a3ca
RA
189932002-02-06 Robert Anisko <robert@lrde.epita.fr>
18994
18995 * data/bison.c++: Fix m4 quoting in comments.
18996
50997c6e
RA
189972002-02-06 Robert Anisko <robert@lrde.epita.fr>
18998
18999 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19000 not expanded by m4.
19001
3f3eed27
AD
190022002-02-05 Akim Demaille <akim@epita.fr>
19003
19004 * data/bison.c++: Adjust to the M4 back end.
19005 More is certainly needed.
19006
be2a1a68
AD
190072002-02-05 Akim Demaille <akim@epita.fr>
19008
19009 Give a try to M4 as a back end.
19010
19011 * lib/readpipe.c: New, from wdiff.
19012 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19013 BISON_HAIRY.
19014 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19015 specific values. Now it is m4 that performs the lookup.
19016 * src/parse-skel.y: Remove.
19017 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19018 * src/output.c (actions_output, guards_output)
19019 (token_definitions_output): No longer keeps track of the output
19020 line number, hence remove the second argument.
19021 (guards_output): Check against the guard member of a rule, not the
19022 action member.
19023 Adjust callers.
19024 (output_skeleton): Don't look for the skeleton location, let m4 do
19025 that.
19026 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19027 file will be used.
19028 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19029 (prepare): Given that for the time being changesyntax is not
19030 usable in M4, rename the muscles using `-' to `_'.
19031 Define `defines_flag', `output_parser_name' and `output_header_name'.
19032 * src/output.h (actions_output, guards_output)
19033 (token_definitions_output): Adjust prototypes.
19034 * src/scan-skel.l: Instead of scanning the skeletons, it now
19035 processes the output of m4: `__oline__' and `#output'.
19036 * data/bison.simple: Adjust to be used by M4(sugar).
19037 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19038 to date.
19039 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19040 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19041 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19042 shamelessly stolen from CVS Autoconf.
19043
beda758b
AD
190442002-02-05 Akim Demaille <akim@epita.fr>
19045
19046 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19047 * configure.in: Check for the declarations of free and malloc.
19048 * src/muscle_tab.c: Adjust.
19049
5ece6d43
AD
190502002-02-05 Akim Demaille <akim@epita.fr>
19051
19052 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19053 which have no values.
19054
5bb18f9a
AD
190552002-02-05 Akim Demaille <akim@epita.fr>
19056
19057 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19058 * data/: here.
19059
894dd62e
PE
190602002-01-29 Paul Eggert <eggert@twinsun.com>
19061
19062 * src/bison.simple (YYSIZE_T): Do not define merely because
19063 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19064 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19065
82841af7
AD
190662002-01-27 Akim Demaille <akim@epita.fr>
19067
19068 Fix `%nonassoc and eof'.
19069
19070 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19071 which were not properly copied! Replace
19072 memcpy (res->errs, src->errs, src->nerrs);
19073 with
19074 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19075 !!!
19076 * tests/regression.at (%nonassoc and eof): Adjust to newest
19077 Autotest: `.' is not in the PATH.
19078
318b76e9
AD
190792002-01-27 Akim Demaille <akim@epita.fr>
19080
19081 * tests/sets.at (AT_EXTRACT_SETS): New.
19082 (Nullable): Use it.
19083 (Firsts): New.
19084
30d2f3d5
AD
190852002-01-26 Akim Demaille <akim@epita.fr>
19086
19087 * tests/actions.at, tests/calc.at, tests/headers.at,
19088 * tests/torture.at: Adjust to the newest Autotest which no longer
19089 forces `.' in the PATH.
19090
30f8c395
AD
190912002-01-25 Akim Demaille <akim@epita.fr>
19092
19093 * tests/regression.at (%nonassoc and eof): New.
19094 Suggested by Robert Anisko.
19095
29ae55f1
AD
190962002-01-24 Akim Demaille <akim@epita.fr>
19097
19098 Bison dumps core when trying to complain about broken input files.
19099 Reported by Cris van Pelt.
19100
19101 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
19102 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
19103 into...
19104 (Invalid inputs): Strengthen: exercise parse_percent_token.
19105
2b548aa6
RA
191062002-01-24 Robert Anisko <robert.anisko@epita.fr>
19107
19108 * src/Makefile.am: Add bison.c++.
19109 * src/bison.c++: New skeleton.
19110
bb0146c2
AD
191112002-01-21 Paolo Bonzini <bonzini@gnu.org>
19112
19113 * po/it.po: New.
19114
bec30531
AD
191152002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19116
19117 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
19118
fc6edc45
MA
191192002-01-20 Marc Autret <marc@gnu.org>
19120
19121 * src/files.c (compute_output_file_names): Fix
19122
5e5d5415
MA
191232002-01-20 Marc Autret <marc@gnu.org>
19124
19125 * tests/output.at: New test.
19126 * src/files.c (compute_base_names): Don't map extensions when
19127 the YACC flag is set, use defaults.
19128 Reported by Evgeny Stambulchik.
19129
44ea3fbd
MA
191302002-01-20 Marc Autret <marc@gnu.org>
19131
ba0fe3c7
PE
19132 * src/system.h: Need to define __attribute__ away for non-GCC
19133 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
19134 Suggested by Albert Chin-A-Young.
19135
338963d1
TVH
191362002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
19137
19138 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
19139 canonical definition.
19140 * src/system.h: Use the canonical definition for PARAMS (avoids
19141 a conflict with the macro from lib/hash.h).
19142
c57b2479
AD
191432002-01-11 Akim Demaille <akim@epita.fr>
19144
19145 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 19146 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 19147
b85810ae
AD
191482002-01-09 Akim Demaille <akim@epita.fr>
19149
19150 * src/files.c, src/files.h (output_infix): New.
19151 (tab_extension): Remove.
19152 (compute_base_names): Compute the former, drop the latter.
19153 * src/output.c (prepare): Insert the muscles `output-infix', and
19154 `output-suffix'.
19155 * src/parse-skel.y (string, string.1): New.
19156 (section.header): Use it.
19157 (section.yacc): Remove.
19158 (prefix): Remove too.
19159 * src/scan-skel.l: Adjust.
19160 * src/bison.simple, src/bison.hairy: Adjust.
19161
cae60122
AD
191622002-01-09 Akim Demaille <akim@epita.fr>
19163
19164 * configure.in (WERROR_CFLAGS): Compute it.
19165 * src/Makefile.am (CFLAGS): Pass it.
19166 * tests/atlocal.in (CFLAGS): Idem.
19167 * src/files.c: Fix a few warnings.
19168 (get_extension_index): Remove, unused.
19169
ae404801
AD
191702002-01-08 Akim Demaille <akim@epita.fr>
19171
19172 * src/getargs.c (AS_FILE_NAME): New.
19173 (getargs): Use it to convert DOSish file names.
19174 * src/files.c (base_name): Rename as full_base_name to avoid
19175 clashes with `base_name ()'.
19176 (filename_split): New.
19177 (compute_base_names): N-th rewrite, using filename_split.
19178
22312b71
AD
191792002-01-08 Akim Demaille <akim@epita.fr>
19180
19181 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
19182 New, stolen from the Fileutils 4.1.
19183 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19184 * configure.in: Check for the presence of memrchr, and of its
19185 prototype.
19186
a67cef01
TVH
191872002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
19188
19189 * lib/hash.h (__P): Added definition for this macro.
19190 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
19191 BUILT_SOURCES, to ensure they are generated first.
19192 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
19193 %error-verbose to allow bootstrapping with bison 1.30x.
19194
2b25d624
AD
191952002-01-06 Akim Demaille <akim@epita.fr>
19196
19197 * src/reader.c (parse_braces): Don't fetch the next char, the
19198 convention is to fetch on entry.
19199 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
19200 'switch' without a following semicolon.
19201 * tests/regression.at (braces parsing): New.
19202
3460813b
AD
192032002-01-06 Akim Demaille <akim@epita.fr>
19204
19205 Bison is dead wrong in its RR conflict reports.
19206
19207 * tests/torture.at (GNU Cim Grammar): New.
19208 * src/conflicts.c (count_rr_conflicts): Fix.
19209
73784c64
AD
192102002-01-06 Akim Demaille <akim@epita.fr>
19211
19212 Creating package.m4 from configure.ac causes too many problems.
19213
19214 * tests/Makefile.am (package.m4): Create it by hand,
19215 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
19216
25d81090
AD
192172002-01-06 Akim Demaille <akim@epita.fr>
19218
19219 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
19220 skeleton.h.
19221
a9b8959e
PE
192222002-01-04 Paul Eggert <eggert@twinsun.com>
19223
19224 * doc/bison.texinfo (Debugging):
19225 Remove YYSTDERR; it's no longer defined or used.
19226 Also, s/cstdio.h/cstdio/.
19227
25d81090
AD
192282002-01-03 Akim Demaille <akim@epita.fr>
19229
19230 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
19231
1109455c
AD
192322002-01-03 Akim Demaille <akim@epita.fr>
19233
19234 * src/parse-skel.y (process_skeleton): Don't bind the parser's
19235 tracing code to --trace, wait for a better --trace option, with
19236 args.
19237
7ea5e977
AD
192382002-01-03 Akim Demaille <akim@epita.fr>
19239
19240 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
19241 The ISO C++ standard is extremely clear about it: stderr is
19242 considered a macro, not a regular symbol (see table 94 `Header
19243 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
19244 Therefore std:: does not apply to it. It still does with fprintf.
19245 Also, s/cstdio.h/cstdio/.
19246
fab5b110
AD
192472002-01-03 Akim Demaille <akim@epita.fr>
19248
19249 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
19250 for non system headers.
19251
aed7fd9b
AD
192522002-01-02 Akim Demaille <akim@epita.fr>
19253
19254 Equip the skeleton chain with location tracking, runtime trace,
19255 pure parser and scanner.
19256
19257 * src/parse-skel.y: Request a pure parser, locations, and prefix
19258 renaming.
19259 (%union): Having several members with the same type does not help
19260 type mismatches, simplify.
19261 (YYPRINT, yyprint): New.
19262 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
19263 (skel_error): this.
19264 Handle locations.
19265 * src/scan-skel.l: Adjust to these changes.
19266 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
19267 (LOCATION_PRINT, skel_control_t): New.
19268
24fad99e
AD
192692001-12-30 Akim Demaille <akim@epita.fr>
19270
19271 * src/parse-skel.y: Get rid of the shift/reduce conflict:
19272 replace `gb' with BLANKS.
19273 * src/scan-skel.l: Adjust.
19274
a4b36db4
AD
192752001-12-30 Akim Demaille <akim@epita.fr>
19276
19277 * src/system.h: We don't need nor want bcopy.
19278 Throw away MS-DOS crap: we don't need getpid.
19279 * configure.in: We don't need strndup. It was even causing
19280 problems: because Flex includes the headers *before* us,
19281 _GNU_SOURCE is not defined by config.h, and therefore strndup was
19282 not visible.
19283 * lib/xstrndup.c: New.
19284 * src/scan-skel.l: Use it.
19285 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
19286 * src/parse-skel.y: Use %directives instead of #defines.
19287
1239777d
AD
192882001-12-30 Akim Demaille <akim@epita.fr>
19289
19290 * src/skeleton.h: New.
19291 * src/output.c (output_parser, output_master_parser): Remove, dead
19292 code.
19293 * src/output.h (get_lines_number, actions_output, guards_output)
19294 (token_definitions_output): Prototype them.
19295 * src/parse-skel.y: Add the license notice.
19296 Include output.h and skeleton.h.
19297 (process_skeleton): Returns void, and takes a single parameter.
19298 * src/scan-skel.l: Add the license notice.
19299 Include skeleton.h.
19300 Don't use %option yylineno: it seems that then Flex imagines
19301 REJECT has been used, and therefore it won't reallocate its
19302 buffers (which makes no other sense to me than a bug). It results
19303 in warnings for `unused: yy_flex_realloc'.
19304
9b3add5b
RA
193052001-12-30 Robert Anisko <robert.anisko@epita.fr>
19306
19307 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19308 (MUSCLE_INSERT_PREFIX): ...to there.
19309 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19310 (MUSCLE_INSERT_PREFIX): Move from here...
19311
19312 * src/bison.hairy: Add a section directive. Put braces around muscle
19313 names. This parser skeleton is still broken, but Bison should not
19314 choke on a bad muscle 'syntax'.
19315 * src/bison.simple: Add a section directive. Put braces around muscle
19316 names.
19317
19318 * src/files.h (strsuffix, stringappend): Add declarations.
19319 (tab_extension): Add declaration.
19320 (short_base_name): Add declaration.
19321
19322 * src/files.c (strsuffix, stringappend): No longer static. These
19323 functions are used in the skeleton parser.
19324 (tab_extension): New.
19325 (compute_base_names): Use the computations done in this function
fab5b110 19326 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
19327 names.
19328 (short_base_name): No longer static.
19329
19330 * src/output.c (output_skeleton): New.
19331 (output): Disable call to output_master_parser, and give a try to
19332 a new skeleton handling system.
19333 (guards_output, actions_output): No longer static.
19334 (token_definitions_output, get_lines_number): No longer static.
19335
19336 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
19337
fab5b110 19338 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
19339 parse-skel.y.
19340
19341 * src/parse-skel.y: New file.
19342 * src/scan-skel.l: New file.
19343
b5b61c61
AD
193442001-12-29 Akim Demaille <akim@epita.fr>
19345
19346 %name-prefix is broken.
19347
19348 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
19349 Adjust all dependencies.
19350 * tests/headers.at (export YYLTYPE): Strengthen this test: use
19351 %name-prefix.
19352
19353 Renaming yylval but not yylloc is not consistent. Now we do.
19354
19355 * src/bison.simple: Prefix yylloc if used.
19356 * doc/bison.texinfo (Decl Summary): Document that.
19357
8c9a50be
AD
193582001-12-29 Akim Demaille <akim@epita.fr>
19359
19360 * doc/bison.texinfo: Promote `%long-directive' over
19361 `%long_directive'.
19362 Remove all references to fixed-output-files, yacc is enough.
19363
d99361e6
AD
193642001-12-29 Akim Demaille <akim@epita.fr>
19365
19366 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
19367 user prologue. These are defaults.
19368 * tests/actions.at (Mid-rule actions): Make sure the user can
19369 define YYDEBUG and YYERROR_VERBOSE.
19370
b9cecb91
AD
193712001-12-29 Akim Demaille <akim@epita.fr>
19372
19373 * src/output.c (header_output): Don't forget to export YYLTYPE and
19374 yylloc.
19375 * tests/headers.at (export YYLTYPE): New, make sure it does.
19376 * tests/regression.at (%union and --defines, Invalid CPP headers):
19377 Move to...
19378 * tests/headers.at: here.
19379
aea13e97
AD
193802001-12-29 Akim Demaille <akim@epita.fr>
19381
19382 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
19383
931394cb
AD
193842001-12-29 Akim Demaille <akim@epita.fr>
19385
19386 * tests/actions.at (Mid-rule actions): Output on a single line
19387 instead of several.
19388
704a47c4
AD
193892001-12-29 Akim Demaille <akim@epita.fr>
19390
19391 * doc/bison.texinfo: Formatting changes.
19392
091e20bb
AD
193932001-12-29 Akim Demaille <akim@epita.fr>
19394
19395 Don't store the token defs in a muscle, just be ready to output it
19396 on command. Now possible via `symbols'. Fixes a memory leak.
19397
19398 * src/output.c (token_definitions_output): New.
19399 (output_parser, header_output): Use it.
19400 * src/reader.c (symbols_save): Remove.
19401
cce71710
AD
194022001-12-29 Akim Demaille <akim@epita.fr>
19403
19404 * src/bison.simple: Do not provide a default for YYSTYPE and
19405 YYLTYPE before the user's prologue. Otherwise it's hardly... a
19406 default.
19407
82c035a8
AD
194082001-12-29 Akim Demaille <akim@epita.fr>
19409
19410 Mid-rule actions are simply... ignored!
19411
19412 * src/reader.c (readgram): Be sure to attach mid-rule actions to
19413 the empty-rule associated to the dummy symbol, not to the host
19414 rule.
19415 * tests/actions.at (Mid-rule actions): New.
19416
8419d367
AD
194172001-12-29 Akim Demaille <akim@epita.fr>
19418
19419 Memory leak.
19420
19421 * src/reader.c (reader): Free grammar.
19422
375d5806
AD
194232001-12-29 Akim Demaille <akim@epita.fr>
19424
19425 Memory leak.
19426
19427 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19428 since it allocates it for each state, although only one is needed.
19429 (allocate_storage): Do it here.
19430
f51cb8ff
AD
194312001-12-29 Akim Demaille <akim@epita.fr>
19432
19433 * src/options.h, src/options.c (create_long_option_table): Rename
19434 as...
19435 (long_option_table_new): this, with a clearer prototype.
19436 (percent_table): Remove, unused,
19437 * src/getargs.c (getargs): Adjust.
19438
29e88316
AD
194392001-12-29 Akim Demaille <akim@epita.fr>
19440
19441 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19442 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19443 as states.
19444
b9f71f19
AD
194452001-12-29 Akim Demaille <akim@epita.fr>
19446
19447 * src/lalr.c (build_relations): Rename `states' as `states1'.
19448 Sorry, I don't understand exactly what it is, no better name...
19449
1a2b5d37
AD
194502001-12-29 Akim Demaille <akim@epita.fr>
19451
19452 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19453 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19454 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19455 as rules.
19456
1cca533e
AD
194572001-12-29 Akim Demaille <akim@epita.fr>
19458
19459 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19460 ago.
19461
c03ae966
AD
194622001-12-29 Akim Demaille <akim@epita.fr>
19463
19464 * src/reader.c, src/reader.h (user_toknums): Remove.
19465 Adjust all users to use symbols[i]->user_token_number.
19466
5a670b1e
AD
194672001-12-29 Akim Demaille <akim@epita.fr>
19468
19469 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19470 Adjust all users to use symbols[i]->prec or ->assoc.
19471
ad949da9
AD
194722001-12-29 Akim Demaille <akim@epita.fr>
19473
19474 * src/reader.c, src/reader.h (tags): Remove.
19475 Adjust all users to use symbols[i]->tag.
19476
0e78e603
AD
194772001-12-29 Akim Demaille <akim@epita.fr>
19478
19479 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19480 and rule_table.
19481 * src/reader.c (packsymbols): Fill this table.
19482 Drop sprec.
19483 * src/conflicts.c (resolve_sr_conflict): Adjust.
19484 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19485 single table.
19486 Use symbols[i]->tag instead of tags[i].
19487
213e640e
AD
194882001-12-29 Akim Demaille <akim@epita.fr>
19489
19490 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19491 In addition, put a comment in there, to replace...
19492 * tests/regression.at (%union and C comments): Remove.
19493
e7b8bef1
AD
194942001-12-29 Akim Demaille <akim@epita.fr>
19495
19496 * tests/regression.at (Web2c Actions): Blindly move the actual
19497 output as expected output. The contents *seem* right to me, but I
19498 can't pretend reading perfectly parser tables... Nonetheless, all
19499 the other tests pass correctly, the table look OK, even though the
19500 presence of `$axiom' is to be noted: AFAICS it is useless (but
19501 harmless).
19502
b68e7744
AD
195032001-12-29 Akim Demaille <akim@epita.fr>
19504
19505 * src/reader.c (readgram): Don't add the rule 0 if there were no
19506 rules read. In other words, add it _after_ having performed
19507 grammar sanity checks.
19508 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
19509
78d5bae9
AD
195102001-12-29 Akim Demaille <akim@epita.fr>
19511
19512 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
19513 visible, and some states have now a different number.
19514
ff442794
AD
195152001-12-29 Akim Demaille <akim@epita.fr>
19516
19517 * src/reader.c (readgram): Bind the initial rule's lineno to that
19518 of the first rule.
19519 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
19520 (Solved SR Conflicts): Adjust rule 0's line number.
19521
610ab194
AD
195222001-12-29 Akim Demaille <akim@epita.fr>
19523
19524 Fix the `GAWK Grammar' failure.
19525
19526 * src/LR0.c (final_state): Initialize to -1 so that we do compute
19527 the reductions of the first state which was mistakenly confused
19528 with the final state because precisely final_state was initialized
19529 to 0.
19530 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
19531 now noticed by Bison.
19532 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
19533 have a reduction on $default.
19534
29d29c8f
AD
195352001-12-29 Akim Demaille <akim@epita.fr>
19536
19537 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
19538 rule line numbers.
19539 * src/closure.c (print_closure): Likewise.
19540 * src/derives.c (print_derives): Likewise.
19541 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
19542 now.
19543
7c6b64d0
AD
195442001-12-29 Akim Demaille <akim@epita.fr>
19545
19546 * src/lalr.c (lookaheads_print): New.
19547 (lalr): Call it when --trace-flag.
19548 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
19549 are dumped.
19550
3d4daee3
AD
195512001-12-29 Akim Demaille <akim@epita.fr>
19552
19553 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
19554 when walking through ritem, even via rule->rhs.
19555 * src/reduce.c (dump_grammar, useful_production, reduce_output)
19556 (useful_production, useless_nonterminals): Likewise.
19557 (reduce_grammar_tables): Likewise, plus update nritems.
19558 * src/nullable.c (set_nullable): Likewise.
19559 * src/lalr.c (build_relations): Likewise.
19560 * tests/sets.at (Nullable): Adjust.
19561 Fortunately, now, the $axiom is no longer nullable.
19562
9e7f6bbd
AD
195632001-12-29 Akim Demaille <akim@epita.fr>
19564
19565 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
19566 the 0-sentinel.
19567 * src/gram.c (ritem_longest_rhs): Likewise.
19568 * src/reduce.c (nonterminals_reduce): Likewise.
19569 * src/print_graph.c (print_graph): Likewise.
19570 * src/output.c (output_rule_data): Likewise.
19571 * src/nullable.c (set_nullable): Likewise.
19572
255ef638
AD
195732001-12-29 Akim Demaille <akim@epita.fr>
19574
19575 * src/output.c: Comment changes.
19576
0d8a7363
AD
195772001-12-27 Paul Eggert <eggert@twinsun.com>
19578
19579 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
19580 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
19581 Sparc, as they were causing more porting problems than the
19582 (minor) performance improvement was worth.
19583
19584 Also, catch up with 1.31's YYSTD.
19585
3db472b9
AD
195862001-12-27 Akim Demaille <akim@epita.fr>
19587
19588 * src/output.c (output_gram): Rely on nritems, not the
19589 0-sentinel. See below.
19590 Use -1 as separator, not 0.
19591 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
19592 Rely on -1 as separator in yyrhs, instead of 0.
19593 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
19594 twice `Now at end of input', therefore there are two lines less to
19595 expect.
19596
b365aa05
AD
195972001-12-27 Akim Demaille <akim@epita.fr>
19598
19599 * tests/regression.at (Unresolved SR Conflicts):
19600 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
19601 below.
19602
30171f79
AD
196032001-12-27 Akim Demaille <akim@epita.fr>
19604
19605 * src/LR0.c (new_state): Recognize the final state by the fact it
19606 is reached by eoftoken.
19607 (insert_start_shifting_state, insert_eof_shifting_state)
19608 (insert_accepting_state, augment_automaton): Remove, since now
19609 these states are automatically computed from the initial state.
19610 (generate_states): Adjust.
19611 * src/print.c: When reporting a rule number to the user, substract
19612 1, so that the axiom rule is rule 0, and the first user rule is 1.
19613 * src/reduce.c: Likewise.
19614 * src/print_graph.c (print_core): For the time being, just as for
19615 the report, depend upon --trace-flags to dump the full set of
19616 items.
19617 * src/reader.c (readgram): Once the grammar read, insert the rule
19618 0: `$axiom: START-SYMBOL $'.
19619 * tests/set.at: Adjust: rule 0 is now displayed, and since the
19620 number of the states has changed (the final state is no longer
19621 necessarily the last), catch up.
19622
75142d45
AD
196232001-12-27 Akim Demaille <akim@epita.fr>
19624
19625 Try to make the use of the eoftoken valid. Given that its value
19626 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
19627 is used instead of > 0 where appropriate, (ii), depend upon nritems
19628 instead of the 0-sentinel.
19629
19630 * src/gram.h, src/gram.c (nritems): New.
19631 Expected to be duplication of nitems, but for the time being...
19632 * src/reader.c (packgram): Assert nritems and nitems are equal.
19633 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
19634 * src/closure.c (print_closure, print_fderives): Likewise.
19635 * src/gram.c (ritem_print): Likewise.
19636 * src/print.c (print_core, print_grammar): Likewise.
19637 * src/print_graph.c: Likewise.
19638
b7c49edf
AD
196392001-12-27 Akim Demaille <akim@epita.fr>
19640
19641 * src/main.c (main): If there are complains after grammar
19642 reductions, then output the report anyway if requested, then die.
19643 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
19644 * src/reader.c (eoftoken): New.
19645 (parse_token_decl): If the token being defined has value `0', it
19646 is the eoftoken.
19647 (packsymbols): No longer hack `tags' to insert `$' by hand.
19648 Be sure to preserve the value of the eoftoken.
19649 (reader): Make sure eoftoken is defined.
19650 Initialize nsyms to 0: now eoftoken is created just like the others.
19651 * src/print.c (print_grammar): Don't special case the eof token.
19652 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
19653 lie anyway, albeit pleasant.
19654 * tests/calc.at: Exercise error messages with eoftoken.
19655 Change the grammar so that empty input is invalid.
19656 Adjust expectations.
19657 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19658
ec2da99f
AD
196592001-12-27 Akim Demaille <akim@epita.fr>
19660
19661 * configure.in: Check the protos of strchr ans strspn.
19662 Replace strchr if needed.
19663 * src/system.h: Provide the protos of strchr, strspn and memchr if
19664 missing.
19665 * lib/strchr.c: New.
19666 * src/reader.c (symbols_save): Use strchr.
19667
8adfa272
AD
196682001-12-27 Akim Demaille <akim@epita.fr>
19669
19670 * src/print.c, src/print_graph.c (escape): New.
19671 Use it to quote the TAGS outputs.
19672 * src/print_graph.c (print_state): Now errors are in red, and
19673 reductions in green.
19674 Prefer high to wide: output the state number on a line of its own.
19675
80dac38c
AD
196762001-12-27 Akim Demaille <akim@epita.fr>
19677
19678 * src/state.h, src/state.c (reductions_new): New.
19679 * src/LR0.c (set_state_table): Let all the states have a
19680 `reductions', even if reduced to 0.
19681 (save_reductions): Adjust.
19682 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19683 * src/print.c (print_reductions, print_actions): Adjust.
19684 * src/output.c (action_row): Adjust.
19685
2cec70b9
AD
196862001-12-27 Akim Demaille <akim@epita.fr>
19687
19688 * src/state.h, src/state.c (errs_new, errs_dup): New.
19689 * src/LR0.c (set_state_table): Let all the states have an errs,
19690 even if reduced to 0.
19691 * src/print.c (print_errs, print_reductions): Adjust.
19692 * src/output.c (output_actions, action_row): Adjust.
19693 * src/conflicts.c (resolve_sr_conflict): Adjust.
19694
13ca549a
AD
196952001-12-27 Akim Demaille <akim@epita.fr>
19696
19697 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19698
5092aba5
AD
196992001-12-27 Akim Demaille <akim@epita.fr>
19700
19701 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19702 * src/print.c: here.
19703 (lookaheadset, shiftset): New, used as additional storage by
19704 print_reductions.
19705 (print_results): Adjust.
19706 (print_shifts, print_gotos, print_errs): New, extracted from...
19707 (print_actions): here.
19708 * src/print_graph.c (print_actions): Remove dead code.
19709
11e2beca
AD
197102001-12-27 Akim Demaille <akim@epita.fr>
19711
19712 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19713 `$n' and `@n'.
19714
dac3c910
AD
197152001-12-27 Akim Demaille <akim@epita.fr>
19716
19717 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19718 (build_relations): Adjust.
19719
d0b0fefa
AD
197202001-12-27 Akim Demaille <akim@epita.fr>
19721
19722 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19723 duplication.
19724
adc8c848
AD
197252001-12-27 Akim Demaille <akim@epita.fr>
19726
19727 * src/reader.c (packgram): Catch nitems overflows.
19728
14d293ac
AD
197292001-12-27 Akim Demaille <akim@epita.fr>
19730
19731 * src/files.c, src/files.h (guard_obstack): Remove.
19732 * src/output.c (output): Adjust.
19733 * src/reader.c (parse_braces): New, factoring...
19734 (copy_action, copy_guard): these two which are renamed as...
19735 (parse_action, parse_guard): these.
19736 As a voluntary consequence, using braces around guards is now
19737 mandatory.
19738
f499b062
AD
197392001-12-27 Akim Demaille <akim@epita.fr>
19740
19741 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19742 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19743 members.
19744 (symbol_list_new): Adjust.
19745 (copy_action): action_line is the first line, not the last.
19746 (copy_guard): Just as for actions, store the `action' only, not
19747 the switch/case/break flesh.
19748 Don't parse the user action that might follow the guard, let...
19749 (readgram): do it, i.e., now, there can be an action after a
19750 guard.
19751 In other words the guard is just explicitly optional.
19752 (packgram): Adjust.
19753 * src/output.c (guards_output): New.
19754 (output_parser): Call it when needed.
19755 (output): Also free the guard and attrs obstacks.
19756 * src/files.c, src/files.h (obstack_save): Remove.
19757 (output_files): Remove.
19758 As a result, if one needs the former `.act' file, using an
19759 appropriate skeleton which requires actions and guards is now
19760 required.
19761 * src/main.c (main): Adjust.
19762 * tests/semantic.at: New.
19763 * tests/regression.at: Use `input.y' as input file name.
19764 Avoid 8+3 problems by requiring input.c when the test needs the
19765 parser.
19766
d945f5cd
AD
197672001-12-27 Akim Demaille <akim@epita.fr>
19768
19769 * src/reader.c (symbol_list_new): Be sure to initialize all the
19770 fields.
19771
d200e455
AD
197722001-12-27 Akim Demaille <akim@epita.fr>
19773
19774 All the hacks using a final pseudo state are now useless.
19775
19776 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19777 * src/lalr.c (nLA): New.
19778 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19779 instead of lookaheadsp from the pseudo state (nstate + 1).
19780
f9507c28
AD
197812001-12-27 Akim Demaille <akim@epita.fr>
19782
19783 * src/output.c (action_row, token_actions): Use a state_t instead
19784 of a integer, and nlookaheads instead of the following state's
19785 lookaheadsp.
19786
065fbd27
AD
197872001-12-27 Akim Demaille <akim@epita.fr>
19788
19789 * src/conflicts.c (log_resolution, flush_shift)
19790 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19791 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19792 (conflicts_print, print_reductions): Use a state_t instead of an
19793 integer when referring to a state.
19794 As much as possible, depend upon nlookaheads, instead of the
19795 `lookaheadsp' member of the following state (since lookaheads of
19796 successive states are successive, the difference between state n + 1
19797 and n served as the number of lookaheads for state n).
19798 * src/lalr.c (add_lookback_edge): Likewise.
19799 * src/print.c (print_core, print_actions, print_state)
19800 (print_results): Likewise.
19801 * src/print_graph.c (print_core, print_actions, print_state)
19802 (print_graph): Likewise.
19803 * src/conflicts.h: Adjust.
19804
1b177bd7
AD
198052001-12-27 Akim Demaille <akim@epita.fr>
19806
19807 * src/bison.hairy: Formatting/comment changes.
19808 ANSIfy.
19809 Remove `register' indications.
19810 Add plenty of `static'.
19811
7742ddeb
AD
198122001-12-27 Akim Demaille <akim@epita.fr>
19813
19814 * src/output.c (prepare): Drop the muscle `ntbase' which
19815 duplicates ntokens.
19816 * src/bison.simple: Formatting/comment changes.
19817 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19818 is an undocumented synonym.
19819
1fa14068
AD
198202001-12-22 Akim Demaille <akim@epita.fr>
19821
19822 * src/output.c (output_table_data): Change the prototype to use
19823 `int' for array ranges: some invocations do pass an int, not a
19824 short.
19825 Reported by Wayne Green.
19826
b9752825
AD
198272001-12-22 Akim Demaille <akim@epita.fr>
19828
19829 Some actions of web2c.y are improperly triggered.
19830 Reported by Mike Castle.
19831
19832 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19833 * tests/regression.at (Web2c): Rename as...
19834 (Web2c Report): this.
19835 (Web2c Actions): New.
19836
776209d6
AD
198372001-12-22 Akim Demaille <akim@epita.fr>
19838
19839 Reductions in web2c.y are improperly reported.
19840 Reported by Mike Castle.
19841
19842 * src/conflicts.c (print_reductions): Fix.
19843 * tests/regression.at (Web2c): New.
19844
275fc3ad
AD
198452001-12-18 Akim Demaille <akim@epita.fr>
19846
19847 Some host fail on `assert (!"foo")', which expands to
19848 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19849 Reported by Nelson Beebee.
19850
19851 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
19852 `#define it_succeeded 0' and `assert (it_succeeded)'.
19853
897668ee
MA
198542001-12-17 Marc Autret <autret_m@epita.fr>
19855
19856 * src/bison.simple: Don't hard code the skeleton line and filename.
19857 * src/output.c (output_parser): Rename 'line' as 'output_line'.
19858 New line counter 'skeleton_line' (skeleton-line muscle).
19859
ab3399e0
PE
198602001-12-17 Paul Eggert <eggert@twinsun.com>
19861
19862 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
19863 YYDEBUG must be defined to a nonzero value.
19864
19865 * src/bison.simple (yytname): Do not assume that the user defines
19866 YYDEBUG to a properly parenthesized expression.
19867
3877f72b
AD
198682001-12-17 Akim Demaille <akim@epita.fr>
19869
19870 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
19871 nlookaheads is a new member.
19872 Adjust all users.
19873 * src/lalr.h (nlookaheads): Remove this orphan declaration.
19874 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
19875 state.
776209d6 19876
331dbc1b
AD
198772001-12-17 Akim Demaille <akim@epita.fr>
19878
19879 * src/files.h, src/files.c (open_files, close_files): Remove.
19880 * src/main.c (main): Don't open/close files, nor invoke lex_free,
19881 let...
19882 * src/reader.c (reader): Do it.
776209d6 19883
be750e4c
AD
198842001-12-17 Akim Demaille <akim@epita.fr>
19885
19886 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 19887
709ae8c6
AD
198882001-12-17 Akim Demaille <akim@epita.fr>
19889
19890 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
19891 (flush_reduce): New.
19892 (resolve_sr_conflict): Adjust.
776209d6 19893
f87685c3
AD
198942001-12-17 Akim Demaille <akim@epita.fr>
19895
19896 * src/output.c (output_obstack): Be static and rename as...
19897 (format_obstack): this, to avoid any confusion with files.c's
19898 output_obstack.
19899 * src/reader.h (muscle_obstack): Move to...
19900 * src/output.h: here, since it's defined in output.c.
19901
837491d8
AD
199022001-12-17 Akim Demaille <akim@epita.fr>
19903
19904 * src/output.c (action_row, save_column, default_goto)
19905 (sort_actions, matching_state, pack_vector): Better variable
19906 locality.
19907
796d61fb
AD
199082001-12-17 Akim Demaille <akim@epita.fr>
19909
19910 * src/output.c: Various formatting changes.
776209d6 19911
64d15509
AD
199122001-12-17 Akim Demaille <akim@epita.fr>
19913
19914 * src/files.c (output_files): Free the output_obstack.
19915 * src/main.c (main): Call print and print_graph conditionally.
19916 * src/print.c (print): Work unconditionally.
19917 * src/print_graph.c (print_graph): Work unconditionally.
19918 * src/conflicts.c (log_resolution): Output only if verbose_flag.
19919
fbc8ecb7
MA
199202001-12-16 Marc Autret <autret_m@epita.fr>
19921
19922 * src/output.c (actions_output): Fix. When we use %no-lines,
19923 there is one less line per action.
19924
f0440388
MA
199252001-12-16 Marc Autret <autret_m@epita.fr>
19926
19927 * src/bison.simple: Remove a useless #line directive.
19928 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
19929 * src/output.c (get_lines_number): New.
776209d6 19930 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
19931 output muscles.
19932 Fix line numbering.
19933 (actions_output): Computes the number of lines taken by actions.
19934 (output_master_parser): Insert new skeleton which is the name of
19935 the output parser file name.
19936
a79986b8
MA
199372001-12-15 Marc Autret <autret_m@epita.fr>
19938
19939 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
19940
4ec8e00f
MA
199412001-12-15 Marc Autret <autret_m@epita.fr>
19942
19943 * src/output.c (output_gram): Keep track of the hairy one.
19944
1a4648ff
AD
199452001-12-15 Akim Demaille <akim@epita.fr>
19946
19947 Make `make distcheck' work.
19948
19949 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
19950 system.h which uses libgettext.h.
19951
9c2c67e6
AD
199522001-12-15 Akim Demaille <akim@epita.fr>
19953
19954 * src/nullable.c (set_nullable): Useless rules must be skipped,
19955 otherwise, since we range over their symbols, we might look at a
19956 nonterminal which no longer ``exists'', i.e., it is not counted in
19957 `nvars', hence we overflow our arrays.
19958
93ede233
AD
199592001-12-15 Akim Demaille <akim@epita.fr>
19960
19961 The header can also be produced directly, without any obstack!
19962 Yahoo!
19963
19964 * src/files.c, src/files.h (defines_obstack): Remove.
19965 (compute_header_macro): Global.
19966 (defines_obstack_save): Remove.
19967 * src/reader.c (parse_union_decl): No longer output to
19968 defines_obstack: its content can be found in the `stype' muscle
19969 anyway.
19970 (output_token_translations): Merge into...
19971 (symbols_output): this.
19972 Rename as...
19973 (symbols_save): this.
19974 (reader): Adjust.
19975 * src/output.c (header_output): New.
19976 (output): Call it.
19977
2666f928
AD
199782001-12-15 Akim Demaille <akim@epita.fr>
19979
19980 * src/reader.c (parse_union_decl): Instead of handling two obstack
19981 simultaneously, use one to define the `stype' muscle, and use the
19982 value of the latter to fill defines_obstack.
19983 (copy_comment): Remove.
19984 (copy_comment2): Work for a single obstack.
19985 Rename as...
19986 (copy_comment): this.
19987
428046f8
AD
199882001-12-15 Akim Demaille <akim@epita.fr>
19989
19990 * src/lex.c, src/lex.h (xgetc): No longer static.
19991 * src/reader.c (parse_union_decl): Revamp.
19992
ea52d706
AD
199932001-12-15 Akim Demaille <akim@epita.fr>
19994
19995 Still making progress in separating Bison into (i) input, (ii)
19996 process, (iii) output: now we can directly output the parser file
19997 without using table_obstack at all.
19998
19999 * src/files.c, src/files.h (table_obstack): Bye bye.
20000 (parser_file_name): New.
20001 * src/files.c (compute_output_file_names): Compute it.
20002 * src/output.c (actions_output, output_parser)
20003 (output_master_parser): To a file instead of an obstack.
20004
3f96f4dc
AD
200052001-12-15 Akim Demaille <akim@epita.fr>
20006
20007 Attach actions to rules, instead of pre-outputting them to
20008 actions_obstack.
20009
20010 * src/gram.h (rule_t): action and action_line are new members.
20011 * src/reader.c (symbol_list): Likewise.
20012 (copy_action): Save the actions within the rule.
20013 (packgram): Save them in rule_table.
20014 * src/output.c (actions_output): New.
20015 (output_parser): Use it on `%%actions'.
20016 (output_rule_data): Don't free rule_table.
20017 (output): Do it.
20018 (prepare): Don't save the `action' muscle.
20019 * src/bison.simple: s/%%action/%%actions/.
20020
51576fb3
AD
200212001-12-15 Akim Demaille <akim@epita.fr>
20022
20023 * src/reader.c (copy_action): When --yacc, don't append a `;'
20024 to the user action: let it fail if lacking.
dee049eb 20025 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 20026
2648a72d
AD
200272001-12-14 Akim Demaille <akim@epita.fr>
20028
20029 * src/lex.c (literalchar): Simply return the char you decoded, non
20030 longer mess around with obstacks and int pointers.
20031 Adjust all callers.
20032
92790e5b
AD
200332001-12-14 Akim Demaille <akim@epita.fr>
20034
20035 * src/lex.c (literalchar): Don't escape the special characters,
20036 just decode them, and keep them as char (before, eol was output as
20037 the 2 char string `\n' etc.).
20038 * src/output.c (output_rule_data): Use quotearg to output the
20039 token strings.
20040
927c1557
PE
200412001-12-13 Paul Eggert <eggert@twinsun.com>
20042
20043 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20044 Do not infringe on the global user namespace when using C++.
20045 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20046 All uses of `fprintf' and `stderr' changed.
20047
20048 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20049
ed8e1f68
AD
200502001-12-13 Akim Demaille <akim@epita.fr>
20051
20052 The computation of nullable is broken: it doesn't handle empty
20053 RHS's properly.
20054
20055 * tests/torture.at (GNU AWK Grammar): New.
20056 * tests/sets.at (Nullable): New.
20057 * src/nullable.c (set_nullable): Instead of blindly looping over
20058 `ritems', loop over the rules, and then over their rhs's.
20059
20060 Work around Autotest bugs.
20061
20062 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20063 frame, because Autotest understand lines starting with a `+' as
20064 traces from the shell. Then, they are not processed properly.
20065 Admittedly an Autotest bug, but we don't have time to wait for
20066 Autotest to catch up.
20067 * tests/regression.at (Broken Closure): Adjust to the new table
20068 frames.
20069 Move to...
20070 * tests/sets.at: here.
20071
cb581495
AD
200722001-12-13 Akim Demaille <akim@epita.fr>
20073
20074 * src/closure.c (closure): Use nrules instead of playing tricks
20075 with BITS_PER_WORD.
20076
2e729273
AD
200772001-12-13 Akim Demaille <akim@epita.fr>
20078
20079 * src/print.c (print_actions): Output the handling of `$' as the
20080 traces do: shifting the token EOF. Before EOF was treated as a
20081 nonterminal.
20082 * tests/regression.at: Adjust some tests.
20083 * src/print_graph.c (print_core): Complete the set of items via
20084 closure. The next-to-final and final states are still unsatisfying,
20085 but that's to be addressed elsewhere.
20086 No longer output the rule numbers, but do output the state number.
20087 A single loop for the shifts + gotos is enough, but picked a
20088 distinct color for each.
20089 (print_graph): Initialize and finalize closure.
20090
107f7dfb
AD
200912001-12-13 Akim Demaille <akim@epita.fr>
20092
20093 * src/reader.c (readgram): Remove dead code, an strip useless
20094 braces.
20095 (get_type): Remove, unused.
20096
9b53a24f
AD
200972001-12-12 Akim Demaille <akim@epita.fr>
20098
20099 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
20100 on that of lib/error.c.
20101
dbfb6dcd
AD
201022001-12-12 Akim Demaille <akim@epita.fr>
20103
20104 Some hosts don't like `/' in includes.
20105
20106 * src/system.h: Include libgettext.h without qualifying the path.
20107 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20108 $(top_srcdir).
20109
c25fb648
MA
201102001-12-11 Marc Autret <autret_m@epita.fr>
20111
20112 * src/output.c (output_parser): Remove useless muscle.
20113
710ddc4f
MA
201142001-12-11 Marc Autret <autret_m@epita.fr>
20115
20116 * src/bison.simple: Remove #line just before %%epilogue. It
20117 is now handled in ...
20118 * src/reader.c (read_additionnal_code): Add the output of a
20119 #line for the epilogue.
20120
e83d80b8
MA
201212001-12-10 Marc Autret <autret_m@epita.fr>
20122
927c1557 20123 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
20124 replace precedent remove.
20125 * src/bison.simple: Remove #line before %%prologue because
20126 %%input-line is wrong at this time.
20127
971d5158
MA
201282001-12-10 Marc Autret <autret_m@epita.fr>
20129
20130 * src/reader.c (symbols_output): Clean up.
927c1557 20131 * src/output.c (output_gram, output): Clean up.
971d5158 20132
5edafffd
AD
201332001-12-10 Akim Demaille <akim@epita.fr>
20134
20135 * src/lalr.c (initialize_lookaheads): New. Extracted from...
20136 * src/LR0.c (set_state_table): here.
20137 * src/lalr.c (lalr): Call it.
20138
0279f8e9
AD
201392001-12-10 Akim Demaille <akim@epita.fr>
20140
20141 * src/state.h (shifts): Remove the `number' member: shifts are
20142 attached to state, hence no longer need to be labelled with a
20143 state number.
20144
190c4f5f
AD
201452001-12-10 Akim Demaille <akim@epita.fr>
20146
20147 Now that states have a complete set of members, the linked list of
20148 shifts is useless: just fill directly the state's shifts member.
20149
20150 * src/state.h (shifts): Remove the `next' member.
20151 * src/LR0.c (first_state, last_state): Remove.
20152 Adjust the callers.
20153 (augment_automaton): Don't look for the shifts that must be added
20154 a shift on EOF: it is those of the state we looked for! But now,
20155 since shifts are attached, it is no longer needed to looking
20156 merely by its id: its number.
20157
2a73b93d
AD
201582001-12-10 Akim Demaille <akim@epita.fr>
20159
20160 * src/LR0.c (augment_automaton): Better variable locality.
20161 Remove an impossible branch: if there is a state corresponding to
20162 the start symbol being shifted, then there is shift for the start
20163 symbol from the initial state.
20164
74392f6a
AD
201652001-12-10 Akim Demaille <akim@epita.fr>
20166
20167 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
20168 only when appropriate: when insert_start_shifting_state' is not
20169 invoked.
20170 * tests/regression.at (Rule Line Numbers): Adjust.
20171
37c82725
AD
201722001-12-10 Akim Demaille <akim@epita.fr>
20173
20174 * src/LR0.c (augment_automaton): Now that all states have shifts,
20175 merge the two cases addition shifts to the initial state.
20176
6a164e0c
AD
201772001-12-10 Akim Demaille <akim@epita.fr>
20178
20179 * src/lalr.c (set_state_table): Move to...
20180 * src/LR0.c: here.
20181 * src/lalr.c (lalr): Don't call it...
20182 * src/LR0.c (generate_states): do it.
20183 * src/LR0.h (first_state): Remove, only the table is used.
20184
7215de24
AD
201852001-12-10 Akim Demaille <akim@epita.fr>
20186
20187 * src/LR0.h (first_shift, first_reduction): Remove.
20188 * src/lalr.c: Don't use first_shift: find shifts through the
20189 states.
20190
80e25d4d
AD
201912001-12-10 Akim Demaille <akim@epita.fr>
20192
20193 * src/LR0.c: Attach shifts to states as soon as they are
20194 computed.
20195 * src/lalr.c (set_state_table): Instead of assigning shifts to
20196 state, just assert that the mapping was properly done.
20197
0ab3728b
AD
201982001-12-10 Akim Demaille <akim@epita.fr>
20199
20200 * src/LR0.c (insert_start_shift): Rename as...
20201 (insert_start_shifting_state): this.
20202 (insert_eof_shifting_state, insert_accepting_state): New.
20203 (augment_automaton): Adjust.
20204 Better locality of the variables.
20205 When looking if the start_symbol is shifted from the initial
20206 state, using `while (... symbol != start_symbol ...)' sounds
20207 better than `while (... symbol < start_symbol ...)': If fail
20208 to see how the order between symbols could be relevant!
20209
78af9bbc
AD
202102001-12-10 Akim Demaille <akim@epita.fr>
20211
20212 * src/getargs.h: Don't declare `spec_name_prefix' and
20213 `spec_file_prefix', declared by src/files.h.
20214 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
20215 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
20216 * src/output.c (prepare): Adjust.
20217 * src/reader.c (symbols_output): Likewise.
20218 * src/vmsgetargs.c: Vaguely adjust, but who cares?
20219
bdef2a41
AD
202202001-12-10 Akim Demaille <akim@epita.fr>
20221
20222 * src/muscle_tab.c (muscle_init): NULL is a better default than
20223 `"0"'.
20224
3735969c
AD
202252001-12-10 Akim Demaille <akim@epita.fr>
20226
20227 * src/reader.c (reader): Calling symbols_output once is enough.
20228
49701457
AD
202292001-12-10 Akim Demaille <akim@epita.fr>
20230
20231 Now that states have a complete set of members, the linked list of
20232 reductions is useless: just fill directly the state's reductions
20233 member.
20234
20235 * src/state.h (struct reductions): Remove member `number' and
20236 `next'.
20237 * src/LR0.c (first_reduction, last_reduction): Remove.
20238 (save_reductions): Don't link the new reductions, store them in
20239 this_state.
20240 * src/lalr.c (set_state_table): No need to attach reductions to
20241 states, it's already done.
20242 * src/output.c (output_actions): No longer free the shifts, then
20243 the reductions, then the states: free all the states and their
20244 members.
20245
0edad749
AD
202462001-12-10 Akim Demaille <akim@epita.fr>
20247
20248 * src/options.c (OPTN, DRTV, BOTH): New.
20249 (option_table): Use them.
20250
0edad749
AD
20251 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
20252 the job of system.h.
20253 * src/options.c: Don't include stdio.h and xalloc.h for the same
20254 reasons.
20255
5449dd0f
AD
202562001-12-10 Akim Demaille <akim@epita.fr>
20257
20258 * src/output.c (output, prepare): Make sure the values of the
20259 muscles `action' and `prologue' are 0-terminated.
20260
a870c567
AD
202612001-12-10 Akim Demaille <akim@epita.fr>
20262
20263 Clean up GCC warnings.
20264
20265 * src/reader.c (copy_action): `buf' is not used.
20266 (parse_skel_decl): Be static.
20267 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
20268 * src/options.h (create_long_option_table): Have a real prototype.
20269 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
20270 (hash_delete_at): Return const void *.
20271 Adjust casts to preserve the const.
20272
80df8768
AD
202732001-12-10 Akim Demaille <akim@epita.fr>
20274
20275 * configure.in: Require 2.52g.
20276 M4 is not needed, but AUTOM4TE is.
20277 * m4/m4.m4: Remove.
20278 * tests/Makefile.am: Adjust.
20279
f693ad14
AD
202802001-12-10 Akim Demaille <akim@epita.fr>
20281
20282 One structure for states is enough, even though theoretically
20283 there are LR(0) states and LALR(1) states.
20284
20285 * src/lalr.h (state_t): Remove.
20286 (state_table): Be state_t **, not state_t *.
20287 * src/state.h (core, CORE_ALLOC): Rename as...
20288 (state_t, STATE_ALLOC): this.
20289 Add the LALR(1) members: shifts, reductions, errs.
20290 * src/LR0.c (state_table): Rename as...
20291 (state_hash): this, to avoid name clashes with the global
20292 `state_table'.
20293 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
20294 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
20295
74ffbcb6
AD
202962001-12-10 Akim Demaille <akim@epita.fr>
20297
20298 Bison dumps core on bash.y.
20299 Reported by Pascal Bart.
20300
20301 * src/warshall.c (bitmatrix_print): New.
20302 (TC): Use it.
ba0fe3c7 20303 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
20304 j must be the outer loop.
20305 * tests/regression.at (Broken Closure): New.
20306
07708e19
AD
203072001-12-05 Akim Demaille <akim@epita.fr>
20308
20309 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
20310 its argument.
ba1ecc07 20311 Reported by Peter Hamorsky.
07708e19 20312
92b16366
AD
203132001-12-05 Akim Demaille <akim@epita.fr>
20314
20315 * src/conflicts.c (err_table): Remove.
20316 (resolve_sr_conflict): Adjust.
20317 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
20318 Rename as...
20319 (state_t.reductions, state_t.shifts): this.
20320
076ab033
AD
203212001-12-05 Akim Demaille <akim@epita.fr>
20322
20323 * src/reduce.c (reduce_grammar_tables): No longer disable the
20324 removal of useless rules via CPP but via `if (0)', so that the
20325 compiler still check the code is valid.
20326 For instance, it should have noticed `rline' no longer exists: use
20327 the `line' member of rule_t.
20328 * src/gram.c (dummy, rline): Remove, unused.
20329
3843c413
AD
203302001-12-05 Akim Demaille <akim@epita.fr>
20331
20332 * src/output.c (pack_vector): Use assert, not berror.
20333 * src/main.c (berror): Remove, unused.
20334
43168960
AD
203352001-12-05 Akim Demaille <akim@epita.fr>
20336
20337 New experimental feature: if --verbose --trace output all the
20338 items of a state, not only its kernel.
20339
20340 * src/print.c (print_core): If `trace_flag', then invoke closure
20341 before outputting the items of the state (print_core is no longer
20342 a correct name them).
20343 (print_results): Invoke new_closure/free_closure if needed.
20344
b2872512
AD
203452001-12-05 Akim Demaille <akim@epita.fr>
20346
20347 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
20348 * src/closure.c, src/closure.h (itemsetsize): Rename as...
20349 (nitemset): for consistency with the rest of the project.
20350
23cbcc6c
AD
203512001-12-05 Akim Demaille <akim@epita.fr>
20352
20353 * src/closure.c (print_closure): Improve.
20354 (closure): Use it for printing input and output.
20355
03ec521c
AD
203562001-12-05 Akim Demaille <akim@epita.fr>
20357
20358 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
20359 indexed by nonterminals.
20360
3a7456dd
AD
203612001-12-05 Akim Demaille <akim@epita.fr>
20362
20363 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
20364 what it was!).
20365 * src/warshall.h: Remove accidental duplication of the content.
20366
1cbcf2e7
AD
203672001-12-05 Akim Demaille <akim@epita.fr>
20368
20369 * src/closure.c (set_fderives): De-obfuscate.
20370
84182270
AD
203712001-12-05 Akim Demaille <akim@epita.fr>
20372
20373 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
20374
3f6f053c
AD
203752001-12-05 Akim Demaille <akim@epita.fr>
20376
20377 * src/closure.c (set_firsts): De-obfuscate.
20378
7a5350ba
AD
203792001-12-05 Akim Demaille <akim@epita.fr>
20380
20381 * src/output.c (action_row): De-obfuscate
20382 using the good o' techniques: arrays not pointers, variable
20383 locality, BITISSET, RESETBIT etc.
20384
d954473d
AD
203852001-12-05 Akim Demaille <akim@epita.fr>
20386
20387 Pessimize the code to simplify it: from now on, all the states
20388 have a valid SHIFTS, which NSHIFTS is possibly 0.
20389
20390 * src/LR0.c (shifts_new): Be global and move to..
20391 * src/state.c, src/state.h: here.
20392 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
20393 * src/print_graph: Adjust.
20394
9839bbe5
AD
203952001-12-05 Akim Demaille <akim@epita.fr>
20396
20397 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
20398 * src/conflicts.c: Use it.
20399 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
20400 incorrectly ``simplified''.
20401
9f136c07
AD
204022001-12-05 Akim Demaille <akim@epita.fr>
20403
20404 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
20405 using the good o' techniques: arrays not pointers, variable
20406 locality, BITISSET, RESETBIT etc.
20407
b608206e
AD
204082001-12-05 Akim Demaille <akim@epita.fr>
20409
20410 * src/state.h (SHIFT_SYMBOL): New.
20411 * src/conflicts.c: Use it to deobfuscate.
20412
52afa962
AD
204132001-12-05 Akim Demaille <akim@epita.fr>
20414
20415 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
20416 (print_reductions): De-obfuscate using the good o' techniques:
20417 arrays not pointers, variable locality, BITISSET.
20418
e74dc321
AD
204192001-12-05 Akim Demaille <akim@epita.fr>
20420
20421 * src/conflicts.c (print_reductions): Arrays, not pointers.
20422 Use BITISSET.
20423
768fca83
AD
204242001-12-05 Akim Demaille <akim@epita.fr>
20425
20426 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20427
a17e599f
AD
204282001-12-05 Akim Demaille <akim@epita.fr>
20429
20430 * src/conflicts.c (print_reductions): Improve variable locality.
20431
a04bc341
AD
204322001-12-05 Akim Demaille <akim@epita.fr>
20433
20434 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20435
c8ea038e
AD
204362001-12-05 Akim Demaille <akim@epita.fr>
20437
20438 * src/conflicts.c (print_reductions): Improve variable locality.
20439
aa2aab3c
AD
204402001-12-05 Akim Demaille <akim@epita.fr>
20441
20442 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20443 * src/lalr.c: Use them.
20444
b178c8cc
AD
204452001-12-05 Akim Demaille <akim@epita.fr>
20446
20447 * src/LR0.c (augment_automaton): Formatting changes.
20448 Better variable locality.
20449
f67d13aa
AD
204502001-12-05 Akim Demaille <akim@epita.fr>
20451
20452 * src/lalr.c (matrix_print): New.
20453 (transpose): Use it.
20454 Use arrays instead of pointers.
20455
c2713865
AD
204562001-12-05 Akim Demaille <akim@epita.fr>
20457
20458 * src/lalr.c (maxrhs): Move to...
20459 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20460 * src/lalr.c (build_relations): Adjust.
20461
9887c18a
AD
204622001-12-05 Akim Demaille <akim@epita.fr>
20463
20464 * src/lalr.c (transpose): Free the memory allocated to the
20465 argument, as it is replaced by the results by the unique caller.
20466 (build_relations): Merely invoke transpose: it handles the memory
20467 deallocation.
20468 Improve variable locality.
20469 Avoid variables used as mere abbreviations.
20470 (compute_lookaheads): Use arrays instead of pointers.
20471
4d4f699c
AD
204722001-12-05 Akim Demaille <akim@epita.fr>
20473
20474 * src/lalr.c (initialize_F): Improve variable locality.
20475 Avoid variables used as mere abbreviations.
20476
80a69750
AD
204772001-12-05 Akim Demaille <akim@epita.fr>
20478
20479 * src/derives.c (print_derives): Display the ruleno.
20480 * src/lalr.c (initialize_F, transpose): Better variable locality
20481 to improve readability.
20482 Avoid variables used as mere abbreviations.
20483
fe961097
AD
204842001-12-05 Akim Demaille <akim@epita.fr>
20485
20486 * src/lalr.c (traverse): Use arrays instead of pointers.
20487
e3e4e814
AD
204882001-12-05 Akim Demaille <akim@epita.fr>
20489
20490 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20491 the handling of squeue.
20492 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20493
630e182b
AD
204942001-12-05 Akim Demaille <akim@epita.fr>
20495
20496 Because useless nonterminals are now kept alive (instead of being
20497 `destroyed'), we now sometimes examine them, and store information
20498 related to them. Hence we need to know their number, and adjust
20499 memory allocations.
20500
20501 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20502 static.
20503 * src/LR0.c (allocate_itemsets): The memory allocated to
20504 `symbol_count' was used for two different purpose: once to count
20505 the number of occurrences of each symbol, and later reassigned to
20506 `shift_symbol', containing the symbol that can be shifted from a
20507 given state.
20508 Deobfuscate, i.e., allocate, use and free `symbol_count' here
20509 only, and...
20510 (new_itemsets): Allocate `shift_symbol' here.
20511 (allocate_itemsets): symbol_count includes useless nonterminals.
20512 Make room for them.
20513 (free_storage): Use `free', not `XFREE', for pointers that cannot
20514 be null.
20515
81b51460
AD
205162001-12-05 Akim Demaille <akim@epita.fr>
20517
20518 * src/nullable.c (set_nullable): Deobfuscate the handling of
20519 ritem.
20520 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20521
3067fbef
AD
205222001-12-05 Akim Demaille <akim@epita.fr>
20523
20524 * src/gram.c, src/gram.h (ritem_print): New.
20525 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
20526 (This useless function was defined only to work around VMS linkers
20527 that can't handle compilation units with variables only).
20528 * src/reduce.c (dump_grammar): Use it to trace the construction of
20529 ritem.
20530
c2bea5f9
PE
205312001-12-04 Paul Eggert <eggert@twinsun.com>
20532
7d27c823
PE
20533 * src/bison.simple (union yyalloc): Change member names
20534 to be the same as the stack names.
20535 (yyparse): yyptr is now union yyalloc *, not char *.
20536 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
20537 and may generate better code on some machines.
c2bea5f9
PE
20538 (yystpcpy): Use prototype if __STDC__ is defined, not just
20539 if __cplusplus is defined.
35687a9d 20540
2c8a9dfa
AD
205412001-11-30 Akim Demaille <akim@epita.fr>
20542
20543 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
20544 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
20545 Gettext doesn't compile cleanly, and dies with -Werror.
20546 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
20547 Include WARNING_CFLAGS here.
20548 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
20549 before being defined.
20550
f4e421e6
AD
205512001-11-27 Paul Eggert <eggert@twinsun.com>
20552
20553 * lib/quotearg.h (quotearg_n, quotearg_n_style):
20554 First arg is int, not unsigned.
20555 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
20556 (SIZE_MAX, UINT_MAX): New macros.
20557 (quotearg_n_options): Abort if N is negative.
20558 Avoid overflow check on hosts where size_t is 64 bits and int
20559 is 32 bits, as overflow is impossible there.
20560 Fix off-by-one typo that caused unnecessary reallocation.
20561
7093d0f5
AD
205622001-11-29 Paul Eggert <eggert@twinsun.com>
20563
20564 Name space cleanup in generated parser.
20565
20566 * doc/bison.texinfo (Bison Parser): Discuss system headers
20567 and their effect on the user name space.
20568
20569 * src/bison.simple:
20570 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
20571 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
20572 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
20573
20574 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
20575 on user names when possible.
20576
20577 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
20578 Simplify test for whather <alloca.h> exists.
20579
20580 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
20581
20582 (<stdio.h>): Include if YYDEBUG.
20583
20584 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
20585 ! defined (yyoverflow) && ! defined (yymemcpy).
20586
20587 (yymemcpy, yyparse): Rename local variables as needed so that
20588 they all begin with 'yy'.
20589
20590 (yystrlen, yystpcpy): New functions.
20591
20592 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
20593 All uses changed.
20594
20595 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
20596 instead of relying on string.h functions. Use YYSTACK_ALLOC
20597 and YYSTACK_FREE instead of malloc and free.
20598
fd51e5ff
AD
205992001-11-30 Akim Demaille <akim@epita.fr>
20600
20601 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
20602 before their first uses.
20603 (YYBISON, YYPURE): Move to the top of the output.
20604
7d13ff5f
AD
206052001-11-30 Akim Demaille <akim@epita.fr>
20606
20607 * tests/reduce.at (Useless Nonterminals): Fix.
20608
892a3995
AD
206092001-11-30 Akim Demaille <akim@epita.fr>
20610
20611 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
20612 if body instead of `;' to pacify GCC's warnings.
20613
68f1e3ed
AD
206142001-11-30 Akim Demaille <akim@epita.fr>
20615
20616 Instead of mapping the LHS of unused rules to -1, keep the LHS
20617 valid, but flag the rules as invalid.
20618
20619 * src/gram.h (rule_t): `useful' is a new member.
20620 * src/print.c (print_grammar): Adjust.
20621 * src/derives.c (set_derives): Likewise.
20622 * src/reader.c (packgram, reduce_output): Likewise.
20623 * src/reduce.c (reduce_grammar_tables): Likewise.
20624 * tests/reduce.at (Underivable Rules, Useless Rules): New.
20625
d2d1b42b
AD
206262001-11-30 Akim Demaille <akim@epita.fr>
20627
20628 * src/reduce.c (reduce_output): Formatting changes.
20629 * src/print.c (print_results, print_grammar): Likewise.
20630 * tests/regression.at (Rule Line Numbers)
20631 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
20632
760b53a8
AD
206332001-11-30 Akim Demaille <akim@epita.fr>
20634
20635 * src/reduce.c (nonterminals_reduce): Instead of throwing away
20636 useless nonterminals, move them at the end of the symbol arrays.
20637 (reduce_output): Adjust.
20638 * tests/reduce.at (Useless Nonterminals): Adjust.
20639
00238958
AD
206402001-11-30 Akim Demaille <akim@epita.fr>
20641
20642 * src/reduce.c: Various comment/formatting changes.
20643 (nonterminals_reduce): New, extracted from...
20644 (reduce_grammar_tables): here.
20645 (reduce_grammar): Call nonterminals_reduce.
20646
396452de
PE
206472001-11-29 Paul Eggert <eggert@twinsun.com>
20648
20649 * src/bison.simple (YYSTACK_REALLOC): Remove.
20650 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
20651 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
20652 New macros.
20653 (union yyalloc): New type.
20654 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
20655 an arbitrary restriction on hosts where size_t is wider than int.
20656
20657 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20658 a parser stack overflow. Allocate just one block of memory for all
20659 three stacks, instead of allocating three blocks; this typically is
20660 faster and reduces fragmentation.
20661
20662 Do not limit the number of items in the stack to a value that fits
20663 in 'int', as this is an arbitrary limit on hosts with 64-bit
20664 size_t and 32-bit int.
20665
147e184c
MA
206662001-11-29 Marc Autret <autret_m@epita.fr>
20667
20668 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20669 of defining YYERROR_VERBOSE.
20670 [AT_DATA]: $4 is now out of C declarations in the prologue.
20671
426cf563
MA
206722001-11-28 Marc Autret <autret_m@epita.fr>
20673
20674 * src/reader.c (parse_dquoted_param): New.
20675 (parse_skel_decl): Use it.
20676 * src/lex.h: Add its prototype.
20677 * src/lex.c (literalchar): Become not static.
20678
c7925b99
MA
206792001-11-28 Marc Autret <autret_m@epita.fr>
20680
20681 * src/output.h: And put its extern declaration here.
20682 * src/output.c (error_verbose): Define here.
20683 (prepare): Echo name modification.
20684 * src/getargs.h: Clean its extern declaration.
20685 * src/getargs.c (error_verbose_flag): Remove.
20686 (getargs): Remove case 'e'.
20687 * src/options.c (option_table): 'error-verbose' is now seen as simple
20688 percent option.
20689 Include output.h.
20690
20691 * src/reader.c (read_declarations): Remove case tok_include.
20692 (parse_include_decl): Remove.
20693 * src/lex.h (token_t): Remove tok_include.
20694 * src/options.c (option_table): 'include' is now a simple command line
20695 option.
20696
5b5d1929
MA
206972001-11-28 Marc Autret <autret_m@epita.fr>
20698
20699 * src/bison.simple: Adjust muscle names.
20700 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20701 * src/output.c (prepare): s/_/-/ for the muscles names.
20702 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20703
8850be4b
MA
207042001-11-28 Marc Autret <autret_m@epita.fr>
20705
20706 * src/bison.simple: Fix debug.
20707 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20708
4a38e613
AD
207092001-11-28 Akim Demaille <akim@epita.fr>
20710
20711 * src/LR0.c (shifts_new): New.
20712 (save_shifts, insert_start_shift, augment_automaton): Use it.
20713
4b35e1c1
AD
207142001-11-28 Akim Demaille <akim@epita.fr>
20715
20716 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20717 keep ruleno only.
20718
d2b04478
AD
207192001-11-28 Akim Demaille <akim@epita.fr>
20720
20721 * src/closure.c (closure): Instead of looping over word in array
20722 then bits in words, loop over bits in array.
20723
2c4c30aa
AD
207242001-11-28 Akim Demaille <akim@epita.fr>
20725
20726 * src/closure.c (closure): No longer optimize the special case
20727 where all the bits of `ruleset[r]' are set to 0, to make the code
20728 clearer.
20729
576890b7
AD
207302001-11-28 Akim Demaille <akim@epita.fr>
20731
20732 * src/closure.c (closure): `r' and `c' are new variables, used to
20733 de-obfuscate accesses to RULESET and CORE.
20734
cb487d7d
AD
207352001-11-28 Akim Demaille <akim@epita.fr>
20736
20737 * src/reduce.c (reduce_print): Use ngettext.
20738 (dump_grammar): Improve the trace accuracy.
20739
6013d43f
AD
207402001-11-28 Akim Demaille <akim@epita.fr>
20741
20742 * src/reduce.c (dump_grammar): Don't translate trace messages.
20743
cb4956ee
AD
207442001-11-28 Akim Demaille <akim@epita.fr>
20745
20746 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20747 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20748 as all tags are free'ed afterwards.
20749 From Enrico Scholz.
20750
648185ab
PE
207512001-11-27 Paul Eggert <eggert@twinsun.com>
20752
20753 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20754 use alloca when we didn't want to, and vice versa.
20755
68254a03
MA
207562001-11-27 Marc Autret <autret_m@epita.fr>
20757
9113b58f
AD
20758 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20759 initialization.
68254a03
MA
20760 * src/output.c (prepare): Remove its update.
20761
04d843a2
MA
207622001-11-27 Marc Autret <autret_m@epita.fr>
20763
20764 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20765 Use %error-verbose.
20766
d2079671 207672001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
20768
20769 * src/bison.simple: Remove YYERROR_VERBOSE using.
20770 Use %%error_verbose.
20771 (yyparse): Likewise.
20772 * src/output.c (prepare): Give its final value.
20773 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20774 * src/getargs.h: Add its extern declaration.
20775 * src/getargs.c (error_verbose_flag): New int.
20776 (getargs): Update to catch new case.
20777 * src/options.c (option_table): 'error-verbose' is a new option.
20778 (shortopts): Update.
20779
e0327bc8
AD
207802001-11-27 Akim Demaille <akim@epita.fr>
20781
20782 * src/system.h: Use intl/libgettext.h.
20783 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20784
000f1a3c
AD
207852001-11-27 Akim Demaille <akim@epita.fr>
20786
20787 * tests/torture.at (Exploding the Stack Size with Malloc):
20788 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20789
26cfe0be
AD
207902001-11-27 Akim Demaille <akim@epita.fr>
20791
20792 * src/files.c: Include error.h.
20793 Reported by Hans Aberg.
20794
f6bd5427
MA
207952001-11-26 Marc Autret <autret_m@epita.fr>
20796
d2079671 20797 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
20798 (read_declarations): Add case tok_include.
20799 * src/getargs.h (include): Add its extern definition.
20800 * src/getargs.c (include): New const char *.
20801 (getargs): Add case '-I'.
20802 * src/options.c (option_table): Add include as command line and
20803 percent option.
20804 * src/lex.h (token_t): Add tok_include.
20805
2ca209c1
AD
208062001-11-26 Akim Demaille <akim@epita.fr>
20807
20808 * src/reader.c (readgram): Make sure rules for mid-rule actions
20809 have a lineno equal to that of their host rule.
20810 Reported by Hans Aberg.
20811 * tests/regression.at (Rule Line Numbers): New.
20812
0e41b407
AD
208132001-11-26 Akim Demaille <akim@epita.fr>
20814
20815 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20816 size_ts.
20817
208182001-11-26 Akim Demaille <akim@epita.fr>
20819
20820 * src/complain.c, src/complain.h (error): Remove, provided by
20821 lib/error.[ch].
20822
e0c40012
AD
208232001-11-26 Akim Demaille <akim@epita.fr>
20824
20825 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20826 issue an error message.
20827 * tests/regression.at (Invalid %directive): New.
20828 Reported by Hans Aberg.
20829
5e147124
AD
208302001-11-26 Akim Demaille <akim@epita.fr>
20831
20832 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20833 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20834
a034c8b8
AD
208352001-11-26 Akim Demaille <akim@epita.fr>
20836
20837 * src/conflicts.c (conflicts_print): Don't complain at all when
20838 there are no reduce/reduce conflicts, and as many shift/reduce
20839 conflicts as expected.
20840 * tests/regression.at (%expect right): Adjust.
20841
c64a20f3
AD
208422001-11-23 Akim Demaille <akim@epita.fr>
20843
20844 * lib/alloca.c: Update, from fileutils.
20845
5b0d29bb
AD
208462001-11-23 Akim Demaille <akim@epita.fr>
20847
20848 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20849
722c4bfe
AD
208502001-11-23 Akim Demaille <akim@epita.fr>
20851
20852 * src/system.h: Include alloca.h.
20853 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
20854
6255b435
AD
208552001-11-23 Akim Demaille <akim@epita.fr>
20856
20857 * src/print_graph.c (print_actions): Remove `rule', unused.
20858 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
20859 pacify GCC's signed < unsigned warnings.
20860 * src/closure.c (itemsetsize): Likewise.
20861 * src/reader.c (symbol_list_new): Static.
20862
b29b2ed5
AD
208632001-11-23 Akim Demaille <akim@epita.fr>
20864
20865 Attaching lineno to buckets is stupid, since only one copy of each
20866 symbol is kept, only the line of the first occurrence is kept too.
20867
20868 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
20869 * src/reader.c (rline_allocated): Remove, unused.
20870 (symbol_list): Have a `line' member.
20871 (symbol_list_new): New.
20872 (readgram): Use it.
20873 * src/print.c (print_grammar): Output the rule line numbers.
20874 * tests/regression.at (Solved SR Conflicts)
20875 (Unresolved SR Conflicts): Adjust.
20876 Reported by Hans Aberg.
20877
a81b1d4a
MA
208782001-11-22 Marc Autret <autret_m@epita.fr>
20879
20880 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
20881
c1ecb3c1
MA
208822001-11-22 Marc Autret <autret_m@epita.fr>
20883
20884 * src/muscle_tab.c (muscle_init): Remove initialization of
20885 skeleton muscle.
20886 * src/output.c (output_master_parser): Do it here.
20887
fbe01355
AD
208882001-11-20 Akim Demaille <akim@epita.fr>
20889
20890 * po/sv.po: New.
20891 * configure.in (ALL_LINGUAS): Adjust.
20892 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
20893 longer contains strings to translate.
20894
81e895c0
AD
208952001-11-19 Akim Demaille <akim@epita.fr>
20896
20897 * src/conflicts.c (conflicts_print): Add a missing \n.
20898
6bb1878b
AD
208992001-11-19 Akim Demaille <akim@epita.fr>
20900
20901 * src/nullable.c (nullable_print): New.
20902 (set_nullable): Call it when tracing.
20903 Better locality of variables.
20904
d9ec2d07
AD
209052001-11-19 Akim Demaille <akim@epita.fr>
20906
20907 * src/print.c (print_actions): Better locality of variables.
20908
720e5c1b
AD
209092001-11-19 Akim Demaille <akim@epita.fr>
20910
20911 * src/derives.c (print_derives): Fix and enrich.
20912 * src/closure.c (print_fderives): Likewise.
20913
fb908786
AD
209142001-11-19 Akim Demaille <akim@epita.fr>
20915
20916 * src/closure.c (itemsetend): Remove, replaced with...
20917 (itemsetsize): new.
20918
125ecb56
AD
209192001-11-19 Akim Demaille <akim@epita.fr>
20920
20921 * src/LR0.c (kernel_end): Remove, replaced with...
20922 (kernel_size): new.
20923
d8cf039f
AD
209242001-11-19 Akim Demaille <akim@epita.fr>
20925
20926 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
20927 to clarify.
20928
7bec0760
AD
209292001-11-19 Akim Demaille <akim@epita.fr>
20930
20931 * src/closure.c (closure): Use arrays instead of pointers to clarify.
20932
c87d4863
AD
209332001-11-19 Akim Demaille <akim@epita.fr>
20934
20935 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
20936 trace messages.
20937 * src/LR0.c: Likewise.
20938 (allocate_itemsets): Use arrays instead of pointers to clarify.
20939
9bfe901c
AD
209402001-11-19 Akim Demaille <akim@epita.fr>
20941
20942 * src/getargs.c (statistics_flag): Replace with...
20943 (trace_flag): New.
20944 (longopts): Accept --trace instead of --statistics.
20945 * src/getargs.h, src/options.c: Adjust.
20946 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
20947 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
20948
97db7bd4
AD
209492001-11-19 Akim Demaille <akim@epita.fr>
20950
cc72668c 20951 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
20952 pointers to clarify the code.
20953 (save_reductions, save_shifts): Factor common parts of alternatives.
20954
2c5f66ed
AD
209552001-11-19 Akim Demaille <akim@epita.fr>
20956
20957 * src/LR0.c (new_state, get_state): Complete TRACE code.
20958 * src/closure.c: Include `reader.h' to get `tags', needed by the
20959 trace code.
20960 Rename the conditional DEBUG as TRACE.
20961 Output consistently TRACEs to stderr, not stdout.
20962 * src/derives.c: Likewise.
20963 * src/reduce.c: (inaccessable_symbols): Using if is better style
20964 than goto.
20965 Use `#if TRACE' instead of `#if 0' for tracing code.
20966
300f275f
AD
209672001-11-19 Akim Demaille <akim@epita.fr>
20968
20969 * src/system.h (LIST_FREE, shortcpy): New.
20970 * src/LR0.c: Use them.
20971 * src/output.c (free_itemsets, free_reductions, free_shifts):
20972 Remove, replaced by LIST_FREE.
20973
f59c437a
AD
209742001-11-19 Akim Demaille <akim@epita.fr>
20975
20976 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
20977 (REDUCTIONS_ALLOC): New.
20978 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
20979 allocation.
20980
6986fd9e
AD
209812001-11-19 Akim Demaille <akim@epita.fr>
20982
20983 * src/LR0.c (new_state): Complete trace code.
20984 * src/nullable.c (set_nullable): Don't translate traces.
20985
4bc30f78
AD
209862001-11-19 Akim Demaille <akim@epita.fr>
20987
20988 * src/print_graph.c (print_core): Better locality of variables.
20989 * src/print.c (print_core): Likewise.
20990
08a946e0
AD
209912001-11-19 Akim Demaille <akim@epita.fr>
20992
20993 * src/vcg.c: You do the output, so you are responsible of the
20994 handling of VCG syntax, in particular: use quotearg.
20995 * src/print_graph.c: Don't.
20996 (print_actions): Don't output the actions as part of the nodes,
20997 since that's the job of the edges.
20998 (print_state): Don't output by hand: fill the node description,
9bfe901c 20999 and ask for its output.
08a946e0 21000
f0473484
AD
210012001-11-19 Akim Demaille <akim@epita.fr>
21002
cc72668c
AD
21003 * src/bison.simple (yyparse): When verbosely reporting an error,
21004 no longer put additional quotes around token names.
f0473484
AD
21005 * tests/calc.at: Adjust.
21006
e41dc700
AD
210072001-11-19 Akim Demaille <akim@epita.fr>
21008
21009 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21010 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21011 * src/output.c: Adjust.
21012
652a871c
AD
210132001-11-19 Akim Demaille <akim@epita.fr>
21014
21015 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21016 (rule_t): this.
21017 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21018
b2ed6e58
AD
210192001-11-19 Akim Demaille <akim@epita.fr>
21020
21021 * src/gram.h (rule_t): New.
21022 (rule_table): New.
21023 (rrhs, rlhs): Remove, part of state_t.
21024 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21025 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21026 * src/reader.c, src/reduce.c: Adjust.
21027
edad7067
AD
210282001-11-19 Akim Demaille <akim@epita.fr>
21029
21030 * src/reader.c (symbols_output): New, extracted from...
21031 (packsymbols): Here.
21032 (reader): Call it.
21033
3feec034
AD
210342001-11-19 Akim Demaille <akim@epita.fr>
21035
21036 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21037 (maxrhs): this new function.
21038
ddcd5fdf
AD
210392001-11-19 Akim Demaille <akim@epita.fr>
21040
cc72668c 21041 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
21042 Adjust.
21043
bb527fc2
AD
210442001-11-19 Akim Demaille <akim@epita.fr>
21045
cc72668c 21046 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
21047 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21048 * src/lalr.c: Adjust.
21049
a845a697
AD
210502001-11-19 Akim Demaille <akim@epita.fr>
21051
21052 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21053 (set_state_table): handle the `lookaheads' members.
21054
f004bf6a
AD
210552001-11-19 Akim Demaille <akim@epita.fr>
21056
cc72668c
AD
21057 * src/lalr.h (lookaheads): Removed array, whose contents is now
21058 a member of...
f004bf6a
AD
21059 (state_t): this structure.
21060 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21061 Adjust.
21062
de326cc0
AD
210632001-11-19 Akim Demaille <akim@epita.fr>
21064
cc72668c
AD
21065 * src/lalr.h (consistent): Removed array, whose contents is now
21066 a member of...
de326cc0
AD
21067 (state_t): this structure.
21068 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21069 Adjust.
21070
90b4416b
AD
210712001-11-19 Akim Demaille <akim@epita.fr>
21072
cc72668c
AD
21073 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21074 contents are now members of...
90b4416b
AD
21075 (state_t): this structure.
21076 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21077 Adjust.
21078
9703cc49
AD
210792001-11-19 Akim Demaille <akim@epita.fr>
21080
21081 * src/lalr.h (state_t): New.
21082 (state_table): Be a state_t * instead of a core **.
21083 (accessing_symbol): Remove, part of state_t.
21084 * src/lalr.c: Adjust.
21085 (set_accessing_symbol): Merge into...
21086 (set_state_table): this.
21087 * src/print_graph.c, src/conflicts.c: Adjust.
21088
d803322e
AD
210892001-11-14 Akim Demaille <akim@epita.fr>
21090
21091 * tests/calc.at, tests/output.at, tests/regression.at,
21092 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21093 now the tests are run in private dirs, therefore AC_CLEANUP and
21094 family can be simplified to 0-ary.
21095 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
21096 use abs. path to find config.h.
21097 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
21098 stderr, there can be way too much random noise.
21099 Instead pass -Werror to GCC and rely on the exit status.
21100 Reported by Wolfram Wagner.
21101
3d76b07d
AD
211022001-11-14 Akim Demaille <akim@epita.fr>
21103
21104 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21105 defined only if yyoverflow is defined, to avoid `warning: unused
21106 variable `yyvs1''.
21107 Reported by The Test Suite.
21108
09b503c8
AD
211092001-11-14 Akim Demaille <akim@epita.fr>
21110
21111 * src/print.c: Include reduce.h.
21112 Reported by Hans Aberg.
21113
211142001-11-14 Akim Demaille <akim@epita.fr>
21115
21116 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21117 Revert a previous patch: these are really const.
21118 * src/conflicts.c (conflict_report): Additional useless pair of
21119 braces to pacify GCC's warnings for `if () if () {} else {}'.
21120 * src/lex.c (parse_percent_token): Replace equal_offset with
21121 arg_offset.
21122 arg is const.
21123 Be sure to strdup `arg' when used, since there is no reason for
21124 token_buffer not to change.
21125
0f37a994
AD
211262001-11-14 Akim Demaille <akim@epita.fr>
21127
21128 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
21129 definition.
21130 * src/main.c (main): Use them.
21131 Suggested by Hans Aberg.
21132
d39d93b8
AD
211332001-11-12 Akim Demaille <akim@epita.fr>
21134
21135 * src/system.h (ngettext): Now that we use ngettext, be sure to
21136 provide a default definition when NLS are not used.
21137
9edcd895
AD
211382001-11-12 Akim Demaille <akim@epita.fr>
21139
21140 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
21141 Use @kbd to denote user input.
21142 (Language and Grammar): ANSIfy the example.
21143 Adjust its layout for info/notinfo.
21144 (Location Tracking Calc): Output error messages to stderr.
21145 Output locations in a more GNUtically correct way.
21146 Fix a couple of Englishos.
21147 Adjust @group/@end group pairs.
21148
7da99ede
AD
211492001-11-12 Akim Demaille <akim@epita.fr>
21150
e3aa65c5 21151 %expect was not functioning at all.
7da99ede
AD
21152
21153 * src/conflicts.c (expected_conflicts): Set to -1.
21154 (conflict_report): Use ngettext.
21155 (conflicts_print): Check %expect and make its violation an error.
21156 * doc/bison.texinfo (Expect Decl): Adjust.
21157 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
21158 * tests/regression.at (%expect not enough, %expect right)
21159 (%expect too much): New.
21160
ba9dda1a
AD
211612001-11-12 Akim Demaille <akim@epita.fr>
21162
21163 * tests/regression.at (Conflicts): Rename as...
21164 (Unresolved SR Conflicts): this.
21165 (Solved SR Conflicts): New.
21166
337c5bd1
AD
211672001-11-12 Akim Demaille <akim@epita.fr>
21168
21169 * src/reduce.c (print_results): Rename as...
21170 (reduce_output): This.
21171 Output to OUT, passed as argument, instead of output_obstack.
21172 (dump_grammar): Likewise.
21173 (reduce_free): New.
21174 Also free V1.
21175 (reduce_grammar): No longer call reduce_output, since...
21176 * src/print.c (print_results): do it.
21177 * src/main.c (main): Call reduce_free;
21178
c73a41af
AD
211792001-11-12 Akim Demaille <akim@epita.fr>
21180
21181 * src/conflicts.c (print_reductions): Accept OUT as argument.
21182 Output to it, not to output_obstack.
21183 * src/print.c (print_actions): Adjust.
21184
0df87bb6
AD
211852001-11-12 Akim Demaille <akim@epita.fr>
21186
21187 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
21188 the result instead of using...
21189 (src_total, rrc_total, src_count, rrc_count): Remove.
21190 (any_conflicts): Remove.
21191 (print_conflicts): Split into...
21192 (conflicts_print, conflicts_output): New.
21193 * src/conflicts.h: Adjust.
21194 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 21195 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
21196 * tests/regression.at (Conflicts): New.
21197 Reported by Tom Lane.
21198
e4d3d4de
AD
211992001-11-12 Akim Demaille <akim@epita.fr>
21200
21201 * tests/regression.at (Invalid input): Remove, duplicate with
21202 ``Invalid input: 1''.
21203
6d7d248e
AD
212042001-11-12 Akim Demaille <akim@epita.fr>
21205
21206 * tests/torture.at (AT_DATA_STACK_TORTURE)
21207 (Exploding the Stack Size with Alloca)
21208 (Exploding the Stack Size with Malloc): New.
21209
e9e4c321
AD
212102001-11-12 Akim Demaille <akim@epita.fr>
21211
21212 * src/bison.simple (YYSTACK_REALLOC): New.
21213 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 21214 Reported by Per Allansson.
e9e4c321 21215
5f7e0832
AD
212162001-11-12 Pascal Bart <pascal.bart@epita.fr>
21217
21218 * src/bison.simple: Define type yystype instead of YYSTYPE, and
21219 define CPP macro, which substitute YYSTYPE by yystype.
21220 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
21221 with yyltype/YYLTYPE. This allows inclusion of the generated
21222 header within the parser if the compiler, such as GGC, accepts
21223 multiple equivalent #defines.
21224 From Akim.
21225
e3f1699f
AD
212262001-11-05 Akim Demaille <akim@epita.fr>
21227
21228 * src/reader.c (symbols_output): New, extracted from...
21229 (packsymbols): here.
21230 (reader): Adjust.
21231
65be0866
AD
212322001-11-05 Akim Demaille <akim@epita.fr>
21233
21234 * src/lex.c (parse_percent_token): s/quotearg/quote/.
21235
e4d910bf
AD
212362001-11-05 Akim Demaille <akim@epita.fr>
21237
21238 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
21239 pattern.
21240
951366c1
AD
212412001-11-05 Akim Demaille <akim@epita.fr>
21242
21243 * src/options.h (struct option_table_struct): set_flags is void*.
21244 * src/options.c (longopts): Support `--output' and `%output'.
21245 (usage): Adjust.
21246 * src/lex.h (tok_setopt): Remove, replaced with...
21247 (tok_intopt, tok_stropt): these new guys.
21248 * src/lex.c (getopt.h): Not needed.
21249 (token_buffer, unlexed_token_buffer): Not const.
21250 (percent_table): Promote `-' over `_' in directive names.
21251 Active `%name-prefix', `file-prefix', and `output'.
21252 (parse_percent_token): Accept possible arguments to directives.
21253 Promote `-' over `_' in directive names.
21254
d8988b2f
AD
212552001-11-04 Akim Demaille <akim@epita.fr>
21256
21257 * doc/bison.texinfo (Decl Summary): Split the list into
21258 `directives for grammars' and `directives for bison'.
21259 Sort'em.
21260 Add description of `%name-prefix', `file-prefix', and `output'.
21261 Promote `-' over `_' in directive names.
21262 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
21263 Simplify the description of `--name-prefix'.
21264 Promote `-' over `_' in directive names.
21265 Promote `--output' over `--output-file'.
21266 Fix the description of `--defines'.
21267 * tests/output.at: Exercise %file-prefix and %output.
21268
6468d18e
AD
212692001-11-02 Akim Demaille <akim@epita.fr>
21270
21271 * doc/refcard.tex: Update.
21272
6b7e85b9
AD
212732001-11-02 Akim Demaille <akim@epita.fr>
21274
21275 * src/symtab.h (SUNDEF): New.
21276 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
21277 stand for `uninitialized', instead of 0.
21278 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
21279 * src/lex.c (lex): Adjust.
21280
21281 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
21282 Number it 0.
21283 Let yylex return it instead of a plain 0.
21284 Reported by Dick Streefland.
21285
cd5aafcf
AD
212862001-11-02 Akim Demaille <akim@epita.fr>
21287
21288 * tests/regression.at (Mixing %token styles): New test.
21289
037ca2f1
AD
212902001-11-02 Akim Demaille <akim@epita.fr>
21291
21292 * src/reader.c (parse_thong_decl): Formatting changes.
21293 (token_translations_init): New, extracted from...
21294 (packsymbols): Here.
21295 Adjust.
21296
270a173c
AD
212972001-11-01 Akim Demaille <akim@epita.fr>
21298
21299 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
21300 Check that `9foo.y' produces correct cpp guards.
21301 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
21302 guards.
21303 Reported by Wwp.
21304
561f9a30
AD
213052001-11-01 Akim Demaille <akim@epita.fr>
21306
21307 * tests/regression.at (Invalid input: 2): New.
21308 * src/lex.c (unlexed_token_buffer): New.
21309 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
21310 too.
21311 Reported by Wwp.
21312
f987e9d2
AD
213132001-11-01 Akim Demaille <akim@epita.fr>
21314
21315 * tests/calc.at: Catch up with 1.30.
21316 * configure.in: Bump to 1.49a.
21317 Adjust to newer Autotest.
21318
0846f581
PB
213192001-10-19 Pascal Bart <pascal.bart@epita.fr>
21320
21321 * src/conflicts.c: Move global variables rrc_total and src_total ...
21322 (print_conflicts): here.
21323 * src/output.c (output): Free global variable user_toknums.
21324 * src/lex.c (token_obstack): Become static.
21325
3c1a79b3
AD
213262001-10-18 Akim Demaille <akim@epita.fr>
21327
21328 * tests/atlocal.in (GCC): Add.
21329 * tests/calc.at: s/m4_match/m4_bmatch/.
21330 s/m4_patsubst/m4_bpatsubst/.
21331 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
21332 * configure.in: AC_SUBST(GCC).
21333
5d52e7d0
MA
213342001-10-14 Marc Autret <autret_m@epita.fr>
21335
21336 * src/options.c (create_long_option_table): Fix.
21337
631aa1d3
AD
213382001-10-10 Akim Demaille <akim@epita.fr>
21339
21340 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
21341
f6ec6d13
AD
213422001-10-04 Akim Demaille <akim@epita.fr>
21343
21344 * src/reader.c (parse_union_decl): Push the caracters in
21345 union_obstack, not attrs_obstack.
21346
342b8b6e
AD
213472001-10-04 Akim Demaille <akim@epita.fr>
21348
21349 Merge in the branch 1.29.
21350
21351 * src/reader.c (packsymbols): Use a temporary obstack for
21352 `%%tokendef', since output_stack is already used elsewhere.
21353
21354 2001-10-02 Akim Demaille <akim@epita.fr>
21355
21356 Bump 1.29d.
21357
21358 2001-10-02 Akim Demaille <akim@epita.fr>
21359
21360 Version 1.29c.
21361
21362 2001-10-02 Akim Demaille <akim@epita.fr>
21363
21364 * tests/regression.at (Invalid CPP headers): New.
21365 From Alexander Belopolsky.
21366 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
21367
21368 2001-10-02 Akim Demaille <akim@epita.fr>
21369
21370 * tests/regression.at (Invalid input): New.
21371 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
21372 Reported by Shura.
21373
21374 2001-10-02 Akim Demaille <akim@epita.fr>
21375
21376 * tests/calc.at: Now that --debug works, the tests must be adjusted.
21377
21378 2001-10-02 Akim Demaille <akim@epita.fr>
21379
21380 * src/output.c (output_parser): Assert `skeleton'.
21381 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
21382 systems.
21383 From Shura.
21384
21385 2001-10-01 Marc Autret <autret_m@epita.fr>
21386
21387 * src/lex.h: Echo modifications.
21388 * src/lex.c (unlex): Parameter is now token_t.
21389 From Hans Aberg.
21390
21391 2001-10-01 Marc Autret <autret_m@epita.fr>
21392
21393 * src/main.c: Include lex.h.
21394 From Hans Aberg.
21395
21396 2001-09-29 Akim Demaille <akim@epita.fr>
21397
21398 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
21399
21400 2001-09-28 Akim Demaille <akim@epita.fr>
21401
21402 * tests/testsuite.at: Update to newer Autotest.
21403 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
21404
21405 2001-09-27 Akim Demaille <akim@epita.fr>
21406
21407 Position independent wrapper.
21408
21409 * tests/bison: Remove.
21410 * tests/bison.in: New.
21411 * configure.in: Adjust.
21412
21413 2001-09-27 Paul Eggert <eggert@twinsun.com>
21414
21415 Port quotearg fixes from tar 1.13.24.
21416
21417 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
21418 tm to be declared.
21419 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
21420 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
21421
21422 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21423 * m4/mbrtowc.m4: New file.
21424 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21425 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21426
21427 2001-09-27 Akim Demaille <akim@epita.fr>
21428
21429 Bump to 1.29c.
21430
21431 2001-09-27 Akim Demaille <akim@epita.fr>
21432
21433 Version 1.29b.
21434
21435 2001-09-25 Akim Demaille <akim@epita.fr>
21436
21437 * src/system.h: Include `xalloc.h'.
21438 Remove it from the C files.
21439 * src/files.c (output_files): Free the obstacks.
21440 * src/lex.c (init_lex): Rename as...
21441 (lex_init): this.
21442 (lex_free): New.
21443 * src/main.c (main): Use it.
21444
21445 2001-09-24 Marc Autret <autret_m@epita.fr>
21446
21447 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21448 to output informations in fout (FILE*).
21449 (open_graph, close_graph): Likewise.
21450 (output_graph, output_edge, output_node): Likewise.
21451 * src/vcg.h: Update function prototypes.
21452 * src/print_graph.c (print_graph): Open output graph file.
21453 (print_actions): Adjust.
21454 * src/files.h: Remove extern declaration.
21455 * src/files.c: Remove graph_obstack declaration.
21456 (open_files): Remove graph_obstack initialization.
21457 (output_files): Remove graph_obstack saving.
21458
21459 2001-09-24 Marc Autret <autret_m@epita.fr>
21460
21461 * src/files.c (compute_output_file_names): Fix.
21462
21463 2001-09-24 Marc Autret <autret_m@epita.fr>,
21464 Akim Demaille <akim@epita.fr>
21465
21466 * src/reader.c (reader): Remove call to free_symtab ().
21467 * src/main.c (main): Call it here.
21468 Include symtab.h.
21469 * src/conflicts.c (initialize_conflicts): Rename as...
21470 (solve_conflicts): this.
21471 * src/print.c (print_core, print_actions, print_state)
21472 (print_grammar): Dump to a file instead a `output_obstack'.
21473 (print_results): Dump `output_obstack', and then proceed with the
21474 FILE *.
21475 * src/files.c (compute_output_file_names, close_files): New.
21476 (output_files): Adjust.
21477 * src/main.c (main): Adjust.
21478
21479 2001-09-23 Marc Autret <autret_m@epita.fr>
21480
21481 * src/files.c (compute_header_macro): Computes header macro name
21482 from spec_defines_file when given.
21483
21484 2001-09-23 Marc Autret <autret_m@epita.fr>
21485
21486 * src/files.c (output_files): Add default extensions.
21487
21488 2001-09-22 Akim Demaille <akim@epita.fr>
21489
21490 * src/conflicts.c (finalize_conflicts): Rename as...
21491 (free_conflicts): this.
21492
21493 2001-09-22 Akim Demaille <akim@epita.fr>
21494
21495 * src/gram.c (gram_free): Rename back as...
21496 (dummy): this.
21497 (output_token_translations): Free `token_translations'.
21498 * src/symtab.c (free_symtab): Free the tag field.
21499
21500 2001-09-22 Akim Demaille <akim@epita.fr>
21501
21502 Remove `translations' as it is always set to true.
21503
21504 * src/gram.h: Adjust.
21505 * src/reader.c (packsymbols, parse_token_decl): Adjust
21506 * src/print.c (print_grammar): Adjust.
21507 * src/output.c (output_token_translations): Adjust.
21508 * src/lex.c (lex): Adjust.
21509 * src/gram.c: Be sure the set pointers to NULL.
21510 (dummy): Rename as...
21511 (gram_free): this.
21512
21513 2001-09-22 Akim Demaille <akim@epita.fr>
21514
21515 * configure.in: Invoke AM_LIB_DMALLOC.
21516 * src/system.h: Use dmalloc.
21517 * src/LR0.c: Be sure to have pointers initialized to NULL.
21518 (allocate_itemsets): Allocate kernel_items only if needed.
21519
21520 2001-09-22 Akim Demaille <akim@epita.fr>
21521
21522 * configure.in: Bump to 1.29b.
21523 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
21524 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
21525 need xmalloc.c in calc.y.
21526 From Pascal Bart.
21527
21528 2001-09-21 Akim Demaille <akim@epita.fr>
21529
21530 Version 1.29a.
21531 * Makefile.maint, config/config.guess, config/config.sub,
21532 * config/missing: Update from masters.
21533 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
21534 upon package.m4.
21535 * configure.in (ALL_LINGUAS): Add `tr'.
21536
21537 2001-09-21 Akim Demaille <akim@epita.fr>
21538
21539 * tests/Makefile.am (package.m4): Move to...
21540 ($(srcdir)/$(TESTSUITE)): here.
21541
21542 2001-09-20 Akim Demaille <akim@epita.fr>
21543
21544 * src/complain.c: No longer try to be standalone: use system.h.
21545 Don't assume __STDC__ is defined to 1. Just test if it is defined.
21546 * src/complain.h: Likewise.
21547 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
21548 Remove the unused variable `n'.
21549 From Albert Chin-A-Young.
21550
21551 2001-09-18 Marc Autret <autret_m@epita.fr>
21552
21553 * doc/bison.1: Update.
21554 * doc/bison.texinfo (Bison Options): Update --defines and --graph
21555 descriptions.
21556 (Option Cross Key): Update.
21557 Add --graph.
21558
21559 2001-09-18 Marc Autret <autret_m@epita.fr>
21560
21561 * tests/regression.at: New test (comment in %union).
21562
21563 2001-09-18 Marc Autret <autret_m@epita.fr>
21564
21565 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
21566 do that.
21567 Reported by Keith Browne.
21568
21569 2001-09-18 Marc Autret <autret_m@epita.fr>
21570
21571 * tests/output.at: Add tests for --defines and --graph.
21572
21573 2001-09-18 Marc Autret <autret_m@epita.fr>
21574
21575 * tests/output.at: Removes tests of %{header,src}_extension features.
21576
21577 2001-09-18 Akim Demaille <akim@epita.fr>
21578
21579 * tests/Makefile.am (package.m4): New.
21580 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
21581 (_AT_CHECK_CALC_ERROR): Likewise.
21582 Factor the `, ' part of verbose error messages.
21583
21584 2001-09-18 Marc Autret <autret_m@epita.fr>
21585
21586 * src/getargs.c (longopts): Declare --defines and --graph as options
21587 with optional arguments.
21588 * src/files.h: Add extern declarations.
21589 * src/files.c (spec_graph_file, spec_defines_file): New.
21590 (output_files): Update.
21591 Remove CPP-outed code.
21592
21593 2001-09-18 Marc Autret <autret_m@epita.fr>
21594
21595 Turn off %{source,header}_extension feature.
21596
21597 * src/files.c (compute_exts_from_gf): Update.
21598 (compute_exts_from_src): Update.
21599 (output_files): CPP-out useless code.
21600 * src/files.h: Remove {header,source}_extension extern declarations.
21601 * src/reader.c (parse_dquoted_param): CPP-out.
21602 (parse_header_extension_decl): Remove.
21603 (parse_source_extension_decl): Remove.
21604 (read_declarations): Remove cases tok_{hdrext,srcext}.
21605 * src/lex.c (percent_table): Remove {header,source}_extension entries.
21606 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
21607
21608 2001-09-10 Akim Demaille <akim@epita.fr>
21609
21610 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
21611 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
21612 (AT_CHECK_OUTPUT): this.
21613 Merely check ls' exit status, its output is useless.
21614
21615 2001-09-10 Akim Demaille <akim@epita.fr>
21616
21617 * tests/calc.at: Use m4_match.
21618 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
21619
21620 2001-09-10 Marc Autret <autret_m@epita.fr>,
21621 Akim Demaille <akim@epita.fr>
21622
21623 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
21624 enum color_e.
21625 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
21626 to `normal'.
21627 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
21628 * src/lex.h: Adjust prototype.
21629 (token_t): Add `tok_undef'.
21630 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
21631 (parse_percent_token): Now returns token_t.
21632 Add default statement in switch.
21633 (lex): Separate `c' as an input variable, from the token_t result
21634 part.
21635 (unlexed): Is a token_t.
21636
21637 2001-09-10 Akim Demaille <akim@epita.fr>
21638
21639 * configure.in: Bump to 1.29a.
21640
21641 2001-09-07 Akim Demaille <akim@epita.fr>
21642
21643 Version 1.29.
21644
21645 2001-08-30 Akim Demaille <akim@epita.fr>
21646
21647 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
21648 * m4/atconfig.m4: Remove.
21649 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
21650 * tests/bison: New.
21651 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
21652 m4_if, m4_patsubst, and m4_regexp.
21653 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
21654 `input' file instead of echo.
21655
21656 2001-08-29 Akim Demaille <akim@epita.fr>
21657
21658 Bump to 1.28e.
21659
21660 2001-08-29 Akim Demaille <akim@epita.fr>
21661
21662 Version 1.28d.
21663
21664 2001-08-29 Paul Eggert <eggert@twinsun.com>
21665
21666 * src/bison.simple (yyparse): Don't take the address of an
21667 item before the start of an array, as that doesn't conform to
21668 the C Standard.
21669
21670 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21671
21672 * doc/bison.texinfo (Location Tracking Calc): New node.
21673
21674 2001-08-29 Paul Eggert <eggert@twinsun.com>
21675
21676 * src/output.c (output): Do not define const, as this now
21677 causes more problems than it cures.
21678
21679 2001-08-29 Akim Demaille <akim@epita.fr>
21680
21681 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21682 the nodes.
21683 Be sure to tag the `detailmenu'.
21684
21685 2001-08-29 Akim Demaille <akim@epita.fr>
21686
21687 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21688 download in a tmp dir.
21689
21690 2001-08-28 Marc Autret <autret_m@epita.fr>
21691
21692 * config/depcomp: New file.
21693
21694 2001-08-28 Marc Autret <autret_m@epita.fr>
21695
21696 * doc/bison.1 (mandoc): Adjust.
21697 From Juan Manuel Guerrero.
21698
21699 2001-08-28 Marc Autret <autret_m@epita.fr>
21700
21701 * src/print_graph.c (print_state): Fix.
21702
21703 2001-08-27 Marc Autret <autret_m@epita.fr>
21704
21705 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21706 char * members.
21707 Echo modifications to the functions prototypes.
21708 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21709
21710 2001-08-27 Marc Autret <autret_m@epita.fr>
21711
21712 * src/vcg.c: Include `xalloc.h'.
21713 (add_colorentry): New.
21714 (add_classname): New.
21715 (add_infoname): New.
21716 * src/vcg.h: Add new prototypes.
21717
21718 2001-08-27 Akim Demaille <akim@epita.fr>
21719
21720 * Makefile.maint: Sync. again with CVS Autoconf.
21721
21722 2001-08-27 Akim Demaille <akim@epita.fr>
21723
21724 * Makefile.maint: Formatting changes.
21725 (po-update, cvs-update, update): New targets.
21726 (AMTAR): Remove.
21727
21728 2001-08-27 Akim Demaille <akim@epita.fr>
21729
21730 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21731 * Makefile.maint: Sync. with CVS Autoconf.
21732
21733 2001-08-27 Marc Autret <autret_m@epita.fr>
21734
21735 * src/vcg.h (struct infoname_s): New.
21736 (struct colorentry_s): New.
21737 (graph_s): New fields {vertical,horizontal}_order in structure.
21738 Add `infoname' field.
21739 Add `colorentry' field;
21740 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21741 (G_HORIZONTAL_ORDER): New.
21742 (G_INFONAME): New.
21743 (G_COLORENTRY): New.
21744 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21745 Add output of `infoname'.
21746 Add output of `colorentry'.
21747
21748 2001-08-27 Marc Autret <autret_m@epita.fr>
21749
21750 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21751 This one shadowed a global parameter.
21752
21753 2001-08-24 Marc Autret <autret_m@epita.fr>
21754
21755 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21756 instead of `unsigned'.
21757 (print_state): Do not call obstack_object_size () in obstack_grow ()
21758 to avoid macro variables shadowing.
21759
21760 2001-08-23 Marc Autret <autret_m@epita.fr>
21761
21762 * src/lex.c (percent_table): Typo: s/naem/name/.
21763 Add graph option.
21764 Normalize new options declarations.
21765
21766 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21767
21768 * tests/suite.at: Exercise %header_extension and %source_extension.
21769
21770 2001-08-16 Marc Autret <autret_m@epita.fr>
21771
21772 * src/reader.c (parse_dquoted_param): New.
21773 (parse_header_extension_decl): Use it.
21774 (parse_source_extension_decl): Likewise.
21775
21776 2001-08-16 Marc Autret <autret_m@epita.fr>
21777
21778 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21779 (get_xxxx_str): Use assert () instead of complain ().
21780 Remove return invokations in default cases.
21781 (get_decision_str): Modify default behaviour. Remove second argument.
21782 Echo modifications on calls.
21783 (output_graph): Fix.
21784
21785 2001-08-16 Marc Autret <autret_m@epita.fr>
21786
21787 * src/getargs.c (usage): Update with ``-g, --graph''.
21788
21789 2001-08-16 Marc Autret <autret_m@epita.fr>
21790
21791 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21792 (Option Cross Key): Likewise.
21793 * doc/bison.1: Update.
21794
1c8c2190
PB
217952001-09-25 Pascal Bart <pascal.bart@epita.fr>
21796
21797 * src/output.c (output_master_parser): Don't finish action_obstack.
21798 (output_parser): Don't care about the muscle action, here.
21799 (prepare): Copy the action_obstack in the action muscle.
21800 (output): Free action_obstack.
21801
180d45ba
PB
218022001-09-23 Pascal Bart <pascal.bart@epita.fr>
21803
21804 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21805 will contain `%union' declaration.
21806 (parse_union_decl): Delete #line directive output.
21807 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21808 informations about %union.
21809 (parse_union_decl): Copy the union_obstack in the muscle stype.
21810 * src/bison.simple: Add new #line directive.
21811 Add typdef %%stype YYSTYPE.
21812
c51d1a19
PB
218132001-09-23 Pascal Bart <pascal.bart@epita.fr>
21814
21815 * src/bison.simple: Add new `#line' directive.
21816
6f9344da
PB
218172001-09-22 Pascal Bart <pascal.bart@epita.fr>
21818
21819 * src/bison.simple: New `#line' directive.
21820 * src/output.c (output_parser): Support new dynamic muscle input_line.
21821
652def80
MA
218222001-09-22 Marc Autret <autret_m@epita.fr>
21823
21824 * src/output.c (output_master_parser): New.
21825 (output_parser): Be more re-entrant.
21826
25b222fa
MA
218272001-09-21 Marc Autret <autret_m@epita.fr>
21828
21829 * src/reader.c (copy_definition, parse_union_decl): Update and use
21830 `linef' muscle.
21831 (copy_action): Likewise.
21832 Use obstack_1grow ().
21833 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21834
6bc35ae5
MA
218352001-09-21 Marc Autret <autret_m@epita.fr>
21836
21837 * src/options.c (option_table): Adjust.
21838 * src/lex.c (parse_percent_token): Fix.
21839
c0629aa1
PB
218402001-09-20 Pascal Bart <pascal.bart@epita.fr>
21841
21842 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 21843
82b6d266
PB
218442001-09-20 Pascal Bart <pascal.bart@epita.fr>
21845
21846 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21847 is now an option_table_struct*.
21848 (option_strcmp): New function option_strcmp.
21849 (parse_percent_token): Call option_strcmp.
21850 * src/getargs.c (xalloc.h, options.h): Include it.
21851 (getargs): Call create_long_option_table.
21852 (getargs): Free longopts at the end of the function.
21853 (shortopts): Move in options.c.
21854 * src/options.c (create_long_option_table): New function. Convert
21855 information from option_table to option structure.
21856 * src/reader.c (options.h): Include it.
21857
21858 * src/Makefile.am: Adjust.
21859 * src/options.c (option_table): Create from longopts and percent_table.
21860 * src/getargs.c (longopts): Delete.
21861 * src/lex.c (struct percent_table_struct): Delete.
21862 (percent_table): Delete.
21863 (options.h): Include it.
21864 * src/options.c: Create.
21865 * src/options.h: Create.
21866 Declare enum opt_access_e.
21867 Define struct option_table_struct.
21868
75f5aaea
MA
218692001-09-20 Marc Autret <autret_m@epita.fr>
21870
21871 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
21872 sections of Bison.
21873
f508cb0a
PB
218742001-09-19 Pascal Bart <pascal.bart@epita.fr>
21875
21876 * src/bison.simple: s/%%filename/%%skeleton.
21877 * src/muscle_tab.c (getargs.h): Include it.
21878 (muscle_init): Insert new muscle skeleton.
21879
13105fc1
PB
218802001-09-18 Pascal Bart <pascal.bart@epita.fr>
21881
21882 * src/output.c (output_parser): Delete unused variable actions_dumped.
21883
b0c4483e
PB
218842001-09-07 Pascal Bart <pascal.bart@epita.fr>
21885
21886 * src/output.c (output): Delete call to reader_output_yylsp.
21887 * src/reader.c (reader): Likewise.
ba0fe3c7 21888 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 21889
11d82f03
MA
218902001-09-02 Marc Autret <autret_m@epita.fr>
21891
21892 * src/reader.c: Include muscle_tab.h.
21893 (parse_union_decl): Update.
21894 (parse_macro_decl): Rename parse_muscle_decl.
21895 Update to use renamed functions and variable.
21896 (read_declarations, copy_action, read_additionnal_code, : Updated
21897 with correct variables and functions names.
21898 (packsymbols, reader): Likewise.
342b8b6e 21899
11d82f03 21900 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 21901
11d82f03
MA
21902 * src/output.c: Include muscle_tab.h
21903 In all functions using macro_insert, change by using muscle_insert ().
21904 (macro_obstack): Rename muscle_obstack.
21905 Echo modifications in the whole file.
21906 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
21907 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
21908 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
21909
21910 * src/muscle_tab.h: Update double inclusion macros.
21911 (macro_entry_s): Rename muscle_entry_s.
21912 Update prototypes.
342b8b6e 21913
11d82f03
MA
21914 * src/muscle_tab.c: Include muscle_tab.h.
21915 Rename macro_tabble to muscle_table.
21916 (mhash1, mhash2, mcmp): Use muscle_entry.
21917 (macro_init): Rename muscle_init. Update.
21918 (macro_insert): Rename muscle_insert. Update.
21919 (macro_find): Rename muscle_find. Update.
21920
21921 * src/main.c: Include muscle_tab.h.
21922 (main): Call muscle_init ().
21923 * src/Makefile.am (bison_SOURCES): Echo modifications.
21924
93a37297
MA
219252001-09-02 Marc Autret <autret_m@epita.fr>
21926
f753cd62 21927 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 21928
f753cd62
MA
21929 * src/muscle_tab.c, src/muscle_tab.h: Add files.
21930
219312001-09-02 Marc Autret <autret_m@epita.fr>
21932
21933 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 21934
682d48cd
PB
219352001-09-01 Pascal Bart <pascal.bart@epita.fr>
21936
342b8b6e 21937 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
21938 filename.
21939
087c8fda
MA
219402001-09-01 Marc Autret <autret_m@epita.fr>
21941
21942 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
21943 to an explicit value to activate the feature. We do it here.
21944
dda680cb
PB
219452001-08-31 Pascal Bart <pascal.bart@epita.fr>
21946
21947 * src/output.c (prepare): Delete the `filename' muscule insertion.
21948 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
21949 (parse_union_decl): Likewise.
21950 * src/macrotab.c (macro_init): Initialize filename by infile.
21951
9e644e64
MA
219522001-08-31 Marc Autret <autret_m@epita.fr>
21953
21954 * src/bison.simple (YYLSP_NEEDED): New definition.
21955 * src/output.c (prepare): Add macro insertion of `locations_flag'
21956
17da6427
PB
219572001-08-31 Pascal Bart <pascal.bart@epita.fr>
21958
21959 * src/output.c (prepare): Delete insertion of previous muscles,
21960 and insert the `prefix' muscles.
21961 * src/macrotab.c (macro_init): Likewise.
21962 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 21963 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
21964 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
21965 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 21966 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
21967 name_prefix.
21968
e8cb70b9
PB
219692001-08-31 Pascal Bart <pascal.bart@epita.fr>
21970
21971 * src/main.c (main): Standardize.
21972 * src/output.c (output_table_data, output_parser): Likewise.
21973 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
21974
63c2d5de
MA
219752001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
21976
342b8b6e 21977 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
21978 %%epilogue.
21979 * src/output.c (output): Rename %%declarations to %%prologue.
21980 * src/bison.simple: Echo modifications.
342b8b6e 21981
d8cb5183
MA
219822001-08-31 Marc Autret <autret_m@epita.fr>
21983
21984 * src/reader.c (readgram): CleanUp.
21985 (output_token_defines): Likewise.
21986 (packsymbols): Likewise.
21987 (reader): Likewise.
21988 * src/output.c (output): CPP-out useless code.
21989
6c686258
PB
219902001-08-31 Pascal Bart <pascal.bart@epita.fr>
21991
342b8b6e 21992 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
21993 output_trailers and output_headers.
21994 * src/output.h: Remove obsolete functions prototypes of output_headers
21995 and output_trailers.
21996
8f451ef7
PB
219972001-08-30 Pascal Bart <pascal.bart@epita.fr>
21998
21999 * src/main.c: Include macrotab.h.
342b8b6e 22000 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
22001 Adjust functions prototypes.
22002 * src/macrotab.c (macro_insert): Constify key and value.
22003 (macro_find): Constify key.
22004 (macro_insert): Include 'xalloc.h'
22005 (macro_insert): Use XMALLOC.
22006 (macro_find): Constify return value.
22007 * src/output.c (output_table_data): Rename table to table_data.
22008 (output_parser): Constify macro_key, macro_value.
22009
997b6fd0 220102001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
22011
22012 * src/reader.c (parse_skel_decl): New.
342b8b6e 22013 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
22014 * src/lex.h (token_t): New token `tok_skel'.
22015 * src/lex.c (percent_table): Add skeleton option entry.
22016 Standardize.
22017
ff48177d
MA
220182001-08-29 Marc Autret <autret_m@epita.fr>
22019
22020 * src/bison.simple: Add %%user_code directive at the end.
22021 * src/reader.c (read_additionnal_code): New.
22022 (reader): Use it.
22023 * src/output.c (output_program): Remove.
22024 (output): Update.
22025
b33160bf
MA
220262001-08-28 Marc Autret <autret_m@epita.fr>
22027
22028 * src/output.c (output_actions): Clean up.
4e5caae2 22029 (output_gram): CPP-out useless code.
b33160bf
MA
22030 * src/reader.c (reader): Clean up, CPP-out useless code.
22031
d1a2daf7
PB
220322001-08-28 Pascal Bart <pascal.bart@epita.fr>
22033
342b8b6e 22034 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 22035 directive.
d1a2daf7
PB
22036 * src/bison.simple: Add `%%definitions'.
22037
2b763dfe
MA
220382001-08-28 Marc Autret <autret_m@epita.fr>
22039
22040 * config/depcomp: New file.
22041
f1a87ef6
PE
220422001-08-27 Paul Eggert <eggert@twinsun.com>
22043
22044 * src/bison.simple (yyparse): Don't take the address of an
22045 item before the start of an array, as that doesn't conform to
22046 the C Standard.
22047
82e236e2
RA
220482001-08-27 Robert Anisko <robert.anisko@epita.fr>
22049
f1a87ef6 22050 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
22051 obstack. It was done too late here.
22052
22053 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22054 completely wrong.
22055 (reader): Initialize the macro obstack here, since we need it to grow
22056 '%define' directives.
22057
22058 * src/reader.h: Declare the macro obstack as extern.
22059
b0cfa28a
RA
220602001-08-27 Robert Anisko <robert.anisko@epita.fr>
22061
22062 * src/output.c (output_parser): Fix. Store single '%' characters in
22063 the output obstack instead of throwing them away.
22064
6fc74234
AD
220652001-08-27 Akim Demaille <akim@epita.fr>
22066
22067 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22068
9c76d118
RA
220692001-08-25 Robert Anisko <robert.anisko@epita.fr>
22070
22071 * lib/Makefile.am: Adjust.
22072
a8289c62
RA
220732001-08-25 Robert Anisko <robert.anisko@epita.fr>
22074
22075 * src/bison.simple: Update and add '%%' directives.
22076
b6610515
RA
220772001-08-25 Robert Anisko <robert.anisko@epita.fr>
22078
22079 * src/reader.c (reader): Remove calls to 'output_headers' and
22080 'output_trailers'. Remove some C output.
22081 (readgram): Disable a piece of code that was writing a default
22082 definition for 'YYSTYPE'.
22083 (reader_output_yylsp): Remove.
22084 (packsymbols): Output token defintions to a macro.
22085 (copy_definition): Disable C output.
6fc74234 22086
b6610515
RA
22087 * src/reader.c (parse_macro_decl): New function used to parse macro
22088 declarations.
22089 (copy_string2): Put the body of copy_string into this new function.
22090 Add a parameter to let the caller choose whether he wants to copy the
22091 string delimiters or not.
22092 (copy_string): Be a simple call to copy_string2 with the last argument
22093 bound to true.
22094 (read_declarations): Add case for macro definition.
22095 (copy_identifier): New.
6fc74234 22096 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
22097 rather than lex.
22098
26f609ff
RA
220992001-08-25 Robert Anisko <robert.anisko@epita.fr>
22100
22101 * src/output.c (prepare): Add prefixed names.
22102 (output_parser): Output semantic actions.
22103 (output_parser): Fix bug on '%%line' directives.
6fc74234 22104
26f609ff
RA
22105 * src/output.c (output_headers): Remove. The C code printed by this
22106 function should now be in the skeletons.
22107 (output_trailers): Remove.
22108 (output): Disable call to 'reader_output_yylsp'.
22109 (output_rule_data): Do not output tables to the table obstack.
22110
22111 * src/output.c: Remove some C dedicated output.
22112 Improve the use of macro and output obstacks.
22113 (output_defines): Remove.
6fc74234 22114
26f609ff
RA
22115 * src/output.c (output_token_translations): Associate 'translate'
22116 table with a macro. No output to the table obstack.
22117 (output_gram): Same for 'rhs' and 'prhs'.
22118 (output_stos): Same for 'stos'.
22119 (output_rule_data): Same for 'r1' and 'r2'.
22120 (token_actions): Same for 'defact'.
22121 (goto_actions): Same for 'defgoto'.
22122 (output_base): Same for 'pact' and 'pgoto'.
22123 (output_table): Same for 'table'.
22124 (output_check): Same for 'check'.
6fc74234 22125
26f609ff
RA
22126 * src/output.c (output_table_data): New function.
22127 (output_short_table): Remove.
22128 (output_short_or_char_table): Remove.
6fc74234 22129
26f609ff
RA
22130 * src/output.c (output_parser): Replace most of the skeleton copy code
22131 with something new. Skeletons are now processed character by character
22132 rather than line by line, and Bison looks for '%%' macros. This is the
22133 first step in making Bison's output process (a lot) more flexible.
22134 (output_parser): Use the macro table.
22135
6f43b113
RA
221362001-08-25 Robert Anisko <robert.anisko@epita.fr>
22137
22138 * src/main.c (main): Initialize the macro table.
22139
dd3127cf
RA
221402001-08-25 Robert Anisko <robert.anisko@epita.fr>
22141
22142 * src/lex.c (percent_table): Add tok_define.
22143 * src/lex.h: Add tok_define.
22144
aa321494
RA
221452001-08-25 Robert Anisko <robert.anisko@epita.fr>
22146
22147 * src/macrotab.c: New file.
22148 * src/macrotab.h: New file.
22149 * src/Makefile.am: Update.
22150
68bd3b6b
RA
221512001-08-25 Robert Anisko <robert.anisko@epita.fr>
22152
22153 * lib/hash.c: New file.
22154 * lib/hash.h: New file.
22155 * lib/Makefile.am: Update.
22156
45f8dd1e
AD
221572001-08-15 Akim Demaille <akim@epita.fr>
22158
22159 Version 1.28c.
22160
40a64a7a 221612001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
22162
22163 * src/reader.c (readgram): Indent output macro YYSTYPE.
22164 (packsymbols): Likewise.
22165 (output_token_defines): Likewise.
22166 * src/files.c: Standardize.
22167 (compute_header_macro): New.
22168 (defines_obstack_save): New. Use compute_header_macro.
22169 (output_files): Update. Use defines_obstack_save.
22170
f9a8293a
AD
221712001-08-15 Akim Demaille <akim@epita.fr>
22172
22173 * doc/bison.texinfo (Table of Symbols): Document
22174 YYSTACK_USE_ALLOCA.
22175
150ca7a7
AD
221762001-08-15 Akim Demaille <akim@epita.fr>
22177
22178 * missing: Update from CVS Automake.
22179 * config/config.guess, config/config.sub, config/texinfo.tex:
22180 Update from gnu.org.
22181
69b5cec4
AD
221822001-08-15 Akim Demaille <akim@epita.fr>
22183
22184 * Makefile.maint: Sync with CVS Autoconf.
22185
f2b5126e
PB
221862001-08-14 Pascal Bart <pascal.bart@epita.fr>
22187
69b5cec4 22188 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
22189 `fdl.texi'.
22190 * doc/fdl.texi: Add to package.
22191
4ecbf796
MA
221922001-08-14 Marc Autret <autret_m@epita.fr>
22193
22194 Turn on %{source,header}_extension features.
22195
69b5cec4 22196 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
22197 source_extension.
22198 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 22199 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
22200 between options.
22201
95fb5662
MA
222022001-08-14 Marc Autret <autret_m@epita.fr>
22203
22204 * src/files.c (compute_base_names): Add extensions computing when
22205 `--file-prefix' used.
22206 Standardize function calls.
22207
78d09da9
MA
222082001-08-13 Marc Autret <autret_m@epita.fr>
22209
69b5cec4 22210 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
22211 defining it (defined but null disables alloca).
22212
5a009f2c
MA
222132001-08-13 Marc Autret <autret_m@epita.fr>
22214
22215 * src/bison.simple (_yy_memcpy): CPP reformat.
22216
1e41465a
PB
222172001-08-13 Pascal Bart <pascal.bart@epita.fr>
22218
22219 * tests/atconfig.in (CPPFLAGS): Fix.
22220
c67a198d
PB
222212001-08-10 Pascal Bart <pascal.bart@epita.fr>
22222
79282c6c 22223 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
22224 `gpl.texi'.
22225 * doc/gpl.texi: Add to package.
22226
09a6de7e
MA
222272001-08-10 Marc Autret <autret_m@epita.fr>
22228
22229 * src/print_graph.h: Fix.
22230 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
22231
b77b9ee0
AD
222322001-08-10 Akim Demaille <akim@epita.fr>
22233
22234 * src/system.h: Provide default declarations for stpcpy, strndup,
22235 and strnlen.
22236
3e259915
MA
222372001-08-10 Robert Anisko <anisko_r@epita.fr>
22238
22239 * doc/bison.texinfo (Locations): Update @$ stuff.
22240
ca96bc2d
MA
222412001-08-09 Robert Anisko <anisko_r@epita.fr>
22242
22243 * src/bison.simple (YYLLOC_DEFAULT): Update.
22244 (yyparse): Adjust.
22245
fdc6758b
MA
222462001-08-08 Marc Autret <autret_m@epita.fr>
22247
b77b9ee0 22248 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
22249 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
22250 Reported by Fabrice Bauzac.
957d4dbf 22251
600cad3b
MA
222522001-08-08 Marc Autret <autret_m@epita.fr>
22253
22254 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
22255 * src/vcg.c (output_node): Fix.
22256 * src/vcg.h: Cleanup.
22257 * src/print_graph.c: Add comments.
b77b9ee0 22258 (node_output_size): New global variable. Simplify the formatting of
600cad3b 22259 the VCG graph output.
b77b9ee0 22260 (print_actions): Unused code is now used. It notifies the final state
600cad3b 22261 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 22262 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
22263 blue.
22264 Get the current node name and node_obstack by argument.
22265 (node_obstack): New variable.
22266 (print_state): Manage node_obstack.
22267 (print_core): Use node_obstack given by argument.
22268 A node is not only computed here but in print_actions also.
22269 (print_graph): CPP out useless code instead of commenting it.
22270
976e528f
AD
222712001-08-07 Pascal Bart <pascal.bart@epita.fr>
22272
22273 * tests/atconfig.in (CPPFLAGS): Fix.
22274
20e8e5ca
AD
222752001-08-07 Akim Demaille <akim@epita.fr>
22276
22277 * src/print_graph.c (quote): New.
22278 (print_core): Use it.
22279
957d4dbf 222802001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 22281
3e3da797
AD
22282 * src/vcg.c (complain.h): Include it.
22283 Unepitaize `return' invocations.
c4b66126 22284 [NDEBUG] (main): Remove.
79282c6c 22285 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
22286 * src/files.c (open_files): Initialize graph_obstack.
22287 * src/print_graph.c (print_actions): CPP out useless code.
22288 (print_core): Don't output the last `\n' in labels.
22289 Use `quote'.
22290 * src/files.c (output_files): Output the VCG file.
22291 * src/main.c (main): Invoke print_graph ();
3e3da797 22292
957d4dbf 222932001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
22294
22295 Automaton VCG graph output.
22296 Using option ``-g'' or long option ``--graph'', you can generate
22297 a gram_filename.vcg file containing a VCG description of the LALR (1)
22298 automaton of your grammar.
22299
22300 * src/main.c: Call to print_graph() function.
22301 * src/getargs.h: Update.
22302 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
22303 (graph_flag): New flag.
22304 (longopts): Update.
22305 (getargs): Add case `g'.
22306 * src/files.c (graph_obstack): New obstack struct.
22307 (open_files): Initialize new obstack.
22308 (output_files): Saves graph_obstack if required.
22309 * src/files.h (graph_obstack): New extern declaration.
22310 * src/Makefile.am: Add new source files.
22311
927c1557 223122001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
22313
22314 * src/print_graph.c, src/print_graph.h (graph): New.
22315 * src/vcg.h: New file.
22316 * src/vcg.c: New file, VCG graph handling.
22317
7333d403
AD
223182001-08-06 Marc Autret <autret_m@epita.fr>
22319
22320 Add of %source_extension and %header_extension which specify
22321 the source or/and the header output file extension.
22322
22323 * src/files.c (compute_base_names): Remove initialisation of
22324 src_extension and header_extension.
22325 (compute_exts_from_gf): Update.
22326 (compute_exts_from_src): Update.
22327 (output_files): Update.
22328 * src/reader.c (parse_header_extension_decl): New.
22329 (parse_source_extension_decl): New.
22330 (read_declarations): New case statements for the new tokens.
22331 * src/lex.c (percent_table): Add entries for %source_extension
22332 and %header_extension.
22333 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
22334
84163231
AD
223352001-08-06 Marc Autret <autret_m@epita.fr>
22336
22337 * configure.in: Bump to 1.28c.
22338 * doc/bison.texinfo: Texinfo thingies.
22339
8303fc42
AD
223402001-08-04 Pascal Bart <pascal.bart@epita.fr>
22341
22342 * tests/atconfig.in (CPPFLAGS): Add.
22343 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
22344
70a84437
AD
223452001-08-03 Akim Demaille <akim@epita.fr>
22346
22347 Version 1.28b.
22348
2ce10144
AD
223492001-08-03 Akim Demaille <akim@epita.fr>
22350
22351 * tests/Makefile.am (check-local): Ship testsuite.
22352 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
22353 Include `string.h'.
22354
1e3e4bc1
AD
223552001-08-03 Akim Demaille <akim@epita.fr>
22356
22357 * configure.in: Try using -Wformat when compiling.
22358
42b45b7f
AD
223592001-08-03 Akim Demaille <akim@epita.fr>
22360
22361 * configure.in: Bump to 1.28b.
22362
8f13fe33
AD
223632001-08-03 Akim Demaille <akim@epita.fr>
22364
22365 * src/complain.c: Adjust strerror_r portability issues.
22366
b37ba92c
AD
223672001-08-03 Akim Demaille <akim@epita.fr>
22368
22369 Version 1.28a.
22370
b0ce6046
AD
223712001-08-03 Akim Demaille <akim@epita.fr>
22372
22373 * src/getargs.c, src/getarg.h (skeleton)): Constify.
22374 * src/lex.c (literalchar): Avoid name clashes on `buf'.
22375 * src/getargs.c: Include complain.h.
22376 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
22377 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
22378
d01c415b
AD
223792001-08-03 Akim Demaille <akim@epita.fr>
22380
22381 * src/reader.c (readgram): Display hidden chars in error messages.
22382
459dd1a6
AD
223832001-08-03 Akim Demaille <akim@epita.fr>
22384
22385 Update to gettext 0.10.39.
22386
53b74c0c
AD
223872001-08-03 Akim Demaille <akim@epita.fr>
22388
22389 * lib/strspn.c: New.
22390
234a3be3
AD
223912001-08-01 Marc Autret <autret_m@epita.fr>
22392
22393 * doc/bison.texinfo: Update.
22394 * doc/bison.1 (mandoc): Update.
22395 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
22396 * src/files.c: Support output files extensions computing.
22397 (src_extension): New static variable.
22398 (header_extension): New static variable.
22399 (tr): New function.
22400 (get_extension_index): New function, gets the index of an extension
22401 filename in a string.
22402 (compute_exts_from_gf): New function, computes extensions from the
22403 grammar file extension.
22404 (compute_exts_from_src): New functions, computes extensions from the
22405 C source file extension, file given by ``-o'' option.
22406 (compute_base_names): Update.
22407 (output_files): Update.
22408
847bf1f5
AD
224092001-08-01 Robert Anisko <anisko_r@epita.fr>
22410
d995fee7 22411 * doc/bison.texi: Document @$.
847bf1f5
AD
22412 (Locations): New section.
22413
d074a105
AD
224142001-07-18 Akim Demaille <akim@epita.fr>
22415
22416 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
22417 * config/prev-version.txt, config/move-if-change: New.
22418 * Makefile.am: Adjust.
22419
3419715d
AD
224202001-07-08 Pascal Bart <pascal.bart@epita.fr>
22421
22422 * src/bison.simple (yyparse): Suppress warning `comparaison
22423 between signed and unsigned'.
22424
62ab6972
AD
224252001-07-05 Pascal Bart <pascal.bart@epita.fr>
22426
22427 * src/getargs.h (raw_flag): Remove.
22428 * src/getargs.c: Die on `-r'/`--raw'.
22429 * src/lex.c (parse_percent_token): Die on `%raw'.
22430 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22431 * tests/calc.at: Suppress test with option `--raw'.
22432
1e24cc5b
AD
224332001-07-14 Akim Demaille <akim@epita.fr>
22434
22435 * config/: New.
22436 * configure.in: Require Autoconf 2.50.
22437 Update to gettext 0.10.38.
22438
32dfccf8
AD
224392001-03-16 Akim Demaille <akim@epita.fr>
22440
22441 * doc/bison.texinfo: ANSIfy the examples.
22442
cd5bd6ac
AD
224432001-03-16 Akim Demaille <akim@epita.fr>
22444
22445 * getargs.c (skeleton): New variable.
22446 (longopts): --skeleton is a new option.
22447 (shortopts, getargs): -S is a new option.
22448 * getargs.h: Declare skeleton.
22449 * output.c (output_parser): Use it.
22450
5141b016
AD
224512001-03-16 Akim Demaille <akim@epita.fr>
22452
22453 * m4/strerror_r.m4: New.
22454 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22455 * lib/error.h, lib/error.c: Update.
22456
447992b9
AD
224572001-03-16 Akim Demaille <akim@epita.fr>
22458
22459 * src/getargs.c (longopts): Clean up.
22460
274d42ce
AD
224612001-02-21 Akim Demaille <akim@epita.fr>
22462
22463 * src/reader.c (gensym): `gensym_count' is your own.
22464 Use a static buf to create the symbol name, as token_buffer is no
22465 longer a buffer.
22466
22c821f3
AD
224672001-02-08 Akim Demaille <akim@epita.fr>
22468
22469 * src/conflicts.c (conflict_report): Be sure not to append to res
22470 between two calls, which could happen if both first sprintf were
22471 skipped, but not the first cp += strlen.
22472
18569462
AD
224732001-02-08 Akim Demaille <akim@epita.fr>
22474
22475 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22476 New, from fileutils 4.0.37.
22477 * configure.in: Require Autoconf 2.49c. I took some time before
22478 making this decision. This is the only way out for portability
22479 issues in Bison, it would mean way too much duplicate effort to
22480 import in Bison features implemented in 2.49c since 2.13.
22481 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22482
0d8f3c8a
AD
224832001-02-02 Akim Demaille <akim@epita.fr>
22484
22485 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 22486 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 22487
f17bcd1f
AD
224882001-01-19 Akim Demaille <akim@epita.fr>
22489
22490 Get rid of the ad hoc handling of token_buffer in the scanner: use
22491 the obstacks.
22492
22493 * src/lex.c (token_obstack): New.
22494 (init_lex): Initialize it. No longer call...
22495 (grow_token_buffer): this. Remove it.
22496 Adjust all the places which used it to use the obstack.
22497
511e79b3
AD
224982001-01-19 Akim Demaille <akim@epita.fr>
22499
22500 * src/lex.h: Rename all the tokens:
22501 s/\bENDFILE\b/tok_eof/g;
22502 s/\bIDENTIFIER\b/tok_identifier/g;
22503 etc.
22504 Let them be enums, not #define, to ease debugging.
22505 Adjust all the code.
22506
0d6508ef
AD
225072001-01-18 Akim Demaille <akim@epita.fr>
22508
22509 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
22510 * src/lex.c (maxtoken, grow_token_buffer): Static.
22511
6deb4447
AD
225122001-01-18 Akim Demaille <akim@epita.fr>
22513
22514 Since we now use obstacks, more % directives can be enabled.
22515
22516 * src/lex.c (percent_table): Also accept `%yacc',
22517 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
22518 `%debug'.
22519 Handle the actions for `%semantic_parser' and `%pure_parser' here,
22520 instead of returning a token.
22521 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
22522 * src/reader.c (read_declarations): Adjust.
22523 * src/files.c (open_files): Don't call `compute_base_names', don't
22524 compute `attrsfile' since they depend upon data which might be
22525 *in* the input file now.
22526 (output_files): Do it here.
22527 * src/output.c (output_headers): Document the fact that this patch
22528 introduces a guaranteed SEGV for semantic parsers.
22529 * doc/bison.texinfo: Document them.
22530 * tests/suite.at: Exercise these %options.
22531
ff4423cc
AD
225322000-12-20 Akim Demaille <akim@epita.fr>
22533
22534 Also handle the output file (--verbose) with obstacks.
22535
22536 * files.c (foutput): Remove.
22537 (output_obstack): New.
22538 Adjust all dependencies.
22539 * src/conflicts.c: Return a string.
22540 * src/system.h (obstack_grow_string): Rename as...
22541 (obstack_sgrow): this. Be ready to work with non literals.
22542 (obstack_fgrow4): New.
22543
956dba3a
AD
225442000-12-20 Akim Demaille <akim@epita.fr>
22545
22546 * src/files.c (open_files): Fix the computation of short_base_name
22547 in the case of `-o foo.tab.c'.
22548
337bab46
AD
225492000-12-20 Akim Demaille <akim@epita.fr>
22550
22551 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
22552 (copy_dollar): Now that everything uses obstacks, get rid of the
22553 FILE * parameters.
22554
5d3214b8
AD
225552000-12-20 Akim Demaille <akim@epita.fr>
22556
22557 * src/files.c (open_files): Actually the `.output' file is based
22558 on the short_base_name, not base_name.
22559 * tests/suite.at (Checking output file names): Adjust.
22560
29092a57
AD
225612000-12-20 Akim Demaille <akim@epita.fr>
22562
22563 * src/bison.s1: Remove, we now use directly...
22564 * src/bison.simple: this.
22565 * src/Makefile.am: Use pkgdata instead of data.
22566
ea5607fd
AD
225672000-12-20 Akim Demaille <akim@epita.fr>
22568
22569 * src/files.c (guard_obstack): New.
22570 (open_files): Initialize it.
22571 (output_files): Dump it...
22572 * src/files.h: Export it.
22573 * src/reader.c (copy_guard): Use it.
22574
27110317
AD
225752000-12-19 Akim Demaille <akim@epita.fr>
22576
22577 * src/files.c (outfile, defsfile, actfile): Removed as global
22578 vars.
22579 (open_files): Don't compute them.
22580 (output_files): Adjust.
22581 (base_name, short_base_name): Be global.
22582 Adjust dependencies.
22583
19c50364
AD
225842000-12-19 Akim Demaille <akim@epita.fr>
22585
22586 * src/files.c (strsuffix): New.
22587 (stringappend): Be just like strcat but allocate.
22588 (base_names): Eve out from open_files.
22589 Try to simplify the rather hairy computation of base_name and
22590 short_base_name.
22591 (open_files): Use it.
22592 * tests/suite.at (Checking output file names): New test.
22593
573c1d9f
AD
225942000-12-19 Akim Demaille <akim@epita.fr>
22595
22596 * src/system.h (obstack_grow_literal_string): Rename as...
22597 (obstack_grow_string): this.
22598 * src/output.c (output_parser): Recognize `%% actions' instead of
22599 `$'.
22600 * src/bison.s1: s/$/%% actions/.
22601 * src/bison.hairy: Likewise.
22602
ef7ddedd
AD
226032000-12-19 Akim Demaille <akim@epita.fr>
22604
22605 * src/output.c (output_parser): Compute the `#line' lines when
22606 there are.
22607 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
22608 Suggested by Hans Aberg.
22609
ff61dabd
AD
226102000-12-19 Akim Demaille <akim@epita.fr>
22611
22612 Let the handling of the skeleton files be local to the procedures
22613 that use it.
22614
22615 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
22616 longer static.
22617 (fparser, open_extra_files): Remove.
22618 (open_files, output_files): Don't take care of fparser.
22619 * src/files.h: Adjust.
22620 * src/output.c (output_parser): Open and close the file to the
22621 skeleton.
22622 * src/reader.c (read_declarations): When %semantic_parser, open
22623 fguard.
22624
55b96341
AD
226252000-12-19 Akim Demaille <akim@epita.fr>
22626
22627 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
22628 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
22629
358c15b7
AD
226302000-12-19 Akim Demaille <akim@epita.fr>
22631
22632 * src/files.c (open_files): Yipee! We no longer need all the code
22633 looking for `/tmp' since we have no tmp file.
22634
7de3329e
AD
226352000-12-19 Akim Demaille <akim@epita.fr>
22636
22637 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
22638 New macros.
22639 * src/files.c (open_files): Less dependency on MSDOS etc.
22640
3abcd459
AD
226412000-12-14 Akim Demaille <akim@epita.fr>
22642
22643 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
22644 Provide a default definition.
22645 Use it when executing the default @ action.
22646 * src/reader.c (reader_output_yylsp): No longer include
22647 `timestamp' and `text' in the default YYLTYPE.
22648
2a91a95e
AD
226492000-12-12 Akim Demaille <akim@epita.fr>
22650
22651 * src/reader.c (copy_definition, parse_union_decl, copy_action)
22652 (copy_guard): Quote the file names.
22653 Reported by Laurent Mascherpa.
22654
14d3eb9b
AD
226552000-12-12 Akim Demaille <akim@epita.fr>
22656
22657 * src/output.c (output_headers, output_program, output): Be sure
22658 to escape special characters when outputting filenames.
22659 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22660 (output_headers): Don't depend on them, Use ACTSTR.
22661
d7045ec6
AD
226622000-11-17 Akim Demaille <akim@epita.fr>
22663
22664 * lib/obstack.h: Formatting changes.
22665 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22666 prevents type checking.
22667 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22668 cast the value to (void *): assigning a `foo *' to a `void *'
22669 variable is valid.
22670 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22671 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22672 append characters.
22673
6fd54b73
AD
226742000-11-17 Akim Demaille <akim@epita.fr>
22675
22676 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22677 as...
22678 (suite.m4, regression.m4, calc.m4): these.
22679 * tests/atgeneral.m4: Update from CVS Autoconf.
22680
4c50eae6
AD
226812000-11-17 Akim Demaille <akim@epita.fr>
22682
22683 * tests/regression.m4 (%union and --defines): New test,
22684 demonstrating a current bug in the obstack implementation.
22685
a35f64ea
AD
226862000-11-17 Akim Demaille <akim@epita.fr>
22687
22688 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22689 macros.
22690 Use them to declare the variables which are global or local to
22691 `yyparse'.
22692
7de23534
AD
226932000-11-17 Akim Demaille <akim@epita.fr>
22694
22695 * acconfig.h: Remove, no longer used.
22696
aa7815f5
AD
226972000-11-07 Akim Demaille <akim@epita.fr>
22698
22699 * src: s/Copyright (C)/Copyright/g.
22700
5af1f549
AD
227012000-11-07 Akim Demaille <akim@epita.fr>
22702
22703 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22704 defining.
22705 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22706
553e2b22
AD
227072000-11-07 Akim Demaille <akim@epita.fr>
22708
22709 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22710 Merge in a single CPP if/else.
22711
8a4f41d6
AD
227122000-11-07 Akim Demaille <akim@epita.fr>
22713
22714 * src/output.c (output): Remove useless variables.
22715 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22716 argument `data' for consistency with the prototypes.
22717 Qualify it `const'.
22718 (obstack_copy, obstack_copy0): Rename the second argument as
22719 `address' for consistency. Qualify it `const'.
22720 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22721 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22722 `const' their input argument (`data' or `address').
22723 Adjust the corresponding macros to include `const' in casts.
22724
095a3fb5
AD
227252000-11-03 Akim Demaille <akim@epita.fr>
22726
22727 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22728 s/PFILE1/BISON_HAIRY/.
22729 Adjust dependencies.
22730
d1cdce7c
AD
227312000-11-03 Akim Demaille <akim@epita.fr>
22732
090c5ebf 22733 For some reason, this was not applied.
d1cdce7c
AD
22734
22735 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22736 `unlink': it's no longer used.
22737
9311529b
AD
227382000-11-03 Akim Demaille <akim@epita.fr>
22739
22740 * src/files.c (skeleton_find): New function, eved out of...
22741 (open_files, open_extra_files): here.
22742
d8880f69
AD
227432000-11-03 Akim Demaille <akim@epita.fr>
22744
22745 Don't use `atexit'.
22746
22747 * src/files.c (obstack_save): New function.
22748 (done): Rename as...
22749 (output_files): this.
22750 Use `obstack_save'.
22751 * src/main.c (main): Don't use `atexit' to register `done', since
22752 it no longer has to remove tmp files, just call `output_files'
22753 when there are no errors.
22754
0dbb648e
AD
227552000-11-02 Akim Demaille <akim@epita.fr>
22756
22757 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22758 `unlink': it's no longer used.
22759 * src/files.h: Formatting changes.
22760
896fe5c1
AD
227612000-11-02 Akim Demaille <akim@epita.fr>
22762
22763 Remove the last uses of mktemp and unlink/delete.
22764
22765 * src/files.c (fdefines, ftable): Removed.
22766 (defines_ostack, table_obstack): New.
22767 Adjust dependencies of the former into uses of the latter.
22768 * src/output.c (output_short_or_char_table, output_short_table):
22769 Convert to using obstacks.
22770 * src/reader.c (copy_comment2): Accept one FILE * and two
22771 obstacks.
22772 (output_token_defines, reader_output_yylsp): Use obstacks.
22773 * src/system.h (obstack_fgrow3): New.
1f65350a 22774 * po/POTFILES.in: Adjust.
896fe5c1 22775
dd60faec
AD
227762000-11-01 Akim Demaille <akim@epita.fr>
22777
22778 Change each use of `fattrs' into a use of `attrs_obstack'.
22779
22780 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22781 * src/files.c (fattrs): Remove.
22782 (attrs_obstack): New.
22783 Adjust all dependencies.
22784 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22785
8c7ebe49
AD
227862000-11-01 Akim Demaille <akim@epita.fr>
22787
22788 Introduce obstacks.
22789 Change each use of `faction' into a use of `action_obstack'.
22790
22791 * lib/obstack.h, lib/obstack.c: New files.
22792 * src/files.c (faction): Remove.
22793 (action_obstack): New.
22794 Adjust all dependencies.
22795
77aee789
AD
227962000-10-20 Akim Demaille <akim@epita.fr>
22797
22798 * lib/quote.h (PARAMS): New macro. Use it.
22799
43591cec
AD
228002000-10-16 Akim Demaille <akim@epita.fr>
22801
22802 * src/output.c (output_short_or_char_table): New function.
22803 (output_short_table, output_token_translations): Use it.
22804 (goto_actions): Use output_short_table.
22805
1e9798d5
AD
228062000-10-16 Akim Demaille <akim@epita.fr>
22807
22808 * src/symtab.c (bucket_new): New function.
22809 (getsym): Use it.
22810
22811 * src/output.c (output_short_table): New argument to display the
22812 comment associated with the table.
22813 Adjust dependencies.
22814 (output_gram): Use it.
22815 (output_rule_data): Nicer output layout for YYTNAME.
22816
f282676b
AD
228172000-10-16 Akim Demaille <akim@epita.fr>
22818
22819 * src/lex.c (read_typename): New function.
22820 (lex): Use it.
22821 * src/reader.c (copy_dollar): Likewise.
22822
550a72a3
AD
228232000-10-16 Akim Demaille <akim@epita.fr>
22824
22825 * src/reader.c (copy_comment2): Expect the input stream to be on
22826 the `/' which is suspected to open a comment, instead of being
22827 called after `//' or `/*' was read.
22828 (copy_comment, copy_definition, parse_union_decl, copy_action)
22829 (copy_guard): Adjust.
22830
131e2fef
AD
228312000-10-16 Akim Demaille <akim@epita.fr>
22832
22833 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22834 `read_signed_integer'.
22835
79282c5a
AD
228362000-10-16 Akim Demaille <akim@epita.fr>
22837
22838 * src/reader.c (copy_dollar): New function.
22839 (copy_guard, copy_action): Use it.
22840
ff4a34be
AD
228412000-10-16 Akim Demaille <akim@epita.fr>
22842
22843 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22844 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22845 New files, from Fileutils 4.0.27.
22846 * src/main.c (printable_version): Remove.
22847 * src/lex.c, src/reader.c: Use `quote'.
22848
228492000-10-04 Akim Demaille <akim@epita.fr>
22850
22851 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
22852
14ded682
AD
228532000-10-04 Akim Demaille <akim@epita.fr>
22854
22855 * doc/bison.texinfo: Various typos spotted by Neil Booth.
22856
8e03724b
AD
228572000-10-04 Akim Demaille <akim@epita.fr>
22858
22859 When a literal string is used to define two different tokens,
22860 `bison -v' segfaults.
22861 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
22862
22863 * tests/regression.m4: New file.
22864 Include the core of the sample provided by Piotr Gackiewicz.
22865 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
22866 properly.
22867
a9e64249
AD
228682000-10-04 Akim Demaille <akim@epita.fr>
22869
22870 * src/reader.c (parse_expect_decl): Keep `count' within the size
22871 of `buffer'.
22872 From Neil Booth.
22873
da9abf43
AD
228742000-10-02 Paul Eggert <eggert@twinsun.com>
22875
22876 * bison.s1 (yyparse): Assign the default value
22877 unconditionally, to avoid a GCC warning and make the parser a
22878 tad smaller.
22879
c33638bb
AD
228802000-10-02 Akim Demaille <akim@epita.fr>
22881
22882 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
22883 options.
22884
444c570a
AD
228852000-10-02 Akim Demaille <akim@epita.fr>
22886
22887 * src/derives.c, src/print.c, src/reduce.c: To ease the
22888 translation, move some `\n' out of the translated strings.
22889
89cab50d
AD
228902000-10-02 Akim Demaille <akim@epita.fr>
22891
22892 The location tracking mechanism is precious for parse error
22893 messages. Nevertheless, it is enabled only when `@n' is used in
22894 the grammar, which is a different issue (you can use it in error
22895 message, but not in the grammar per se). Therefore, there should
22896 be another means to enable it.
22897
22898 * src/getargs.c (getargs): Support `--locations'.
22899 (usage): Report it.
22900 * src/getargs.h (locationsflag): Export it.
22901 * src/lex.c (percent_table): Support `%locations'.
22902 * src/reader.c (yylsp_needed): Remove this variable, now replaced
22903 with `locationsflag'.
22904 * doc/bison.texinfo: Document `--locations' and `%locations'.
22905 Sort the options.
22906 * tests/calc.m4: Test it.
22907
22908 For regularity of the names, replace each
22909 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
22910 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
22911 In addition replace each `flag' with `_flag'.
22912
d6c2cba0
AD
229132000-10-02 Akim Demaille <akim@epita.fr>
22914
22915 Also test parse error messages, including with YYERROR_VERBOSE.
22916
22917 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
22918 associative).
22919 Use it to check the computations.
22920 Use it to check `nonassoc' is honored.
22921 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
22922 `--yyerror-verbose'.
22923 (_AT_CHECK_CALC): Adjust to this option.
22924 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
22925
5a35a6cb
AD
229262000-10-02 Akim Demaille <akim@epita.fr>
22927
22928 Test also `--verbose', `--defines' and `--name-prefix'. Testing
22929 the latter demonstrates a flaw in the handling of non debugging
22930 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
22931 was used in order to simplify:
22932
22933 #if YYDEBUG
22934 if (yydebug)
22935 {
22936 ...
22937 }
22938 #endif
22939
22940 into
22941
22942 if (yydebug)
22943 {
22944 ...
22945 }
22946
22947 unfortunately this leads to a CPP conflict when
22948 `--name-prefix=foo' is used since it produces `#define yydebug
22949 foodebug'.
22950
22951 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
22952 (YYDPRINTF): New macro.
22953 Spread its use.
22954 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
22955 the bison options.
22956 Also test `--verbose', `--defines' and `--name-prefix'.
22957
71da9eea
AD
229582000-10-02 Akim Demaille <akim@epita.fr>
22959
22960 Improve the readability of the produced parsers.
22961
22962 * src/bison.s1: Formatting changes.
22963 Improve the comment related to the `$' mark.
22964 (yydefault): Don't fall through to `yyresume': `goto' there.
22965 * src/output.c (output_parser): When the `$' is met, skip the end
22966 of its line.
22967 New variable, `number_of_dollar_signs', to check there's exactly
22968 one `$' in the parser skeleton.
22969
95e36146
AD
229702000-10-02 Akim Demaille <akim@epita.fr>
22971
22972 * lib/xstrdup.c: New file, from the fileutils.
22973 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
22974 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
22975 instead of strlen + xmalloc + strcpy.
22976 * src/symtab.c (copys): Remove, use xstrdup instead.
22977
d7020c20
AD
229782000-10-02 Akim Demaille <akim@epita.fr>
22979
22980 * src/gram.h (associativity): New enum type which replaces the
22981 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
22982 `right_assoc', `left_assoc' and `non_assoc'.
22983 Adjust all dependencies.
22984 * src/reader.c: Formatting changes.
22985 (LTYPESTR): Don't define it, use it as a literal in
22986 `reader_output_yylsp'.
22987 * src/symtab.h (symbol_class): New enum type which replaces the
22988 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
22989 `sunknown', `stoken and `snterm'.
22990
1916f98e
AD
229912000-10-02 Akim Demaille <akim@epita.fr>
22992
22993 * src/getargs.c (fixed_outfiles): Rename as...
22994 (yaccflag): for consistency and accuracy.
22995 Adjust dependencies.
22996
d7913476
AD
229972000-10-02 Akim Demaille <akim@epita.fr>
22998
22999 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23000 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23001 difficult and introduced a lot of core dump. It turns out that
23002 Bison used an implementation of `xmalloc' based on `calloc', and
23003 at various places it does depend upon the initialization to 0. I
23004 have not tried to isolate the pertinent places, and all the former
23005 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23006 someone should address this issue.
23007
23008 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23009 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23010 files.
23011 Adjust dependencies.
23012 * src/warshall.h: New file.
23013 Propagate.
23014
340ef489
AD
230152000-10-02 Akim Demaille <akim@epita.fr>
23016
23017 Various anti-`extern in *.c' changes.
23018
23019 * src/system.h: Include `assert.h'.
23020
b2ca4022
AD
230212000-10-02 Akim Demaille <akim@epita.fr>
23022
23023 * src/state.h (nstates, final_state, first_state, first_shift)
23024 (first_reduction): Move their exportation from here...
23025 * src/LR0.h: to here.
23026 Adjust dependencies.
23027 * src/getargs.c (statisticsflag): New variable.
23028 Add support for `--statistics'.
23029 Adjust dependencies.
23030
23031 Remove a lot of now useless `extern' statements in most files.
23032
403b315b
AD
230332000-10-02 Akim Demaille <akim@epita.fr>
23034
23035 * src/LR0.h: New file.
23036 Propagate its use.
23037
07a58c13
AD
230382000-10-02 Akim Demaille <akim@epita.fr>
23039
23040 * src/print.h: New file.
23041 Propagate its use.
23042 * src/print.c: Formatting and ordering changes.
23043 (verbose, terse): Replace with...
23044 (print_results): this new function.
23045 Adjust dependencies.
23046
0619caf0
AD
230472000-10-02 Akim Demaille <akim@epita.fr>
23048
23049 * src/conflicts.c (conflict_report): New function.
23050 (conflict_log, verbose_conflict_log): Replace with...
23051 (print_conflicts): this function.
23052 Adjust dependencies.
23053 * src/conflicts.h: New file.
23054 Propagate its inclusion.
23055
3519ec76
AD
230562000-10-02 Akim Demaille <akim@epita.fr>
23057
23058 * src/nullable.h: New file.
23059 Propagate its inclusion.
23060 * src/nullable.c: Formatting changes.
23061
015acc48
AD
230622000-10-02 Akim Demaille <akim@epita.fr>
23063
23064 * src/reduce.h: New file.
23065 Propagate its inclusion.
23066 * src/reduce.c: Topological sort and other formatting changes.
23067 (bool, TRUE, FALSE): Move their definition to...
23068 * src/system.h: here.
23069
8963a27b
AD
230702000-10-02 Akim Demaille <akim@epita.fr>
23071
23072 * src/files.c: Formatting changes.
23073 (tryopen, tryclose, openfiles): Rename as...
23074 (xfopen, xfclose, open_files): this.
23075 (stringappend): static.
23076 * src/files.h: Complete the list of exported symbols.
23077 Propagate its use.
23078
a70083a3
AD
230792000-10-02 Akim Demaille <akim@epita.fr>
23080
23081 * src/reader.h: New file.
23082 Propagate its use instead of tedious list of `extern' and
23083 prototypes.
23084 * src/reader.c: Formatting changes, topological sort,
23085 s/register//.
23086
abadc117
AD
230872000-10-02 Akim Demaille <akim@epita.fr>
23088
23089 * src/lex.h: Prototype `lex.c' exported functions.
23090 * src/reader.c: Adjust.
23091 * src/lex.c: Formatting changes.
23092 (safegetc): Rename as...
23093 (xgetc): this.
23094
720d742f
AD
230952000-10-02 Akim Demaille <akim@epita.fr>
23096
23097 * src/lalr.h: New file.
23098 Propagate its inclusion instead of prototypes and `extern'.
23099 * src/lalr.c: Formatting changes, topological sorting etc.
23100
f2acea59
AD
231012000-10-02 Akim Demaille <akim@epita.fr>
23102
23103 * src/output.c (token_actions): Introduce a temporary array,
23104 YYDEFACT, that makes it possible for this function to use
23105 output_short_table.
23106
d019d655
AD
231072000-10-02 Akim Demaille <akim@epita.fr>
23108
23109 `user_toknums' is output as a `short[]' in `output.c', while it is
23110 defined as a `int[]' in `reader.c'. For consistency with the
23111 other output tables, `user_toknums' is now defined as a table of
23112 shorts.
23113
23114 * src/reader.c (user_toknums): Be a short table instead of an int
23115 table.
23116 Adjust dependencies.
23117
23118 Factor the short table outputs.
23119
23120 * src/output.c (output_short_table): New function.
23121 * src/output.c (output_gram, output_stos, output_rule_data)
23122 (output_base, output_table, output_check): Use it.
23123
6c89f1c1
AD
231242000-10-02 Akim Demaille <akim@epita.fr>
23125
23126 * src/output.c (output): Topological sort of the functions, in
23127 order to get rid of the `static' prototypes.
23128 No longer use `register'.
23129 * src/output.h: New file.
23130 Propagate its inclusion in files explicitly prototyping functions
23131 from output.c.
23132
d9efd181
AD
231332000-09-21 Akim Demaille <akim@epita.fr>
23134
23135 * src/atgeneral.m4: Update from Autoconf.
23136
c29240e7 231372000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
23138
23139 * src/closure.h: New file.
23140 * src/closure.c: Formatting changes, topological sort over the
23141 functions, use of closure.h.
23142 (initialize_closure, finalize_closure): Rename as...
23143 (new_closure, free_closure): these. Adjust dependencies.
23144 * src/LR0.c: Formatting changes, topological sort, use of
23145 cloture.h.
23146 (initialize_states): Rename as...
23147 (new_states): this.
23148 * src/Makefile.am (noinst_HEADERS): Adjust.
23149
499daa50
AD
231502000-09-20 Akim Demaille <akim@epita.fr>
23151
23152 * src/acconfig.h: Don't protect config.h against multiple
23153 inclusion.
23154 Don't define PARAMS.
23155 * src/system.h: Define PARAMS.
23156 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
23157 purpose of config.h. system.h must not try to fix wrong
23158 definitions in config.h.
23159
cc84fd5d
AD
231602000-09-20 Akim Demaille <akim@epita.fr>
23161
23162 * src/derives.h: New file.
23163 * src/main.c, src/derives.h: Use it.
23164 Formatting changes.
23165 * src/Makefile.am (noinst_HEADERS): Adjust.
23166
db5b3a89
AD
231672000-09-20 Akim Demaille <akim@epita.fr>
23168
23169 * tests/atgeneral.m4: Update from Autoconf.
23170 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
23171 (AT_CHECK_CALC): New macros.
23172 Use these macros to test bison with options `', `--raw',
23173 `--debug', `--yacc', `--yacc --debug'.
23174
ceed8467
AD
231752000-09-19 Akim Demaille <akim@epita.fr>
23176
23177 * src/output.c: Formatting changes.
23178 * src/machine.h: Remove, leaving its contents in...
23179 * src/system.h: here.
23180 Include stdio.h.
23181 Adjust all dependencies on stdio.h and machine.h.
23182 * src/getargs.h: New file.
23183 Let all `extern' declarations about getargs.c be replaced with
23184 inclusion of `getargs.h'.
23185 * src/Makefile.am (noinst_HEADERS): Adjust.
23186
23187 * tests/calc.m4 (yyin): Be initialized in main, not on the global
23188 scope.
23189 (yyerror): Returns void, not int.
23190 * doc/bison.texinfo: Formatting changes.
23191
05a1d24b
AD
231922000-09-19 Akim Demaille <akim@epita.fr>
23193
23194 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
23195 portable.
23196
cbd25751
AD
231972000-09-18 Akim Demaille <akim@epita.fr>
23198
23199 * configure.in: Append WARNING_CFLAGS to CFLAGS.
23200 * src/Makefile.am (INCLUDES): Don't.
23201 Be ready to fetch headers in lib/.
23202
13863333
AD
232032000-09-18 Akim Demaille <akim@epita.fr>
23204
23205 * doc/bison.texinfo: Update the copyright.
23206 ANSIfy and GNUify the examples.
23207 Remove the old menu.
23208
0d533154
AD
232092000-09-18 Akim Demaille <akim@epita.fr>
23210
23211 First set of tests: use the `calc' example from the documentation.
23212
23213 * src/bison.s1 (yyparse): Condition the code using `yytname' which
23214 is defined only when YYDEBUG is.
23215 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
23216 * src/files.c (tryopen, tryclose): Formatting changes.
23217 Move to the top and be static.
23218 * src/reader.c (read_signed_integer): Likewise.
23219 * tests/calc.m4: New file.
23220 * Makefile.am, suite.m4: Adjust.
23221 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
23222
e79137ac
AD
232232000-09-18 Akim Demaille <akim@epita.fr>
23224
23225 Add support for an Autotest test suite for Bison.
23226
23227 * m4/m4.m4, m4/atconfig.m4: New files.
23228 * m4/Makefile.am (EXTRA_DIST): Adjust.
23229 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
23230 files.
23231 * src/getargs.c: Display a more standard --version message.
23232 * src/reader.c (reader): Formatting changes.
23233 No longer depend upon VERSION_STRING.
23234 * configure.in: No longer use `dnl'.
23235 Set up the test suite and the new directory `tests/.
23236 (VERSION_STRING): Remove.
23237
27821bff
AD
232382000-04-14 Akim Demaille <akim@epita.fr>
23239
23240 * src/reader.c (copy_comment2): New function, same as former
23241 `copy_comment', but outputs into two FILE *.
23242 (copy_comment): Use it.
23243 (parse_union_decl): Use it.
23244 (get_type, parse_start_decl): Use the same `invalid' message.
23245 (parse_start_decl, parse_union_decl): Use the same `multiple'
23246 message.
23247 (parse_union_decl, copy_guard, copy_action): Use the same
23248 `unmatched' message.
23249 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
23250
cfe5fbc0
AD
232512000-03-31 Akim Demaille <akim@epita.fr>
23252
23253 * src/files.c (tryopen, tryclose): Move to the top.
23254 Be static.
23255
cb7db13e
AD
232562000-03-31 Akim Demaille <akim@epita.fr>
23257
23258 * src/main.c (main): Don't call `done', exit does it.
23259
a0f6b076
AD
232602000-03-31 Akim Demaille <akim@epita.fr>
23261
36281465
AD
23262 * allocate.c: s/return (foo)/return foo/.
23263 * lalr.c: Likewise.
23264 * LR0.c: Likewise.
23265 * output.c: Likewise.
23266 * reader.c: Likewise.
23267 * symtab.c: Likewise.
23268 * vmsgetargs.c: Likewise.
23269
232702000-03-31 Akim Demaille <akim@epita.fr>
23271
23272 Clean up the error reporting functions.
a0f6b076
AD
23273
23274 * src/report.c: New file.
23275 * src/report.h: Likewise.
23276 * src/Makefile.am: Adjust.
23277 * m4/error.m4: New file.
23278 * m4/Makefile.am: Adjust.
23279 * configure.in (jm_PREREQ_ERROR): Call it.
23280 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
23281 Remove.
23282 (fatal, fatals): Remove. All callers use complain.c::fatal.
23283 (warn, warni, warns, warnss, warnss): Remove. All callers use
23284 complain.c::complain.
23285 (toomany): Remove, use fatal instead.
23286 * src/files.c (done): No argument, use complain_message_count.
23287 * src/main.c (main): Register `done' to `atexit'.
23288
23289 * src/getargs.c (usage): More `fputs', less `fprintf'.
23290
18539825
AD
232912000-03-28 Akim Demaille <akim@epita.fr>
23292
23293 * lib/: New directory.
23294 * Makefile.am (SUBDIRS): Adjust.
23295 * configure.in: Adjust.
23296 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
23297 useless.
23298 * src/alloca.c: Moved to lib/.
23299 * src/getopt.c: Likewise.
23300 * src/getopt1.c: Likewise.
23301 * src/getopt.h: Likewise.
23302 * src/ansi2knr.c: Likewise.
23303 * src/ansi2knr.1: Likewise.
23304 * src/Makefile.am: Adjust.
23305 * lib/Makefile.am: New file.
23306
9f306f2a
AD
233072000-03-28 Akim Demaille <akim@epita.fr>
23308
23309 * src/getargs.c (usage): Refresh the help message.
23310
0ba347b6
AD
233112000-03-17 Akim Demaille <akim@epita.fr>
23312
23313 * src/getopt1.c: Updated from textutils 2.0e
23314 * src/getopt.c: Likewise.
23315 * src/getopt.h: Likewise.
23316
dbe7f271
AD
233172000-03-17 Akim Demaille <akim@epita.fr>
23318
23319 * src/Makefile.am (bison.simple): Fix the awk program: quote only
23320 the file name, not the whole `#line LINE FILE'.
23321
75bbe78d
AD
233222000-03-17 Akim Demaille <akim@epita.fr>
23323
23324 On syntax errors, report the token on which we choked.
23325
aa5fd0ee
AD
23326 * src/bison.s1 (yyparse): In the label yyerrlab, when
23327 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 23328
7b306f52
AD
233292000-03-17 Akim Demaille <akim@epita.fr>
23330
aa5fd0ee 23331 * src/reader.c (copy_at): New function.
7b306f52
AD
23332 (copy_guard): Use it.
23333 (copy_action): Use it.
23334
e87b5700
AD
233352000-03-17 Akim Demaille <akim@epita.fr>
23336
23337 Be kind to translators, save some useless translations.
23338
aa5fd0ee 23339 * src/main.c (banner): New function.
e87b5700
AD
23340 (fatal_banner): Use it.
23341 (warn_banner): Use it.
23342
ae3c3164
AD
233432000-03-17 Akim Demaille <akim@epita.fr>
23344
aa5fd0ee
AD
23345 * src/reader.c (copy_definition): Use copy_string and
23346 copy_comment. Removed now unused `match', `ended',
23347 `cplus_comment'.
ae3c3164
AD
23348 (copy_comment, copy_string): Moved, to be visible from
23349 copy_definition.
23350
4dc58e7c
AD
233512000-03-17 Akim Demaille <akim@epita.fr>
23352
aa5fd0ee
AD
23353 * src/reader.c (copy_string): Declare `static inline'. No
23354 problems with inline, since it is checked by configure.
4dc58e7c
AD
23355 (copy_comment): Likewise.
23356
0a6384c4
AD
233572000-03-17 Akim Demaille <akim@epita.fr>
23358
aa5fd0ee 23359 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 23360
3cef001a
AD
233612000-03-17 Akim Demaille <akim@epita.fr>
23362
aa5fd0ee 23363 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
23364 (copy_action): Use it. Removed now unused `match', `ended',
23365 `cplus_comment'.
23366 (copy_guard): Likewise.
23367
ca36d2ef
AD
233682000-03-17 Akim Demaille <akim@epita.fr>
23369
aa5fd0ee 23370 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
23371 (copy_action): Use it.
23372 (copy_guard): Likewise.
23373
6666f98f
AD
233742000-03-17 Akim Demaille <akim@epita.fr>
23375
23376 Change the handling of @s so that they behave exactly like $s.
23377 There is now a pseudo variable @$ (readble and writable), location
23378 of the lhs of the rule (by default ranging from the location of
23379 the first symbol of the rhs, to the location of the last symbol,
23380 or, if the rhs is empty, YYLLOC).
23381
23382 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
23383 yyval.
23384 (yyparse): When providing a default semantic action, provide a
23385 default location action.
23386 (after the $): No longer change `*YYLSP', just stack YYLOC the
23387 same way you stack YYVAL.
23388 * src/reader.c (read_declarations): Use warns.
23389 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
23390 (copy_action, case '@'): Likewise.
23391 Use a standard error message, to save useless work from
23392 translators.
23393
41aca2e0
AD
233942000-03-17 Akim Demaille <akim@epita.fr>
23395
aa5fd0ee
AD
23396 * src/bison.s1: Formatting and cosmetics changes.
23397 * src/reader.c: Likewise.
41aca2e0
AD
23398 Update the Copyright notice.
23399
dc08c1d5
AD
234002000-03-17 Akim Demaille <akim@epita.fr>
23401
aa5fd0ee
AD
23402 * src/bison.s1 (#line): All set to `#line' only, since the
23403 Makefile now handles them.
dc08c1d5 23404
9ee3c97b
AD
234052000-03-16 Akim Demaille <akim@epita.fr>
23406
23407 * src/output.c (output_rule_data): Output the documentation of
23408 some of the tables.
23409 (Copyright notice): Update.
23410 Formatting changes.
23411
0de741ca
AD
234122000-03-16 Akim Demaille <akim@epita.fr>
23413
23414 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
23415 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
23416 One `#if YYDEBUG' remains, since it uses variables which are
23417 defined only if `YYDEBUG != 0'.
23418
bb10be54
AD
234192000-03-16 Akim Demaille <akim@epita.fr>
23420
23421 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
23422 and related variables so that the similarities are highlighted.
23423
b07b484a
AD
234242000-03-16 Akim Demaille <akim@epita.fr>
23425
23426 * src/bison.s1: Properly indent CPP directives.
23427
361f60b3
AD
234282000-03-16 Akim Demaille <akim@epita.fr>
23429
23430 * src/bison.s1: Properly indent the `alloca' CPP section.
23431
8c44d3ec
AD
234322000-03-16 Akim Demaille <akim@epita.fr>
23433
23434 Do not hard code values of directories in `configure.in'.
23435 Update the `configure' tool chain.
23436
23437 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23438 src/makefile.am.
23439 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23440 (AC_OUTPUT): Add m4/Makefile.
23441 Bump to bison 1.28a, 1.29 has never been released.
23442 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23443 handled via src/Makefile.am.
23444 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23445 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23446 autoheader.
23447 * Makefile.am (SUBDIRS): Add m4.
23448 (ACLOCAL_AM_FLAGS): New variable.
23449 (AUTOMAKE_OPTIONS): Add check-news.
23450 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23451 the proper line number and file name.
23452 (DEFS): Propagate the location of bison library files and of the
23453 locale files.
23454 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23455 builddir.
23456 * acinclude.m4: Remove, replaced by the directory m4.
23457 * m4/Makefile.am (EXTRA_DIST): New variable.
23458 * m4/gettext.m4: New file, from the fileutils.
23459 * m4/lcmessage.m4: Likewise
23460 * m4/progtest.m4: Likewise.
23461 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23462
f95997e7
AD
234632000-03-10 Akim Demaille <akim@epita.fr>
23464
23465 * src/closure.c:
23466 Formatting changes of various comments.
23467 Respect the GNU coding standards at various places.
23468 Don't use `_()' when no translation is needed.
23469
234701999-12-13 Jesse Thilo <jthilo@gnu.org>
23471
23472 * src/files.c:
23473 OS/2 honors TMPDIR environment variable.
23474
234751999-12-13 Jesse Thilo <jthilo@gnu.org>
23476
23477 * doc/bison.texinfo: Tweaked spelling and grammar.
23478 Updated ISBN.
23479 Removed reference to price of printed copy.
23480 Mention BISON_SIMPLE and BISON_HAIRY.
23481
234821999-12-13 Jesse Thilo <jthilo@gnu.org>
23483
23484 * configure.in, NEWS:
23485 Bison 1.29 released.
23486
234871999-10-27 Jesse Thilo <jthilo@gnu.org>
23488
23489 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23490 Added reference card.
23491
234921999-07-26 Jesse Thilo <jthilo@gnu.org>
23493
23494 * po/ru.po: Added Russian translation.
23495
234961999-07-26 Jesse Thilo <jthilo@gnu.org>
23497
23498 * configure.in: Added Russian translation.
23499
235001999-07-06 Jesse Thilo <jthilo@gnu.org>
23501
23502 * configure.in, NEWS, README:
23503 Released version 1.28.
23504
235051999-06-14 Jesse Thilo <jthilo@gnu.org>
23506
23507 * src/system.h:
23508 Squashed redefinition warning on some systems.
23509
23510 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
23511 Have configure build version string instead of relying on ANSI string
23512 concatentation.
23513
235141999-06-14 Jesse Thilo <jthilo@gnu.org>
23515
23516 * po/POTFILES.in: Got rid of version.c.
23517
235181999-06-14 Jesse Thilo <jthilo@gnu.org>
23519
23520 * acconfig.h, configure.in:
23521 Have configure build version string instead of relying on ANSI string
23522 concatentation.
23523
235241999-06-08 Jesse Thilo <jthilo@gnu.org>
23525
23526 * doc/bison.1:
23527 Dropped mention of `+' for long-named options.
23528
235291999-05-30 Jesse Thilo <jthilo@gnu.org>
23530
23531 * src/files.c: Added <unistd.h> for unlink().
23532
23533 * src/Makefile.am, src/system.h:
23534 I18n fixes.
23535
235361999-05-30 Jesse Thilo <jthilo@gnu.org>
23537
23538 * README: Added a FAQ list.
23539
23540 * configure.in, acconfig.h:
23541 I18n fixes.
23542
235431999-05-30 Jesse Thilo <jthilo@gnu.org>
23544
23545 * doc/FAQ, doc/Makefile.am:
23546 Added a FAQ list.
23547
235481999-05-19 Jesse Thilo <jthilo@gnu.org>
23549
23550 * src/alloc.h, src/symtab.h, src/version.c:
23551 Protected inclusion of "config.h" with HAVE_CONFIG_H.
23552
235531999-04-18 Jesse Thilo <jthilo@gnu.org>
23554
23555 * src/.cvsignore, src/Makefile.am:
23556 Reorganized: sources in `src', documentation in `doc'.
23557
23558 * src/lex.c (literalchar):
23559 fixed the code for escaping double quotes (thanks
23560 Jonathan Czisny.)
23561
235621999-04-18 Jesse Thilo <jthilo@gnu.org>
23563
23564 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
23565 Adjusted paths to reflect directory reorganization.
23566
235671999-04-18 Jesse Thilo <jthilo@gnu.org>
23568
23569 * doc/.cvsignore, doc/Makefile.am:
23570 Reorganized: sources in `src', documentation in `doc'.
23571
235721999-04-18 Jesse Thilo <jthilo@gnu.org>
23573
23574 * configure.in:
23575 Updated AC_INIT file to reflect directory reorganization.
23576
23577 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
23578 Reorganized: sources in `src', documentation in `doc'.
23579
235801999-04-13 Jesse Thilo <jthilo@gnu.org>
23581
23582 * src/allocate.c:
23583 Don't declare calloc() and realloc() if not necessary.
23584
235851999-04-13 Jesse Thilo <jthilo@gnu.org>
23586
23587 * configure.in, acconfig.h, acinclude.m4:
23588 Don't declare calloc() and realloc() if not necessary.
23589
235901999-03-23 Jesse Thilo <jthilo@gnu.org>
23591
23592 * po/.cvsignore: Added i18n support.
23593
235941999-03-23 Jesse Thilo <jthilo@gnu.org>
23595
23596 * acconfig.h, configure.in, Makefile.am:
23597 Added i18n support.
23598
235991999-03-22 Jesse Thilo <jthilo@gnu.org>
23600
23601 * src/bison.s1: Fixed #line numbers.
23602
236031999-03-15 Jesse Thilo <jthilo@gnu.org>
23604
23605 * po/es.po, po/fr.po, po/nl.po, po/de.po:
23606 Added PO files from Translation Project.
23607
236081999-03-03 Jesse Thilo <jthilo@gnu.org>
23609
23610 * Makefile.am:
23611 Added support for non-ANSI compilers (ansi2knr).
23612
236131999-02-16 Jesse Thilo <jthilo@gnu.org>
23614
23615 * configure.in: Bumped version number to 1.27.
23616
23617 * Makefile.am:
23618 Added `bison.simple' to list of files removed by `make distclean'.
23619
236201999-02-12 Jesse Thilo <jthilo@gnu.org>
23621
23622 * src/files.c, src/files.h:
23623 Defined locations of parser files in config.h instead of Makefile.
23624
236251999-02-12 Jesse Thilo <jthilo@gnu.org>
23626
23627 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
23628 Defined locations of parser files in config.h instead of Makefile.
23629
236301999-02-09 Jesse Thilo <jthilo@gnu.org>
23631
23632 * Makefile.am:
23633 Removed inappropriate use of $< macro.
23634
236351999-02-05 Jesse Thilo <jthilo@gnu.org>
23636
23637 * po/Makefile.in.in, po/POTFILES.in:
23638 Add `po' directory skeleton.
23639
236401999-01-27 Jesse Thilo <jthilo@gnu.org>
23641
23642 * README: Document help-bison list.
23643
23644 * configure.in: Add check for mkstemp().
23645
236461999-01-20 Jesse Thilo <jthilo@gnu.org>
23647
23648 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
23649 Hush a few compiler warnings.
23650
23651 * src/files.c:
23652 Add tryclose(), which verifies that fclose was successful.
23653 Hush a couple of compiler warnings.
23654
236551999-01-20 Jesse Thilo <jthilo@gnu.org>
23656
23657 * Makefile.am, OChangeLog:
23658 ChangeLog is now automatically generated. Include the old version as
23659 OChangeLog.
23660
236611999-01-14 Jesse Thilo <jthilo@gnu.org>
23662
23663 * 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:
23664 Update FSF address.
23665
236661999-01-14 Jesse Thilo <jthilo@gnu.org>
23667
23668 * doc/bison.texinfo: Fix formatting glitch.
23669
23670 * doc/bison.texinfo: Update FSF address.
23671
236721999-01-14 Jesse Thilo <jthilo@gnu.org>
23673
23674 * acconfig.h: Update FSF address.
23675
236761999-01-08 Jesse Thilo <jthilo@gnu.org>
23677
23678 * src/system.h:
23679 Don't define PACKAGE here, since config.h defines it.
23680
236811998-12-30 Jesse Thilo <jthilo@gnu.org>
23682
23683 * src/reader.c: Update copyright date.
23684
23685 * src/main.c:
23686 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23687 favor of output directly to stderr (avoids buffer overruns).
23688
23689 * src/reader.c: Some checks for premature EOF.
23690
23691 * 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:
23692 Use prototypes if the compiler understands them.
23693
23694 * src/files.c: Honor TMPDIR on Unix hosts.
23695 Use prototypes if the compiler understands them.
23696
23697 * src/reader.c:
23698 Fix a couple of buffer overrun bugs.
23699 Use prototypes if the compiler understands them.
23700
23701 * src/system.h: Include unistd.h and ctype.h.
23702 Use #ifdef instead of #if for NLS symbols.
23703
237041998-12-30 Jesse Thilo <jthilo@gnu.org>
23705
23706 * doc/bison.texinfo:
23707 Delete comment "consider using @set for edition number, etc..." since
23708 we now are doing so.
23709
237101998-12-30 Jesse Thilo <jthilo@gnu.org>
23711
23712 * configure.in:
23713 Use prototypes if the compiler understands them.
23714
23715 * NEWS: Document 1.26 highlights.
23716
23717 * Makefile.am: Require Automake 1.3 or later.
23718
23719 * acconfig.h:
23720 Use prototypes if the compiler understands them.
23721
237221998-12-29 Jesse Thilo <jthilo@gnu.org>
23723
23724 * src/version.c:
23725 Use VERSION symbol from automake for version number.
23726
237271998-12-29 Jesse Thilo <jthilo@gnu.org>
23728
23729 * acconfig.h, configure.in, version.cin:
23730 Use VERSION symbol from automake for version number.
23731
237321998-11-28 Jesse Thilo <jthilo@gnu.org>
23733
23734 * Makefile.am:
23735 Distribute original version of simple parser (bison.s1), not built
23736 version (bison.simple).
23737
237381998-11-28 Jesse Thilo <jthilo@gnu.org>
23739
23740 * doc/bison.texinfo: Add info dir entry.
23741
23742 * doc/bison.texinfo:
23743 Let automake put version number into documentation.
23744
237451998-11-26 Jesse Thilo <jthilo@gnu.org>
23746
23747 * src/bison.cld, src/build.com, src/vmshlp.mar:
23748 Add non-RCS files from /gd/gnu/bison.
23749
237501998-11-26 Jesse Thilo <jthilo@gnu.org>
23751
23752 * doc/bison.1:
23753 Document the BISON_HAIRY and BISON_SIMPLE variables.
23754
237551998-11-25 Jesse Thilo <jthilo@gnu.org>
23756
23757 * src/version.c: Build version.c automatically.
23758
23759 * src/reader.c:
23760 Fix token numbering (used to start at 258, not 257).
23761
23762 * src/system.h: Include config.h.
23763
23764 * src/getargs.c: Update bug report address.
23765
23766 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23767 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23768
237691998-11-25 Jesse Thilo <jthilo@gnu.org>
23770
23771 * Makefile.am:
23772 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23773
23774 * configure.in, version.cin:
23775 Build version.c automatically.
23776
23777 * AUTHORS: Add AUTHORS file.
23778
23779 * README: Update bug report address.
23780
23781 * bison.simple:
23782 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23783
23784 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23785 Add automake stuff.
23786
237871998-11-25 Jesse Thilo <jthilo@gnu.org>
23788
23789 * doc/bison.texinfo: Clean up some formatting.
23790
237911998-05-05 Richard Stallman <rms@gnu.org>
23792
23793 * doc/bison.texinfo:
23794 Explain better why to make a pure parser.
23795
237961998-01-05 Richard Stallman <rms@gnu.org>
23797
23798 * src/files.c (openfiles):
23799 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23800 find a temporary directory, if possible. Do not unlink files while
23801 they are open.
23802
238031997-08-25 Richard Stallman <rms@gnu.org>
23804
23805 * src/reader.c (stack_offset;):
23806 Change some warni to warns.
23807
23808 * src/lex.c (literalchar): Use warns, not warni.
23809
238101997-06-28 Richard Stallman <rms@gnu.org>
23811
23812 * src/bison.s1: Add a Bison version comment.
23813
23814 * src/main.c (fatal, warn, berror):
23815 Use program_name.
23816
238171997-06-28 Richard Stallman <rms@gnu.org>
23818
23819 * Makefile.in (bison_version): New variable.
23820 (dist): Use that variable.
23821 (bison.s1): Substitute the Bison version into bison.simple.
23822
23823 * bison.simple: Add a Bison version comment.
23824
238251997-06-18 Richard Stallman <rms@gnu.org>
23826
23827 * src/main.c (fatal, warn, berror):
23828 Make error messages standard.
23829 (toomany): Improve error message text.
23830
23831 * 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:
23832 new.h renamed to alloc.h.
23833
238341997-06-18 Richard Stallman <rms@gnu.org>
23835
23836 * Makefile.in: new.h renamed to alloc.h.
23837
238381997-05-24 Richard Stallman <rms@gnu.org>
23839
23840 * src/lex.c (literalchar):
23841 Fix the code for escaping \, " and '.
23842
23843 (lex): Avoid trouble when there are many chars
23844 to discard in a char literal with just several chars in it.
23845
238461997-05-17 Richard Stallman <rms@gnu.org>
23847
23848 * src/bison.s1:
23849 Use malloc, if using alloca is troublesome.
23850 (YYSTACK_USE_ALLOCA): New flag macro.
23851 Define it for some systems and compilers.
23852 (YYSTACK_ALLOC): New macro.
23853 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23854 If it was malloc'd, free it.
23855
238561997-05-17 Richard Stallman <rms@gnu.org>
23857
23858 * bison.simple:
23859 Use malloc, if using alloca is troublesome.
23860 (YYSTACK_USE_ALLOCA): New flag macro.
23861 Define it for some systems and compilers.
23862 (YYSTACK_ALLOC): New macro.
23863 (yyparse): Use YYSTACK_ALLOC to allocate stack.
23864 If it was malloc'd, free it.
23865
238661997-04-23 Richard Stallman <rms@gnu.org>
23867
23868 * src/bison.s1:
23869 (alloca) [__hpux]: Always define as __builtin_alloca.
23870
238711997-04-23 Richard Stallman <rms@gnu.org>
23872
23873 * bison.simple:
23874 (alloca) [__hpux]: Always define as __builtin_alloca.
23875
238761997-04-22 Richard Stallman <rms@gnu.org>
23877
23878 * src/bison.s1:
23879 [__hpux]: Include alloca.h (right for HPUX 10)
23880 instead of declaring alloca (right for HPUX 9).
23881
23882 * src/bison.s1 (__yy_memcpy):
23883 Declare arg `count' as unsigned int.
23884 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23885
238861997-04-22 Richard Stallman <rms@gnu.org>
23887
23888 * bison.simple:
23889 [__hpux]: Include alloca.h (right for HPUX 10)
23890 instead of declaring alloca (right for HPUX 9).
23891
23892 * bison.simple (__yy_memcpy):
23893 Declare arg `count' as unsigned int.
23894 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
23895
238961997-01-03 Richard Stallman <rms@gnu.org>
23897
23898 * src/allocate.c: [__STDC__ or _MSC_VER]:
23899 Declare calloc and realloc to return void *.
23900
239011997-01-02 Richard Stallman <rms@gnu.org>
23902
23903 * src/system.h:
23904 [_MSC_VER]: Include stdlib.h and process.h.
23905 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
23906
23907 * src/main.c (main): Return FAILURE as a value.
23908 (printable_version): Declare arg as int, not char.
23909
239101997-01-02 Richard Stallman <rms@gnu.org>
23911
23912 * Makefile.in (dist):
23913 Explicitly check for symlinks, and copy them.
23914
239151996-12-19 Richard Stallman <rms@gnu.org>
23916
23917 * src/files.c:
23918 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
23919
239201996-12-18 Paul Eggert <eggert@gnu.org>
23921
23922 * src/bison.s1 (yyparse):
23923 If __GNUC__ and YYPARSE_PARAM are both defined,
23924 declare yyparse to have a void * argument.
23925
239261996-12-18 Paul Eggert <eggert@gnu.org>
23927
23928 * bison.simple (yyparse):
23929 If __GNUC__ and YYPARSE_PARAM are both defined,
23930 declare yyparse to have a void * argument.
23931
239321996-12-17 Richard Stallman <rms@gnu.org>
23933
23934 * src/reduce.c (nbits): Add some casts.
23935
239361996-08-12 Richard Stallman <rms@gnu.org>
23937
23938 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
23939
239401996-08-12 Richard Stallman <rms@gnu.org>
23941
23942 * bison.simple: Test _MSDOS as well as _MSDOS_.
23943
239441996-07-31 Richard Stallman <rms@gnu.org>
23945
23946 * src/bison.s1:
23947 [__sun && __i386]: Include alloca.h.
23948
239491996-07-31 Richard Stallman <rms@gnu.org>
23950
23951 * bison.simple:
23952 [__sun && __i386]: Include alloca.h.
23953
239541996-07-30 Richard Stallman <rms@gnu.org>
23955
23956 * src/bison.s1: Comment change.
23957
23958 * src/bison.s1: Test _MSDOS_, not MSDOS.
23959
239601996-07-30 Richard Stallman <rms@gnu.org>
23961
23962 * bison.simple: Comment change.
23963
23964 * bison.simple: Test _MSDOS_, not MSDOS.
23965
239661996-06-01 Richard Stallman <rms@gnu.org>
23967
23968 * 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:
23969 Insert `_' macro around many string constants.
23970
23971 * src/main.c:
23972 Insert `_' macro around many string constants.
23973
23974 (main): Call setlocale, bindtextdomain and textdomain.
23975
23976 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
23977 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
23978 [ENABLE_NLS]: Include libintl.h.
23979 [ENABLE_NLS] (gettext): Define.
23980 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
23981 (N_, PACKAGE, LOCALEDIR): New macros.
23982
239831996-06-01 Richard Stallman <rms@gnu.org>
23984
23985 * POTFILES.in: New file.
23986
23987 * Makefile.in (allocate.o):
23988 Define target explicitly.
23989
23990 * Makefile.in (CFLAGS): Set to @CFLAGS@.
23991 (LDFLAGS): Set to @LDFLAGS@.
23992 (configure): Run autoconf only if preceding `cd' succeeds.
23993 (bison.s1): Redirect output to temporary file then move the
23994 temporary to the target, rather than redirecting directly to bison.s1.
23995 (clean): Remove config.status and config.log.
23996 (distclean): Don't remove config.status here.
23997
239981996-05-12 Richard Stallman <rms@gnu.org>
23999
24000 * src/bison.s1:
24001 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24002
240031996-05-12 Richard Stallman <rms@gnu.org>
24004
24005 * bison.simple:
24006 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24007
240081996-05-11 Richard Stallman <rms@gnu.org>
24009
24010 * src/bison.s1 (__yy_memcpy):
24011 Really reorder the args, as was supposedly done on Feb 14 1995.
24012 (yyparse): Calls changed accordingly.
24013
240141996-05-11 Richard Stallman <rms@gnu.org>
24015
24016 * Makefile.in (dist): Don't use $(srcdir).
24017
24018 * bison.simple (__yy_memcpy):
24019 Really reorder the args, as was supposedly done on Feb 14 1995.
24020 (yyparse): Calls changed accordingly.
24021
240221996-01-27 Richard Stallman <rms@gnu.org>
24023
24024 * src/output.c (output_rule_data):
24025 Test YYERROR_VERBOSE in the conditional
24026 around the definition of ttyname.
24027
240281995-12-29 Richard Stallman <rms@gnu.org>
24029
24030 * src/bison.s1:
24031 Fix line numbers in #line commands.
24032
240331995-12-29 Richard Stallman <rms@gnu.org>
24034
24035 * bison.simple:
24036 Fix line numbers in #line commands.
24037
240381995-12-27 Richard Stallman <rms@gnu.org>
24039
24040 * src/bison.s1 (YYPARSE_PARAM_DECL):
24041 In C++, make it always null.
24042 (YYPARSE_PARAM_ARG): New macro.
24043 (yyparse): Use YYPARSE_PARAM_ARG.
24044
240451995-12-27 Richard Stallman <rms@gnu.org>
24046
24047 * bison.simple (YYPARSE_PARAM_DECL):
24048 In C++, make it always null.
24049 (YYPARSE_PARAM_ARG): New macro.
24050 (yyparse): Use YYPARSE_PARAM_ARG.
24051
240521995-11-29 Richard Stallman <rms@gnu.org>
24053
24054 * doc/bison.texinfo:
24055 Describe literal string tokens, %raw, %no_lines, %token_table.
24056
240571995-11-29 Daniel Hagerty <hag@gnu.org>
24058
24059 * doc/bison.texinfo: Fixed update date
24060
240611995-10-16 Richard Stallman <rms@gnu.org>
24062
24063 * src/version.c: Version 1.25.
24064
240651995-10-16 Richard Stallman <rms@gnu.org>
24066
24067 * NEWS: *** empty log message ***
24068
240691995-10-16 Richard Stallman <rms@gnu.org>
24070
24071 * doc/bison.1, doc/bison.rnh:
24072 Add new options.
24073
240741995-10-15 Richard Stallman <rms@gnu.org>
24075
24076 * src/vmsgetargs.c, src/getargs.c:
24077 Added -n, -k, and -raw switches.
24078 (noparserflag, toknumflag, rawtoknumflag): New variables.
24079
24080 * src/symtab.h (SALIAS):
24081 New #define for adding aliases to %token.
24082 (struct bucket): Added `alias' field.
24083
24084 * src/reduce.c (reduce_grammar):
24085 Revise error message.
24086 (print_notices): Remove final `.' from error message.
24087
24088 * src/reader.c (reader_output_yylsp):
24089 New function.
24090 (readgram): Use `#if 0' around code that accepted %command
24091 inside grammar rules: The documentation doesn't allow it,
24092 and it will fail since the %command processors scan for the next %.
24093 (parse_token_decl): Extended the %token
24094 declaration to allow a multi-character symbol as an alias.
24095 (parse_thong_decl): New function.
24096 (read_declarations): Added %thong declarations.
24097 (read_declarations): Handle NOOP to deal with allowing
24098 % declarations as another means to specify the flags.
24099 (readgram): Allow %prec prior to semantics embedded in a rule.
24100 (skip_to_char, read_declarations, copy_definition)
24101 (parse_token_decl, parse_start_decl, parse_type_decl)
24102 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
24103 (get_type_name, copy_guard, copy_action, readgram)
24104 (get_type, packsymbols): Revised most error messages.
24105 Changed `fatal' to `warnxxx' to avoid aborting for error.
24106 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24107 (read_declarations): Improve the error message for
24108 an invalid character. Do not abort.
24109 (read_declarations, copy_guard, copy_action): Use
24110 printable_version to avoid unprintable characters in printed output.
24111 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24112 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24113 Allow the type of a non-terminal can be given
24114 more than once, as long as all specifications give the same type.
24115
24116 * src/output.c:
24117 (output_headers, output_trailers, output, output_gram)
24118 (output_rule_data): Implement noparserflag variable.
24119 Implement toknumflag variable.
24120 (output): Call reader_output_yylsp to output LTYPESTR.
24121
24122 * src/main.c (main):
24123 If reader sees an error, don't process the grammar.
24124 (fatals): Updated to not use VARARGS1.
24125 (printable_version, int_to_string, warn, warni, warns, warnss)
24126 (warnsss): New error reporting functions. Avoid abort for error.
24127
24128 * src/lex.h:
24129 Added THONG and NOOP for alias processing.
24130 Added SETOPT for the new code that allows setting options with %flags.
24131
24132 * src/lex.c:
24133 Include getopt.h. Add some extern decls.
24134 (safegetc): New function to deal with EOF gracefully.
24135 (literalchar); new function to deal with reading \ escapes.
24136 (lex): Use literalchar.
24137 (lex): Implemented "..." tokens.
24138 (literalchar, lex, parse_percent_token): Made tokenbuffer
24139 always contain the token. This includes growing the token
24140 buffer while reading an integer.
24141 (parse_percent_token): Replaced if-else statement with percent_table.
24142 (parse_percent_token): Added % declarations as another
24143 way to specify the flags -n, -l, and -r. Also added hooks for
24144 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
24145 major changes to files.c.
24146 (lex) Retain in the incoming stream a character following
24147 an incorrect '/'.
24148 (skip_white_space, lex): Revised most error messages
24149 and changed fatal to warn to avoid aborting.
24150 (percent_table): Added %thong declarations.
24151
24152 * src/gram.h: Comment changes.
24153
24154 * src/files.c (openfiles, open_extra_files, done):
24155 Add faction flag
24156 and actfile file. Handle noparserflag. Both for -n switch.
24157
24158 * src/conflicts.c (resolve_sr_conflict):
24159 Remove use of alloca.
24160
241611995-06-01 Jim Meyering <meyering@gnu.org>
24162
24163 * doc/bison.texinfo: *** empty log message ***
24164
241651995-05-06 Richard Stallman <rms@gnu.org>
24166
24167 * src/bison.s1: Comment change.
24168
241691995-05-06 Richard Stallman <rms@gnu.org>
24170
24171 * bison.simple: Comment change.
24172
241731995-05-03 Richard Stallman <rms@gnu.org>
24174
24175 * src/version.c: Version now 1.24.
24176
24177 * src/bison.s1: Change distribution terms.
24178
24179 * src/version.c: Version now 1.23.
24180
241811995-05-03 Richard Stallman <rms@gnu.org>
24182
24183 * doc/bison.texinfo:
24184 Rewrite "Conditions for Using Bison".
24185 Update version to 1.24.
24186
241871995-05-03 Richard Stallman <rms@gnu.org>
24188
24189 * bison.simple: Change distribution terms.
24190
241911995-02-23 Richard Stallman <rms@gnu.org>
24192
24193 * src/files.c: Test __VMS_POSIX as well as VMS.
24194
241951995-02-14 Jim Meyering <meyering@gnu.org>
24196
24197 * src/bison.s1 (__yy_memcpy):
24198 Renamed from __yy_bcopy to avoid
24199 confusion. Reverse FROM and TO arguments to be consistent with
24200 those of memcpy.
24201
242021995-02-14 Jim Meyering <meyering@gnu.org>
24203
24204 * bison.simple (__yy_memcpy):
24205 Renamed from __yy_bcopy to avoid
24206 confusion. Reverse FROM and TO arguments to be consistent with
24207 those of memcpy.
24208
242091994-11-10 David J. MacKenzie <djm@gnu.org>
24210
24211 * NEWS: reformat
24212
24213 * NEWS: New file.
24214
24215 * Makefile.in (DISTFILES): Include NEWS.
24216
24217 * Makefile.in (DISTFILES):
24218 Include install-sh, not install.sh.
24219
24220 * configure.in: Update to Autoconf v2 macro names.
24221
242221994-10-05 David J. MacKenzie <djm@gnu.org>
24223
24224 * Makefile.in: fix typo
24225
24226 * Makefile.in (prefix, exec_prefix):
24227 Let configure set them.
24228
242291994-09-28 David J. MacKenzie <djm@gnu.org>
24230
24231 * Makefile.in: Set datadir to $(prefix)/share.
24232
242331994-09-15 Richard Stallman <rms@gnu.org>
24234
24235 * src/bison.s1:
24236 Update copyright notice and GPL version.
24237
242381994-09-15 Richard Stallman <rms@gnu.org>
24239
24240 * bison.simple:
24241 Update copyright notice and GPL version.
24242
242431994-07-12 Richard Stallman <rms@gnu.org>
24244
24245 * src/reduce.c, src/reader.c:
24246 entered into RCS
24247
242481994-05-05 David J. MacKenzie <djm@gnu.org>
24249
24250 * Makefile.in: entered into RCS
24251
242521994-03-26 Richard Stallman <rms@gnu.org>
24253
24254 * src/bison.s1: entered into RCS
24255
242561994-03-26 Richard Stallman <rms@gnu.org>
24257
24258 * bison.simple: entered into RCS
24259
242601994-03-25 Richard Stallman <rms@gnu.org>
24261
24262 * src/main.c: entered into RCS
24263
242641994-03-24 Richard Stallman <rms@gnu.org>
24265
24266 * src/conflicts.c: entered into RCS
24267
242681994-01-02 Richard Stallman <rms@gnu.org>
24269
24270 * Makefile.in: *** empty log message ***
24271
242721993-11-21 Richard Stallman <rms@gnu.org>
24273
24274 * src/bison.s1: *** empty log message ***
24275
242761993-11-21 Richard Stallman <rms@gnu.org>
24277
24278 * doc/bison.texinfo: entered into RCS
24279
24280 * doc/bison.texinfo: *** empty log message ***
24281
242821993-11-21 Richard Stallman <rms@gnu.org>
24283
24284 * bison.simple: *** empty log message ***
24285
242861993-10-25 David J. MacKenzie <djm@gnu.org>
24287
24288 * doc/bison.texinfo: *** empty log message ***
24289
242901993-10-19 Richard Stallman <rms@gnu.org>
24291
24292 * src/bison.s1: *** empty log message ***
24293
242941993-10-19 Richard Stallman <rms@gnu.org>
24295
24296 * bison.simple: *** empty log message ***
24297
242981993-10-14 Richard Stallman <rms@gnu.org>
24299
24300 * src/bison.s1: *** empty log message ***
24301
243021993-10-14 Richard Stallman <rms@gnu.org>
24303
24304 * bison.simple: *** empty log message ***
24305
243061993-09-14 David J. MacKenzie <djm@gnu.org>
24307
24308 * doc/bison.texinfo: *** empty log message ***
24309
243101993-09-13 Noah Friedman <friedman@gnu.org>
24311
24312 * Makefile.in: *** empty log message ***
24313
243141993-09-10 Richard Stallman <rms@gnu.org>
24315
24316 * src/conflicts.c: *** empty log message ***
24317
24318 * src/system.h: entered into RCS
24319
243201993-09-10 Richard Stallman <rms@gnu.org>
24321
24322 * doc/bison.1: entered into RCS
24323
243241993-09-06 Noah Friedman <friedman@gnu.org>
24325
24326 * src/version.c: entered into RCS
24327
243281993-09-06 Noah Friedman <friedman@gnu.org>
24329
24330 * Makefile.in: *** empty log message ***
24331
243321993-07-30 David J. MacKenzie <djm@gnu.org>
24333
24334 * Makefile.in: *** empty log message ***
24335
243361993-07-24 Richard Stallman <rms@gnu.org>
24337
24338 * src/bison.s1: *** empty log message ***
24339
243401993-07-24 Richard Stallman <rms@gnu.org>
24341
24342 * bison.simple: *** empty log message ***
24343
243441993-07-08 David J. MacKenzie <djm@gnu.org>
24345
24346 * Makefile.in: *** empty log message ***
24347
243481993-07-04 Richard Stallman <rms@gnu.org>
24349
24350 * src/bison.s1: *** empty log message ***
24351
243521993-07-04 Richard Stallman <rms@gnu.org>
24353
24354 * bison.simple: *** empty log message ***
24355
243561993-06-26 David J. MacKenzie <djm@gnu.org>
24357
24358 * src/getargs.c: entered into RCS
24359
243601993-06-26 David J. MacKenzie <djm@gnu.org>
24361
24362 * doc/bison.texinfo: *** empty log message ***
24363
24364 * doc/bison.1: New file.
24365
243661993-06-25 Richard Stallman <rms@gnu.org>
24367
24368 * src/getargs.c: New file.
24369
243701993-06-16 Richard Stallman <rms@gnu.org>
24371
24372 * src/bison.s1: *** empty log message ***
24373
243741993-06-16 Richard Stallman <rms@gnu.org>
24375
24376 * bison.simple: *** empty log message ***
24377
243781993-06-03 Richard Stallman <rms@gnu.org>
24379
24380 * src/bison.s1: New file.
24381
243821993-06-03 Richard Stallman <rms@gnu.org>
24383
24384 * doc/bison.texinfo: *** empty log message ***
24385
243861993-06-03 Richard Stallman <rms@gnu.org>
24387
24388 * bison.simple: New file.
24389
243901993-05-19 Richard Stallman <rms@gnu.org>
24391
24392 * doc/bison.texinfo: New file.
24393
243941993-05-07 Noah Friedman <friedman@gnu.org>
24395
24396 * Makefile.in: *** empty log message ***
24397
243981993-04-28 Noah Friedman <friedman@gnu.org>
24399
24400 * src/reader.c: *** empty log message ***
24401
244021993-04-23 Noah Friedman <friedman@gnu.org>
24403
24404 * src/alloc.h: entered into RCS
24405
244061993-04-20 David J. MacKenzie <djm@gnu.org>
24407
24408 * src/version.c: *** empty log message ***
24409
24410 * src/files.c, src/allocate.c:
24411 entered into RCS
24412
24413 * src/reader.c: *** empty log message ***
24414
24415 * src/lex.c: entered into RCS
24416
24417 * src/conflicts.c: New file.
24418
24419 * src/symtab.c: entered into RCS
24420
24421 * src/alloc.h: New file.
24422
24423 * src/LR0.c: entered into RCS
24424
244251993-04-18 Noah Friedman <friedman@gnu.org>
24426
24427 * src/reader.c: New file.
24428
24429 * src/version.c: *** empty log message ***
24430
244311993-04-18 Noah Friedman <friedman@gnu.org>
24432
24433 * Makefile.in: *** empty log message ***
24434
244351993-04-17 Noah Friedman <friedman@gnu.org>
24436
24437 * Makefile.in: *** empty log message ***
24438
244391993-04-15 Richard Stallman <rms@gnu.org>
24440
24441 * src/main.c, src/files.c:
24442 New file.
24443
244441993-04-15 Noah Friedman <friedman@gnu.org>
24445
24446 * configure.in: entered into RCS
24447
24448 * configure.in: *** empty log message ***
24449
24450 * configure.in: New file.
24451
244521993-04-14 Richard Stallman <rms@gnu.org>
24453
24454 * Makefile.in: New file.
24455
244561993-04-13 Richard Stallman <rms@gnu.org>
24457
24458 * src/version.c: New file.
24459
244601993-03-25 Richard Stallman <rms@gnu.org>
24461
24462 * src/output.c: entered into RCS
24463
244641992-09-25 Richard Stallman <rms@gnu.org>
24465
24466 * configure.bat: entered into RCS
24467
244681992-06-22 Richard Stallman <rms@gnu.org>
24469
24470 * src/vmsgetargs.c: entered into RCS
24471
244721992-06-22 Richard Stallman <rms@gnu.org>
24473
24474 * doc/bison.rnh: entered into RCS
24475
244761992-04-20 David J. MacKenzie <djm@gnu.org>
24477
24478 * README: entered into RCS
24479
244801992-01-22 Richard Stallman <rms@gnu.org>
24481
24482 * src/machine.h: entered into RCS
24483
244841991-12-21 Richard Stallman <rms@gnu.org>
24485
24486 * src/lalr.c, src/closure.c:
24487 entered into RCS
24488
244891991-12-20 Richard Stallman <rms@gnu.org>
24490
24491 * src/state.h: entered into RCS
24492
244931991-12-18 Richard Stallman <rms@gnu.org>
24494
24495 * src/print.c, src/nullable.c, src/derives.c:
24496 entered into RCS
24497
244981991-11-03 David J. MacKenzie <djm@gnu.org>
24499
24500 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24501 entered into RCS
24502
245031988-09-09 Richard Stallman <rms@gnu.org>
24504
24505 * src/bison.hairy: entered into RCS
24506
245071987-12-16 Richard Stallman <rms@gnu.org>
24508
24509 * REFERENCES: entered into RCS
dc546b0f 24510
f294a2c2 24511
04098407 24512 -----
f294a2c2 24513
04098407 24514 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e021191b
JD
24515 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
24516 2008, 2009 Free Software Foundation, Inc.
f294a2c2 24517
04098407
PE
24518 Copying and distribution of this file, with or without
24519 modification, are permitted provided the copyright notice and this
24520 notice are preserved.