]> git.saurik.com Git - bison.git/blob - ChangeLog
%parse: support several arguments.
[bison.git] / ChangeLog
1 2009-09-09 Akim Demaille <demaille@gostai.com>
2
3 %parse: support several arguments.
4 * src/parse-gram.y (current_param): New.
5 (param_type): Add param_none.
6 (params): New nonterminal.
7 Use it.
8
9 2009-09-09 Akim Demaille <demaille@gostai.com>
10
11 Regen.
12
13 2009-09-09 Akim Demaille <demaille@gostai.com>
14
15 %param.
16 Provide a means to factor lex-param and parse-param common
17 declarations.
18
19 * src/parse-gram.y (param_type): New.
20 Define a %printer for it.
21 (add_param): Use it.
22 (%parse-param, %lex-param): Merge into...
23 (%parse): this new token.
24 Adjust the grammar to use it.
25 * src/scan-gram.l (RETURN_VALUE): New.
26 (RETURN_PERCENT_FLAG): Use it.
27 (RETURN_PERCENT_PARAM): New.
28 Use it to support %parse-param, %lex-param and %param.
29
30 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
31
32 Use aver not assert.
33 * src/output.c: Don't include assert.h.
34 (output_skeleton): Use aver not assert.
35 * src/system.h (aver): In documentation of why, add links to
36 Paul Eggert's explanations in the mailing lists.
37
38 2009-09-05 Alex Rozenman <rozenman@gmail.com>
39
40 Use "Unresolved reference" error message when no symbols were found
41 in a symbolic reference resolution. Remove .expr and -expr from
42 the shown reference when the reference is unresolved.
43 * src/scan-code.l: Change the error message, adjust location columns,
44 rename variable "exact_mode" to "explicit_bracketing".
45 * tests/named-ref.at: Adjust existing tests and add a new one.
46
47 2009-09-04 Akim Demaille <demaille@gostai.com>
48
49 Adjust synclines in src/parse-gram.[ch].
50 * tests/bison.in: Do some magic (including working around issues
51 with ylwrap) when this wrapper is used to compile
52 src/parse-gram.y.
53
54 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
55
56 Complain about unused %define variables and %code qualifiers.
57 * NEWS (2.5): Document.
58 * data/bison.m4 (b4_check_user_names): Complain instead of warn.
59 * doc/bison.texinfo (Decl Summary): Document complaint, and
60 improve %define documentation a little otherwise.
61 * tests/input.at (Reject unused %code qualifiers): Update.
62 (%define errors): Update.
63 (%define, --define, --force-define): Update.
64 (%define backward compatibility): Update.
65 (Unused %define api.pure): Update.
66 * tests/push.at (Push Parsing: Unsupported Skeletons): Update.
67
68 2009-09-03 Joel E. Denny <jdenny@clemson.edu>
69
70 Don't suppress warnings about unused parse.error.
71 * data/bison.m4 (b4_error_verbose_flag): Don't examine value of
72 %define variable parse.error unless b4_error_verbose_flag is
73 actually expanded in a skeleton.
74
75 2009-09-03 Akim Demaille <demaille@gostai.com>
76
77 * NEWS (2.4.2): Add "Internationalization" item.
78
79 2009-09-03 Akim Demaille <demaille@gostai.com>
80
81 bootstrap: fix/improve find_tool.
82 * bootstrap (find_tool): Improve error messages.
83 Fix typo about find_tool_names.
84
85 2009-08-29 Joel E. Denny <jdenny@clemson.edu>
86
87 Fix gcc 3.4.4 shadowing warning reported by Eric Blake.
88 See
89 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00093.html>.
90 * src/scan-code.h (code_props_rule_action_init): Rename
91 named_ref arg to name so it doesn't shadow named_ref type. This
92 makes it consistent with the function definition in scan-code.l
93 anyway.
94
95 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
96
97 %define: accept unquoted values.
98 * NEWS (2.5): Group all %define changes together, and document
99 this one. Remove quotes in IELR and canonical LR entry.
100 * doc/bison.texinfo: Remove quotes in most examples throughout.
101 (Decl Summary): Update %define documentation.
102 (Table of Symbols): Likewise.
103 * src/ielr.c (LrType): Update documentation.
104 * src/parse-gram.y (content.opt): Add production for ID.
105 * tests/actions.at: Remove quotes in most tests.
106 * tests/calc.at: Likewise.
107 * tests/existing.at: Likewise.
108 * tests/input.at: Likewise.
109 * tests/local.at: Likewise.
110 * tests/push.at: Likewise.
111 * tests/reduce.at: Likewise.
112 * tests/torture.at: Likewise.
113
114 2009-08-28 Joel E. Denny <jdenny@clemson.edu>
115
116 %define lr.type: make values lowercase IDs.
117 That is, "LALR" => "lalr", "IELR" => "ielr", and
118 "canonical LR" => "canonical-lr".
119 * NEWS (2.5): Update documentation.
120 * doc/bison.texinfo (Decl Summary): Likewise.
121 * src/ielr.c (ielr): Use new values.
122 * src/ielr.h (ielr): Update documentation.
123 * src/reader.c (prepare_percent_define_front_end_variables): Use
124 and validate new values.
125 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): Update test
126 grammars.
127 * tests/reduce.at (AT_TEST_LR_TYPE): Likewise.
128
129 2009-08-27 Eric Blake <ebb9@byu.net>
130
131 scan-gram: avoid portability trap with ctype usage.
132 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
133 Avoid compiler warning.
134
135 2009-08-27 Joel E. Denny <jdenny@clemson.edu>
136
137 tests: use perl for printing special sequences to files.
138 And skip tests if perl is not available. This is better than
139 playing tricks with shell portability. Suggested by Akim
140 Demaille.
141 * tests/input.at (Bad character literals): Use it here for
142 omitting final newlines.
143 (Bad escapes in literals): Use it here for special characters.
144
145 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
146
147 tests: show a use of %define lr.default-reductions "consistent"
148 * tests/conflicts.at (%nonassoc and eof): Extend to test that it
149 prevents the omission of expected tokens for %error-verbose.
150
151 2009-08-26 Akim Demaille <demaille@gostai.com>
152
153 tests: portability fix.
154 * tests/input.at (Bad escapes in literals): Don't expect "echo
155 '\0'" to output \ then 0.
156
157 2009-08-26 Joel E. Denny <jdenny@clemson.edu>
158
159 Actually handle the yytable zero value correctly this time.
160 * data/bison.m4 (b4_integral_parser_tables_map): Don't mention
161 zero values in the YYTABLE comments.
162 * data/glr.c (yytable_value_is_error): Don't check for zero
163 value.
164 * data/lalr1.cc (yy_table_value_is_error_): Likewise.
165 * data/yacc.c (yytable_value_is_error): Likewise.
166 * data/lalr1.java (yy_table_value_is_error_): Likewise.
167 (yysyntax_error): Fix typo in code: use yytable_ not yycheck_.
168 * src/tables.h: In header comments, explain why it's useless to
169 check for a zero value in yytable.
170
171 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
172
173 More fixes related to last two patches.
174 * data/bison.m4 (b4_integral_parser_tables_map): Fix YYTABLE
175 comments: zero indicates syntax error not default action.
176 * data/c.m4 (b4_table_value_equals): Comment that YYID must be
177 defined.
178 * data/glr.c (yyis_pact_ninf): Rename to...
179 (yypact_value_is_default): ... this.
180 (yyisDefaultedState): Update for rename.
181 (yyis_table_ninf): Rename to...
182 (yytable_value_is_error): ... this, and check for value zero
183 besides just YYTABLE_NINF.
184 (yygetLRActions): Check for default value from yypact. It
185 appears that this check is always performed before this function
186 is invoked, and so adding the check here is probably redundant.
187 However, the code may evolve after this subtlety is forgotten.
188 Also, update for rename to yytable_value_is_error. Because that
189 macro now checks for zero, a different but equivalent branch of
190 the if-then-else here is evaluated.
191 (yyreportSyntaxError): Update for rename to
192 yytable_value_is_error. The zero condition was mishandled
193 before.
194 (yyrecoverSyntaxError): Update for renames. No behavioral
195 changes.
196 * data/lalr1.cc, data/lalr1.java (yy_pact_value_is_default_):
197 New function.
198 (yy_table_value_is_error_): New function.
199 (parse): Use new functions where possible. No behavioral
200 changes.
201 (yysyntax_error_, yysyntax_error): Use yy_table_value_is_error_.
202 The zero condition was mishandled before.
203 * data/yacc.c (yyis_pact_ninf): Rename to...
204 (yypact_value_is_default): ... this.
205 (yyis_table_ninf): Rename to...
206 (yytable_value_is_error): ... this, and check for value zero
207 besides just YYTABLE_NINF.
208 (yysyntax_error): Update for rename to yytable_value_is_error.
209 The zero condition was mishandled before.
210 (yyparse): Update for renames. No behavioral changes.
211 * src/tables.h: Improve comments about yypact, yytable, etc.
212 more. Most importantly, say yytable value of zero means syntax
213 error not default action.
214
215 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
216
217 Fix %error-verbose for conflicts resolved by %nonassoc.
218 * NEWS (2.5): Document.
219 * data/glr.c (yyreportSyntaxError): Fix this by checking
220 yyis_table_ninf.
221 * data/yacc.c (yysyntax_error): Likewise.
222 * data/lalr1.cc (yysyntax_error_): Fix this by checking
223 yytable_ninf_.
224 * data/lalr1.java (yysyntax_error): Likewise.
225 * tests/conflicts.at (%nonassoc and eof): Update expected output
226 and remove FIXME.
227
228 2009-08-25 Joel E. Denny <jdenny@clemson.edu>
229
230 Some code and documentation improvements.
231 * data/c.m4 (b4_table_value_equals): New macro to capture
232 some repeated code.
233 * data/glr.c (yyis_pact_ninf): Use it here.
234 (yyis_table_ninf): Likewise.
235 (yyreportSyntaxError): Improve internal comments.
236 * data/yacc.c (yyis_pact_ninf): New macro copied from glr.c.
237 Use it everywhere possible.
238 (yyis_table_ninf): Likewise.
239 (yysyntax_error): Improve internal comments.
240 * data/lalr1.cc (yysyntax_error_): Likewise.
241 * data/lalr1.java (yysyntax_error): Likewise.
242 * src/tables.h: Improve comments about yypact, yytable, etc.
243
244 2009-08-21 Joel E. Denny <jdenny@clemson.edu>
245
246 Use locale when quoting.
247 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER): Use
248 quote rather than implementing quoting here.
249
250 2009-08-20 Eric Blake <ebb9@byu.net>
251
252 Make previous patch more robust.
253 * src/output.c (ARRAY_CARDINALITY): New macro, copied from
254 argmatch.h.
255 (output_skeleton): Use it.
256 Suggested by Akim Demaille.
257
258 Import latest m4/m4.m4.
259 * submodules/autoconf: Update to autoconf 2.64.
260 * configure.ac (M4_GNU_OPTION): New define.
261 * src/output.c (output_skeleton): Use it to resolve FIXME.
262 * NEWS: Mention this.
263
264 2009-08-19 Joel E. Denny <jdenny@clemson.edu>
265
266 Fix complaints about escape sequences.
267 Discussed starting at
268 <http://lists.gnu.org/archive/html/bison-patches/2009-08/msg00036.html>.
269 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER):
270 For a \0 and similar escape sequences meaning the null
271 character, report an invalid escape sequence instead of an
272 invalid null character because the latter does not actually
273 appear in the user's input.
274 In all escape sequence complaints, don't escape the initial
275 backslash, and don't quote when the sequence appears at the end
276 of the complaint line unless there's whitespace that quotearg
277 won't escape.
278 Consistently say "invalid" not "unrecognized".
279 Consistently prefer "empty character literal" over "extra
280 characters in character literal" warning for invalid escape
281 sequences; that is, consistently discard those sequences.
282 * tests/input.at (Bad escapes in literals): New.
283
284 2009-08-19 Akim Demaille <demaille@gostai.com>
285
286 doc: fixes.
287 * doc/bison.texinfo: Fix minor Texinfo errors.
288
289 2009-08-19 Akim Demaille <demaille@gostai.com>
290
291 tests: distcc compliance.
292 * tests/synclines.at (AT_SYNCLINES_COMPILE): Discard distcc's
293 error messages from the output.
294
295 2009-08-19 Akim Demaille <demaille@gostai.com>
296
297 variables: simplify the upgrade of namespace into api.namespace.
298
299 This patch simplifies "variables: rename namespace as
300 api.namespace", commit 67501061076ba46355cfd9f9361c7eed861b389c.
301 Suggested by Joel E. Denny in
302 http://lists.gnu.org/archive/html/bison-patches/2009-07/msg00006.html
303
304 * src/muscle-tab.c (muscle_percent_variable_update): New.
305 (muscle_percent_define_insert): Use it in replacement of the
306 previous tr invocation.
307 Remove variable_tr, no longer needed.
308 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
309 Remove.
310 * data/c++.m4: No longer handle namespace -> api.namespace.
311 * tests/input.at (%define backward compatibility): Check that
312 namespace is treated as api.namespace.
313
314 2009-08-19 Akim Demaille <demaille@gostai.com>
315
316 doc: %initial-action to initialize yylloc.
317 Reported by Bill Allombert.
318 * doc/bison.texinfo: Set fill-column to 76.
319 (Location Type): Document the use of %initial-action to initialize
320 yylloc.
321
322 2009-08-19 Akim Demaille <demaille@gostai.com>
323
324 lalr1.cc: use state_type.
325 * data/lalr1.cc (yysyntax_error_): Use state_type.
326 Move argument names into yy*.
327
328 2009-08-19 Akim Demaille <demaille@gostai.com>
329
330 lalr1.cc: get rid of yyparse's yystate.
331 yystate and yystack_[0].state are equal, keep only the latter.
332 The former was also used as a temporary variable to compute the
333 post-reduction state. Move this computation into an auxiliary
334 function.
335
336 * data/glr.c (yyLRgotoState): Fuse variable definition and first
337 assignment.
338 * data/lalr1.cc (yy_lr_goto_state_): New.
339 (yyparse): Use it.
340 Replace remaining uses of yystate by yystate_[0].state.
341 Remove the former.
342
343 2009-08-19 Akim Demaille <demaille@gostai.com>
344
345 lalr1.cc: destroy $$ when YYERROR is called.
346 * data/lalr1.cc (yyreduce): Compute the resulting state before
347 running the user action so that yylhs is a valid symbol.
348 (yyerrorlab): Since yylhs is complete (it knows its type), we can
349 simply call yy_destroy_ to destroy $$ on YYERROR invocations.
350 * tests/c++.at (AT_CHECK_VARIANTS): Test YYERROR with variants.
351
352 2009-08-18 Joel E. Denny <jdenny@clemson.edu>
353
354 maint: update for gnulib's recent update-copyright changes
355 * gnulib: Update.
356 * .x-update-copyright (COPYING): Add as it's no longer implied
357 when .x-update-copyright is present.
358 * cfg.mk (update-copyright-local): Remove, now ignored.
359 (update-copyright): Declare update-b4-copyright as a dependency.
360
361 2009-08-17 Akim Demaille <demaille@gostai.com>
362
363 build: require gettext 0.17.
364
365 Suggested by Bruno Haible.
366 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00009.html
367 * configure.ac: require gettext 0.17 to ensure compatibility with
368 gnulib.
369
370 2009-08-17 Akim Demaille <demaille@gostai.com>
371
372 build: lower gettext requirements.
373
374 Bison was uselessly requiring the formatstring macros from
375 gettext, which resulted in mo files not being installed on systems
376 that perfectly supported Bison mo files. Lower the requirement.
377 http://lists.gnu.org/archive/html/bug-bison/2009-08/msg00006.html
378
379 * configure.ac: Require need-ngettext instead of
380 need-formatstring-macros.
381 Reported by Martin Jabocs.
382 Suggested by Bruno Haible.
383 * INSTALL: Restructure.
384 (Internationalization): New.
385
386 2009-08-14 Joel E. Denny <jdenny@clemson.edu>
387
388 maint: fix use of copyright year intervals.
389 * gnulib: Update.
390 * bootstrap.conf (gnulib_modules): Update getopt to getopt-gnu
391 as now recommended in gnulib/NEWS.
392 * build-aux/update-b4-copyright: Fix.
393 * cfg.mk (update-copyright-env): Configure update-copyright.
394
395 2009-08-13 Joel E. Denny <jdenny@clemson.edu>
396
397 Make it easier to write deterministic tests.
398 Continues Akim's work from his 2009-06-10 commits.
399 * src/reader.c (check_and_convert_grammar): Don't add any
400 symbols after the first symbols_do invocation.
401 * src/symtab.c (symbols_sorted): New static global.
402 (user_token_number_redeclaration): Update comments.
403 (symbol_from_uniqstr): If a new symbol is being created, assert
404 that symbols_sorted hasn't been allocated yet.
405 (symbols_free): Free symbols_sorted.
406 (symbols_cmp, symbols_cmp_qsort): New functions.
407 (symbols_do): Sort symbol_table into symbols_sorted on first
408 invocation.
409 * tests/input.at (Numbered tokens): Recombine tests now that the
410 output should be deterministic across multiple numbers.
411
412 2009-08-12 Akim Demaille <demaille@gostai.com>
413
414 tests: GCC 4.5 compliance.
415 * tests/synclines.at (AT_SYNCLINES_COMPILE): Adjust to GCC 4.5's
416 messages about #error.
417
418 2009-08-12 Akim Demaille <demaille@gostai.com>
419
420 build: fix the generation of the documentation.
421 Some of our targets use "bison --help", but they can't depend on
422 "bison" itself (to avoid additional requirements on the user), so
423 they used to call "make src/bison" in the commands. Then
424 concurrent builds may fail: one make might be aiming one of its
425 jobs at compiling src/bison, and another job at generating the man
426 page. If the latter is faster than the former, then we have two
427 makes that concurrently try to compile src/bison.
428
429 This might also be a more convincing explanation for the failure
430 described in the patch "build: fix paths".
431
432 * Makefile.am (SUFFIXES): Initialize.
433 * build-aux/move-if-change: New, symlink to gnulib's.
434 * build-aux/local.mk: Ship it.
435 * doc/common.x: Remove, merged into...
436 * doc/bison.x: here.
437 * doc/local.mk (doc/bison.help): New.
438 ($(CROSS_OPTIONS_TEXI)): Depend on it.
439 Use src/bison.
440 (.x.1): Replace with...
441 (doc/bison.1): this explicit, simpler, target.
442 (common_dep): Remove, inlined where appropriate.
443 (SUFFIXES, PREPATH): Remove, unused.
444
445 2009-08-12 Akim Demaille <demaille@gostai.com>
446
447 gnulib: improve prefixing.
448 * configure.ac (gl_PREFIXED_LIBOBJS): Don't rename it, rather,
449 change the value of...
450 (gl_LIBOBJS): this.
451 Adjust more variables.
452 * etc/prefix-gnulib-mk (prefix_assignment): Don't rename
453 gl_LIBOBJS.
454 (prefix): Also transform rules whose targets have slashes.
455 Use $prefix liberally.
456 Map @MKDIR_P@ to $(MKDIR_P).
457 Prefix directories that are mkdir'd.
458
459 2009-08-12 Akim Demaille <demaille@gostai.com>
460
461 build: fix paths.
462 When using $(top_builddir) inconsistently, Make (including GNU
463 Make) is sometimes confused. As a result it may want to build
464 lib/libbison.la and $(top_builddir)/lib/libbison.la (the same
465 file, different names) concurrently, which, amusingly enough,
466 might end with:
467
468 ranlib lib/libbison.a
469 ranlib lib/libbison.a
470 make[2]: *** [lib/libbison.a] Segmentation fault
471
472 on OS X.
473
474 * doc/local.mk, src/local.mk: Do not use $(top_builddir) when not
475 needed.
476
477 2009-08-12 Akim Demaille <demaille@gostai.com>
478
479 distcheck: fix.
480
481 * examples/calc++/Makefile.am: (EXTRA_DIST): Ship calc.stamp.
482
483 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
484
485 * tests/local.mk (TESTSUITE_AT): Add named-refs.at.
486
487 2009-08-10 Joel E. Denny <jdenny@clemson.edu>
488
489 Miscellaneous code readability improvements.
490
491 * src/reader.c (reader): Move %define front-end variable
492 defaults and checking into...
493 (prepare_percent_define_front_end_variables): ... this new
494 function.
495
496 * src/scan-gram.l (INITIAL): For consistency with string
497 literals, don't store open quote on character literal. It's
498 discarded before returning anyway.
499 (SC_ESCAPED_CHARACTER): Similarly, don't store close quote.
500 Make length test more readable, and make the character stored
501 for an empty literal more obvious while consistent with the
502 previous behavior.
503
504 * src/symtab.c, src/symtab.h: Rename USER_NUMBER_ALIAS to
505 USER_NUMBER_HAS_STRING_ALIAS throughout.
506 * src/symtab.c (symbol_make_alias): Remove comment from symtab.c
507 that is repeated in symtab.h. Improve argument names to make it
508 clear which side of the symbol-string alias pair is which.
509 (symbol_check_alias_consistency): Improve local variable names
510 for the same purpose.
511 * src/symtab.h (struct symbol): Make comments about aliases
512 clearer.
513 (symbol_make_alias): Improve comments and argument name.
514 * src/output.c (token_definitions_output): Update for rename to
515 USER_NUMBER_HAS_STRING_ALIAS and improve comments about aliases.
516
517 2009-08-08 Alex Rozenman <rozenman@gmail.com>
518
519 Convert "misleading reference" messages to warnings.
520 * src/scan-code.l: New function 'show_sub_messages', more
521 factoring.
522 * tests/named-ref.at: Adjust tests.
523
524 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
525
526 maint: run "make update-copyright"
527
528 2009-08-06 Joel E. Denny <jdenny@clemson.edu>
529
530 maint: make update-b4-copyright easier to use
531 * build-aux/update-b4-copyright: In warnings, report line
532 numbers rather than character positions.
533 * cfg.mk (update-copyright-local): Set to update-b4-copyright so
534 that update-copyright runs it.
535 * gnulib: Update.
536
537 2009-08-05 Joel E. Denny <jdenny@clemson.edu>
538
539 maint: clean up update-b4-copyright code
540 * build-aux/update-b4-copyright: Do not accept 2-digit
541 UPDATE_COPYRIGHT_YEAR, which was not handled correctly.
542 Don't accept a `[' in a b4_copyright argument.
543 Format code more consistently.
544 Don't assume b4*copyright never occurs.
545
546 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
547
548 maint: automate b4_copyright updates.
549 * Makefile.am (update-b4-copyright): New target rule.
550 * build-aux/local.mk (EXTRA_DIST): Add update-b4-copyright.
551 * build-aux/update-b4-copyright: New.
552 * data/yacc.c: Remove stray characters around b4_copyright
553 invocations.
554
555 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
556
557 maint: automate annual package-wide copyright-year update.
558 * .x-update-copyright: New.
559 * Makefile.am (EXTRA_DIST): Remove maint.mk.
560 * bootstrap.conf (gnulib_modules): Add maintainer-makefile and
561 update-copyright. Remove gnumakefile, which is implied by
562 maintainer-makefile.
563 * cfg.mk (bootstrap-tools): Copy from old maint.mk.
564 * gnulib: Update.
565 * maint.mk: Remove, now copied from gnulib.
566 * examples/extexi: Add missing "(C)" in copyright statement so
567 update-copyright can recognize it.
568 * src/LR0.h: Likewise.
569 * src/print.h: Likewise.
570 * src/print_graph.h: Likewise.
571 * src/gram.c: Add missing comma in copyright statement.
572 * src/gram.h: Likewise.
573
574 2009-08-04 Joel E. Denny <jdenny@clemson.edu>
575
576 Fix "make distcheck".
577 * examples/calc++/Makefile.am: Say $(srcdir)/calc.stamp instead
578 of just calc.stamp.
579
580 2009-08-01 Joel E. Denny <jdenny@clemson.edu>
581
582 Pacify "gcc -Wunused" for the input function from Flex.
583 Reported by Alex Rozenman. This warning shows up with gcc-4.3.0
584 and later.
585 * src/scan-code.l: Add "%option noinput", which I cannot find in
586 the Flex manual, but which Flex has supported since at least as
587 far back as 2.5.4. However, if any of our developers still use
588 Flex 2.5.4, they'll need to stop configuring with
589 --enable-gcc-warnings because "%option noinput" didn't work
590 correctly until Flex 2.5.6.
591 * src/scan-gram.l: Likewise.
592 * src/scan-skel.l: Likewise.
593
594 2009-07-31 Alex Rozenman <rozenman@gmail.com>
595
596 Fix --enable-gcc-warnings problems.
597 * src/reader.c: Adjust variable names.
598 * src/scan-code.l: Fix prototypes and adjust names.
599 * src/named-ref.c: Remove redundant "if".
600
601 2009-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
602
603 Fix a --enable-gcc-warnings problem.
604 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Actually use length
605 variable.
606
607 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
608
609 Warn about character literals not of length one.
610 * NEWS (2.5): Document.
611 * src/scan-gram.l (INITIAL): Remove comment that we don't check
612 the length.
613 (SC_ESCAPED_CHARACTER): Warn if length is wrong.
614 * tests/input.at (Bad character literals): New test group.
615
616 2009-07-24 Alex Rozenman <rozenman@gmail.com>
617
618 Fix some memory leaks.
619 * src/named-ref.c: Add a pointer check (named_ref_free).
620 * src/scan-code.l: New function (variant_table_free). Called in
621 code_scanner_free.
622 * src/symlist.c: Call to named_ref_free (symbol_list_free).
623
624 2009-07-24 Joel E. Denny <jdenny@ces.clemson.edu>
625
626 * src/lalr.c (state_lookahead_tokens_count): Correct comment.
627
628 2009-07-22 Joel E. Denny <jdenny@ces.clemson.edu>
629
630 Some M4 cleanup in the testsuite.
631 Suggested by Eric Blake at
632 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00083.html>.
633 * tests/existing.at (_AT_TEST_EXISTING_GRAMMAR): Do not
634 complicate the code by distinguishing between a missing value
635 and an empty string value for an optional argument. This fix is
636 allowed by the similar fix in AT_TEST_TABLES_AND_PARSE below.
637 * tests/local.at (_AT_TEST_TABLES_AND_PARSE): Merge into...
638 (AT_TEST_TABLES_AND_PARSE): ... this now that the special
639 arguments are not needed because of the following changes.
640 Fix stale comments.
641 Bison developers should use GNU M4 and should not use
642 POSIXLY_CORRECT when building the test suite, so do not
643 complicate the code by avoiding $10 and above.
644 Do not quote an empty string value for an optional argument, and
645 do not distinguish between a missing value and an empty string
646 value.
647
648 2009-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
649
650 Revert unnecessary column realignment in --help output.
651 Reported by Akim Demaille at
652 <http://lists.gnu.org/archive/html/bison-patches/2009-06/msg00010.html>.
653 * src/getargs.c (usage): Here.
654
655 2009-07-04 Alex Rozenman <rozenman@gmail.com>
656
657 Alphabetical order in src/local.mk.
658 * src/local.mk: Adjust.
659
660 2009-07-04 Alex Rozenman <rozenman@gmail.com>
661
662 Style changes and factoring.
663 * src/named-ref.h: Add comments.
664 * src/parse-gram.y: Readability and style changes.
665 * src/reader.c: Factoring: assign_named_ref function.
666 * src/scan-code.l: Factoring and style changes. Rename
667 parse_named_ref to parse_ref. Use "c-ctype.h" from gnulib.
668 Use "unsigned" type for variant index. Improve readablity.
669 * src/scan-gram.l: Change error messages and add comments.
670 * src/symlist.h: symbol_list_null: New function decl.
671 * src/symlist.c: symbol_list_null: Implement here.
672 * tests/named-refs.at: Adjust for new error messages.
673
674 2009-06-29 Eric Blake <ebb9@byu.net>
675
676 scan-code: avoid compiler warnings
677 * src/scan-code.l (parse_named_ref): Use correct specifiers.
678
679 2009-06-29 Akim Demaille <demaille@gostai.com>
680
681 build: avoid concurrent extraction of calc++.
682 * examples/calc++/Makefile.am (calc.stamp): New.
683 Depend on it to create the sources of calc++ so that concurrent
684 builds don't launch several "extexi" in parallel.
685 Not only this is inefficient, this also builds incorrect sources
686 with several extractions mixed together.
687
688 2009-06-29 Akim Demaille <demaille@gostai.com>
689
690 parse.error: fix.
691 * data/bison.m4: Move code related to specific variables after the
692 definition of the variable-maintaining macros so that we don't
693 "invoke" b4_percent_define_check_values before it is defined.
694
695 2009-06-29 Akim Demaille <demaille@gostai.com>
696
697 variables: parse.error
698
699 Implement, document, and test the replacement of %error-verbose
700 by %define parse.error "verbose".
701 * data/bison.m4 (b4_error_verbose_if): Reimplement to track the
702 values of the parse.error variable.
703 Make "simple" its default value.
704 Check the valid values.
705 * src/parse-gram.y: Use %define parse.error.
706 (PERCENT_ERROR_VERBOSE): New token.
707 Support it.
708 * src/scan-gram.l: Support %error-verbose.
709
710 * doc/bison.texinfo (Decl Summary): Replace the documentation of
711 %define error-verbose by that of %define parse.error.
712 * NEWS: Document it.
713
714 * tests/actions.at, tests/calc.at: Use parse.error instead of
715 %error-verbose.
716
717 2009-06-27 Alex Rozenman <rozenman@gmail.com>
718
719 Implement support for named symbol references.
720 * src/parse-gram.y: Add new syntax (named_ref.opt).
721 * src/reader.c: Store named refs in symbol lists.
722 * src/reader.h: New argument for symbol_append and
723 action_append functions.
724 * src/scan-code.h: Add new field (named_ref) into
725 code_props data structure. Keeps named ref of midrule
726 actions.
727 * src/scan-code.l: Support for named refs in semantic
728 action code. New function 'parse_named_ref'.
729 * src/scan-gram.l: Support bracketed id.
730 * src/symlist.c: Store named refs in symbol lists.
731 * src/symlist.h: New field in symbol list: named_ref.
732 * src/named-ref.h: New file, a struct for named_ref.
733 * src/named-ref.cp: New file, named_ref_new function.
734 * src/local.mk: Add two new files.
735 * tests/testsuite.at: Include new test group:
736 * tests/named-refs.at: this new file.
737
738 2009-06-25 Akim Demaille <demaille@gostai.com>
739
740 hash: check insertion for memory exhaustion.
741 * src/uniqstr.c (uniqstr_new): New.
742
743 2009-06-24 Akim Demaille <demaille@gostai.com>
744
745 variables: rename namespace as api.namespace.
746 Discussed in
747 http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00033.html
748
749 * data/bison.m4 (b4_percent_define_copy_, b4_percent_define_copy):
750 New.
751 (b4_percent_define_use): New.
752 Use it where applicable.
753 * data/c++.m4: Replace uses of the variable "namespace" by
754 "api.namespace".
755 Default the latter to the former.
756 * doc/bison.texinfo (Decl Summary): Document "namespace" as
757 obsolete.
758 Document api.namespace.
759 Use @samp to document %define uses, keep @code for identifiers.
760 * NEWS: Likewise.
761 * tests/c++.at, tests/input.at: Test api.namespace instead of
762 namespace. (The tests passed with namespace.)
763
764 2009-06-11 Akim Demaille <demaille@gostai.com>
765
766 style changes.
767 * data/xslt/xml2dot.xsl, data/xslt/xml2xhtml.xsl: Space changes.
768 * src/print-xml.c: Style changes.
769 * tests/conflicts.at: Comment changes.
770
771 2009-06-11 Akim Demaille <demaille@gostai.com>
772
773 xml: beware of user strings used to give a %prec to rules.
774 * tests/conflicts.at (%prec with user strings): New.
775 * src/gram.c (grammar_rules_print_xml): Escape the precedence for
776 XML output.
777
778 2009-06-11 Akim Demaille <demaille@gostai.com>
779
780 hash: check insertion for memory exhaustion.
781 * src/muscle-tab.c (muscle_insert, muscle_grow)
782 * src/state.c (state_hash_insert): Check the return value of
783 hash_insert.
784
785 2009-06-11 Akim Demaille <demaille@gostai.com>
786
787 tests: honor TESTSUITEFLAGS in every check target.
788 * tests/local.mk (RUN_TESTSUITE): New.
789 (check-local, installcheck-local, maintainer-check-g++)
790 (maintainer-check-posix, maintainer-check-valgrind): Use it.
791
792 2009-06-10 Akim Demaille <demaille@gostai.com>
793
794 deterministic test suite.
795 Some consistency checks on symbols are performed after all the
796 symbols were read, by an iteration over the symbol table. This
797 traversal is nondeterministic, which can be a problem for test
798 cases.
799 Avoid this.
800 Addresses another form of nondeterminism reported by Joel E. Denny.
801 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
802
803 * tests/input.at (Numbered tokens): Split the hexadecimal/decimal
804 test in two.
805 Use different file names for the three tests to make the
806 maintenance easier.
807
808 2009-06-10 Akim Demaille <demaille@gostai.com>
809
810 gnulib: update.
811 * gnulib: Update to latest.
812 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore,
813 * m4/.gitignore: Regen.
814 * src/symtab.c (symbol_from_uniqstr, semantic_type_from_uniqstr):
815 Call xalloc_die on hash_insert failures.
816 Requested by the new __warn_unused_result__ attribute of
817 hash_insert.
818
819 2009-06-10 Akim Demaille <demaille@gostai.com>
820
821 deterministic user-token-number redeclaration errors.
822 Address nondeterminism reported by Joel E. Denny.
823 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00023.html
824
825 * src/uniqstr.h: Comment changes.
826 * src/location.h (boundary_cmp, location_cmp): New.
827 * src/symtab.c (user_token_number_redeclaration): New.
828 (symbol_translation): Use it.
829 * tests/input.at (Numbered tokens): Adjust the expected output.
830
831 2009-05-25 Akim Demaille <demaille@gostai.com>
832
833 build: avoid ignored errors.
834 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Don't generate ignored
835 errors, they pollute the output.
836
837 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
838
839 Convert multiple variable definition warnings to complaints.
840 * NEWS (2.5): Add a new entry for that change.
841 * doc/bison.texinfo (Decl Summary): Update %define entry.
842 (Bison Options): Update -D/--define/-F/--force-define entry.
843 * src/muscle-tab.c (muscle_percent_define_insert): Implement.
844 * src/muscle-tab.h (muscle_percent_define_insert): Update
845 comments.
846 * tests/input.at (`%define errors'): Update.
847 (`%define, --define, --force-define'): Update.
848
849 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
850
851 -F/--force-define and relative %define/-D/--define priorities.
852 * NEWS (2.5): Add documentation to -D/--define entry.
853 * build-aux/cross-options.pl: Hard-code association of
854 --force-define with %define.
855 * doc/bison.texinfo (Decl Summary): In %define entry,
856 cross-reference command-line options.
857 (Bison Options): Add documentation to -D/--define entry.
858 (Option Cross Key): Widen column for --force-define row.
859 * src/getargs.c (usage): Document -F/--force-define. Realign
860 options in output.
861 (short_options, long_options, getargs): Parse -F/--force-define,
862 and update muscle_percent_define_insert invocations.
863 * src/muscle-tab.h (muscle_percent_define_how): New enum type.
864 (muscle_percent_define_insert): Add argument with that type.
865 * src/muscle-tab.c (muscle_percent_define_insert): Implement
866 -F/--force-define behavior and priorities.
867 (muscle_percent_define_ensure): Update
868 muscle_percent_define_insert invocation.
869 * src/parse-gram.y (prologue_declaration): Update
870 muscle_percent_define_insert invocations.
871 * tests/input.at (`%define, --define'): Rename to...
872 (`%define, --define, --force-define'): ... this and extend.
873
874 2009-05-22 Joel E. Denny <jdenny@ces.clemson.edu>
875
876 Update some comments to make sense for -D.
877 * data/bison.m4 (b4_check_user_names): In header comments, say
878 "user occurrence" instead of "grammar occurrence".
879 * src/muscle-tab.h (muscle_percent_define_insert): Likewise.
880 (muscle_percent_code_grow): Likewise just for consistency.
881
882 2009-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
883
884 * data/c++.m4 (b4_namespace_close): Simplify slightly.
885
886 2009-05-19 Joel E. Denny <jdenny@ces.clemson.edu>
887
888 Handle a trailing `:' in a user-supplied C++ namespace better.
889 * data/c++.m4 (b4_namespace_close): Don't let it be printed
890 among the closing braces here. This fix might make the
891 generated code easier to debug, but otherwise it should be
892 insignificant because a trailing `:' is a C++ error already.
893
894 2009-05-19 Akim Demaille <demaille@gostai.com>
895
896 remove useless variable.
897 * src/getargs.c (skeleton_arg): Remove now useless variable.
898 Should help the compiler see that this printf-like call is sane.
899
900 2009-05-15 Akim Demaille <demaille@gostai.com>
901
902 Rename token.prefix as api.tokens.prefix.
903 Discussed here.
904 http://lists.gnu.org/archive/html/bison-patches/2009-05/msg00024.html.
905
906 * NEWS, data/bison.m4, data/c.m4, data/java.m4, doc/bison.texinfo,
907 * tests/c++.at, tests/calc.at, tests/java.at, tests/local.at
908 (token.prefix): Rename as...
909 (api.tokens.prefix): this.
910
911 2009-05-11 Akim Demaille <demaille@gostai.com>
912
913 doc: use C++ headers.
914 * doc/bison.texinfo (Calc++ Scanner): Prefer C++ headers to C
915 headers.
916
917 2009-05-11 Akim Demaille <demaille@gostai.com>
918
919 doc: token.prefix
920 * doc/bison.simple (Decl Summary): Document token.prefix.
921 (Calc++ Parser): Various fixes.
922 Formatting changes.
923 Use token.prefix.
924 Introduce a macro TOKEN to shorten the code and make it more
925 readable.
926 (Calc++ Scanner): Adjust.
927 * NEWS (Variable token.prefix): New.
928
929 2009-05-04 Akim Demaille <demaille@gostai.com>
930
931 bison: catch bad symbol names.
932 * src/scan-gram.l({int}{id}): Report as an invalid identifier.
933 * tests/input.at: Adjust.
934
935 2009-05-04 Akim Demaille <demaille@gostai.com>
936
937 identifiers: dashes are letters.
938 Dashes can now start identifiers (symbols and directives).
939
940 * src/scan-gram.l ({letter}): Add dash.
941 ({id}): Remove it.
942 * tests/input.at (Symbols): Adjust.
943 Remove stray comment.
944 * tests/regression.at (Invalid inputs): Adjust error message.
945 * doc/bison.texinfo (Symbols): Update.
946
947 2009-05-01 Joel E. Denny <jdenny@ces.clemson.edu>
948
949 Declare %code to be a permanent feature.
950 * NEWS (2.4.2): Here.
951 * doc/bison.texinfo (Prologue Alternatives): Don't say it's
952 experimental.
953 (Decl Summary): Likewise.
954
955 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
956
957 Convert underscores to dashes in some %define variable names.
958 For now, just api.push-pull and lr.keep-unreachable-states.
959 Maintain old names for backward compatibility.
960 * NEWS (2.5): Document.
961 * data/c.m4 (b4_identification): Update comment.
962 * data/yacc.c: Update access.
963 * doc/bison.texinfo: Update.
964 * etc/bench.pl.in (bench_push_parser): Update use.
965 * src/files.c (tr): Move to...
966 * src/getargs.c, src/getargs.h (tr): ... here because I can't
967 think of a better place to expose it. My logic is that, for all
968 uses of tr so far, command-line arguments can be involved, and
969 getargs.h is already included.
970 * src/main.c (main): Update access.
971 * src/muscle_tab.c (muscle_percent_define_insert): Convert old
972 variable names to new variable names before assigning value.
973 * src/reader.c (reader): Update setting default.
974 * tests/calc.at: Update uses.
975 * tests/conflicts.at (Unreachable States After Conflict
976 Resolution): Update use.
977 * tests/input.at (%define enum variables): Update use.
978 (%define backward compatibility): New test group.
979 * tests/push.at: Update uses.
980 * tests/reduce.at: Update uses.
981 * tests/torture.at: Update uses.
982
983 2009-04-30 Joel E. Denny <jdenny@ces.clemson.edu>
984
985 Set all front-end %define defaults in one place.
986 * src/main.c (main): Move lr.keep_unreachable_states default...
987 * src/reader.c (reader): ... to here.
988
989 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
990
991 Rename lr.default_reductions to lr.default-reductions.
992 * NEWS (2.5): Here.
993 * doc/bison.texinfo: Here.
994 * src/lalr.c (initialize_LA): Here.
995 * src/print.c (print_reductions): Here.
996 * src/reader.c (reader): Here.
997 * src/tables.c (action_row): Here.
998 * tests/input.at (%define enum variables): Here.
999 * tests/reduce.at (AT_TEST_LR_DEFAULT_REDUCTIONS): Here.
1000
1001 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1002
1003 Pacify ./configure --enable-gcc-warnings.
1004 * tests/input.at (Symbols): Prototype yyerror and yylex.
1005
1006 2009-04-29 Joel E. Denny <jdenny@ces.clemson.edu>
1007
1008 Document how `%define "var" "value"' is not M4-friendly.
1009 * src/parse-gram.y (variable): In comments here.
1010
1011 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1012
1013 Clean up recent patches a little.
1014 Reported by Akim Demaille.
1015 * doc/bison.texinfo (Understanding): Fix typos.
1016 * src/print.c (print_reductions): Don't use negated variable.
1017
1018 2009-04-24 Joel E. Denny <jdenny@ces.clemson.edu>
1019
1020 List accepted values for a %define enum variable with an invalid value.
1021 Suggested by Akim Demaille at
1022 <http://lists.gnu.org/archive/html/bison-patches/2009-04/msg00082.html>.
1023 * data/bison.m4 (_b4_percent_define_check_values): Implement.
1024 * src/muscle-tab.c (muscle_percent_define_check_values): Implement.
1025 * tests/input.at (%define lr.default_reductions invalid values): Merge
1026 into...
1027 (%define enum variables): ... here, and update output.
1028
1029 2009-04-23 Joel E. Denny <jdenny@ces.clemson.edu>
1030
1031 Rename "default rule" to "default reduction".
1032 This includes changing variable names in code, changing
1033 comments, and renaming %define lr.default_rules to %define
1034 lr.default_reductions.
1035 * NEWS (2.5): Update IELR documentation.
1036 * data/bison.m4 (b4_integral_parser_tables_map): Adjust YYDEFACT
1037 documentation.
1038 * data/glr.c, data/lalr1.java: Sync copyright dates.
1039 * doc/bison.texinfo (Decl Summary): Adjust lr.default_reductions
1040 and lr.type documentation. Make some other wording
1041 improvements.
1042 (Glossary): Adjust cross-references and Default Reduction
1043 definition.
1044 * src/lalr.c (state_lookahead_tokens_count): Adjust code.
1045 Remove a confusing comment pointed out by Akim Demaille.
1046 (initialize_LA): Adjust code.
1047 * src/print-xml.c (print_reductions): Adjust code.
1048 * src/print.c (print_reductions): Adjust code.
1049 * src/reader.c (reader): Adjust code.
1050 * src/tables.c (action_row): Adjust code.
1051 (token_actions): Adjust code.
1052 * src/tables.h: Adjust YYDEFACT documentation.
1053 * tests/input.at (%define lr.default_rules invalid values):
1054 Rename test group to...
1055 (%define lr.default_reductions invalid values): ... this, and
1056 update grammar file and expected output.
1057 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): Rename to...
1058 (AT_TEST_LR_DEFAULT_REDUCTIONS): ... this, and update.
1059
1060 2009-04-21 Akim Demaille <demaille@gostai.com>
1061
1062 tests: check the use of dashes and periods in symbols.
1063 * tests/input.at (Symbol): New test group.
1064
1065 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1066
1067 Document %define lr.type and lr.default_rules.
1068 * NEWS (2.5): Add an entry.
1069 * src/getargs.c (usage): Mention IELR(1) and canonical LR(1)
1070 besides just LALR(1) and GLR(1).
1071 * doc/bison.texinfo (Introduction): Likewise.
1072 (Language and Grammar): Bison is no longer limited to LALR(1)
1073 restrictions.
1074 (GLR parsing): Say deterministic or LR(1) rather than LALR(1)
1075 when trying to distinguish from GLR. Talk about LR(1) grammars
1076 rather than LALR(1) grammars.
1077 (Decl Summary): In %define api.push_pull entry, say it applies
1078 to deterministic parsers in C rather than LALR(1) parsers in C.
1079 Add lr.default_rules entry.
1080 Add lr.type entry.
1081 (Mystery Conflicts): Bison is no longer limited to LALR(1)
1082 restrictions.
1083 (Generalized LR Parsing): Same changes as for the previous GLR
1084 section.
1085 (Memory Management): Say deterministic rather than LALR(1).
1086 (Understanding): Correct some bison output.
1087 Index discussion of "accepting state".
1088 Say deterministic rather than LALR(1).
1089 (Bison Options): In --yacc entry, say deterministic rather than
1090 LALR(1).
1091 In --report, --graph, and --xml entries, just don't mention
1092 LALR(1).
1093 (C++ Parsers): Say deterministic rather than LALR(1).
1094 (Table of Symbols): Likewise in YYSTACK_USE_ALLOCA entry.
1095 (Glossary): Add Accepting State, Consistent State, Default Rule,
1096 and IELR(1) definitions.
1097 In Generalized LR (GLR) definition, make same changes as in
1098 previous GLR sections.
1099 In LALR(1) definition, say Bison uses LALR(1) by default rather
1100 than implying Bison is limited to LALR(1).
1101 (LocalWords): Add IELR.
1102
1103 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1104
1105 Finish implementing %define lr.type.
1106 Its value can be "LALR", "IELR", or "canonical LR".
1107 * lib/timevar.def (TV_IELR_PHASE1): New var.
1108 (TV_IELR_PHASE2): New var.
1109 (TV_IELR_PHASE3): New var.
1110 (TV_IELR_PHASE4): New var.
1111 * src/Makefile.am (bison_SOURCES): Add AnnotationList.c,
1112 AnnotationList.h, InadequacyList.c, InadequacyList.h, Sbitset.c,
1113 Sbitset.h, ielr.h, and ielr.c.
1114 * src/getargs.h, src/getargs.c (enum trace, trace_args,
1115 trace_types): Add trace_ielr.
1116 * src/lalr.h, src/lalr.c (ngotos): Export it.
1117 (F): Rename to...
1118 (goto_follows): ... this, update all uses, and export it.
1119 (set_goto_map): Export it.
1120 (map_goto): Export it.
1121 (compute_lookahead_tokens): Don't free goto_follows yet. Now
1122 handled in ielr.
1123 (initialize_LA): Export it. Move lookback allocation to...
1124 (lalr): ... here because, for canonical LR, initialize_LA must
1125 be invoked but lookback and much of the rest of LALR isn't
1126 needed.
1127 * main.c (main): Instead of lalr, invoke ielr, which invokes
1128 lalr.
1129 * src/reader.c (reader): Default lr.type to "LALR".
1130 Default lr.default_rules to "accepting" if lr.type is "canonical
1131 LR". Leave the default as "all" otherwise.
1132 Check for a valid lr.type value.
1133 * src/state.h, src/state.c (struct state_list): Add state_list
1134 member.
1135 (state_new): Initialize state_list member to NULL.
1136 (state_new_isocore): New function, exported.
1137 * tests/existing.at (AT_TEST_EXISTING_GRAMMAR): New macro that
1138 exercises all values of lr.type.
1139 (GNU AWK Grammar): Rename test group to...
1140 (GNU AWK 3.1.0 Grammar): ... this, and extend to use
1141 AT_TEST_EXISTING_GRAMMAR.
1142 (GNU Cim Grammar): Extend to use AT_TEST_EXISTING_GRAMMAR.
1143 (GNU pic Grammar): Rename test group to...
1144 (GNU pic (Groff 1.18.1) Grammar): ... this, and extend to use
1145 AT_TEST_EXISTING_GRAMMAR.
1146 * tests/reduce.at (AT_TEST_LR_TYPE): New macro that exercises
1147 all values of lr.type.
1148 (Single State Split): New test groups using AT_TEST_LR_TYPE.
1149 (Lane Split): Likewise.
1150 (Complex Lane Split): Likewise.
1151 (Split During Added Lookahead Propagation): Likewise.
1152
1153 2009-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
1154
1155 Add new files for IELR and canonical LR implementation.
1156 * src/AnnotationList.c: New.
1157 * src/AnnotationList.h: New.
1158 * src/InadequacyList.c: New.
1159 * src/InadequacyList.h: New.
1160 * src/Sbitset.c: New.
1161 * src/Sbitset.h: New.
1162 * src/ielr.c: New.
1163 * src/ielr.h: New.
1164
1165 2009-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
1166
1167 Implement %define lr.default_rules.
1168 Its value describes the states that are permitted to contain
1169 default rules: "all", "consistent", or "accepting".
1170 * src/reader.c (reader): Default lr.default_rules to "all".
1171 Check for a valid lr.default_rules value.
1172 * src/lalr.c (state_lookahead_tokens_count): If lr.default_rules
1173 is "accepting", then only mark the accepting state as
1174 consistent.
1175 (initialize_LA): Tell state_lookahead_tokens_count whether
1176 lr.default_rules is "accepting".
1177 * src/tables.c (action_row): If lr.default_rules is not "all",
1178 then disable default rules in inconsistent states.
1179 * src/print.c (print_reductions): Use this opportunity to
1180 perform some assertions about whether lr.default_rules was
1181 obeyed correctly.
1182 * tests/local.at (AT_TEST_TABLES_AND_PARSE): New macro that
1183 helps with checking the parser tables for a grammar.
1184 * tests/input.at (%define lr.default_rules invalid values): New
1185 test group.
1186 * tests/reduce.at (AT_TEST_LR_DEFAULT_RULES): New macro using
1187 AT_TEST_TABLES_AND_PARSE.
1188 (`no %define lr.default_rules'): New test group generated by
1189 AT_TEST_LR_DEFAULT_RULES.
1190 (`%define lr.default_rules "all"'): Likewise.
1191 (`%define lr.default_rules "consistent"'): Likewise.
1192 (`%define lr.default_rules "accepting"'): Likewise.
1193
1194 2009-04-20 Akim Demaille <demaille@gostai.com>
1195
1196 Formatting change.
1197
1198 2009-04-20 Akim Demaille <demaille@gostai.com>
1199
1200 bison: factoring.
1201 * src/output.c (token_definitions_output): Use symbol_id_get
1202 instead of duplicating its logic.
1203 * TODO (YYERRCODE): Extend.
1204
1205 2009-04-20 Akim Demaille <demaille@gostai.com>
1206
1207 variables: prefer error-verbose to error_verbose.
1208 * data/bison.m4 (b4_error_verbose_if): Based on error-verbose
1209 instead of error_verbose.
1210 * src/scan-gram.l (%error-verbose): Map to the error-verbose
1211 variable.
1212 * doc/bison.texinfo: Promote %define error-verbose instead of
1213 %error-verbose.
1214 * tests/actions.at: Prefer %define error-verbose to %error-verbose.
1215
1216 2009-04-15 Akim Demaille <demaille@gostai.com>
1217
1218 variables: accept dashes.
1219 * data/bison.m4 (b4_percent_define_if_define_): Also map dashes to
1220 underscores.
1221 * src/scan-gram.l ({id}): Also accept dashes after the initial
1222 letter.
1223 ({directive}): Use {id}.
1224 * src/parse-gram.y: Comment and formatting changes.
1225 * doc/bison.texinfo (Symbols): Adjust the lexical definitions of
1226 symbols.
1227 * src/complain.h, src/complain.c (yacc_at): New.
1228 * src/symtab.c (symbol_new): Use yacc_at to report inappropriate
1229 symbol names.
1230 * src/output.c (token_definitions_output): Do not #define token
1231 names with dashes.
1232
1233 2009-04-20 Akim Demaille <demaille@gostai.com>
1234
1235 Consistently refer to Yacc, not YACC.
1236 * src/getargs.c (usage, warnings_args): s/YACC/Yacc/.
1237
1238 2009-04-17 Joel E. Denny <jdenny@ces.clemson.edu>
1239
1240 Pacify make maintainer-check-posix.
1241 * tests/input.at (%define, --define): Move bison command-line
1242 options before grammar file name.
1243
1244 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1245
1246 Document semicolon warnings.
1247 * NEWS (2.5): Here.
1248
1249 2009-04-14 Akim Demaille <demaille@gostai.com>
1250
1251 variables: use `parse.assert' instead of `assert'.
1252 * TODO (assert): Remove.
1253 * data/bison.m4 (b4_assert_if): Replace with...
1254 (b4_parse_assert_if): this.
1255 * data/lalr1.cc, data/variant.hh, tests/c++.at: Adjust.
1256 * doc/bison.texinfo (Decl Summary): Document parse.assert.
1257
1258 2009-04-14 Akim Demaille <demaille@gostai.com>
1259
1260 variables: use `parse.trace' instead of `debug'.
1261 * src/getargs.c (getargs): Map -t to %define trace.parse.
1262 * src/scan-gram.l (%debug): Map to %define trace.parse.
1263 * data/bison.m4 (b4_percent_define_if_define): Map `.' in variable
1264 names to `_' in macro names.
1265 (b4_debug_if): Replace with...
1266 (b4_parse_trace_if): this.
1267 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
1268 * data/yacc.c: Adjust.
1269 * doc/bison.texinfo (Decl Summary): Document %debug as obsoleted.
1270 Use @code to label the variable list.
1271 Document the variable parse.trace.
1272 (Tracing): Promote the parse.trace variable.
1273 * TODO: %printer is not documented.
1274
1275 2009-04-14 Akim Demaille <demaille@gostai.com>
1276
1277 doc: minor fixes.
1278 * doc/bison.texinfo (Decl Summary): Fix entry about %debug.
1279 (Table of Symbols): Remove duplicate entry for %debug.
1280
1281 2009-04-10 Eric Blake <ebb9@byu.net>
1282
1283 submodules: update to latest
1284 * submodules/autoconf: Use latest upstream Autoconf.
1285
1286 2009-04-06 Eric Blake <ebb9@byu.net>
1287
1288 Work around autoconf 2.63b bug in testsuite.
1289 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Avoid tripping
1290 autoconf bug related to # in test.
1291
1292 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1293
1294 * NEWS (2.5): New section. Describe new -D/--define feature.
1295
1296 2009-04-06 Akim Demaille <demaille@gostai.com>
1297
1298 Regen.
1299 * src/parse-gram.h, src/parse-gram.c: Regen.
1300
1301 2009-04-06 Akim Demaille <demaille@gostai.com>
1302
1303 rename muscle_tab.* as muscle-tab.* for consistency.
1304 * src/muscle_tab.h, src/muscle_tab.c: Rename as...
1305 * src/muscle-tab.h, src/muscle-tab.c: these.
1306 * src/getargs.c, src/local.mk, src/main.c, src/output.c,
1307 * src/parse-gram.y, src/reader.c, src/scan-code.l: Adjust.
1308
1309 2009-04-06 Akim Demaille <demaille@gostai.com>
1310
1311 Makefile: introduce $(BISON).
1312 * src/local.mk (BISON): New.
1313 (YACC): Use it.
1314
1315 2009-04-06 Akim Demaille <demaille@gostai.com>
1316
1317 parser: handle %locations as %define locations.
1318 * src/getargs.h, src/getargs.c (locations_flag): Remove.
1319 * src/getargs.c, src/scan-code.l: Use muscle_percent_define_ensure
1320 to set "locations" to true.
1321 * src/output.c (prepare): Don't output "locations".
1322 * src/scan-gram.l (%locations): Handle it as a %<flag>.
1323 * src/parse-gram.y: It's no longer a token.
1324 Don't handle it.
1325 * data/bison.m4 (b4_locations_if): Define it with
1326 b4_percent_define_if_define.
1327 * data/c.m4, data/glr.cc: Adjust.
1328
1329 2009-04-06 Akim Demaille <demaille@gostai.com>
1330
1331 Regen.
1332 * src/parse-gram.c: Regen.
1333
1334 2009-04-06 Akim Demaille <demaille@gostai.com>
1335
1336 muscle: factor the handling of obsolete of obsolete directives.
1337 Suggested by Joel E. Denny.
1338
1339 * src/muscle_tab.h, src/muscle_tab.c (muscle_percent_define_ensure):
1340 New, extracted from...
1341 * src/parse-gram.y (prologue_declaration: pure-parser): here.
1342 Remove it.
1343 (prologue_declaration: "%<flag>"): Use
1344 muscle_percent_define_ensure.
1345 (%error-verbose, %pure-parser): No longer tokens.
1346 * src/scan-gram.l (pure-parser): Return as a %<flag>.
1347
1348 2009-04-06 Joel E. Denny <jdenny@ces.clemson.edu>
1349
1350 Fix options documentation.
1351 * build-aux/cross-options.pl: As in --help output, write optional
1352 arguments as [=ARG] not =[ARG].
1353 * doc/bison.texinfo (Bison Options): Add -W/--warnings argument.
1354
1355 2009-04-04 Joel E. Denny <jdenny@ces.clemson.edu>
1356
1357 Replace BISON_PROG_GNU_M4 with Autoconf's AC_PROG_GNU_M4.
1358 If the first m4 in $PATH is wrong, it keeps looking. Moreover, its
1359 requirements for a correct m4 are stricter.
1360 * m4/m4.m4: Make it a symbolic link to submodules/autoconf/m4/m4.m4.
1361 * configure.ac: Update to use AC_PROG_GNU_M4.
1362 Reported by Eric Blake.
1363
1364 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1365
1366 Help with updating web manual.
1367 * HACKING: Incorporate instructions from gnulib/doc/README.
1368 * bootstrap.conf (gnulib_modules): Add gendocs.
1369
1370 2009-04-03 Akim Demaille <demaille@gostai.com>
1371
1372 Regen.
1373 * src/parse-gram.h, src/parse-gram.c: Regen.
1374
1375 2009-04-03 Akim Demaille <demaille@gostai.com>
1376
1377 Factor %FLAG at scan level.
1378 * src/parse-gram.y (PERCENT_DEBUG, PERCENT_ERROR_VERBOSE): Token
1379 definitions and associated rules, replaced by....
1380 (PERCENT_FLAG): this new token type, and rule.
1381 * src/scan-gram.l (RETURN_PERCENT_FLAG): New.
1382 Use it for %debug and %error-verbose.
1383
1384 2009-04-03 Akim Demaille <demaille@gostai.com>
1385
1386 Regen.
1387 * src/parse-gram.h, src/parse-gram.c: Regen.
1388
1389 2009-04-03 Akim Demaille <demaille@gostai.com>
1390
1391 Treat %debug as %define debug.
1392 * data/bison.m4 (b4_debug_if): New.
1393 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c,
1394 * data/lalr1.java: Use it instead of b4_debug_flag.
1395 * src/getargs.h, src/getargs.c (debug_flag): Remove.
1396 * src/output.c (prepare): Don't output it.
1397 * src/parse-gram.y: Treat %debug as %define debug.
1398
1399 2009-04-03 Akim Demaille <demaille@gostai.com>
1400
1401 Treat %error-verbose as %define error_verbose.
1402 This allows to pass -Derror_verbose on the command line. Better
1403 yet, it allows to pass -Derror_verbose=$(ERROR_VERBOSE), with
1404 ERROR_VERBOSE being defined as false or true.
1405 * data/bison.m4 (b4_percent_define_if_define): Instead of relying
1406 on b4_percent_define_ifdef, for does not check the defined value,
1407 but only whether the symbol is defined, rely on
1408 b4_percent_define_flag_if, so that a value of "false" is processed
1409 as a false.
1410 If not defined, define the flag to "false".
1411 (b4_error_verbose_if): New.
1412 * data/glr.c, data/lalr1.cc, data/yacc.c: Use it instead of
1413 b4_error_verbose_flag.
1414 * src/getargs.h, src/getargs.c (error_verbose_flag): Remove.
1415 * src/output.c (prepare): Don't output it.
1416 * src/parse-gram.y (%error-verbose): Treat as %define error_verbose.
1417
1418 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1419
1420 Fix strange %define locations for default values.
1421 Reported by Akim Demaille at
1422 <http://lists.gnu.org/archive/html/bug-bison/2007-12/msg00001.html>
1423 and discussed again starting at
1424 <http://lists.gnu.org/archive/html/bison-patches/2008-11/msg00102.html>.
1425 * data/bison.m4 (b4_percent_define_default): Leave syncline blank
1426 because location information is bogus.
1427 Use angle brackets to delimit fake file name because square brackets
1428 look like underexpanded m4. Choose a better fake file name.
1429 Use negative line numbers.
1430 * src/muscle_tab.c (muscle_percent_define_default): Likewise.
1431 * src/location.c (location_print): If line for a boundary is negative,
1432 only print that boundary's file name.
1433 * src/location.h: Document that.
1434 * tests/skeletons.at (%define Boolean variables: invalid skeleton
1435 defaults): Update output.
1436
1437 2009-04-03 Joel E. Denny <jdenny@ces.clemson.edu>
1438
1439 Pacify ./configure --enable-gcc-warnings.
1440 * Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS) because many files
1441 in lib won't compile with it.
1442 * src/local.mk (src_bison_CFLAGS): Use $(WERROR_CFLAGS) here only.
1443
1444 2009-03-31 Akim Demaille <demaille@gostai.com>
1445
1446 bootstrap: --help to stdout.
1447 * bootstrap (usage): Don't send --help to stderr.
1448 Use a here doc instead of a long string.
1449
1450 2009-03-31 Akim Demaille <demaille@gostai.com>
1451
1452 bootstrap: README-hacking no longer exists
1453 * bootstrap (checkout_only_file): Set to HACKING.
1454
1455 2009-03-26 Akim Demaille <demaille@gostai.com>
1456
1457 doc: merge HACKING and README-hacking.
1458 Two files is confusing.
1459 Reported by Alexandre Duret-Lutz.
1460
1461 * README-hacking: Merge into...
1462 * HACKING (Working from the repository): here.
1463
1464 2009-03-26 Akim Demaille <demaille@gostai.com>
1465
1466 doc: update README-hacking.
1467 * README-hacking: We now use git and git submodules.
1468 Reported by Ralf Wildenhues and Alexandre Duret-Lutz.
1469
1470 2009-03-26 Akim Demaille <demaille@gostai.com>
1471
1472 lalr1.cc: avoid GCC 4.3 warnings.
1473 GCC 4.3 now warns about "a || b && c" and asks for explicit
1474 parentheses.
1475 Reported by Alexandre Duret-Lutz.
1476 * data/location.cc: Update copyright years.
1477 (Position::operator==): Use parens to make precedence explicit.
1478 Compare lines and columns first, as they are more likely to be
1479 different, and they are faster to compare.
1480
1481 2009-03-26 Akim Demaille <demaille@gostai.com>
1482
1483 gnulib: update.
1484 * gnulib: Update to latest.
1485 * src/local.mk (AM_CFLAGS): Move to...
1486 * Makefile.am: here.
1487 * etc/prefix-gnulib-mk (prefix_assignment): Also transform
1488 AM_CFLAGS.
1489
1490 2009-03-02 Akim Demaille <demaille@gostai.com>
1491
1492 Comment changes.
1493
1494 2009-03-02 Akim Demaille <demaille@gostai.com>
1495
1496 Share b4_yytranslate_define.
1497 * data/lalr1.cc (b4_yytranslate_define): Move to...
1498 * data/c++.m4: here.
1499
1500 2009-03-02 Akim Demaille <demaille@gostai.com>
1501
1502 Use locations in the variant example.
1503 Yes, this obfuscates the point of this example, variants only.
1504 But glr.cc cannot work (yet?) without locations. This change
1505 makes it easier to use this example with glr.cc.
1506
1507 * examples/variant.yy (assert): %define it.
1508 (locations): Request them.
1509 (yylex): Bind the location to the stage.
1510
1511 2009-03-02 Akim Demaille <demaille@gostai.com>
1512
1513 Dub make_TOKEN as a public type interface.
1514 * data/c++.m4 (b4_symbol_constructor_declare)
1515 (b4_symbol_constructor_define): New empty stubs.
1516 (b4_public_types_declare, b4_public_types_define): Use them.
1517 * data/lalr1.cc (b4_symbol_constructor_declare)
1518 (b4_symbol_constructor_declare_)
1519 (b4_symbol_constructor_define_, b4_symbol_constructor_define):
1520 Move to...
1521 * data/variant.hh: here.
1522 Remove the "b4_variant_if" parts, as variant.hh is loaded only if
1523 needed.
1524 * data/lalr1.cc: No longer invoke b4_symbol_constructor_define and
1525 b4_symbol_constructor_declare, as it is now done by
1526 b4_public_types_define and b4_public_types_declare.
1527
1528 2009-03-02 Akim Demaille <demaille@gostai.com>
1529
1530 Coding style changes.
1531 * data/lalr1.cc (b4_symbol_constructor_declaration_)
1532 (b4_symbol_constructor_declarations)
1533 (b4_symbol_constructor_definition_)
1534 (b4_symbol_constructor_definitions)
1535 (b4_yytranslate_definition): Rename as...
1536 (b4_symbol_constructor_declare_)
1537 (b4_symbol_constructor_declare)
1538 (b4_symbol_constructor_define_)
1539 (b4_symbol_constructor_define)
1540 (b4_yytranslate_define): these.
1541 * data/variant.hh (b4_variant_definition): Rename as...
1542 (b4_variant_define): this.
1543
1544 2009-03-02 Akim Demaille <demaille@gostai.com>
1545
1546 Factor b4_assert_if, b4_lex_symbol_if, and b4_variant_if.
1547 * data/bison.m4 (b4_percent_define_if_define): New.
1548 * data/c++.m4 (b4_variant_if): Move to...
1549 * data/bison.m4: Here, using b4_percent_define_if_define.
1550 * data/lalr1.cc (b4_assert_if, b4_lex_symbol_if): Move to...
1551 * data/bison.m4: Here, using b4_percent_define_if_define.
1552
1553 2009-03-02 Akim Demaille <demaille@gostai.com>
1554
1555 Dub symbol_type_base as a public type.
1556 * data/c++.m4 (b4_public_types_declare): Now define
1557 symbol_type_base and symbol_type.
1558 (b4_public_types_define): New.
1559 In both cases, the definitions are taken verbatim from lalr1.cc.
1560 * data/lalr1.cc: Adjust.
1561
1562 2009-03-02 Akim Demaille <demaille@gostai.com>
1563
1564 b4_public_types_declare.
1565 * data/c++.m4 (b4_public_types_declare): New.
1566 * data/glr.cc, data/lalr1.cc: Use it.
1567
1568 2009-03-02 Akim Demaille <demaille@gostai.com>
1569
1570 b4_semantic_type_declare.
1571 * data/c++.m4 (b4_semantic_type_declare): New.
1572 Factors and generalizes what was in glr.cc and lalr1.cc.
1573 * data/variant.hh (b4_semantic_type_declare): Redefine it for
1574 variants.
1575 * data/lalr1.cc, data/glr.cc: Use it.
1576
1577 2009-02-26 Akim Demaille <demaille@gostai.com>
1578
1579 Upgrade gnulib.
1580 * gnulib: Upgrade from master.
1581 * lib/.cvsignore, lib/.gitignore, m4/.cvsignore, m4/.gitignore:
1582 Regen.
1583
1584 2009-02-25 Akim Demaille <demaille@gostai.com>
1585
1586 Remove useless arguments.
1587 * data/glr.c (yy_reduce_print): $$ and @$ are not used and not
1588 relevant.
1589
1590 2009-02-25 Akim Demaille <demaille@gostai.com>
1591
1592 Comment changes.
1593 * data/lalr1.cc: here.
1594
1595 2009-02-25 Akim Demaille <demaille@gostai.com>
1596
1597 Fix glr.cc's debug level handling.
1598 * data/glr.cc (yydebug_): Remove, as it is actually yydebug from
1599 glr.c which is used.
1600 (debug_level, set_debug_level): Adjust.
1601
1602 2009-02-25 Akim Demaille <demaille@gostai.com>
1603
1604 Copyright years.
1605 * data/glr.c: Add 2007 and 2008 here, consistenly with the comments.
1606
1607 2009-02-25 Akim Demaille <demaille@gostai.com>
1608
1609 Style changes.
1610 * etc/bench.pl.in (generate_grammar_list): Consitently use
1611 location_type, not yy::location.
1612
1613 2009-02-25 Akim Demaille <demaille@gostai.com>
1614
1615 Comment change.
1616 * data/lalr1.cc: here.
1617
1618 2009-02-19 Akim Demaille <demaille@gostai.com>
1619
1620 Make yyparser::error public.
1621 * data/lalr1.cc: here.
1622 There is no good reason to keep it private (and it is convenient
1623 to use it from the scanner for instance). It is already public in
1624 glr.cc.
1625
1626 2009-02-19 Akim Demaille <demaille@gostai.com>
1627
1628 Comment changes.
1629 * data/glr.cc: here.
1630
1631 2009-02-19 Akim Demaille <demaille@gostai.com>
1632
1633 Remove trailing blanks.
1634 The epilogue has its own ending \n, no need to add another.
1635
1636 * data/glr.c, data/lalr1.java, data/yacc.c: dnl when outputing the
1637 epilogue.
1638 * data/glr.cc: dnl when extending the epilogue.
1639 Remove stray "private:".
1640
1641 2009-02-19 Akim Demaille <demaille@gostai.com>
1642
1643 Use b4_c_modern.
1644 * data/c.m4 (b4_c_function_decl): Here.
1645
1646 2009-02-19 Akim Demaille <demaille@gostai.com>
1647
1648 Comment changes.
1649 * data/lalr1.cc: here.
1650
1651 2009-02-19 Akim Demaille <demaille@gostai.com>
1652
1653 Extract variant.hh
1654 * data/variant.hh: New, extracted from...
1655 * data/lalr1.cc: here.
1656 Adjust.
1657 * data/local.mk: Adjust.
1658
1659 2009-02-19 Akim Demaille <demaille@gostai.com>
1660
1661 Extract stack.hh from lalr1.cc.
1662 * data/stack.hh: New.
1663 * data/lalr1.cc: Extract from here.
1664 * data/local.mk: Adjust.
1665
1666 2009-02-03 Joel E. Denny <jdenny@ces.clemson.edu>
1667
1668 Add reminder about uploading public key to keys.gnupg.net.
1669 * HACKING (Release Procedure): Here.
1670
1671 2009-01-28 Akim Demaille <demaille@gostai.com>
1672
1673 * NEWS: Update information about 2.4.1 and 2.4.2.
1674
1675 2008-11-04 Akim Demaille <demaille@gostai.com>
1676
1677 Reformat NEWS.
1678 * NEWS: Use more outline-mode markup.
1679 Suggested by Jim Meyering.
1680
1681 2009-01-08 Akim Demaille <demaille@gostai.com>
1682
1683 Fix grep portability issues.
1684 Grep on Solaris does not support -q.
1685 Reported by Summum Bonum.
1686
1687 * NEWS: Add a stub for 2.4.2.
1688 * THANKS: Add Summum Bonum.
1689 * tests/atlocal.in (EGREP): New.
1690 (CC, CXX, XSLTPROC): Make it possible to override them via
1691 envvars.
1692 * tests/java.at: Use $EGREP instead of egrep.
1693 Use AT_CHECK's ignore instead of grep's -q.
1694
1695 2008-12-11 Akim Demaille <demaille@gostai.com>
1696
1697 Pass the token type to yysyntax_error.
1698 * data/yacc.c (yysyntax_error): Take the transated token instead
1699 of the raw number.
1700 Adjust callers.
1701 * TODO: Update.
1702
1703 2008-12-11 Akim Demaille <demaille@gostai.com>
1704
1705 Formatting changes.
1706 * data/glr.c: Formatting changes.
1707
1708 2008-12-11 Akim Demaille <demaille@gostai.com>
1709
1710 Propagate i18n changes into glr.c.
1711 * TODO: Update.
1712 * data/glr.c (yyreportSyntaxError): Use "switch" instead of
1713 building the error message format dynamically.
1714 * data/lalr1.java: Formatting changes.
1715
1716 2008-12-11 Akim Demaille <demaille@gostai.com>
1717
1718 Use testsuite -C.
1719 * tests/local.mk: Replace "cd && testsuite" by "testsuite -C".
1720 Solves problems when top_srcdir is an absolute path.
1721 Suggested by Eric Blake.
1722 * configure.ac: Require Autoconf 2.62.
1723
1724 2008-12-11 Akim Demaille <demaille@gostai.com>
1725
1726 Simplify the i18n of the error messages.
1727 * data/lalr1.cc: Comment changes.
1728 * data/yacc.c (yysyntax_error): Rewrite, using a switch as in
1729 lalr1.cc instead of building dynamically the format string.
1730
1731 2008-12-08 Akim Demaille <demaille@gostai.com>
1732
1733 Fix portability issue in the test suite.
1734 * tests/local.at (AT_MATCHES_CHECK): New.
1735 Based on Perl instead of Sed. Sed has too many portability
1736 pitfalls, not ever Sed is GNU Sed.
1737 * tests/actions.at (Fix user actions without a trailing semicolon):
1738 Use it.
1739
1740 2008-12-08 Akim Demaille <demaille@gostai.com>
1741
1742 Update data/README.
1743 * data/README: Document glr.cc, lalr1.java, m4sugar and xslt.
1744
1745 2008-12-08 Akim Demaille <demaille@gostai.com>
1746
1747 Install autoconf as a submodule to get m4sugar.
1748 * .gitmodules: Add submodules/autoconf.
1749 * data/m4sugar/foreach.m4, data/m4sugar/m4sugar.m4: Now links into
1750 submodules/autoconf.
1751
1752 2008-12-08 Akim Demaille <demaille@gostai.com>
1753
1754 Test token.prefix in all the skeletons.
1755 * data/java.m4 (b4_token_enum): Use the token.prefix.
1756 * tests/local.at (AT_BISON_OPTION_PUSHDEFS): Define AT_TOKEN_PREFIX.
1757 * tests/calc.at (_AT_DATA_CALC_Y): Use it.
1758 Add checks for yacc.c, glr.c, lalr1.cc and glr.cc.
1759 * tests/java.at: Comment changes.
1760 (AT_CHECK_JAVA_MINIMAL): Define the END token.
1761 (Java parser class and package names): Add token.prefix check.
1762
1763 2008-12-08 Akim Demaille <demaille@gostai.com>
1764
1765 Fix regeneration of atconfig.
1766 * tests/local.mk (tests/atconfig): The rule was incorrect, but
1767 remove it: now that there is no tests/Makefile.am, the top-level
1768 Makefile properly updates atconfig when needed.
1769
1770 2008-12-07 Di-an Jan <dianj@freeshell.org>
1771
1772 Implement the FIXME that ends an user action with a semicolon
1773 if it seems necessary.
1774 * src/scan-code.l (flex rules section): Flag cpp directive from
1775 any `#' to the first unescaped end-of-line. Semicolon is not
1776 needed after `;', `{', '}', or cpp directives and is needed after
1777 any other token (whitespaces and comments have no effect).
1778 * tests/actions.at (Fix user actions without a trailing semicolon):
1779 New test.
1780 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add semicolons to
1781 to make user actions complete statements.
1782 Adjust column numbers in error messages.
1783 * tests/regression.at (Fix user actions without a trailing semicolon):
1784 Remove. Covered by new test.
1785
1786 2008-12-07 Akim Demaille <demaille@gostai.com>
1787
1788 Update gnulib.
1789 * gnulib: Update from master.
1790
1791 2008-12-05 Eric Blake <ebb9@byu.net>
1792
1793 Avoid compiler warning.
1794 * src/output.c (muscle_insert_item_number_table): Delete unused
1795 function.
1796
1797 2008-12-02 Eric Blake <ebb9@byu.net>
1798
1799 Build testsuite with newer autoconf.
1800 * tests/output.at (m4_expand): Don't override in newer autoconf,
1801 where the underlying implementation changed.
1802 * tests/cxx-type.at (_AT_RESOLVED_GLR_OUTPUT)
1803 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT)
1804 (_AT_AMBIG_GLR_OUTPUT_WITH_LOC, _AT_GLR_STDERR)
1805 (_AT_VERBOSE_GLR_STDERR): Expand to double-quoted strings,
1806 since some of them contain unbalanced ')'.
1807
1808 2008-12-01 Akim Demaille <demaille@gostai.com>
1809
1810 Use b4_symbol for printers and destructors everywhere.
1811 * data/bison.m4 (b4_symbol_action_location): New.
1812 * data/c.m4 (b4_symbol_actions): Remove.
1813 Adjust all callers to use by b4_symbol_foreach and the corresponding
1814 b4_symbol_printer/destructor macro.
1815 * data/glr.cc: Adjust.
1816 * data/lalr1.java: Adjust the %destructor sanity check.
1817 * src/output.c (symbol_code_props_output): Remove, we no longer
1818 need the b4_symbol_printers/destructors tables.
1819
1820 2008-12-01 Akim Demaille <demaille@gostai.com>
1821
1822 Use b4_symbol_case_.
1823 * data/lalr1.cc, data/bison.m4 (b4_symbol_action): Use
1824 b4_symbol_case_.
1825
1826 2008-12-01 Akim Demaille <demaille@gostai.com>
1827
1828 Move b4_symbol based macro to bison.m4.
1829 * data/lalr1.cc (b4_symbol_, b4_symbol, b4_symbol_if)
1830 (b4_symbol_action, b4_symbol_destructor, b4_symbol_printer)
1831 (b4_symbol_case_, b4_symbol_foreach, b4_type_action_)
1832 (b4_type_foreach): Move to...
1833 * data/bison.m4: Here.
1834 * data/lalr1.cc (b4_symbol_action): Specialize for C++: use
1835 b4_symbol_value_template instead of b4_symbol_value.
1836
1837 2008-12-01 Akim Demaille <demaille@gostai.com>
1838
1839 b4_symbol/type_foreach.
1840 * data/lalr1.cc (b4_symbol_foreach, b4_type_foreach): New.
1841 Use them.
1842
1843 2008-12-01 Akim Demaille <demaille@gostai.com>
1844
1845 Use the symbol properties to output the printer/destructor for lalr1.cc.
1846 Instead of defining complex list of tuples to define various
1847 properties of the symbols, we now prefer to define symbols as
1848 "structs" in m4: using the symbol key (its number), and the
1849 property name, b4_symbol gives it value. Use this to handle
1850 destructors and printers.
1851
1852 * src/output.c (CODE_PROP): New.
1853 (prepare_symbol_definitions): Use it to define the printer and
1854 destructor related attributes of the symbols.
1855 * data/lalr1.cc (b4_symbol_actions): Rename as...
1856 (b4_symbol_action): this.
1857 Use b4_symbol instead of 6 arguments.
1858 (b4_symbol_printer, b4_symbol_destructor): New.
1859 Use them instead of b4_symbol_actions.
1860
1861 2008-12-01 Akim Demaille <demaille@gostai.com>
1862
1863 Avoid capturing variables too easily.
1864 * src/muscle_tab.h (MUSCLE_INSERT_BOOL, MUSCLE_OBSTACK_SGROW): Use
1865 v__ and p__ instead of v and p.
1866
1867 2008-12-01 Akim Demaille <demaille@gostai.com>
1868
1869 Remove spurious empty line before syncline.
1870 * data/bison.m4 (b4_syncline): Don't output an empty line before
1871 the output.
1872
1873 2008-11-26 Akim Demaille <demaille@gostai.com>
1874
1875 Convert lib/Makefile.am into lib/local.mk.
1876 The real problem is rather gnulib.mk, which itself is extracted
1877 from a Makefile.am that gnulib expects to the "recursive". The
1878 tool prefix-gnulib-mk converts such a gnulib.mk to be
1879 non-recursive. Also, some AC_SUBST variables need to be adjusted.
1880
1881 * etc/prefix-gnulib-mk: New.
1882 * bootstrap (slurp): Use it to convert further gnulib.mk.
1883 No longer try to avoid re-creation of lib/gnulib.mk as the changes
1884 are deeper.
1885 * lib/Makefile.am: Rename as...
1886 * lib/local.mk: this.
1887 Adjust to be prefixed.
1888 * Makefile.am, configure.ac: Adjust.
1889 * src/local.mk (AM_CPPFLAGS): Extend it, don't define it.
1890
1891 2008-11-26 Akim Demaille <demaille@gostai.com>
1892
1893 s/_FLAGS/FLAGS/.
1894 * tests/local.mk (TESTSUITE_FLAGS, AUTOTEST_FLAGS): Rename as...
1895 (TESTSUITEFLAGS, AUTOTESTFLAGS): these to compy with the GCS.
1896 Reported by Eric Blake.
1897
1898 2008-11-26 Akim Demaille <demaille@gostai.com>
1899
1900 Use b4_parser_tables_define in glr.cc.
1901 * data/glr.c: Use b4_parser_tables_define instead of defining the
1902 (deterministic integral) tables by hand.
1903
1904 2008-11-26 Akim Demaille <demaille@gostai.com>
1905
1906 Use b4_parser_tables_define in Java.
1907 * data/java.m4 (b4_typed_parser_table): Rename as...
1908 (b4_typed_parser_table_define): this, for consistency.
1909 Accept a comment as $4.
1910 Move $2 into yy*_.
1911 (b4_integral_parser_table): Rename as...
1912 (b4_integral_parser_table_define): this.
1913 * data/lalr1.java: Adjust all uses.
1914 Use b4_parser_tables_define instead of generation by hand.
1915
1916 2008-11-26 Akim Demaille <demaille@gostai.com>
1917
1918 Prepare the convergence bw C style and Java table generation.
1919 * data/bison.m4 (b4_tables_map, b4_tables_declare)
1920 (b4_tables_define): Rename as...
1921 (b4_integral_parser_tables_map, b4_parser_tables_declare)
1922 (b4_parser_tables_define): these.
1923 * data/c.m4 (b4_table_define): Rename as...
1924 (b4_integral_parser_table_define): this.
1925 * data/lalr1.cc: Adjust.
1926 (b4_table_define, b4_table_declare): Rename as...
1927 (b4_integral_parser_table_define)
1928 (b4_integral_parser_table_declare): these.
1929 (yyrline_): Move the comment where it is actually used.
1930 * data/yacc.c: Adjust.
1931 (yyrline): Use b4_integral_parser_table_define.
1932
1933 2008-11-26 Akim Demaille <demaille@gostai.com>
1934
1935 Regen.
1936 * src/parse-gram.h, src/parse-gram.c: Regen.
1937
1938 2008-11-26 Akim Demaille <demaille@gostai.com>
1939
1940 Factor the generation of the (integral) tables bw yacc.c and lalr1.cc.
1941 * data/lalr1.cc (b4_tables_map): Move to...
1942 * data/bison.m4: here.
1943 Update the comment for yytable during the flight.
1944 (b4_tables_declare, b4_tables_define): New.
1945 * data/lalr1.cc: Use them.
1946 * data/c.m4 (b4_table_define): New.
1947 * data/yacc.c: Use b4_tables_define instead of output the tables
1948 by hand.
1949 * tests/regression.at (Web2c Actions): Adjust the expected output,
1950 the order of the tables changed.
1951
1952 2008-11-26 Akim Demaille <demaille@gostai.com>
1953
1954 Get rid of (yy)rhs and (yy)prhs.
1955 These tables are no longer needed in the parsers, and they don't seem to
1956 be useful. They are not documented either.
1957
1958 * src/output.c (prepare_rules): Get rid of rhs and prhs.
1959 Adjust the computation of (yy)r2.
1960
1961 2008-11-26 Akim Demaille <demaille@gostai.com>
1962
1963 Rule length is unsigned.
1964 * src/gram.h, src/gram.c (rule_rhs_length): Return a size_t.
1965
1966 2008-11-26 Akim Demaille <demaille@gostai.com>
1967
1968 Get rid of lalr1-split.cc.
1969 It was no longer maintainer.
1970
1971 * data/lalr1-split.cc: Remove.
1972 * etc/bench.pl.in (bench_fusion_parser): Remove.
1973 Adjust.
1974
1975 2008-11-26 Akim Demaille <demaille@gostai.com>
1976
1977 Use yy* consistently.
1978 * data/glr.c: Now that yyrhs no longer exists as a global
1979 variable, rename local "rhs" variables into "yyrhs" for
1980 consistency.
1981
1982 2008-11-25 Akim Demaille <demaille@gostai.com>
1983
1984 Get rid of yyrhs and yyprhs in glr.c.
1985 * data/glr.c (yyrhs, yyprhs): Remove.
1986 Instead, use the state stack and yystos.
1987
1988 2008-11-25 Akim Demaille <demaille@gostai.com>
1989
1990 Flag glr tests.
1991 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): If glr, declare it
1992 as an Autotest keyword.
1993
1994 2008-11-25 Akim Demaille <demaille@gostai.com>
1995
1996 Prefer TESTSUITE_FLAGS.
1997 TESTSUITEFLAGS is barely readable.
1998
1999 * tests/local.mk (TESTSUITE_FLAGS): Default to $(TESTSUITEFLAGS)
2000 for backward compatibility.
2001 Use the former instead of the latter.
2002
2003 2008-11-25 Akim Demaille <demaille@gostai.com>
2004
2005 Get rid of yyrhs and yyprhs in larl1.java.
2006 * data/lalr1.java (yyrhs_, yyprhs_): Remove.
2007 (yy_reduce_print): Rather, use yystos_ and the state stack.
2008
2009 2008-11-25 Akim Demaille <demaille@gostai.com>
2010
2011 Formatting changes.
2012
2013 2008-11-25 Akim Demaille <demaille@gostai.com>
2014
2015 Get rid of yyrhs and yyprhs in yacc.c.
2016 They were used to get the symbol types, given a rule number, when
2017 displaying the top of the stack before a reduction. But the
2018 symbol type is available from the state stack. This has two be
2019 benefits: two tables less in the parser (making it smaller), and a
2020 more consistent use of the three stacks which will help to fuse
2021 them.
2022
2023 * data/yacc.c (yyprhs, yyrhs): Remove.
2024 (YY_REDUCE_PRINT): Pass yyssp to yy_reduce_print.
2025 (yy_reduce_print): Take yyssp as argument.
2026 Use it, together with yystos, to get the symbol type.
2027 * tests/regression.at (Web2c Report): Remove these tables from the
2028 expected output.
2029
2030 2008-11-25 Akim Demaille <demaille@gostai.com>
2031
2032 b4_tables_map.
2033 The point is to factor the generation of the tables across skeletons.
2034 This is language dependant.
2035
2036 * data/c.m4 (b4_comment_): New.
2037 Should be usable to define how to generate tables independently of
2038 the language.
2039 (b4_c_comment): New.
2040 (b4_comment): Bounce to b4_c_comment.
2041 Now support $2 = [PREFIX] for indentation.
2042 * data/lalr1.cc (b4_table_declare): Don't output a comment if
2043 there is no comment.
2044 Indent it properly when there is one.
2045 Output the ending semicolon.
2046 (b4_table_define): Space changes.
2047 Output the ending semicolon.
2048 (b4_tables_map): New.
2049 Use it twice instead of declaring and defining the (integral)
2050 tables by hand.
2051
2052 2008-11-25 Akim Demaille <demaille@gostai.com>
2053
2054 b4_table_declare.
2055 * data/lalr1.cc (b4_table_declare): New.
2056 Use it to declare the tables defined with b4_table_define.
2057 (b4_table_define): Declare a third arg to match b4_table_declare
2058 signature.
2059 Move all the comments around invocations of b4_table_define into
2060 the invocations itselves.
2061 Move things around to have the order for declarations and
2062 definitions.
2063
2064 2008-11-25 Akim Demaille <demaille@gostai.com>
2065
2066 Formatting changes.
2067 * data/lalr1.java: here.
2068
2069 2008-11-25 Akim Demaille <demaille@gostai.com>
2070
2071 b4_args is more general than only C++.
2072 * data/lalr1.cc (b4_args, _b4_args): Move to...
2073 * data/bison.m4: here.
2074
2075 2008-11-21 Di-an Jan <dianj@freeshell.org>
2076
2077 Implement no-XXX arguments for --warnings, --report, --trace.
2078 * src/getargs.c (flags_argmatch): Handles no-XXX.
2079 Fix typo in doxygen comment.
2080
2081 2008-11-21 Akim Demaille <demaille@gostai.com>
2082
2083 Display the changes in cross-options.texi.
2084 * build-aux/cross-options.pl ($sep): New, to separate items.
2085 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): Use diff to display the
2086 changes.
2087
2088 2008-11-20 Di-an Jan <dianj@freeshell.org>
2089
2090 Improves options in the manual.
2091 * doc/bison.texinfo (-g, -x): Add space before argument.
2092 (Option Cross Key): Implement FIXME: listing directives also.
2093 * build-aux/cross-options.pl: Read from <STDIN> rather than <>.
2094 (Short Option): Special case -d. Put arguments inside @option.
2095 (Bison Directive): Add column, automatically extracted from
2096 src/scan-gram.l (actual name passed as the first argument)
2097 with special case for %define.
2098 * doc/local.mk (doc/cross-options.texi): Pass src/scan-gram.l
2099 to build-aux/cross-options.pl.
2100 * src/getargs.c (usage): Document limitations of cross-options.pl.
2101 * src/scan-gram.l: Likewise.
2102
2103 2008-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
2104
2105 Fix unexpanded macros in GLR defines file.
2106 Reported by Csaba Raduly at
2107 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00048.html>.
2108 * THANKS (Csaba Raduly): Add.
2109 * data/glr.c: Fix overquoting on b4_prefix for yylval and yylloc.
2110 * tests/calc.at (_AT_DATA_CALC_Y): If %defines is specified, generate
2111 lexer in a separate module that includes the defines file.
2112 (AT_CHECK_CALC): From AT_FULL_COMPILE, request compilation of lexer
2113 source.
2114 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_DEFINES_IF.
2115 Adjust AT_LOC and AT_VAL to use AT_NAME_PREFIX.
2116 (AT_BISON_OPTION_POPDEFS): Pop AT_DEFINES_IF.
2117 (AT_DATA_SOURCE_PROLOGUE): New.
2118 (AT_DATA_GRAMMAR_PROLOGUE): Use AT_DATA_SOURCE_PROLOGUE.
2119 (AT_DATA_SOURCE): New.
2120 (AT_FULL_COMPILE): Extend to support an additional source file.
2121
2122 2008-11-18 Akim Demaille <demaille@gostai.com>
2123
2124 More TODO.
2125 * TODO: More short term issues.
2126
2127 2008-11-18 Akim Demaille <demaille@gostai.com>
2128
2129 Regen.
2130 * src/parse-gram.h, src/parse-gram.c: Regen.
2131
2132 2008-11-18 Akim Demaille <demaille@gostai.com>
2133
2134 Use b4_subtract where possible.
2135 * data/lalr1.cc (b4_subtract): Move to...
2136 * data/bison.m4: here.
2137 * data/glr.c (b4_rhs_data): Use it.
2138 * data/yacc.c (b4_rhs_value, b4_rhs_location): Use it.
2139
2140 2008-11-18 Akim Demaille <demaille@gostai.com>
2141
2142 Remove incorrect mode specification.
2143 * data/glr.cc: Don't pretend it's C code.
2144
2145 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2146
2147 Simplify last patch slightly.
2148 * src/getargs.c (getargs): Here.
2149
2150 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2151
2152 Fix last warning from --enable-gcc-warnings.
2153 * src/getargs.c (getargs): Don't assign const address to non-const
2154 pointer.
2155
2156 2008-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2157
2158 Don't let maintainer-*-check targets force a version update.
2159 * cfg.mk (_is-dist-target): Implement. maintainer-check* was already
2160 handled.
2161
2162 2008-11-17 Di-an Jan <dianj@freeshell.org>
2163
2164 * doc/bison.texinfo: Synchronize ``Detail Node Listing''.
2165 Align menus. Adjust word wrapping. Use node names for menu names.
2166 (Examples): Don't abbreviate node names.
2167 (LocalWords): Remove abbreviations.
2168 (Copying): Make description a sentence.
2169 (Java Action Features): Remove period to match the rest of menu.
2170
2171 2008-11-17 Di-an Jan <dianj@freeshell.org>
2172
2173 Handles several --enable-gcc-warnings.
2174 * src/getargs.c (command_line_location): Set parameters to void.
2175 * src/output.c (symbol_type_name_cmp): Make static.
2176 (symbols_by_type_name): Set parameters to void.
2177 (symbol_definitions_output): Remove unused parameter. Rename as...
2178 (prepare_symbol_definitions): this.
2179 (muscles_output): Move symbol_definitions_output to...
2180 (output): here as prepare_symbol_definitions.
2181 * tests/c++.at (AT_CHECK_VARIANTS): Remove unused parameters of main.
2182 (AT_CHECK_NAMESPACE): Make unused parameter lloc unnamed.
2183
2184 2008-11-17 Di-an Jan <dianj@freeshell.org>
2185
2186 * tests/c++.at (AT_CHECK_VARIANTS): Fixes tests 198-202.
2187 Use AT_DATA_GRAMMAR instead of AT_DATA for compiled tests.
2188
2189 2008-11-16 Akim Demaille <demaille@gostai.com>
2190
2191 Add missing $(EXEEXT).
2192 * doc/local.mk ($(CROSS_OPTIONS_TEXI)): The target is
2193 "src/bison$(EXEEXT)".
2194 Reported by Di-an Jan.
2195
2196 2008-11-15 Akim Demaille <demaille@gostai.com>
2197
2198 * TODO: Update.
2199
2200 2008-11-15 Akim Demaille <demaille@gostai.com>
2201
2202 Formatting changes.
2203 * tests/input.at: here.
2204
2205 2008-11-15 Akim Demaille <demaille@gostai.com>
2206
2207 Remove duplicate header inclusion.
2208 * src/LR0.c: here.
2209
2210 2008-11-15 Akim Demaille <demaille@gostai.com>
2211
2212 * src/parse-gram.h, src/parse-gram.c: Regen.
2213
2214 2008-11-15 Akim Demaille <demaille@gostai.com>
2215
2216 Support parametric types.
2217
2218 There are two issues to handle: first scanning nested angle
2219 bracket pairs to support types such as std::pair< std::string,
2220 std::list<std::string> > >.
2221
2222 Another issue is to address idiosyncracies of C++: do not glue two
2223 closing angle brackets together (otherwise it's operator>>), and
2224 avoid sticking blindly a TYPE to the opening <, as it can result
2225 in '<:' which is a digraph for '['.
2226
2227 * src/scan-gram.l (brace_level): Rename as...
2228 (nesting): this.
2229 (SC_TAG): New.
2230 Implement support for complex tags.
2231 (tag): Accept
2232 , but not <.
2233 * data/lalr1.cc (b4_symbol_value, b4_symbol_value_template)
2234 (b4_symbol_variant): Leave space around types as parameters.
2235 * examples/variant.yy: Use nested template types and leading ::.
2236 * src/parse-gram.y (TYPE, TYPE_TAG_ANY, TYPE_TAG_NONE, type.opt):
2237 Rename as...
2238 (TAG, TAG_ANY, TAG_NONE, tag.opt): these.
2239 * tests/c++.at: Test parametric types.
2240
2241 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2242
2243 Test token.prefix.
2244 This is not sufficient, but we test at least that the make_SYMBOL
2245 interface is not affected by token.prefix. A more general test
2246 will be implemented when the support of token.prefix is generalized
2247 to more skeletons.
2248
2249 * tests/c++.at: One more variant test, using token.prefix.
2250
2251 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2252
2253 Test the make_TOKEN interface.
2254 * tests/c++.at (AT_CHECK_VARIANTS): Require and use locations.
2255 Factor the common code in yylex.
2256 Use it to test "%define lex_symbol".
2257
2258 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2259
2260 Formatting change.
2261
2262 2008-11-15 Akim Demaille <akim@betelgeuse.gostai.ensta.fr>
2263
2264 Simplify code for variants bench marks.
2265 * etc/bench.pl.in (&generate_grammar_list): Define and use
2266 location_type.
2267 Factor the common code in yylex.
2268
2269 2008-11-15 Akim Demaille <demaille@gostai.com>
2270
2271 Better error message.
2272 * bootstrap (find_tool): Fix the error message.
2273
2274 2008-11-15 Akim Demaille <demaille@gostai.com>
2275
2276 Update variant.yy to newest interface.
2277 * examples/variant.yy: Define lex_symbol.
2278 Adjust.
2279
2280 2008-11-15 Akim Demaille <demaille@gostai.com>
2281
2282 Don't use locations in variant.yy.
2283 * examples/variant.yy: Adjust to not using locations.
2284
2285 2008-11-15 Akim Demaille <demaille@gostai.com>
2286
2287 Comment changes.
2288 * data/local.mk, etc/local.mk, examples/local.mk: Use Automake
2289 comments for the license.
2290
2291 2008-11-15 Akim Demaille <demaille@gostai.com>
2292
2293 Remove tests/Makefile.am.
2294 * tests/Makefile.am: Rename as...
2295 * tests/local.mk: this.
2296 * Makefile.am, configure.ac: Adjust.
2297 * Makefile.am (DISTCLEANFILES): Define.
2298 (maintainer-check, maintainer-xml-check, maintainer-push-check):
2299 Remove, we no longer need to bounce to the real targets.
2300
2301 2008-11-15 Akim Demaille <demaille@gostai.com>
2302
2303 Comment changes.
2304
2305 2008-11-15 Akim Demaille <demaille@gostai.com>
2306
2307 djgpp/local.mk.
2308 * Makefile.am (EXTRA_DIST): Move djgpp related part to...
2309 * djgpp/local.mk: this new file.
2310
2311 2008-11-15 Akim Demaille <demaille@gostai.com>
2312
2313 Remove doc/Makefile.am.
2314 * doc/Makefile.am: Rename as...
2315 * doc/local.mk: this.
2316 Adjust paths
2317 * Makefile.am, configure.ac: Adjust.
2318 * Makefile.am (MOSTLYCLEANFILES): New.
2319 * src/local.mk: Adjust.
2320
2321 2008-11-15 Akim Demaille <demaille@gostai.com>
2322
2323 Move sc_tight_scope into maint.mk.
2324 It does not work, and I don't know how it was supposed to work: it
2325 seems to be looking for sources in the build tree. I just moved
2326 it at a better place, fixing it is still required.
2327
2328 * src/local.mk (echo): Remove.
2329 (sc_tight_scope): Move to...
2330 * maint.mk: here.
2331
2332 2008-11-15 Akim Demaille <demaille@gostai.com>
2333
2334 Regen.
2335 * src/parse-gram.h, src/parse-gram.h: Regen.
2336
2337 2008-11-15 Akim Demaille <demaille@gostai.com>
2338
2339 Remove src/Makefile.am.
2340 * src/Makefile.am: Rename as...
2341 * src/local.mk: this.
2342 Prefix all the paths with src/.
2343 (AUTOMAKE_OPTIONS): Build object files in the sub dirs.
2344 (AM_CPPFLAGS): Find find in builddir/src.
2345 (YACC): Move the flags into...
2346 (AM_YFLAGS): here.
2347 * maint.mk (sc_tight_scope): Disable.
2348 It used to bounce to the version in src/Makefile.am which is now
2349 part of this very Makefile.
2350 * Makefile.am, configure.ac: Adjust.
2351 * src/scan-code-c.c, src/scan-code.l: We can no longer rely on
2352 include "..." to find files "here": we are no longer in src/, so
2353 qualify the includes with src/.
2354 * doc/Makefile.am (PREPATH): No longer include the top_builddir
2355 prefix.
2356 (.x.1): Adjust to be able to create src/foo from the top level
2357 Makefile, instead of going bounce to src/Makefile the creation of
2358 foo.
2359
2360 2008-11-15 Akim Demaille <demaille@gostai.com>
2361
2362 Remove useless variable.
2363 * doc/Makefile.am (srcsrcdir): Remove.
2364
2365 2008-11-15 Akim Demaille <demaille@gostai.com>
2366
2367 Remove data/Makefile.am.
2368 * data/Makefile.am: Rename as...
2369 * data/local.mk: this.
2370 Adjust paths.
2371 * Makefile.am, configure.ac: Adjust.
2372
2373 2008-11-15 Akim Demaille <demaille@gostai.com>
2374
2375 Remove etc/Makefile.am.
2376 * etc/Makefile.am: Rename as...
2377 * etc/local.mk: this.
2378 Adjust.
2379 * Makefile.am, configure.ac: Adjust.
2380
2381 2008-11-15 Akim Demaille <demaille@gostai.com>
2382
2383 Remove examples/local.mk.
2384 examples/calc++/Makefile.am might be interesting to keep as is, since
2385 it is an example in itself.
2386
2387 * examples/Makefile.am: Rename as...
2388 * examples/local.mk: this.
2389 Adjust.
2390 * Makefile.am, configure.ac: Adjust.
2391
2392 2008-11-15 Akim Demaille <demaille@gostai.com>
2393
2394 Remove build-aux/Makefile.am.
2395 Recursive Makefiles are really way too slow, let's get rid of some of
2396 them.
2397
2398 * build-aux/Makefile.am: Rename as...
2399 * build-aux/local.mk: this.
2400 Adjust paths.
2401 * Makefile.am, configure.ac: Adjust.
2402
2403 2008-11-15 Akim Demaille <demaille@gostai.com>
2404
2405 Provide convenience constructors for locations and positions.
2406 * data/location.cc (position::position): Accept file, line and
2407 column as arguments with default values.
2408 Always qualify initial line and column literals as unsigned.
2409 (location::location): Provide convenience constructors.
2410
2411 2008-11-15 Akim Demaille <demaille@gostai.com>
2412
2413 Instead of using make_symbol<TOK_FOO>, generate make_FOO for each
2414 token type.
2415 Using template buys us nothing, and makes it uselessly complex to
2416 construct a symbol. Besides, it could not be generalized to other
2417 languages, while make_FOO would work in C/Java etc.
2418
2419 * data/lalr1.cc (b4_symbol_): New.
2420 (b4_symbol): Use it.
2421 (b4_symbol_constructor_declaration_)
2422 (b4_symbol_constructor_definition_): Instead of generating
2423 specializations of an overloaded template function, just generate
2424 several functions whose names are forged from the token names
2425 without the token.prefix.
2426 (b4_symbol_constructor_declarations): Generate them for all the
2427 symbols, not just by class of symbol type, now that instead of
2428 specializing a function template by the token, we generate a
2429 function named after the token.
2430 (b4_symbol_constructor_specialization_)
2431 (b4_symbol_constructor_specializations): Remove.
2432 * etc/bench.pl.in: Adjust to this new API.
2433
2434 2008-11-13 Akim Demaille <demaille@gostai.com>
2435
2436 %define token.prefix.
2437 Provide a means to add a prefix to the name of the tokens as
2438 output in the generated files. Because of name clashes, it is
2439 good to have such a prefix such as TOK_ that protects from names
2440 such as EOF, FILE etc. But it clutters the grammar itself.
2441
2442 * data/bison.m4 (token.prefix): Empty by default.
2443 * data/c.m4 (b4_token_enum, b4_token_define): Use it.
2444 * data/lalr1.cc (b4_symbol): Ditto.
2445
2446 2008-11-13 Akim Demaille <demaille@gostai.com>
2447
2448 Compute at M4 time some of the subtractions.
2449 * data/lalr1.cc (b4_subtract): New.
2450 (b4_rhs_data): Use it.
2451
2452 2008-11-13 Akim Demaille <demaille@gostai.com>
2453
2454 symbol::token.
2455 This allows the user to get the type of a token returned by yylex.
2456
2457 * data/lalr1.cc (symbol::token): New.
2458 (yytoknum_): Define when %define lex_symbol, independently of
2459 %debug.
2460 (yytoken_number_): Move into...
2461 (symbol::token): here, since that's the only use.
2462 The other one is YYPRINT which was not officially supported
2463 by lalr1.cc, and anyway it did not work since YYPRINT uses this
2464 array under a different name (yytoknum).
2465
2466 2008-11-13 Akim Demaille <demaille@gostai.com>
2467
2468 YYERRCODE.
2469 * TODO (YYERRCODE): Mention the case of $undef.
2470
2471 2008-11-13 Akim Demaille <demaille@gostai.com>
2472
2473 TODO: YYPRINT.
2474 * TODO (YYPRINT): New.
2475
2476 2008-11-13 Akim Demaille <demaille@gostai.com>
2477
2478 Comment changes.
2479 * data/lalr1.cc, data/yacc.c: Fix the description of the
2480 yytranslate and yytoknum tables.
2481
2482 2008-11-13 Akim Demaille <demaille@gostai.com>
2483
2484 Define make_symbol in the header.
2485 To reach good performances these functions should be inlined (yet
2486 this is to measure precisely). To this end they must be available
2487 to the caller.
2488
2489 * data/lalr1.cc (b4_symbol_constructor_definition_): Qualify
2490 location_type with the class name.
2491 Since will now be output in the header, declare "inline".
2492 No longer use b4_symbol_constructor_specializations, but
2493 b4_symbol_constructor_definitions in the header.
2494 Don't call it in the *.cc file.
2495
2496 2008-11-13 Akim Demaille <demaille@gostai.com>
2497
2498 Define yytranslate in the header for lex_symbol.
2499 * data/lalr1.cc: Move the invocation of b4_yytranslate_definition
2500 into the header file when using %define lex_symbol.
2501 (yytranslate_): Declare inline.
2502
2503 2008-11-13 Akim Demaille <demaille@gostai.com>
2504
2505 Define the constructors of symbol_type in
2506 b4_symbol_constructor_definitions.
2507 The constructors are called by the make_symbol functions, which a
2508 forthcoming patch will move elsewhere. Hence the interest of
2509 putting them together.
2510
2511 The stack_symbol_type does not need to be moved, it is used only
2512 by the parser.
2513
2514 * data/lalr1.cc: Move symbol_type and symbol_base_type
2515 constructors into...
2516 (b4_symbol_constructor_definitions): here.
2517 Adjust.
2518
2519 2008-11-13 Akim Demaille <demaille@gostai.com>
2520
2521 Make it easier to move the definition of yytranslate_.
2522 Forthcoming changes will make it possible to use yytranslate_
2523 from outside the parser implementation file.
2524
2525 * data/lalr1.cc (b4_yytranslate_definition): New.
2526 Use it.
2527
2528 2008-11-13 Akim Demaille <demaille@gostai.com>
2529
2530 Remove useless class specification.
2531 * data/lalr1.cc (b4_symbol_constructor_specialization_): No need
2532 to refer to the class name to use a type defined by the class for
2533 arguments of member functions.
2534
2535 2008-11-13 Akim Demaille <demaille@gostai.com>
2536
2537 Finer input type for yytranslate.
2538 This patch is debatable: the tradition expects yylex to return an int
2539 which happens to correspond to token_number (which is an enum). This
2540 allows for instance to return characters (such as '*' etc.). But this
2541 goes against the stronger typing I am trying to have with the new
2542 lex interface which return a symbol_type. So in this case, feed
2543 yytranslate_ with a token_type.
2544
2545 * data/lalr1.cc (yytranslate_): When in %define lex-symbol,
2546 expect a token_type.
2547
2548 2008-11-13 Akim Demaille <demaille@gostai.com>
2549
2550 Honor lex-params in %define lex_symbol mode.
2551 * data/lalr1.cc: Use b4_lex_param.
2552
2553 2008-11-13 Akim Demaille <demaille@gostai.com>
2554
2555 Simplify names.
2556 * src/output.c (symbol_definitions_output): Rename symbol
2557 attributes type_name and has_type_name as type and has_type.
2558 * data/lalr1.cc: Adjust uses.
2559
2560 2008-11-13 Akim Demaille <demaille@gostai.com>
2561
2562 Use b4_type_names for the union type.
2563 The union used to compute the size of the variant used to iterate
2564 over the type of all the symbols, with a lot of redundancy. Now
2565 iterate over the lists of symbols having the same type-name.
2566
2567 * data/lalr1.cc (b4_char_sizeof_): New.
2568 (b4_char_sizeof): Use it.
2569 Adjust to be called with a list of numbers instead of a single
2570 number.
2571 Adjust its caller for new-line issues.
2572
2573 2008-11-13 Akim Demaille <demaille@gostai.com>
2574
2575 Define the "identifier" of a symbol.
2576 Symbols may have several string representations, for instance if
2577 they have an alias. What I call its "id" is a string that can be
2578 used as an identifier. May not exist.
2579
2580 Currently the symbols which have the "tag_is_id" flag set are
2581 those that don't have an alias. Look harder for the id.
2582
2583 * src/output.c (is_identifier): Move to...
2584 * src/symtab.c (is_identifier): here.
2585 * src/symtab.h, src/symtab.c (symbol_id_get): New.
2586 * src/output.c (symbol_definitions_output): Use it to define "id"
2587 and "has_id".
2588 Remove the definition of "tag_is_id".
2589 * data/lalr1.cc: Use the "id" and "has_id" whereever "tag" and
2590 "tag_is_id" were used to produce code.
2591 We still use "tag" for documentation.
2592
2593 2008-11-11 Akim Demaille <demaille@gostai.com>
2594
2595 Locations are no longer required by lalr1.cc.
2596 * data/lalr1.cc (_b4_args, b4_args): New.
2597 Adjust all uses of locations to make them optional.
2598 * tests/c++.at (AT_CHECK_VARIANTS): No longer use the locations.
2599 (AT_CHECK_NAMESPACE): Check the use of locations.
2600 * tests/calc.at (_AT_DATA_CALC_Y): Adjust to be usable with or
2601 without locations with lalr1.cc.
2602 Test these cases.
2603 * tests/output.at: Check lalr1.cc with and without location
2604 support.
2605 * tests/regression.at (_AT_DATA_EXPECT2_Y, _AT_DATA_DANCER_Y):
2606 Don't use locations.
2607
2608 2008-11-11 Akim Demaille <demaille@gostai.com>
2609
2610 AT_FULL_COMPILE.
2611 * tests/local.at (AT_FULL_COMPILE): New.
2612 * tests/actions.at, tests/calc.at, tests/regression.at: Use it.
2613
2614 2008-11-11 Akim Demaille <demaille@gostai.com>
2615
2616 Support parens in calc++.
2617 * doc/bison.texinfo (Calc++ Scanner, Calc++ Parser): Support parens.
2618 * examples/calc++/test (run): Check the expected output.
2619 Adjust callers.
2620 Check parens too.
2621
2622 2008-11-11 Akim Demaille <demaille@gostai.com>
2623
2624 Simplify lalr1.cc since %defines is mandatory.
2625 * data/lalr1.cc: Remove useless calls to b4_defines_if.
2626
2627 2008-11-11 Akim Demaille <demaille@gostai.com>
2628
2629 TODO: yyfmt.
2630 * TODO (yysyntax_error): New item.
2631
2632 2008-11-11 Akim Demaille <demaille@gostai.com>
2633
2634 Prefer M4 to CPP.
2635 * data/lalr1.cc: Use b4_error_verbose_if instead of #if
2636 YYERROR_VERBOSE.
2637
2638 2008-11-11 Akim Demaille <demaille@gostai.com>
2639
2640 Support i18n of the parse error messages.
2641 * TODO (lalr1.cc/I18n): Remove.
2642 * data/lalr1.cc (yysyntax_error_): Support the translation of the
2643 error messages, as done in yacc.c.
2644 Stay within the yy* pseudo namespace.
2645
2646 2008-11-11 Akim Demaille <demaille@gostai.com>
2647
2648 More TODO.
2649 * TODO (single stack, yysyntax_error): New.
2650
2651 2008-11-11 Akim Demaille <demaille@gostai.com>
2652
2653 Make it possible to return a symbol_type from yylex.
2654 * data/lalr1.cc (b4_lex_symbol_if): New.
2655 (parse): When lex_symbol is defined, expected yylex to return the
2656 complete lookahead.
2657 * etc/bench.pl.in (generate_grammar_list): Extend to support this
2658 yylex interface.
2659 (bench_variant_parser): Exercise it.
2660
2661 2008-11-11 Akim Demaille <demaille@gostai.com>
2662
2663 Remove useless bench case.
2664 * etc/bench.pl.in (bench_variant_parser): VARIANT_DESTROY is
2665 no longer used.
2666
2667 2008-11-11 Akim Demaille <demaille@gostai.com>
2668
2669 Improve display of directives.
2670 * etc/bench.pl.in (parse_term): Don't add useless eol.
2671
2672 2008-11-11 Akim Demaille <demaille@gostai.com>
2673
2674 Use string_cast in the bench.
2675 * etc/bench.pl.in (generate_grammar_list): Define and use
2676 string_cast.
2677
2678 2008-11-11 Akim Demaille <demaille@gostai.com>
2679
2680 Replace yychar with a Boolean.
2681 * data/lalr1.cc (parse::yychar): Replace by...
2682 (parse::yyempty): this.
2683
2684 2008-11-11 Akim Demaille <demaille@gostai.com>
2685
2686 Factor the tables.
2687 * TODO: New item.
2688
2689 2008-11-11 Akim Demaille <demaille@gostai.com>
2690
2691 Let yytranslate handle the eof case.
2692 * data/lalr1.cc (yytranslate_): Handle the EOF case.
2693 Adjust callers.
2694 No longer expect yychar to be equal to yyeof_, rather, test the
2695 lookahead's (translated) kind.
2696
2697 2008-11-11 Akim Demaille <demaille@gostai.com>
2698
2699 yychar cannot be empty in yyerrlab.
2700 * TODO (yychar == yyempty_): New.
2701 * data/lalr1.cc: Remove the handling of this case.
2702 This eases forthcoming changes related to yychar and yytranslate.
2703
2704 2008-11-11 Akim Demaille <demaille@gostai.com>
2705
2706 Bench: syntactic sugar for %define/#define.
2707 * etc/bench.pl.in (parse_dirs): Support %d and #d with arguments.
2708 (&bench_push_parser, bench_variant_parser): Use this feature.
2709 (&eat): New.
2710 Use it.
2711
2712 2008-11-11 Akim Demaille <demaille@gostai.com>
2713
2714 Less memory pressure on the "list" bench.
2715 * etc/bench.pl.in (generate_grammar_list): Do not accumulate all
2716 the values, to limit memory pressure.
2717
2718 2008-11-11 Akim Demaille <demaille@gostai.com>
2719
2720 Introduce make_symbol.
2721 make_symbol provides a means to construct a full symbol (kind,
2722 value, location) in a single shot. It is meant to be a Symbol
2723 constructor, parameterized by the symbol kind so that overloading
2724 would prevent incorrect kind/value pairs. Unfortunately
2725 parameterized constructors do not work well in C++ (unless the
2726 parameter also appears as an argument, which is not acceptable),
2727 hence the use of a function instead of a constructor.
2728
2729 * data/lalr1.cc (b4_symbol_constructor_declaration_)
2730 (b4_symbol_constructor_declarations)
2731 (b4_symbol_constructor_specialization_)
2732 (b4_symbol_constructor_specializations)
2733 (b4_symbol_constructor_definition_)
2734 (b4_symbol_constructor_definitions): New.
2735 Use them where appropriate to generate declaration, declaration of
2736 the specializations, and implementations of the templated
2737 overloaded function "make_symbol".
2738 (variant::variant): Always define a default ctor.
2739 Also provide a copy ctor.
2740 (symbol_base_type, symbol_type): New ctor overloads for value-less
2741 symbols.
2742 (symbol_type): Now public, so that functions such as yylex can use
2743 it.
2744
2745 2008-11-11 Akim Demaille <demaille@gostai.com>
2746
2747 Inform m4 whether a tag is a valid id.
2748 * src/output.c (is_identifier): New.
2749 (symbol_definitions_output): Use it to define tag_is_id.
2750 But maybe this should be done at m4 level?
2751
2752 2008-11-11 Akim Demaille <demaille@gostai.com>
2753
2754 Test 214 was failing: it greps with a pattern containing [ ]*
2755 which obviously meant to catch spaces and tabs, but contained only
2756 spaces. Tabulations in sources are a nuisance, so to simplify the
2757 matter, get rid of all the tabulations in the Java sources. The
2758 other skeletons will be treated equally later.
2759
2760 * data/java.m4, data/lalr1.java: Untabify.
2761 * tests/java.at: Simplify AT_CHECK_JAVA_GREP invocations:
2762 tabulations are no longer generated.
2763
2764 2008-11-11 Paolo Bonzini <bonzini@gnu.org>
2765
2766 * bootstrap.conf: Replace m4/warning.m4 with warnings module.
2767 * configure.ac: Adjust usage.
2768 * lib/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2769 * src/Makefile.am: Replace $(WARNING_CFLAGS) with $(WARN_CFLAGS).
2770 * tests/atlocal.in: Replace $(WARNING_*FLAGS) with $(WARN_*FLAGS).
2771
2772 2008-11-10 Di-an Jan <dianj@freeshell.org>
2773
2774 Workaround Java's ``code too large'' problem for parser tables
2775 in most cases, by using one function per initialization.
2776 * data/java.m4 (b4_typed_parser_table, b4_integral_parser_table): New.
2777 * data/lalr1.java (yypact_, yydefact_, yypgoto_, yydefgoto_,
2778 yytable_, yycheck_, yystos_, yytoken_number_, yyr1_, yyr2_, yyrhs_
2779 yyprhs_, yyrline_, yytranslate_table_): Use b4_integral_parser_table.
2780 (yytname_): Use b4_typed_parser_table.
2781 * doc/bison.texinfo (Java Bison Interface): Add note on Java's
2782 ``code too large'' error.
2783
2784 2008-11-10 Di-an Jan <dianj@freeshell.org>
2785
2786 * NEWS: Document them.
2787
2788 General Java skeleton improvements.
2789 * configure.ac (gt_JAVACOMP): Request target of 1.4, which allows
2790 using gcj < 4.3 in the testsuite, according to comments in
2791 gnulib/m4/javacomp.m4.
2792 * data/java.m4 (stype, parser_class_name, lex_throws, throws,
2793 location_type, position_type): Remove extraneous brackets from
2794 b4_percent_define_default.
2795 (b4_lex_param, b4_parse_param): Remove extraneous brackets from
2796 m4_define and m4_define_default.
2797 * data/lalr1.java (b4_pre_prologue): Change to b4_user_post_prologue,
2798 which marks the end of user code with appropriate syncline, like all
2799 the other skeletons.
2800 (b4_user_post_prologue): Add. Don't silently drop.
2801 (yylex): Remove.
2802 (parse): Inline yylex.
2803 * doc/bison.texinfo (bisonVersion, bisonSkeleton): Document.
2804 (%{...%}): Fix typo of %code imports.
2805 * tests/java.at (AT_JAVA_COMPILE): Add "java" keyword.
2806
2807 Support annotations on parser class with %define annotations.
2808 * data/lalr1.java (annotations): Add to parser class modifier.
2809 * doc/bison.texinfo (Java Parser Interface): Document
2810 %define annotations.
2811 (Java Declarations Summary): Document %define annotations.
2812 * tests/java.at (Java parser class modifiers): Test annotations.
2813
2814 Do not generate code for %error-verbose unless requested.
2815 * data/lalr1.java (errorVerbose): Rename to yyErrorVerbose.
2816 Make private. Make conditional on %error-verbose.
2817 (getErrorVerbose, setErrorVerbose): New.
2818 (yytnamerr_): Make conditional on %error-verbose.
2819 (yysyntax_error): Make some code conditional on %error-verbose.
2820 * doc/bison.texinfo (Java Bison Interface): Remove the parts
2821 about %error-verbose having no effect.
2822 (getErrorVerbose, setErrorVerbose): Document.
2823
2824 Move constants for token names to Lexer interface.
2825 * data/lalr1.java (Lexer): Move EOF, b4_token_enums(b4_tokens) here.
2826 * data/java.m4 (b4_token_enum): Indent for move to Lexer interface.
2827 (parse): Qualify EOF to Lexer.EOF.
2828 * doc/bison.texinfo (Java Parser Interface): Move documentation of
2829 EOF and token names to Java Lexer Interface.
2830 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove Calc qualifier.
2831
2832 Make yyerror public.
2833 * data/lalr1.java (Lexer.yyerror): Use longer parameter name.
2834 (yyerror): Change to public. Add Javadoc comments. Use longer
2835 parameter names. Make the body rather than the declarator
2836 conditional on %locations.
2837 * doc/bison.texinfo (yyerror): Document. Don't mark as protected.
2838
2839 Allow user to add code to the constructor with %code init.
2840 * data/java.m4 (b4_init_throws): New, for %define init_throws.
2841 * data/lalr1.java (YYParser.YYParser): Add b4_init_throws.
2842 Add %code init to the front of the constructor body.
2843 * doc/bison.texinfo (YYParser.YYParser): Document %code init
2844 and %define init_throws.
2845 (Java Declarations Summary): Document %code init and
2846 %define init_throws.
2847 * tests/java.at (Java %parse-param and %lex-param): Adjust grep.
2848 (Java constructor init and init_throws): Add tests.
2849
2850 2008-11-10 Akim Demaille <demaille@gostai.com>
2851
2852 Update TODO.
2853 * TODO (-D): is implemented.
2854 (associativity): Same precedence must have the same associativity.
2855 For instance, how can a * b / c be parsed if * is %left and / is
2856 %right?
2857 (YYERRORCODE, YYFAIL, YYBACKUP): New.
2858
2859 2008-11-10 Akim Demaille <demaille@gostai.com>
2860
2861 Formatting changes.
2862
2863 2008-11-10 Akim Demaille <demaille@gostai.com>
2864
2865 More information about the symbols.
2866 * src/output.c (type_names_output): Document all the symbols,
2867 including those that don't have a type-name.
2868 (symbol_definitions_output): Define "is_token" and
2869 "has_type_name".
2870 * data/lalr1.cc (b4_type_action_): Skip symbols that have an empty
2871 type-name, now that they are defined too in b4_type_names.
2872
2873 2008-11-10 Akim Demaille <demaille@gostai.com>
2874
2875 Regen.
2876
2877 2008-11-10 Akim Demaille <demaille@gostai.com>
2878
2879 Make parser::yytranslate static.
2880 Small speedup (1%) on the list grammar. And makes yytranslate_
2881 available in non member functions.
2882
2883 * data/lalr1.cc (yytranslate_): Does not need to be a instance
2884 function.
2885
2886 2008-11-10 Akim Demaille <demaille@gostai.com>
2887
2888 Avoid trailing spaces.
2889 * data/c.m4: b4_comment(TEXT): Don't indent empty lines.
2890 * data/lalr1.cc: Don't indent before rule and symbol actions, as
2891 they can be empty, and anyway this incorrectly indents the first
2892 action.
2893
2894 2008-11-10 Akim Demaille <demaille@gostai.com>
2895
2896 Comment changes.
2897
2898 2008-11-10 Akim Demaille <demaille@gostai.com>
2899
2900 Use "enum" for integral constants.
2901 This is just nicer to read, I observed no speedup.
2902
2903 * data/lalr1.cc (yyeof_, yylast_, yynnts_, yyempty_, yyfinal_)
2904 (yterror_, yyerrcode_, yyntokens_): Define as members of an enum.
2905 (yyuser_token_number_max_, yyundef_token_): Move into...
2906 (yytranslate_): here.
2907
2908 2008-11-10 Akim Demaille <demaille@gostai.com>
2909
2910 Shortcuts in bench directives.
2911 * etc/bench.pl.in (parse_dirs): New.
2912 Use it.
2913 (bench_variant_parser, bench_fusion_parser): Use %s and %d.
2914 Create the benches in "benches/".
2915
2916 2008-11-10 Akim Demaille <demaille@gostai.com>
2917
2918 Formatting changes.
2919 * data/lalr1.cc: here.
2920
2921 2008-11-10 Akim Demaille <demaille@gostai.com>
2922
2923 Adjust verbose message to using emacs.
2924 * etc/bench.pl.in: Inform compilation-mode when we change the
2925 directory.
2926 (generate_grammar_list): Recognize %define "variant" in addition
2927 to %define variant.
2928
2929 2008-11-10 Akim Demaille <demaille@gostai.com>
2930
2931 Classify symbols by type-name.
2932 * src/uniqstr.h (UNIQSTR_CMP): New.
2933 * src/output.c (symbol_type_name_cmp, symbols_by_type_name)
2934 (type_names_output): New.
2935 (muscles_output): Use it.
2936 * data/lalr1.cc (b4_symbol_action_): Remove.
2937 (b4_symbol_case_, b4_type_action_): New.
2938 Adjust uses of b4_symbol_action_ to use b4_type_action_.
2939
2940 2008-11-10 Akim Demaille <demaille@gostai.com>
2941
2942 Change the handling of the symbols in the skeletons.
2943 Before we were using tables which lines were the symbols and which
2944 columns were things like number, tag, type-name etc. It is was
2945 difficult to extend: each time a column was added, all the numbers had
2946 to be updated (you asked for colon $2, not for "tag"). Also, it was
2947 hard to filter these tables when only a subset of the symbols (say the
2948 tokens, or the nterms, or the tokens that have and external number
2949 *and* a type-name) was of interest.
2950
2951 Now instead of monolithic tables, we define one macro per cell. For
2952 instance "b4_symbol(0, tag)" is a macro name which contents is
2953 self-decriptive. The macro "b4_symbol" provides easier access to
2954 these cells.
2955
2956 * src/output.c (type_names_output): Remove.
2957 (symbol_numbers_output, symbol_definitions_output): New.
2958 (muscles_output): Call them.
2959 (prepare_symbols): Define b4_symbols_number.
2960
2961 2008-11-10 Akim Demaille <demaille@gostai.com>
2962
2963 --trace=muscles
2964 * src/getargs.h, src/getargs.c (trace_muscle): New.
2965 (trace_types, trace_args): Support it.
2966 * src/output.c (output_skeleton): Use it.
2967
2968 2008-11-10 Akim Demaille <demaille@gostai.com>
2969
2970 muscles_output.
2971 * src/output.c (muscles_output): New, extracted from...
2972 (output_skeleton): here.
2973 Adjust.
2974
2975 2008-11-10 Akim Demaille <demaille@gostai.com>
2976
2977 Formatting changes.
2978
2979 2008-11-10 Akim Demaille <demaille@gostai.com>
2980
2981 Update the variant example.
2982 * examples/variant.yy: Formatting changes.
2983 One stage build.
2984
2985 2008-11-10 Akim Demaille <demaille@gostai.com>
2986
2987 Support constructor with an argument.
2988 This improves the "list" bench by 2%.
2989
2990 * data/lalr1.cc (variant::build): Add an overloaded version with
2991 an argument.
2992 * tests/c++.at (AT_CHECK_VARIANT): Check it.
2993
2994 2008-11-10 Akim Demaille <demaille@gostai.com>
2995
2996 Test variants.
2997 * tests/c++.at (AT_CHECK_VARIANTS): New.
2998 Use it with and without %define assert.
2999
3000 2008-11-10 Akim Demaille <demaille@gostai.com>
3001
3002 Add %precedence support.
3003 Unfortunately it is not possible to reuse the %prec directive. This
3004 is because to please POSIX, we do not require to end the rules with a
3005 semicolon. As a result,
3006
3007 foo: bar %prec baz
3008
3009 is ambiguous: either a rule which precedence is that of baz, or a rule,
3010 and then a declaration of the precedence of the token baz.
3011
3012 * doc/bison.texinfo: Document %precedence.
3013 (Precedence Only): New.
3014 * src/assoc.h, src/assoc.c (precedence_assoc): New.
3015 * src/conflicts.c (resolve_sr_conflict): Support it.
3016 * src/scan-gram.l, src/parse-gram.y (%precedence): New token.
3017 Parse it.
3018 * tests/calc.at: Use %precedence for NEG.
3019 * tests/conflicts.at (%precedence does not suffice)
3020 (%precedence suffices): New tests.
3021
3022 2008-11-09 Akim Demaille <demaille@gostai.com>
3023
3024 Make benches in a sub dirs.
3025 * etc/bench.pl.in ($dir): New.
3026 Use it.
3027 Check the use of constructors with an argument.
3028 (bench_variant_parser): Fix.
3029
3030 2008-11-09 Akim Demaille <demaille@gostai.com>
3031
3032 fix eof condition
3033
3034 2008-11-09 Akim Demaille <demaille@gostai.com>
3035
3036 Fix --help.
3037
3038 2008-11-09 Akim Demaille <demaille@gostai.com>
3039
3040 Require the generation of parse-gram.output.
3041 * src/Makefile.am (YACC): Pass --report=all.
3042
3043 2008-11-09 Akim Demaille <demaille@gostai.com>
3044
3045 Formatting changes.
3046
3047 2008-11-09 Akim Demaille <demaille@gostai.com>
3048
3049 Update TODO.
3050 * TODO: Remove obsolete items.
3051 Update others.
3052
3053 2008-11-09 Akim Demaille <demaille@gostai.com>
3054
3055 Enhance bench.pl.
3056 * etc/bench.pl.in (parse, parse_expr, parse_term, parse_fact)
3057 (@token, $grammar, $bench): New.
3058 (generate_grammar_variant): Rename as...
3059 (generate_grammar_list): this.
3060 (generate_grammar): Adjust.
3061 (bench_grammar): Rename as...
3062 (bench): this.
3063 Use it in the various bench-marking routines.
3064 (-b, -g): New options.
3065
3066 2008-11-09 Akim Demaille <demaille@gostai.com>
3067
3068 Use a static hierarchy for symbols in the C++ parser.
3069 * data/lalr1.cc (symbol_base_type, symbol_type)
3070 (stack_symbol_type): Make it a static hierarchy.
3071 Adjust dependencies.
3072
3073 2008-11-09 Akim Demaille <demaille@gostai.com>
3074
3075 bench.pl -d, --directive.
3076 * etc/bench.pl.in (@directive): New.
3077 (&bench_grammar): Use it.
3078 (&bench_list_grammar): New, to provide access to the "variant"
3079 grammar.
3080 Use it.
3081 (getopts): Support -d, --directive.
3082
3083 2008-11-09 Akim Demaille <demaille@gostai.com>
3084
3085 Use inline for small operations.
3086 * data/lalr1.cc (symbol_base_type, symbol_type)
3087 (stack_symbol_type): Declare constructor and other operations as
3088 inline.
3089 (yy_destroy_): Inline.
3090
3091 2008-11-09 Akim Demaille <demaille@gostai.com>
3092
3093 Introduce a hierarchy for symbols.
3094 * data/lalr1.cc (symbol_base_type, symbol_type): New.
3095 (data_type): Rename as...
3096 (stack_symbol_type): this.
3097 Derive from symbol_base_type.
3098 (yy_symbol_value_print_): Merge into...
3099 (yy_symbol_print_): this.
3100 Rename as...
3101 (yy_print_): this.
3102 (yydestruct_): Rename as...
3103 (yy_destroy_): this.
3104 (b4_symbols_actions, YY_SYMBOL_PRINT): Adjust.
3105 (parser::parse): yyla is now of symbol_type.
3106 Use its type member instead of yytoken.
3107
3108 2008-11-09 Akim Demaille <demaille@gostai.com>
3109
3110 Rename data_type and stack_symbol_type.
3111 * data/lalr1.cc (data_type): Rename as...
3112 (stack_symbol_type): this.
3113
3114 2008-11-09 Akim Demaille <demaille@gostai.com>
3115
3116 Handle semantic value and location together.
3117 * data/lalr1.cc (b4_symbol_actions): Bounce $$ and @$ to
3118 yydata.value and yydata.location.
3119 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_)
3120 (YY_SYMBOL_PRINT): Now take semantic value and location as a
3121 single arg.
3122 Adjust all callers.
3123 (yydestruct_): New overload for a stack symbol.
3124
3125 2008-11-09 Akim Demaille <demaille@gostai.com>
3126
3127 Push a complete symbol, not connected parts.
3128 * data/lalr1.cc (yypush_): Take a data_type&, not disconnected
3129 state, value and location.
3130 Adjust callers.
3131
3132 2008-11-09 Akim Demaille <demaille@gostai.com>
3133
3134 Agregate yylval and yylloc.
3135 * data/lalr1.cc (parser::yylval, parser::yylloc): Replace by...
3136 (parser::yyla): this.
3137
3138 2008-11-09 Akim Demaille <demaille@gostai.com>
3139
3140 Rely on the state stack to display reduction traces.
3141 To display rhs symbols before a reduction, we used information
3142 about the rule reduced, which required the tables yyrhs and
3143 yyprhs. Now use rely only on the state stack to get the same
3144 information.
3145
3146 * data/lalr1.cc (b4_rhs_data, b4_rhs_state): New.
3147 Use them.
3148 (parser::yyrhs_, parser::yyprhs_): Remove.
3149 (parser::yy_reduce_print_): Use the state stack.
3150
3151 2008-11-09 Akim Demaille <demaille@gostai.com>
3152
3153 Fuse yyval and yyloc into yylhs.
3154 * data/lalr1.cc (b4_lhs_value, b4_lhs_location): Adjust to using
3155 yylhs.
3156 (parse): Replace yyval and yyloc with yylhs.value and
3157 yylhs.location.
3158 After a user action, compute yylhs.state earlier.
3159 (yyerrlab1): Do not play tricks with yylhs.location, rather, use a
3160 fresh error_token.
3161
3162 2008-11-09 Di-an Jan <dianj@freeshell.org>
3163
3164 Remove unused variable.
3165 * src/output.c (type_names_output): Remove unused variable sep.
3166
3167 2008-11-09 Paolo Bonzini <bonzini@gnu.org>
3168
3169 Change tests/output.at quoting.
3170 * tests/output.at (AT_CHECK_OUTPUT): Use conventional m4 quoting when
3171 expanding arguments.
3172
3173 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3174
3175 Don't add a semicolon to actions for %skeleton or %language.
3176 It breaks Java test cases as reported by Akim Demaille.
3177 * src/scan-code.l: Implement.
3178
3179 2008-11-07 Joel E. Denny <jdenny@ces.clemson.edu>
3180
3181 Clean up %skeleton and %language priority implementation.
3182 * src/getargs.c (skeleton_prio): Use default_prio rather than 2, and
3183 remove static qualifier because others will soon need to see it.
3184 (language_prio): Likewise.
3185 (getargs): Use command_line_prio rather than 0.
3186 * src/getargs.h (command_line_prio, grammar_prio, default_prio): New
3187 enum fields.
3188 (skeleton_prio): Extern it.
3189 (language_prio): Extern it.
3190 * src/parse-gram.y: Use grammar_prio rather than 1.
3191
3192 2008-11-07 Akim Demaille <demaille@gostai.com>
3193
3194 Moving push traces into yypush_.
3195 * data/lalr1.cc (yypush_): Now takes a optional trace message.
3196 Adjust all uses.
3197
3198 2008-11-07 Akim Demaille <demaille@gostai.com>
3199
3200 The single-stack C++ parser is now the standard one.
3201 * data/lalr1.cc: Rename as...
3202 * data/lalr1-split.cc: this.
3203 * data/lalr1-fusion.cc: Rename as...
3204 * data/lalr1.cc: this.
3205 * etc/bench.pl.in: Adjust.
3206
3207 2008-11-07 Akim Demaille <demaille@gostai.com>
3208
3209 Avoid empty-if warnings.
3210 Reported by Quentin Hocquet.
3211
3212 * data/lalr1-fusion.cc (YY_SYMBOL_PRINT, YY_REDUCE_PRINT)
3213 (YY_STACK_PRINT): Provide some contents even when !YYDEBUG.
3214
3215 2008-11-07 Akim Demaille <demaille@gostai.com>
3216
3217 Pass command line location to skeleton_arg and language_argmatch.
3218 * src/getargs.h, src/getargs.c (skeleton_arg, language_argmatch):
3219 The location argument is now mandatory.
3220 Adjust all dependencies.
3221 (getargs): Use command_line_location.
3222
3223 2008-11-07 Akim Demaille <demaille@gostai.com>
3224
3225 -D, --define.
3226 * src/getargs.c (usage): Document -D.
3227 Fix help string for --locations.
3228 (command_line_location): New.
3229 (short_options, long_options, getargs): Support -D, --define.
3230 (getargs): Move -d support at the right place.
3231 * doc/bison.texinfo (Bison Options): Update.
3232 * tests/input.at (%define, --define): New.
3233
3234 2008-11-07 Akim Demaille <demaille@gostai.com>
3235
3236 Initialize the muscle table before parsing the command line.
3237 * src/getargs.c (quotearg.h, muscle_tab.h): Include.
3238 (getargs): Define file_name.
3239 * src/main.c (main): Initialize muscle_tab before calling
3240 getargs.
3241 * src/muscle_tab.c (muscle_init): No longer define file_name, as
3242 its value is not available yet.
3243
3244 2008-11-07 Akim Demaille <demaille@gostai.com>
3245
3246 Locations without columns for command line arguments.
3247 * src/location.c (location_print): Don't display negative columns.
3248 * src/location.h: Document this.
3249
3250 2008-11-07 Akim Demaille <demaille@gostai.com>
3251
3252 Fix --help.
3253 * src/getargs.c (usage): Fix help string for -W.
3254
3255 2008-11-07 Akim Demaille <demaille@gostai.com>
3256
3257 Handle more general types of option arguments.
3258 * build-aux/cross-options.pl: The argument ends at the first
3259 space, not the first non-symbol character.
3260 Use @var for each word appearing the argument description.
3261
3262 2008-11-07 Akim Demaille <demaille@gostai.com>
3263
3264 Destroy the variants that remain on the stack in case of error.
3265 * data/lalr1-fusion.cc (yydestruct_): Invoke the variant's
3266 destructor.
3267 Display the value only if yymsg is nonnull.
3268 (yyreduce): Invoke yydestruct_ when popping lhs symbols.
3269
3270 2008-11-07 Akim Demaille <demaille@gostai.com>
3271
3272 Add "%define assert" to variants.
3273 This is used to help the user catch cases where some value gets
3274 ovewritten by a new one. This should not happen, as this will
3275 probably leak.
3276
3277 Unfortunately this uncovered a bug in the C++ parser itself: the
3278 lookahead value was not destroyed between two calls to yylex. For
3279 instance if the previous lookahead was a std::string, and then an int,
3280 then the value of the std::string was correctly taken (i.e., the
3281 lookahead was now an empty string), but std::string structure itself
3282 was not reclaimed.
3283
3284 This is now done in variant::build(other&) (which is used to take the
3285 value of the lookahead): other is not only stolen from its value, it
3286 is also destroyed. This incurs a new performance penalty of a few
3287 percent, and union becomes faster again.
3288
3289 * data/lalr1-fusion.cc (variant::build(other&)): Destroy other.
3290 (b4_variant_if): New.
3291 (variant::built): New.
3292 Use it whereever the status of the variant changes.
3293 * etc/bench.pl.in: Check the penalty of %define assert.
3294
3295 2008-11-07 Akim Demaille <demaille@gostai.com>
3296
3297 Use "%define variant" in bench.pl.
3298 * etc/bench.pl.in: No longer use the pseudo directive %variants,
3299 just use %define variants.
3300
3301 2008-11-07 Akim Demaille <demaille@gostai.com>
3302
3303 Regen.
3304 * src/parse-gram.h, src/parse-gram.c: Regen.
3305
3306 2008-11-04 Joel E. Denny <jdenny@ces.clemson.edu>
3307
3308 Fix user actions without a trailing semicolon.
3309 Reported by Sergei Steshenko at
3310 <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.
3311 * THANKS (Sergei Steshenko): Add.
3312 * src/scan-code.l (SC_RULE_ACTION): Fix it.
3313 * tests/regression.at (Fix user actions without a trailing semicolon):
3314 New test case.
3315
3316 2008-11-04 Akim Demaille <demaille@gostai.com>
3317
3318 Use b4_copyright_years.
3319 * data/yacc.c (b4_copyright_years): New.
3320 Fix its value according to the comments in the file.
3321 Use it and undefine it.
3322
3323 2008-11-04 Akim Demaille <demaille@gostai.com>
3324
3325 Formatting changes.
3326 * data/lalr1-fusion.cc, src/parse-gram.y: here.
3327
3328 2008-11-04 Akim Demaille <demaille@gostai.com>
3329
3330 Formatting changes.
3331 * data/lalr1-fusion.cc: here.
3332
3333 2008-11-04 Akim Demaille <demaille@gostai.com>
3334
3335 Use strict on bench.pl.
3336 * etc/bench.pl.in (&run, &generate_grammar): New.
3337 Rename the grammar generating functions for consistency.
3338 Change the interface so that the list of benches to run is passed
3339 as (optionless) arguments.
3340 (&compile): Use &run.
3341
3342 2008-11-04 Akim Demaille <demaille@gostai.com>
3343
3344 Remove spurious initial empty lines.
3345 * data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java,
3346 * data/yacc.c: End the @output lines with an @.
3347
3348 2008-11-04 Akim Demaille <demaille@gostai.com>
3349
3350 Improve the display of sizes.
3351 * etc/bench.p.in: Higher precision.
3352 Sort by decreasing size.
3353
3354 2008-11-04 Akim Demaille <demaille@gostai.com>
3355
3356 Don't memcpy C++ structures.
3357 * data/lalr1-fusion.cc (b4_symbol_variant): Adjust additional
3358 arguments.
3359 (variant::build): New overload for
3360 copy-construction-that-destroys.
3361 (variant::swap): New.
3362 (parser::yypush_): Use it in variant mode.
3363
3364 2008-11-04 Akim Demaille <demaille@gostai.com>
3365
3366 Better defaults for bench.pl.
3367 * etc/bench.pl.in ($verbose, $cflags, $iterations): Change the
3368 default values.
3369 Adjust &verbose uses.
3370 (-q, --quiet): New.
3371
3372 2008-11-04 Akim Demaille <demaille@gostai.com>
3373
3374 Make variant.yy more complex.
3375 std::list cannot be copied via memcpy, they are more demanding than
3376 std::string. Use one std::list to strengthen the test.
3377
3378 * examples/variant.yy: Use lalr1-fusion.cc, not lalr1.cc.
3379 Adjust.
3380 Create a list of strings, instead of a single large string.
3381
3382 2008-11-04 Akim Demaille <demaille@gostai.com>
3383
3384 bench.pl --bench.
3385 * etc/bench.pl.in (--bench, $bench): New.
3386
3387 2008-11-04 Akim Demaille <demaille@gostai.com>
3388
3389 Sort methods.
3390 * data/lalr1-fusion.cc (destroy): Use as() in its definition.
3391 Define it after as().
3392
3393 2008-11-04 Akim Demaille <demaille@gostai.com>
3394
3395 Useless parens.
3396 * data/lalr1-fusion.cc (b4_rhs_location): Remove useless parens.
3397
3398 2008-11-04 Akim Demaille <demaille@gostai.com>
3399
3400 Issue missing synclines after user actions.
3401 * data/c.m4 (b4_case): Issue synclines on the output file.
3402
3403 2008-11-04 Akim Demaille <demaille@gostai.com>
3404
3405 Remove trailing empty line.
3406 * data/lalr1-fusion.cc: Don't add an empty line after the user's
3407 epilogue.
3408
3409 2008-11-04 Akim Demaille <demaille@gostai.com>
3410
3411 Fix output of copyright years.
3412 * data/bison.m4 (b4_copyright): Fix the indentation of the
3413 copyright year paragraph.
3414 Use b4_copyright_years when no years are given.
3415 * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
3416 (b4_copyright_years): New.
3417 Use it.
3418
3419 2008-11-04 Akim Demaille <demaille@gostai.com>
3420
3421 Avoid the spurious initial empty line.
3422 * data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
3423 the end of @output request to suppress the empty line that
3424 results.
3425
3426 2008-11-04 Akim Demaille <demaille@gostai.com>
3427
3428 Remove parser::rhs_number_type.
3429 * data/lalr1-fusion.cc (rhs_number_type): No longer define it.
3430 (yyrhs_): Use b4_table_define.
3431
3432 2008-11-04 Akim Demaille <demaille@gostai.com>
3433
3434 Fix iteration type.
3435 * data/lalr1-fusion.cc: Use an int to iterate up to an int.
3436
3437 2008-11-04 Akim Demaille <demaille@gostai.com>
3438
3439 Factor the declaration of the integer tables.
3440 * data/lalr1-fusion.cc (b4_table_define): New.
3441 Use it.
3442
3443 2008-11-03 Akim Demaille <demaille@gostai.com>
3444
3445 Fix indentation of tables in lalr1.cc
3446 * data/lalr1-fusion.cc: Fix the indentation.
3447
3448 2008-11-03 Akim Demaille <demaille@gostai.com>
3449
3450 Destroy the lhs symbols after reduction.
3451 * data/lalr1-fusion.cc (parse): After the user action, when in
3452 variant mode, destroy the lhs symbols.
3453
3454 2008-11-03 Akim Demaille <demaille@gostai.com>
3455
3456 Simplify yysyntax_error_ use.
3457 * data/lalr1-fusion.cc (yysyntax_error_): Always pass it the token
3458 type, but make it unnamed in the declaration when it is not used.
3459
3460 2008-11-03 Akim Demaille <demaille@gostai.com>
3461
3462 Let yy::variant::build return an lvalue.
3463 * data/lalr1-fusion.cc (variant::build): Return a reference to the
3464 object.
3465
3466 2008-11-03 Akim Demaille <demaille@gostai.com>
3467
3468 Define yy::variant only when needed.
3469 * data/lalr1-fusion.cc (yy::variant): Define only if variants are
3470 used.
3471
3472 2008-11-03 Akim Demaille <demaille@gostai.com>
3473
3474 Bench the three-stack lalr1.cc.
3475 * etc/bench.pl.in: Bench the three-stack lalr1.cc vs. the
3476 one-stack one.
3477
3478 2008-11-03 Akim Demaille <demaille@gostai.com>
3479
3480 Fail on parse error in calc++.
3481 * doc/bison.texinfo (calc++.cc): Propagate failures to the exit
3482 status.
3483 * examples/calc++/test ($me, $number, $exit, run): New.
3484 Use them to propagate errors to the exit status.
3485
3486 2008-11-03 Akim Demaille <demaille@gostai.com>
3487
3488 Don't specify the skeleton twice in the example.
3489 * examples/calc++/Makefile.am: Don't pass -S to Bison, the grammar
3490 file does what is needed.
3491
3492 2008-11-03 Akim Demaille <demaille@gostai.com>
3493
3494 bench: Improve output.
3495 * etc/bench.pl.in (bench_grammar): Tune the printf format.
3496
3497 2008-11-03 Akim Demaille <demaille@gostai.com>
3498
3499 bench: check impact of %debug on variants.
3500 * etc/bench.pl.in (variant_grammar): Fix the computation of
3501 $variant.
3502 Generate a grammar file that can work with or without %debug.
3503 Do use the @directive.
3504 (bench_variant_parser): Check impact of %debug.
3505 (@directives): Rename all the occurrences to...
3506 (@directive): this, for consistency.
3507
3508 2008-11-03 Akim Demaille <demaille@gostai.com>
3509
3510 bench: report the size too.
3511 * etc/bench.pl.in ($iterations): Defaults to -3.
3512 (&bench_grammar): Require hireswallclock.
3513 Compute and display the size of the result.
3514 More comments.
3515
3516 2008-11-03 Akim Demaille <demaille@gostai.com>
3517
3518 bench: More use of the verbosity level.
3519 * etc/bench.pl.in ($verbose, &verbose): New.
3520 Use them.
3521 More POD documentation.
3522
3523 2008-11-03 Akim Demaille <demaille@gostai.com>
3524
3525 bench.pl: a command line interface
3526 * etc/bench.pl.in: More doc.
3527 Some fixes in the documentation.
3528 ($cflags, $iterations, &help, &getopt): New.
3529 Use them.
3530 (&variant_grammar): Let the number of stages be 10 times what is
3531 specified.
3532
3533 2008-11-03 Akim Demaille <demaille@gostai.com>
3534
3535 Bench the use of Boost.Variants.
3536 * etc/bench.pl.in ($cxx, &variant_grammar, &bench_variant_parser):
3537 New.
3538 (&compile): Be ready to compile C++ parsers.
3539 (&bench_push_parser): Move debug information to the outermost
3540 level.
3541 * THANKS: Add Michiel De Wilde.
3542
3543 2008-11-03 Akim Demaille <demaille@gostai.com>
3544
3545 bench.pl: Pass directives as a list instead of as a string.
3546 * etc/bench.pl.in (&directives): New.
3547 (&triangular_grammar, &calc_grammar): Use it to format the Bison
3548 directives.
3549 (&triangular_grammar): Do use the directives (were ignored).
3550 (&bench_grammar, &bench_push_parser): Adjust to pass lists of
3551 directives.
3552
3553 2008-11-03 Akim Demaille <demaille@gostai.com>
3554
3555 Improve genericity of bench.pl.
3556 * etc/bench.pl.in (&bench_grammar): Take the set of benches as
3557 argument.
3558 (&bench_push_parser): New.
3559 Call it.
3560
3561 2008-11-03 Akim Demaille <demaille@gostai.com>
3562
3563 Add documentation to bench.pl.
3564 * etc/bench.pl.in: Comment changes.
3565
3566 2008-11-03 Akim Demaille <demaille@gostai.com>
3567
3568 Fuse the three stacks into a single one.
3569
3570 In order to make it easy to perform benchmarks to ensure that
3571 there are no performance loss, lalr1.cc is forked into
3572 lalr1-fusion.cc. Eventually, lalr1-fusion.cc will replace
3573 lalr1.cc.
3574
3575 Meanwhile, to make sure that lalr1-fusion.cc is correctly
3576 exercized by the test suite, the user must install a symbolic link
3577 from lalr1.cc to it.
3578
3579 Instead of having three stacks (state, value, location), use a
3580 stack of triples. This considerably simplifies the code (and it
3581 will be easier not to require locations as currently does the C++
3582 parser), and also gives a 10% speedup according to
3583 etc/bench (probably mainly since memory allocation is done once
3584 instead of three times).
3585
3586 Another motivation is to make it easier to destruct properly
3587 semantic values: now that they are bound to their state (hence
3588 symbol type) it will be easier to call the appropriate destructor.
3589
3590 These changes should probably benefit the C parser too.
3591
3592 * data/lalr1.cc: Copy as...
3593 * data/lalr1-fusion.cc: this new file.
3594 (b4_rhs_value, b4_rhs_location): New definitions overriding those
3595 from c++.m4.
3596 (state_stack_type, semantic_stack_type, location_stack_type)
3597 (yystate_stack_, yysemantic_stack_, yylocation_stack_): Remove.
3598 (data_type, stack_type, yystack_): New.
3599 (YYLLOC_DEFAULT, yypush_): Adjust.
3600 (yyerror_range): Now based on data_type, not location_type.
3601
3602 2008-11-03 Akim Demaille <demaille@gostai.com>
3603
3604 Push the state, value, and location at the same time.
3605 This is needed to prepare a forthcoming patch that fuses the three
3606 stacks into one.
3607
3608 * data/lalr1.cc (parser::yypush_): New.
3609 (parser::yynewstate): Change the semantics: instead of arriving to
3610 this label when value and location have been pushed, but yystate
3611 is to be pushed on the state stack, now the three of them must
3612 have been pushed before. yystate still must be the new state.
3613 This allows to use yypush_ everywhere instead of individual
3614 handling of the stacks.
3615
3616 2008-11-03 Akim Demaille <demaille@gostai.com>
3617
3618 Prefer references to pointers.
3619 * data/lalr1.cc (b4_symbol_actions): New, overrides the default C
3620 definition to use references instead of pointers.
3621 (yy_symbol_value_print_, yy_symbol_print_, yydestruct_):
3622 Take the value and location as references.
3623 Adjust callers.
3624
3625 2008-11-03 Akim Demaille <demaille@gostai.com>
3626
3627 stack::size instead of stack::height.
3628 * data/lalr1.cc (stack::height): Rename as...
3629 (stack::size): this.
3630 Fix the output type.
3631 Comment changes.
3632
3633 2008-11-03 Akim Demaille <demaille@gostai.com>
3634
3635 Use variants to support objects as semantic values.
3636 This patch was inspired by work by Michiel De Wilde. But he used
3637 Boost variants which (i) requires Boost on the user side, (ii) is
3638 slow, and (iii) has useless overhead (the parser knows the type of
3639 the semantic value there is no reason to duplicate this
3640 information as Boost.Variants do).
3641
3642 This implementation reserves a buffer large enough to store the
3643 largest objects. yy::variant implements this buffer. It was
3644 implemented with Quentin Hocquet.
3645
3646 * src/output.c (type_names_output): New.
3647 (output_skeleton): Invoke it.
3648 * data/c++.m4 (b4_variant_if): New.
3649 (b4_symbol_value): If needed, provide a definition for variants.
3650 * data/lalr1.cc (b4_symbol_value, b4_symbol_action_)
3651 (b4_symbol_variant, _b4_char_sizeof_counter, _b4_char_sizeof_dummy)
3652 (b4_char_sizeof, yy::variant): New.
3653 (parser::parse): If variants are requested, define
3654 parser::union_type, parser::variant, change the definition of
3655 semantic_type, construct $$ before running the user action instead
3656 of performing a default $$ = $1.
3657 * examples/variant.yy: New.
3658 Based on an example by Michiel De Wilde.
3659
3660 2008-11-03 Akim Demaille <demaille@gostai.com>
3661
3662 Parameterize the extraction of semantic values.
3663 To make future changes easier, no longer rely on ".TYPE" being the
3664 way to get a semantic value.
3665
3666 * data/c.m4 (b4_symbol_value): New.
3667 Use it.
3668 * data/c++.m4, data/yacc.c: Use it.
3669 * data/glr.c: Use b4_symbol_value.
3670 (b4_rhs_data): New.
3671 Use it.
3672
3673 2008-11-03 Akim Demaille <demaille@gostai.com>
3674
3675 Prepare easier M4 changes.
3676 * data/lalr1.cc: Use escaped [] instead of literals to prepare
3677 future changes.
3678
3679 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3680
3681 Initiate further development.
3682 * NEWS: Create an empty section for new entries.
3683 * gnulib: Update submodule to HEAD.
3684
3685 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3686
3687 * NEWS: Version 2.4.
3688
3689 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3690
3691 Prepare for next release.
3692 * NEWS: Briefly mention changes since 2.3b.
3693 * README: Say GNU m4 1.4.6, which we've been requiring in release
3694 announcements already, not 1.4.3, which breaks the build.
3695
3696 2008-11-02 Joel E. Denny <jdenny@ces.clemson.edu>
3697
3698 Say %language is experimental.
3699 We're thinking of extending it's effect on output file naming. See the
3700 thread at
3701 <http://lists.gnu.org/archive/html/bison-patches/2008-10/msg00003.html>.
3702 * NEWS: Say it's experimental.
3703 * doc/bison.texinfo (Decl Summary): Say it's experimental, and so don't
3704 recommend it over %skeleton for now.
3705 (Bison Options): Likewise.
3706 (C++ Bison Interface): Use %skeleton not %language.
3707 (Calc++ Parser): Use %skeleton not %language.
3708 * src/getargs.c (usage): Say it's experimental.
3709
3710 2008-11-01 Di-an Jan <dianj@freeshell.org>
3711 Paolo Bonzini <bonzini@gnu.org>
3712
3713 Support all Java parser class modifiers.
3714 * data/java.m4 (b4_percent_define_get3): New.
3715 (b4_final_if, b4_strictfp_if): New.
3716 * data/lalr1.java (final, strictfp, extends, implements): Support.
3717 * doc/bison.texinfo (final, strictfp, extends, implements): Add
3718 documentation.
3719 * tests/java.at (AT_CHECK_JAVA_MINIMAL): New.
3720 (AT_CHECK_JAVA_MINIMAL_W_LEXER): New.
3721 (AT_CHECK_JAVA_GREP): New.
3722 (Java parser class modifiers): New test.
3723 (Java parser class extends and implements): New test.
3724
3725 Model exception propagation better with throws and lex_throws.
3726 * data/java.m4 (b4_list2): New.
3727 (throws): Change default.
3728 * data/lalr1.java (yyaction): Add throws.
3729 (parse): Add lex_throws in addition to throws.
3730 * doc/bison.texinfo (throws, lex_throws): Add documentation.
3731 * tests/java.at (Java throws specifications): New test.
3732
3733 Improve documentation for Java parsers.
3734 * doc/bison.texinfo (Java Parsers): Add subsections.
3735 Don't quote first argument of %define.
3736 (Java Bison Interface): Document output files. Move documentation
3737 of parser class and merge into Java Parser Interface. Document
3738 features that error out. Document directives with no effect.
3739 Move note about Javadoc higher.
3740 (Java Semantic Values): Explicitly mention stype.
3741 Document that generic types cannot be used.
3742 (Java Location Values): Use @deftypeivar. Document constructors.
3743 Correct return value for toString.
3744 (Java Parser Interface): List undocumented constants/fields.
3745 Move documentation of fields added by %parse-param closer to list
3746 of members. Document that token names are added as fields.
3747 Document constructors accurately. Remove error method.
3748 (Java Scanner Interface): Move note on %pure-parser to Java Bison
3749 Interface. Describe %code lexer and yylex accutately.
3750 Remove documentation that does not match the code.
3751 (Java Action Features): New.
3752 (Java Differences): Add reference. Add item on semantic values.
3753 Add note about @{ ... @}. Clarify %% epilogue placement.
3754 (Java Declarations Summary): New.
3755
3756 Fix Java skeleton.
3757 * data/java.m4 (b4_prefix): Correct quoting for m4_define_default.
3758 (b4_remove_comma): Quote test argument.
3759 (b4_identification): Remove "bison" field.
3760 * tests/java.at (Java parser class and package names): New test.
3761 (Java %parse-param and %lex-param): New test.
3762 (Java stype, position_class and location_class): New test.
3763
3764 2008-10-31 Di-an Jan <dianj@freeshell.org>
3765
3766 * data/lalr1.jave: Update copyright years.
3767 (YYParser): Correct name of "generated from" file in Javadoc:
3768 use b4_file_name instead of @ofile@.
3769 (Location constructor): Correct Javadoc parameter name.
3770 (yylloc): Add missing opening m4 quote after b4_location_if.
3771 This removes a stray [ in the Javadoc of Lexer.getStartPos.
3772 (Lexer.yyerror): Fix incorrect m4 and Javadoc.
3773 (YYParser constructor): Correct Javadoc parameter name.
3774
3775 2008-10-30 Joel E. Denny <jdenny@ces.clemson.edu>
3776
3777 Always put auxiliary code files in the same dir as other output files.
3778 * src/files.c (compute_file_name_parts): When the user specifies
3779 --output but not --file-prefix, extract the directory prefix from the
3780 file prefix not from the grammar file name. This affects the location
3781 of files like location.hh generated by the C++ skeleton. The includes
3782 in the other output files require this fix.
3783 * tests/output.at (AT_CHECK_OUTPUT): Automatically create directories
3784 for expected output files.
3785 (Output files): Add a test for the above.
3786
3787 2008-10-29 Joel E. Denny <jdenny@ces.clemson.edu>
3788
3789 * gnulib: Update submodule to HEAD.
3790
3791 2008-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
3792
3793 Update copyright year.
3794 * src/files.c: Here.
3795
3796 2008-10-28 Di-an Jan <dianj@freeshell.org> (tiny change)
3797
3798 Don't overwrite the input file.
3799 * src/files.c (output_file_name_check): Fatal error if using input file
3800 for output.
3801 * tests/output.at: (AT_CHECK_CONFLICTING_OUTPUT): Add return status
3802 argument.
3803 (Conflicting output files): Add test.
3804
3805 2008-10-28 Akim Demaille <demaille@gostai.com>
3806
3807 Space changes.
3808 * data/lalr1.cc: Formatting changes.
3809
3810 2008-10-28 Akim Demaille <demaille@gostai.com>
3811
3812 Don't define debugging functions when !YYDEBUG.
3813 * data/lalr1.cc (debug_stream, set_debug_stream)
3814 (debug_level_type, debug_level, set_debug_level): Don't
3815 declare them when YYDEBUG is not defined.
3816 The implementation are already YYDEBUG-aware.
3817
3818 2008-10-28 Akim Demaille <demaille@gostai.com>
3819
3820 Prefer "continue" for empty loop bodies.
3821 * etc/bench.pl.in: Use "continue" instead of {}.
3822
3823 2008-10-28 Akim Demaille <demaille@gostai.com>
3824
3825 Space and comments changes.
3826 * data/c++.m4, data/glr.c, data/lalr1.cc: Copyright year changes.
3827 * data/c.m4, data/lalr1.cc: Space changes.
3828
3829 2008-10-28 Akim Demaille <demaille@gostai.com>
3830
3831 Make gnulib a submodule.
3832 * gnulib: New.
3833 * .gitmodules (gnulib): New.
3834
3835 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3836
3837 Fix yyerror_range for user-defined location type in C++. Reported by
3838 Georg Sauthoff at
3839 <http://lists.gnu.org/archive/html/bug-bison/2008-08/msg00008.html>.
3840 * data/lalr1.cc (parse): Change type of yyerror_range to location_type.
3841 * THANKS (Georg Sauthoff): Add.
3842
3843 2008-10-18 Joel E. Denny <jdenny@ces.clemson.edu>
3844
3845 Update several administrative files mainly to facilitate releasing.
3846 * HACKING (Administrivia): Make the git-merge-changelog notes more
3847 helpful.
3848 (Test suite): Don't say lalr1.cc is not exercised in the test suite.
3849 (Release Procedure): Update for git and add numerous details that were
3850 previously missing.
3851 * Makefile.am (EXTRA_DIST): Remove Makefile.cfg and Makefile.maint.
3852 * maint.mk (announcement): Don't list bison as a bootstrap tool so
3853 that announcements don't claim we bootstrapped with whatever bison
3854 happened to be in PATH. Add flex as a bootstrap tool.
3855 * Makefile.maint: Remove, previously replaced by maint.mk.
3856 * Makefile.cfg: Remove, and migrate settings to...
3857 * cfg.mk: ... here for the sake of `make announcement'.
3858 * bootstrap.conf (gnulib_modules): Add announce-gen.
3859 * README: Say GNU Bison instead of just Bison. Suggested by Karl
3860 Berry.
3861
3862 2008-10-08 Di-an Jan <dianj@freeshell.org> (tiny change)
3863
3864 Small but important bugfixes for the Java skeleton.
3865 * data/lalr1.java (yyerror): Change Location to b4_location_type.
3866 (yy_symbol_print): Call toString on yyvaluep.
3867
3868 2008-08-29 Akim Demaille <demaille@gostai.com>
3869
3870 Clarify UPDATED use.
3871 * doc/bison.texinfo: It refers to the last edition of this file,
3872 not to the release date of Bison.
3873 Reported by Joel E. Denny.
3874
3875 2008-08-29 Akim Demaille <demaille@gostai.com>
3876
3877 * README: Update FAQ pointer.
3878 Reported by Joel E. Denny.
3879
3880 2008-08-27 Eric Blake <ebb9@byu.net>
3881
3882 Resync m4sugar from autoconf.
3883 * data/m4sugar/m4sugar.m4 (m4_defn, m4_popdef, m4_undefine)
3884 (m4_init): Adjust to latest m4.git changes.
3885 (m4_mapall_sep, _m4_list_cmp, m4_version_compare): Reduce side
3886 effects.
3887 * data/m4sugar/foreach.m4 (_m4_shiftn): Fix off-by-one bug.
3888 (_m4_list_cmp): Reduce side effects.
3889
3890 2008-08-27 Akim Demaille <demaille@gostai.com>
3891
3892 Check yyerrok in calc.at.
3893 * tests/calc.at (calc.y): Use yyerrok on "( error )".
3894 (AT_CHECK_CALC): Add a check that ensures that yyerrok works as
3895 expected.
3896
3897 2008-08-27 Akim Demaille <demaille@gostai.com>
3898
3899 Support yyerrok in lalr1.cc.
3900 YYBACKUP is still to import back into lalr1.cc.
3901 * data/lalr1.cc (yyerrork, yyclearin, YYRECOVERING): Define.
3902
3903 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3904
3905 For maintainer-check*, don't recompile for a $(VERSION) update.
3906 * cfg.mk: New file.
3907 (_is-dist-target): Override the one in GNUmakefile.
3908 * Makefile.am (EXTRA_DIST): Add cfg.mk.
3909
3910 2008-08-26 Joel E. Denny <jdenny@ces.clemson.edu>
3911
3912 Update for recent change to gnulib.
3913 * src/parse-gram.y: Don't include strverscmp.h. It comes from
3914 string.h now.
3915
3916 2008-08-15 Eric Blake <ebb9@byu.net>
3917
3918 Remaining m4sugar merge from autoconf.
3919 * data/m4sugar/m4sugar.m4: Copy entire file from autoconf.
3920 * data/m4sugar/foreach.m4: New file, copied from autoconf.
3921 * data/Makefile.am (dist_m4sugar_DATA): Distribute it.
3922 * src/output.c (output_skeleton): Tell m4 how to find it.
3923
3924 Partial m4sugar merge from autoconf: m4_map.
3925 * data/m4sugar/m4sugar.m4 (m4_fst): Delete.
3926 (m4_map, m4_map_sep, _m4_map): Rewrite more efficiently.
3927 (m4_apply, _m4_apply, m4_mapall, m4_mapall_sep): New macros.
3928 * data/java.m4 (b4_token_enums): Use more efficient short-circuit
3929 for empty list.
3930 * data/c.m4 (b4_token_defines, b4_token_enums, b4_c_ansi_formals):
3931 Likewise.
3932 (b4_parse_param_for): Avoid m4_fst, now that autoconf no longer
3933 declares it.
3934
3935 2008-08-07 Joel E. Denny <jdenny@ces.clemson.edu>
3936
3937 Keep .version and PACKAGE_VERSION in sync.
3938 * Makefile.am ($(top_srcdir)/.version): Declare configure as a
3939 dependency, and add comments justifying this in more detail. Discussed
3940 starting at
3941 <http://lists.gnu.org/archive/html/bison-patches/2008-07/msg00022.html>.
3942
3943 2008-08-06 Eric Blake <ebb9@byu.net>
3944
3945 Partial m4sugar merge from autoconf: m4_shiftn.
3946 * data/m4sugar/m4sugar.m4 (m4_shiftn): Faster implementation.
3947 (m4_shift2, m4_shift3): New macros.
3948 (m4_case, m4_bmatch, m4_bpatsubsts, m4_join): Adjust clients.
3949 * data/c.m4 (b4_c_function_def, b4_c_ansi_function_def)
3950 (b4_c_ansi_function_decl, b4_c_function_call): Likewise.
3951 * data/java.m4 (b4_remove_comma): Likewise.
3952
3953 Partial m4sugar merge from autoconf: m4_wrap vs. m4 1.6.
3954 * data/m4sugar/m4sugar.m4 (m4_unquote, m4_wrap_lifo): New macros.
3955 (m4_wrap): Guarantee FIFO order, in spite of m4 1.6.
3956 (m4_init): Consolidate wrapped text into single m4_wrap.
3957 * data/bison.m4 (b4_check_user_names_wrap): Stick with LIFO order
3958 in wrapped text.
3959
3960 2008-08-05 Eric Blake <ebb9@byu.net>
3961
3962 Partial m4sugar merge from autoconf: builtins, version.m4.
3963 * data/m4sugar/m4sugar.m4 (changeword): Nuke.
3964 (m4_prepend): Remove, as it is unused and inherently quadratic,
3965 whereas m4_append is linear in newer m4.
3966 (m4_mkstemp): New builtin.
3967 (m4_symbols): Make rename conditional.
3968 (m4_version_prereq): Ensure fatal error if used in bison, which
3969 intentionally lacks version.m4.
3970
3971 Fix comments in m4sugar.
3972 * data/m4sugar/m4sugar.m4: Comment changes, borrowed from autoconf.
3973
3974 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3975
3976 Update for recent .gitignore fix in Gnulib.
3977 * bootstrap: Back out 2008-07-18 hack now that gnulib-tool creates
3978 anchored .gitignore entries.
3979
3980 2008-08-02 Joel E. Denny <jdenny@ces.clemson.edu>
3981
3982 Set gnu or gnits strictness.
3983 * configure.ac (AM_INIT_AUTOMAKE): Set gnu strictness during
3984 development and gnits strictness for releases. Based on Eric Blake's
3985 suggestion at
3986 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00019.html>.
3987
3988 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
3989
3990 * NEWS: Clarify documentation of %language.
3991
3992 2008-07-31 Paolo Bonzini <bonzini@gnu.org>
3993
3994 Support usage of git-merge-changelog.
3995 * .gitattributes: New.
3996 * HACKING: Document usage of git-merge-changelog.
3997 * bootstrap: Install git-merge-changelog entries in .git/config
3998 if appropriate.
3999
4000 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4001
4002 Remove remaining dependence on CVS Id keyword.
4003 * ChangeLog: For the sake of people still using CVS, don't use dollars
4004 when mentioning Id.
4005 * data/xslt/bison.xsl: Remove Id from header comments, where it was
4006 unusual anyway.
4007 * data/xslt/xml2dot.xsl: Likewise.
4008 * data/xslt/xml2text.xsl: Likewise.
4009 * data/xslt/xml2xhtml.xsl: Likewise.
4010 * doc/Doxyfile.in (PROJECT_NUMBER): Don't use ID.
4011 * doc/Makefile.am (neutralize): Remove, no longer needed.
4012 (.x.1): Don't use neutralize.
4013 (edit): Don't substitute for ID.
4014 (Doxyfile): Don't define Id, and thus don't depend on ChangeLog.
4015
4016 2008-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
4017
4018 Fix dependence on computed configure variables.
4019 * doc/Makefile.am (common_dep): Depend on $(top_srcdir)/configure not
4020 $(top_srcdir)/configure.ac so that changes to computed variables, such
4021 as PACKAGE_VERSION, are seen.
4022 * tests/Makefile.am ($(srcdir)/package.m4): Likewise.
4023
4024 2008-07-20 Joel E. Denny <jdenny@ces.clemson.edu>
4025
4026 Update copyright dates for recent changes.
4027 * Makefile.am: Here.
4028 * src/Makefile.am: Here.
4029 * src/reduce.c: Here.
4030 * tests/reduce.at: Here.
4031
4032 2008-07-18 Joel E. Denny <jdenny@ces.clemson.edu>
4033
4034 Use git-version-gen for version names between releases.
4035 * .cvsignore (.tarball-version, GNUmakefile, *~): Add.
4036 * .gitignore (/.tarball-version, /GNUmakefile, /*~): Add.
4037 * .prev-version: New.
4038 * .version.in: Remove.
4039 * ChangeLog: Remove the Id previously used for capturing the CVS
4040 revision.
4041 * GNUmakefile: Remove, now copied from Gnulib.
4042 * Makefile.am: Add code suggested by comments in
4043 build-aux/git-version-gen.
4044 (EXTRA_DIST): Remove GNUmakefile, handled by Gnulib. Add maint.mk,
4045 .prev-version, and .version.
4046 * NEWS (2.3b+): Rename to...
4047 (?.?): ... this because we're dropping the "+" version naming scheme,
4048 but, in general, we still can't be sure of our next release name.
4049 * bootstrap: Add a quick hack to remove from .gitignore the
4050 GNUmakefile entry that gnulib adds. We already have a /GNUmakefile
4051 entry. This should really be fixed in gnulib instead.
4052 * bootstrap.conf (gnulib_modules): Add gnumakefile.
4053 * configure.ac (AC_INIT): Set version name by invoking
4054 build-aux/git-version-gen.
4055 (AC_CONFIG_FILES): Remove .version, now generated by
4056 build-aux/git-version-gen.
4057 * maint.mk: New, copied from coreutils.
4058 * doc/.cvsignore (bison.1): Add.
4059 * doc/.gitignore (/bison.1): Add.
4060 * doc/bison.1: Remove, generated.
4061 * src/.cvsignore (revision.c): Remove.
4062 * src/.gitignore (/revision.c): Remove.
4063 * src/Makefile.am (bison_SOURCES): Remove revision.c and revision.h.
4064 (BUILT_SOURCES): Remove revision.c.
4065 (revision.c): Remove.
4066 * src/getargs.c (version): Don't print revision after the VERSION.
4067 * src/revision.h: Remove.
4068
4069 2008-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
4070
4071 Fix untranslatable composition of sentences. Reported by Goran
4072 Uddeborg at
4073 <http://lists.gnu.org/archive/html/bug-bison/2008-06/msg00000.html>.
4074 * THANKS (Goran Uddeborg): Add.
4075 * src/reduce.c (reduce_print): Report the number of nonterminals and
4076 rules useless in the grammar in separate sentences.
4077 * tests/reduce.at (Useless Rules): Update output.
4078 (Reduced Automaton): Likewise.
4079 (Underivable Rules): Likewise.
4080 (Empty Language): Likewise.
4081
4082 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4083
4084 Fix some .gitignore and .cvsignore problems.
4085 * bootstrap (insert_sorted_if_absent): Replace all uses with...
4086 (insert_vc_ignore): ... this new function, which prepends `/' to all
4087 .gitignore entries before passing them to insert_sorted_if_absent.
4088 * bootstrap.conf (vc_ignore): Set to '.cvsignore .gitignore' so that
4089 .cvsignore files are maintained even though Bison developers run
4090 bootstrap while using Git.
4091 * .cvsignore (*.patch *.log log patches applied): Remove, apparently
4092 unneeded by Bison.
4093 (gnulib): Add.
4094 * .gitignore (/*.patch *.log log patches applied): Remove, broken and
4095 unneeded. Reported by Eric Blake.
4096 * lib/.gitignore (/*~): Add.
4097 * po/.cvsignore, runtime-po/.cvsignore: Sync with .gitignore.
4098 * examples/calc++/.gitignore (/calc++.exe): Add. Reported by Eric
4099 Blake.
4100 * src/.gitignore (/bison.exe): Add. Reported by Eric Blake.
4101
4102 2008-07-15 Joel E. Denny <jdenny@ces.clemson.edu>
4103
4104 Improve forward-compatibility with GNU M4. Reported by Eric Blake at
4105 <http://lists.gnu.org/archive/html/bug-bison/2008-07/msg00000.html>.
4106 * bootstrap.conf (gnulib_modules): Add unsetenv.
4107 * lib/.gitignore, lib/.cvsignore (/unsetenv.c): Add.
4108 * m4/.gitignore, m4/.cvsignore (/environ.m4): Add.
4109 (/setenv.m4): Add.
4110 * src/output.c (output_skeleton): For the m4 invocation, pass -dV as
4111 the first argument because it may become position-dependent, and unset
4112 POSIXLY_CORRECT so Bison's skeletons have access to GNU M4 extensions.
4113 Add comments explaining these issues in more detail.
4114
4115 2008-07-14 Joel E. Denny <jdenny@ces.clemson.edu>
4116
4117 Add .gitignore everywhere based on .cvsignore.
4118 * .gitignore: New.
4119 * build-aux/.gitignore: New.
4120 * data/.gitignore: New.
4121 * doc/.gitignore: New.
4122 * etc/.gitignore: New.
4123 * examples/.gitignore: New.
4124 * examples/calc++/.gitignore: New.
4125 * lib/.gitignore: New.
4126 * m4/.gitignore: New.
4127 * po/.gitignore: New.
4128 * runtime-po/.gitignore: New.
4129 * src/.gitignore: New.
4130 * tests/.gitignore: New.
4131
4132 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4133
4134 * NEWS (2.3b+): New section, empty for now.
4135 * configure.ac (AC_INIT): 2.3b -> 2.3b+.
4136
4137 2008-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
4138
4139 * NEWS (2.3b): Update release date since there has been a delay in
4140 getting the announcements and tarballs out.
4141
4142 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4143
4144 * NEWS: Version 2.3b.
4145 * configure.ac (AC_INIT): Likewise.
4146 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
4147
4148 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
4149
4150 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
4151 been doing it for years.
4152 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
4153 (Release Procedure): Add FIXME about make alpha being unmaintained.
4154
4155 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
4156
4157 * data/yacc.c: Reformat m4 a little for readability.
4158 * src/lalr.c (build_relations): Correct comment.
4159
4160 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4161
4162 DJGPP specific issue.
4163 * djgpp/config.sed: Fixes required to run configure scripts generated
4164 by autoconf 2.62.
4165
4166 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
4167
4168 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4169 coordinator@translationproject.org.
4170
4171 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
4172
4173 * THANKS: Add Eric Blake.
4174
4175 2008-04-23 Eric Blake <ebb9@byu.net>
4176
4177 Revert prior patch, by working around autoconf regression.
4178 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
4179 ("Output file name: ("): Uncomment test.
4180 ("Output file name: )"): Likewise.
4181 Based on an idea from Noah Misch.
4182
4183 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4184
4185 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
4186 2.61. Reported by Juan Manuel Guerrero at
4187 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
4188 * tests/output.at ("Output file name: ("): Comment out test case for
4189 now.
4190 ("Output file name: )"): Likewise.
4191
4192 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4193
4194 * GNUmakefile: Update git-version-gen invocation so make dist
4195 succeeds.
4196
4197 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
4198
4199 Update to the current gnulib CVS repository, and fix trigraph handling
4200 in Bison.
4201 * bootstrap: Update gnulib CVS repository URL.
4202 (symlink_to_dir): Encapsulate the code that guarantees the destination
4203 directory exists into...
4204 (check_dst_dir): ... this new function, and...
4205 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
4206 fail when copying files into lib/uniwidth/.
4207 * src/output.c (prepare_symbols): When writing yytname muscles, where
4208 symbol names will be encoded in C-string literals, tell quotearg to
4209 escape trigraphs. This used to be the default in gnulib.
4210 * tests/regression.at (Token definitions): Because of the change in
4211 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
4212 escapes trigraphs in symbol names. Thus, yytname no longer has
4213 trigraphs unnecessarily doubly escaped. Update test case output.
4214 Extend test case to be sure Bison's own error messages will no longer
4215 have trigraphs in symbol names unnecessarily escaped once.
4216
4217 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
4218
4219 Fix make dist infinite loop reported by Juan Manuel Guerrero at
4220 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
4221 * .cvsignore: Add .version.
4222 * .version.in: New.
4223 * bootstrap.conf (gnulib_modules): Add git-version-gen.
4224 * configure.ac (AC_CONFIG_FILES): Add .version.
4225 * build-aux/.cvsignore: Add git-version-gen.
4226
4227 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4228
4229 * NEWS (2.3a+): Mention that -g now takes an argument.
4230 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
4231 consistency. Update the -g and -x entries now that they take
4232 arguments. Use brackets to indicate optional arguments.
4233 * src/getargs.c (usage): Explain the relationship between arguments of
4234 long and short options more completely. Document --defines and -d
4235 separately since the former takes an argument but, for POSIX Yacc, the
4236 latter does not.
4237 (short_options): Let -W take an optional argument like --warnings.
4238 (getargs): Sort cases.
4239
4240 2008-02-28 Akim Demaille <demaille@gostai.com>
4241
4242 * doc/bison.texinfo: Fix a few typos.
4243
4244 2008-02-28 Akim Demaille <akim@epita.fr>
4245
4246 * doc/bison.texinfo (Bison Options): Document -W.
4247 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
4248
4249 2008-02-28 Akim Demaille <akim@epita.fr>
4250
4251 * src/getargs.c (short_options): Split and sort for readability.
4252 -g and -x take optional arguments, just like their long options.
4253 * build-aux/cross-options.pl: Use /x to make the regexp easier to
4254 understand.
4255 Fix the handling of $opt which resulted in all the argument to be
4256 considered as optional.
4257
4258 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
4259
4260 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
4261 say its interface is experimental.
4262 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
4263 Java.
4264 (Bison Options): In the -L and --language entry, mention Java.
4265 (Java Bison Interface): Say the interface is experimental.
4266 * src/getargs.c (usage): Mention -L and --language.
4267
4268 * NEWS (2.3a+): Say the push parsing interface is experimental.
4269 * doc/bison.texinfo (Push Decl): Likewise.
4270 (Decl Summary): Likewise in the "%define api.push_pull" entry.
4271 (Push Parser Function): Likewise.
4272 (Pull Parser Function): Likewise.
4273 (Parser Create Function): Likewise.
4274 (Parser Delete Function): Likewise.
4275 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
4276 yypull_parse, and yypush_parse entries.
4277
4278 * NEWS (2.3a+): Mention XML support, and say the schema is
4279 experimental.
4280 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
4281 * src/getargs.c (usage): Say the XML schema is experimental.
4282
4283 * NEWS (2.3a+): Say option instead of flag.
4284
4285 2008-02-21 Wojciech Polak <polak@gnu.org>
4286
4287 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
4288 text.
4289
4290 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
4291
4292 Fix impure push parser compile error reported by Bob Rossi at
4293 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
4294 * data/yacc.c: Clean up whitespace in the output a little.
4295 (yypstate_allocated): Define for impure push parsers regardless of
4296 whether the pull interface is also requested.
4297 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
4298 check impure push parsers without the pull interface.
4299
4300 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
4301 yyerror takes arguments specified by %parse-param while yypstate_new
4302 does not.
4303 * doc/bison.texinfo (Parser Create Function): Document that
4304 yypstate_new returns 0 for multiple impure parser instances.
4305 * tests/push.at (Push Parsing: Multiple impure instances): Update
4306 expected stderr output.
4307
4308 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
4309
4310 * runtime-po/POTFILES.in (push.c): Remove.
4311
4312 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4313
4314 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
4315 * data/push.c: Rename to...
4316 * data/yacc.c: ... this, overwriting it.
4317 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
4318 `%push-pull-parser' -> `%define api.push_pull "both"'.
4319 Remove old yacc.c tests, and update push.c tests to yacc.c.
4320
4321 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
4322
4323 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
4324 `"%code top" blocks' instead of `%code "top" blocks'.
4325 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
4326 Clean up whitespace in the output a little.
4327
4328 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4329
4330 Fix documentation problems reported by Tim Josling at
4331 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
4332 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
4333 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
4334 integers. Explain the effect of literal string aliases on error
4335 messages. Copy token 0 documentation from the C++ skeleton
4336 documentation.
4337
4338 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
4339
4340 Accept a token number in a %left, %right, or %nonassoc for POSIX
4341 conformance. Reported by Tim Josling at
4342 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
4343 * NEWS (2.3a+): Mention.
4344 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
4345 and code numbers are treated by precedence declarations.
4346 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
4347 of symbols.1.
4348 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
4349 of symbol.
4350 (symbol.prec): New, just like symbol but allows INT.
4351 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
4352 longer holds.
4353 * tests/regression.at (Token number in precedence declaration): New
4354 test case.
4355
4356 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4357
4358 DJGPP specific issues.
4359 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
4360 be changed. Copyright timestamp adjusted.
4361 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
4362 be changed. Copyright timestamp adjusted.
4363 * djgpp/config.site: Copyright timestamp adjusted.
4364 * djgpp/config_h.sed: Copyright timestamp adjusted.
4365 * djgpp/djunpack.bat: Copyright timestamp adjusted.
4366 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
4367 filename translation list.
4368 * djgpp/subpipe.c (init_subpipe): Check the environment variables
4369 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
4370 files shall be created. Before trying to use the temp dir where the
4371 environment variable points to check that the dir really exists. If
4372 not default to the cwd as temp dir. Copyright timestamp adjusted.
4373 * djgpp/subpipe.h: Copyright timestamp adjusted.
4374 * djgpp/testsuite.sed: Copyright timestamp adjusted.
4375
4376 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
4377
4378 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
4379
4380 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
4381
4382 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
4383 Problem reported by Claudio Saavedra in
4384 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
4385
4386 2008-01-05 Wojciech Polak <polak@gnu.org>
4387
4388 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
4389 document's title with the input grammar file name.
4390
4391 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
4392
4393 Automate regression testing of the XML/XSLT implementation. Discussed
4394 starting at
4395 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
4396 * configure.ac (XSLTPROC): New substitution.
4397 * Makefile.am (maintainer-xml-check): New phony target invoking...
4398 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
4399 invoking make maintainer-check with BISON_TEST_XML=1.
4400 * tests/atlocal.in (XSLTPROC): New.
4401 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
4402 not to report reachable memory when Bison is expected to have a
4403 non-zero exit status and (2) to compare XML/XSLT output with --graph
4404 and --report=all output for every working grammar when
4405 BISON_TEST_XML=1.
4406 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
4407 (AT_BISON_CHECK_XML): New.
4408 (AT_QUELL_VALGRIND): New.
4409 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
4410 (AT_CHECK): ... don't redefine this since this was the old way to
4411 quell Valgrind.
4412 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
4413 AT_BISON_CHECK invocations.
4414 * tests/c++.at: Likewise.
4415 * tests/calc.at: Likewise.
4416 * tests/conflicts.at: Likewise.
4417 * tests/cxx-type.at: Likewise.
4418 * tests/existing.at: Likewise.
4419 * tests/glr-regression.at: Likewise.
4420 * tests/headers.at: Likewise.
4421 * tests/input.at: Likewise.
4422 * tests/java.at: Likewise.
4423 * tests/output.at: Likewise.
4424 * tests/push.at: Likewise.
4425 * tests/reduce.at: Likewise.
4426 * tests/regression.at: Likewise.
4427 * tests/sets.at: Likewise.
4428 * tests/skeletons.at: Likewise.
4429 * tests/synclines.at: Likewise.
4430 * tests/torture.at: Likewise.
4431 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
4432 tends to hang xsltproc.
4433 (Big horizontal): Likewise.
4434
4435 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4436
4437 In XML output, remove redundant class attribute on symbol element.
4438 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
4439 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
4440 look up a symbol to determine whether it's a nonterminal or terminal.
4441 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
4442 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
4443
4444 Add prec/assoc information to XML output.
4445 * src/gram.c (grammar_rules_print_xml): For each rule that has a
4446 %prec, add a percent_prec attribute.
4447 * src/print-xml.c (print_grammar): For each terminal that has a
4448 precedence or associativity, add a prec or assoc attribute.
4449 (xml_indent): New.
4450 (xml_puts): Use xml_indent.
4451 (xml_printf): Use xml_indent.
4452 * src/print-xml.h (xml_indent): Prototype.
4453
4454 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
4455 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
4456
4457 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
4458
4459 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
4460 (bison:ruleByNumber): ... this for clarity.
4461 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
4462 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
4463 (xsl:template match="reduction"): Update.
4464 (xsl:template match="item"): Update.
4465 (xsl:template match="reduction"): Update.
4466
4467 In the XML output, don't print the list of rules where symbols appear.
4468 Compute it in XSLT instead. Discussed at
4469 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
4470 * data/xslt/bison.xsl (bison:ruleByLhs): New.
4471 (bison:ruleByRhs): New.
4472 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
4473 bison:ruleByRhs.
4474 (xsl:template match="terminal/rule"): Remove.
4475 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4476 bison:ruleByRhs.
4477 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4478 Remove.
4479 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
4480 bison:ruleByRhs and mode="number-link" for rule template.
4481 (xsl:template match="terminal/rule"): Remove.
4482 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
4483 bison:ruleByRhs and mode="number-link" for rule template.
4484 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
4485 Rewrite as...
4486 (xsl:template match="rule" mode="number-link"): ... this.
4487 * src/print-xml.c (print_grammar): Don't print the list of rules.
4488
4489 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
4490
4491 Don't let --report affect XML output; always print all information.
4492 Discussed at
4493 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
4494 * src/conflicts.c (log_resolution): Implement.
4495 * src/print-xml.c (print_core): Implement.
4496 (print_state): Implement.
4497 (print_xml): Implement.
4498
4499 * NEWS (2.3a+): Fix quotes.
4500 * src/parse-gram.y (prologue_declaration): For consistency with -v,
4501 don't let %verbose clear the list specified by --report.
4502
4503 2007-11-26 Akim Demaille <akim@epita.fr>
4504
4505 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
4506
4507 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
4508
4509 In the XML output, list useless and unused symbols and rules with the
4510 useful ones and add a "usefulness" attribute. Discussed starting at
4511 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
4512 * src/gram.c (grammar_rules_partial_print_xml): Remove.
4513 (grammar_rules_print_xml): Print all rules instead of just those
4514 useful in the grammar, and add a "usefulness" attribute.
4515 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
4516 * src/print-xml.c (print_rules_useless_in_parser): Remove.
4517 (print_grammar): Print all nonterminals instead of just useful ones,
4518 and add a "usefulness" attribute to nonterminals and terminals.
4519 (print_xml): Don't print a separate "reductions" or
4520 "rules-useless-in-parser" element.
4521 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
4522 (reduce_xml): Remove.
4523 (reduce_token_unused_in_grammar): New.
4524 (reduce_nonterminal_useless_in_grammar): New.
4525 * src/reduce.h (reduce_xml): Remove prototype.
4526 (reduce_token_unused_in_grammar): Add prototype.
4527 (reduce_nonterminal_useless_in_grammar): Add prototype.
4528 * data/xslt/xml2text.xsl: Update for XML changes.
4529 * data/xslt/xml2xhtml.xsl: Update for XML changes.
4530 * tests/reduce.at (Useless Terminals): Update output.
4531 (Useless Rules): Update output.
4532 (Reduced Automaton): Update output.
4533
4534 Say "Terminals unused in grammar" instead of "Unused terminals".
4535 * NEWS (2.3a+): Update.
4536 * doc/bison.texinfo (Understanding): Update example output.
4537 * src/reduce.c (reduce_output): Implement.
4538 * data/xslt/xml2text.xsl: Implement.
4539 * data/xslt/xml2xhtml.xsl: Implement.
4540
4541 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
4542
4543 Accept --report-file=FILE to override the default `.output' filename.
4544 * NEWS (2.3a+): Mention.
4545 * doc/bison.texinfo (Bison Options): Add an entry.
4546 * src/files.c (compute_output_file_names): Don't override
4547 spec_verbose_file if already set.
4548 * src/getargs.c (usage): Document --report-file.
4549 (REPORT_FILE_OPTION): New anonymous enum member.
4550 (long_options): Add entry for it.
4551 (getargs): Add case for it setting spec_verbose_file.
4552
4553 * build-aux/cross-options.pl: Don't record a short option just because
4554 there's an arg.
4555 * doc/.cvsignore: Add yacc.1.
4556
4557 2007-11-14 Akim Demaille <akim@epita.fr>
4558
4559 * doc/yacc.1.in: New.
4560 * configure.ac, doc/Makefile.am: Adjust.
4561 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
4562 config.h symbol.
4563 Use AC_SUBST for assignments too.
4564 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
4565
4566 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
4567
4568 * src/gram.c: Remove comments that duplicate comments in gram.h.
4569
4570 When reporting useless rules and nonterminals, say "useless in grammar"
4571 instead of "useless", and say "useless in parser" instead of "never
4572 reduced". Discussed starting at
4573 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
4574 * NEWS (2.3a+): Mention this change.
4575 * data/xslt/xml2text.xsl: Update output text and expected input XML
4576 element names to match changes below.
4577 * data/xslt/xml2xhtml.xsl: Likewise.
4578 (xsl:template match="bison-xml-report"): Add missing entry in Table of
4579 Contents: "Rules useless in parser due to conflicts".
4580 * doc/bison.texinfo (Decl Summary): Reword a little.
4581 (Understanding): Update example output for changes below.
4582 * src/gram.c: (rule_useful_p): Rename to...
4583 (rule_useful_in_grammar_p): ... this.
4584 (rule_useless_p): Rename to...
4585 (rule_useless_in_grammar_p): ... this.
4586 (rule_never_reduced_p): Rename to...
4587 (rule_useless_in_parser_p): ... this.
4588 (grammar_rules_print): Update for renames.
4589 (grammar_rules_print_xml): Update for renames.
4590 (grammar_rules_never_reduced_report): Rename to...
4591 (grammar_rules_useless_report): ... this since it is used for either
4592 kind of useless rule.
4593 * src/gram.h: Reword comments and update function names in prototypes.
4594 * src/main.c (main): Say "rule useless in parser due to conflicts".
4595 * src/print-xml.c (print_rules_never_reduced): Rename to...
4596 (print_rules_useless_in_parser): ... this, and rename output XML
4597 element "rules-never-reduced" to "rules-useless-in-parser".
4598 (print_xml): Update for rename.
4599 * src/print.c (print_results): Say "Rules useless in parser due to
4600 conflicts".
4601 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
4602 (nonterminals_reduce): Say "nonterminal useless in grammar".
4603 (reduce_output): Say "Nonterminals useless in grammar".
4604 Say "Rules useless in grammar".
4605 (reduce_xml): Rename output XML element "useless" to
4606 "useless-in-grammar".
4607 (reduce_print): Don't report the count of grammatically useless rules
4608 as "rules never reduced" just because %yacc is specified.
4609 In the correct report of this count, say nonterminal(s) and rule(s)
4610 "useless in grammar".
4611 * tests/conflicts.at (S/R in initial): Update expected output.
4612 (Defaulted Conflicted Reduction): Likewise.
4613 (Unreachable States After Conflict Resolution): Likewise.
4614 * tests/existing.at (GNU pic Grammar): Likewise.
4615 * tests/reduce.at (Useless Nonterminals): Likewise.
4616 (Useless Rules): Likewise.
4617 (Reduced Automaton): Likewise.
4618 (Underivable Rules): Likewise.
4619 (Empty Language): Likewise.
4620
4621 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
4622
4623 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
4624 here document and before the EOF so that BSD's implementation of Bourne
4625 shell doesn't parse the delimiter as part of the here document.
4626 * doc/.cvsignore: Add cross-options.texi.
4627 * src/getargs.c (usage): Add a blank line after the warning categories.
4628
4629 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
4630
4631 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
4632
4633 2007-11-05 Akim Demaille <akim@epita.fr>
4634
4635 Remove Id: from bison.1.
4636 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
4637 (perl -0777 -pi -e 's/\.PP\nId): New.
4638 (.x.1): Use it to ignore the version control revision.
4639
4640 2007-11-05 Akim Demaille <demaille@gostai.com>
4641
4642 * build-aux/Makefile.am: Ship cross-options.pl.
4643 * doc/Makefile.am: Always refer to cross-options.texi with
4644 $(srcdir).
4645 (MAINTAINERCLEANFILES): Add it.
4646
4647 2007-11-04 Akim Demaille <demaille@gostai.com>
4648
4649 Generate the long/short option cross-table.
4650 * build-aux/cross-options.pl: New.
4651 * doc/Makefile.am (cross-options.texi): New.
4652 * doc/bison.texinfo: Use it.
4653
4654 2007-11-04 Akim Demaille <demaille@gostai.com>
4655
4656 Generate bison.1 using help2man.
4657 * doc/common.x, doc/bison.x: New.
4658 * doc/Makefile.am (bison.1, .x.1): New.
4659 The code is taken from autoconf-2.61/man/Makefile.am.
4660 * configure.ac: Look for help2man.
4661
4662 2007-11-04 Akim Demaille <demaille@gostai.com>
4663
4664 Complete --help.
4665 * src/getargs.c (usage): Document -W, make it clear that -d,
4666 -g and -x have optional arguments.
4667
4668 2007-11-04 Akim Demaille <demaille@gostai.com>
4669
4670 Find sha1sum when named gsha1sum.
4671 * bootstrap (find_tool): New.
4672 ($SHA1SUM): New.
4673
4674 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4675
4676 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
4677 at
4678 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
4679 * NEWS (2.3a+): Mention.
4680 * data/bison.m4 (b4_pure_if): Don't define it here.
4681 * data/c.m4 (b4_identification): Depend on individual skeletons to
4682 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
4683 values of the %define variables api.pure or api.push_pull. Define
4684 YYPURE, YYPUSH, and YYPULL accordingly.
4685 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
4686 glr.cc has already defined b4_pure_flag.
4687 * data/push.c: Define b4_pure_if based on `%define api.pure'.
4688 Remove YYPUSH and YYPULL since they're back in b4_identification again.
4689 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
4690 * doc/bison.texinfo (Pure Decl): Update.
4691 (Push Decl): Update.
4692 (Decl Summary): Add api.pure to %define entry.
4693 In %pure-parser entry, say it's deprecated and reference %define.
4694 (Pure Calling): Update.
4695 (Error Reporting): Update.
4696 (C++ Scanner Interface): Update.
4697 (How Can I Reset the Parser): Update.
4698 (Table of Symbols): In %pure-parser entry, say it's deprecated and
4699 reference %define.
4700 * src/getargs.c (pure_parser): Remove global variable.
4701 * src/getargs.h (pure_parser): Remove extern.
4702 * src/output.c (prepare): Don't define pure_flag muscle.
4703 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
4704 wrapper around `%define api.pure'.
4705 * tests/calc.at (Simple LALR Calculator): Update.
4706 (Simple GLR Calculator): Update.
4707 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
4708 Update.
4709 (GLR: Resolve ambiguity, pure, locations): Update.
4710 (GLR: Merge conflicting parses, pure, no locations): Update.
4711 (GLR: Merge conflicting parses, pure, locations): Update.
4712 * tests/glr-regression.at (Uninitialized location when reporting
4713 ambiguity): Update
4714 * tests/input.at (Unused %define api.pure): New test case.
4715 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
4716 AT_PURE_IF and AT_PURE_AND_LOC_IF.
4717 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4718
4719 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
4720
4721 %define push_pull -> %define api.push_pull. Discussed starting at
4722 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
4723 * data/push.c: Expect the new name.
4724 * data/yacc.c: Likewise.
4725 * doc/bison.texinfo (Push Decl): Update.
4726 (Decl Summary): Update %define entry.
4727 (Push Parser Function): Update.
4728 (Pull Parser Function): Update.
4729 (Parser Create Function): Update.
4730 (Parser Delete Function): Update.
4731 * tests/calc.at (Simple LALR Calculator): Update.
4732 * tests/input.at (%define enum variables): Update.
4733 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
4734 (Push Parsing: Multiple impure instances): Update.
4735 (Push Parsing: Unsupported Skeletons): Update.
4736 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
4737 (Exploding the Stack Size with Malloc): Update.
4738
4739 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
4740 other entries some.
4741
4742 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
4743
4744 For the XML output's terminal element, rename @number to @token-number,
4745 and add @symbol-number. In the nonterminal element, rename @number to
4746 @symbol-number. Discussed starting at
4747 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
4748 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
4749 renames.
4750 (xsl:template match="nonterminal"): Likewise.
4751 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
4752 (xsl:template match="nonterminal"): Likewise.
4753 * src/print-xml.c (print_grammar): Implement.
4754
4755 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
4756
4757 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4758 2007-10-11 change, the child elements here are items not rules.
4759 (xsl:template match="item"): New.
4760 (xsl:template match="rule"): Update for new reduced itemset.
4761 (xsl:template match="point"): Remove.
4762 (xsl:template match="empty"): For consistency with --graph, don't
4763 output "/* empty */".
4764 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
4765 line-wrap, don't pass a negative value as first-line-length since this
4766 won't work with the following changes.
4767 (xsl:template name="line-wrap"): Simplify slightly.
4768 (xsl:template name="ws-search"): Eliminate recursion.
4769 * src/print_graph.c (print_core): Don't print a reduction's lookahead
4770 set next to an item whose dot is not at the end of the RHS even if it
4771 happens to be associated with the same rule.
4772
4773 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4774
4775 Add %define lr.keep_unreachable_states.
4776 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
4777 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
4778 * src/main.c (main): Implement it.
4779 * tests/conflicts.at (Unreachable States After Conflict Resolution):
4780 Extend to test it, and fix a typo.
4781
4782 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
4783
4784 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
4785 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
4786 the example .output text.
4787 * tests/regression.at (Extra lookahead sets in report): Improve wording
4788 of comments.
4789
4790 2007-10-17 Wojciech Polak <polak@gnu.org>
4791
4792 * src/print-xml.c (print_grammar): Renamed
4793 <terminal> and <nonterminal> attributes:
4794 "type" to "number" and "symbol" to "name".
4795 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
4796 Use new attribute names.
4797 (xsl:template match="nonterminal"): Likewise.
4798 * data/xslt/xml2xhtml.xsl: Likewise.
4799
4800 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
4801
4802 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
4803 (Option Cross Key): Likewise.
4804
4805 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
4806 next to an item whose dot is not at the end of the RHS even if it
4807 happens to be associated with the same rule.
4808 * src/print.c (print_core): Likewise.
4809 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
4810 (Resolved SR Conflicts): Update output.
4811 * tests/regression.at (Extra lookahead sets in report): New test case.
4812
4813 2007-10-11 Wojciech Polak <polak@gnu.org>
4814
4815 * src/print-xml.c (print_core): Remove item set
4816 redundancy.
4817 * data/xslt/bison.xsl (bison:ruleNumber): New key.
4818 Improve processing time. Suggested by Joel E. Denny.
4819 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
4820 Write xsl:param "required" attribute as comment.
4821 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
4822 (xsl:template match="rule"): Support new reduced itemset.
4823 (xsl:template match="point"): Remove.
4824 * data/xslt/xml2xhtml.xsl: Likewise.
4825
4826 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4827
4828 * src/getargs.c (version): Update copyright year.
4829
4830 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
4831
4832 Make xml2dot.xsl and --graph produce the same output.
4833 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
4834 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
4835 escaped later.
4836 (xsl:template name="output-node"): Use the new escape template instead
4837 of the string-replace template directly.
4838 (xsl:template name="output-edge"): Likewise.
4839 (xsl:template name="escape"): New, escapes backslashes and newlines in
4840 addition to quotation marks.
4841 * src/graphviz.c (start_graph, output_node, output_edge): Add
4842 whitespace to output for legibility.
4843
4844 Make xml2text.xsl and --report produce the same output, and remove the
4845 XML "conflicts" element since a conflict summary is easily extracted
4846 from the automaton.
4847 * data/xslt/bison.xsl: New.
4848 (xsl:template match="state" mode="bison:count-conflicts): New.
4849 * data/xslt/xml2text.xsl: Import bison.xsl.
4850 (xsl:template match="bison-xml-report"): Instead of styling the
4851 "conflicts" element, style the "automaton" element with mode
4852 "conflicts". Unlike the former, the latter lists S/R and R/R
4853 conflicts for a state on the same line.
4854 (xsl:template match="conflicts"): Remove.
4855 (xsl:template match="conflict"): Remove.
4856 (xsl:template match="terminal"): Line-wrap the list of rules in which
4857 the terminal is used.
4858 (xsl:template match="nonterminal"): Likewise for nonterminals.
4859 (xsl:template match="automaton" mode="conflicts"): New.
4860 (xsl:template match="state" mode="conflicts"): New.
4861 (xsl:template name="line-wrap"): New.
4862 (xsl:template name="ws-search"): New.
4863 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
4864 (xsl:template match="bison-xml-report"): Instead of styling the
4865 "conflicts" element, style the "automaton" element with mode
4866 "conflicts."
4867 (xsl:template match="conflicts"): Remove.
4868 (xsl:template match="conflict"): Remove.
4869 (xsl:template match="automaton" mode="conflicts"): New.
4870 (xsl:template match="state" mode="conflicts): New.
4871 * src/conflicts.c (conflicts_output_xml): Remove.
4872 * src/conflicts.h (conflicts_output_xml): Remove prototype.
4873 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
4874 * src/print.c (print_grammar): Consistently wrap at the 66th column so
4875 the corresponding XSLT is easier. Also, never wrap between a word and
4876 the comma that follows it.
4877
4878 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4879
4880 Improve C++ namespace support. Discussed starting at
4881 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
4882 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
4883 b4_namespace_close): New macros that interpret the %define variable
4884 "namespace" so its value can contain "::" to indicate nested
4885 namespaces.
4886 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
4887 the above macros.
4888 * data/lalr1.cc (b4_namespace): Likewise.
4889 * data/location.cc (b4_namespace): Likewise.
4890 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
4891 inside a new table in the general %define entry. Document `%define
4892 namespace' there as well. Point the %name-prefix entry to it since it
4893 explains it more completely in the case of C++.
4894 (C++ Bison Interface): Mention `%define namespace' instead of
4895 %name-prefix.
4896 (Table of Symbols): Remove the `%define push_pull' entry. The %define
4897 entry suffices.
4898 * tests/c++.at (Relative namespace references): New test case.
4899 (Absolute namespace references): New test case.
4900 (Syntactically invalid namespace references): New test case.
4901 * tests/input.at (C++ namespace reference errors): New test case.
4902
4903 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
4904
4905 Add syncline support and location accessor to internal %define
4906 interfaces.
4907 * data/bison.m4 (b4_percent_define_get_loc): New.
4908 (b4_percent_define_get_syncline): New.
4909 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
4910 (b4_percent_define_default): Record defining location as line 1 rather
4911 than 0 for the sake of synchronizing #line's, and define
4912 b4_percent_define_syncline(VARIABLE).
4913 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
4914 * src/muscle_tab.c (muscle_syncline_grow): New.
4915 (muscle_code_grow): Use muscle_syncline_grow.
4916 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
4917 define b4_percent_define_syncline(VARIABLE).
4918 (muscle_percent_define_get_loc): New.
4919 (muscle_percent_define_get_syncline): New.
4920 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
4921 remove some unused variables.
4922 (muscle_percent_define_default): Record defining location as line 1
4923 rather than 0 for the sake of synchronizing #line's, and define
4924 b4_percent_define_syncline(VARIABLE).
4925 (muscle_percent_define_check_values): Use
4926 muscle_percent_define_get_loc.
4927 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
4928 (muscle_percent_define_get_syncline): Prototype.
4929 * tests/skeletons.at (%define Boolean variables: invalid skeleton
4930 defaults): Update output for location change.
4931 (Complaining during macro argument expansion): Extend to test
4932 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
4933
4934 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
4935
4936 Fix some error-reporting macro bugs.
4937 * data/bison.m4 (b4_cat): New.
4938 (b4_error, b4_error_at): Use b4_cat to send error directives directly
4939 to stdout so they don't become arguments to other macros. Update
4940 comments and add examples.
4941 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
4942 add examples.
4943 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
4944 after printing the error directive so that M4 doesn't report subsequent
4945 problems that are induced by this problem.
4946 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
4947 instead of just in them. Recognize @\n in both places. Both expand to
4948 the empty string. Needed by b4_cat.
4949 * tests/skeletons.at (Complaining during macro argument expansion):
4950 New test case.
4951 (Fatal errors make M4 exit immediately): New test case.
4952
4953 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
4954
4955 Implement --print-datadir.
4956 * src/getargs.c (usage): Mention.
4957 (PRINT_DATADIR_OPTION): New anonymous enum member.
4958 (long_options): Add entry for it.
4959 (getargs): Add case for it calling compute_pkgdatadir.
4960 * src/output.c (output_skeleton): Encapsulate data directory
4961 computation from here...
4962 (prepare): ... and from here...
4963 (compute_pkgdatadir): ... into this new function.
4964 * src/output.h (compute_pkgdatadir): Prototype.
4965
4966 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
4967
4968 * src/print-xml.c (escape_bufs): New static global variable
4969 replacing...
4970 (xml_escape_n): ... the static local variable buf here.
4971 (print_xml): Free memory for escape_bufs.
4972 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
4973
4974 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
4975
4976 Replace `%push-parser' and `%push-pull-parser' with
4977 `%define push_pull "push"' and `%define push_pull "both"'.
4978 `%define push_pull "pull"' is the default.
4979 * doc/bison.texinfo (Push Decl, Push Parser Function,
4980 Pull Parser Function, Parser Create Function, Parser Delete Function):
4981 Update declarations.
4982 (Decl Summary, Table of Symbols): Replace %push-parser and
4983 %push-pull-parser entries with a %define push_pull entry.
4984 * data/bison.m4 (b4_percent_define_check_values): New macro.
4985 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
4986 definitions...
4987 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
4988 definitions...
4989 * data/push.c: ... to here and compute them from the value of the
4990 %define variable push_pull.
4991 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
4992 parsing requests here...
4993 * data/yacc.c: ... hack this to switch to push.c any time
4994 b4_use_push_pull_flag or the %define variable push_pull is set. This
4995 will go away when we mv push.c yacc.c.
4996 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
4997 push parsing is not supported since unused %define variables are
4998 reported anyway.
4999 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
5000 * src/muscle_tab.h (muscle_percent_define_check_values): Update
5001 comments for consistency with b4_percent_define_check_values.
5002 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
5003 muscles.
5004 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
5005 Remove.
5006 (prologue_declaration): Remove %push-parser and %push-pull-parser
5007 rules.
5008 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
5009 * tests/calc.at: Update declarations.
5010 * tests/input.at (%define enum variables): New test case.
5011 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
5012 declaration.
5013 (Push Parsing: Multiple impure instances): Update declaration.
5014 (Push Parsing: Unsupported Skeletons): New test case.
5015 * tests/torture.at (Exploding the Stack Size with Alloca): Update
5016 declaration.
5017 (Exploding the Stack Size with Malloc): Update declaration.
5018
5019 2007-09-24 Wojciech Polak <polak@gnu.org>
5020
5021 Add XSLT transformations.
5022
5023 * data/xslt/xml2dot.xsl: Transform XML into DOT.
5024 * data/xslt/xml2text.xsl: Transform XML into plain text.
5025 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
5026 * data/Makefile.am (xsltdir): New variable.
5027 (dist_xslt_DATA): Add xslt/*.xsl files.
5028
5029 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
5030
5031 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
5032 Problem reported by Wojciech Polak.
5033 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
5034 (xml_printf): Undo change I made on 21 September; that is,
5035 indent 2 spaces, not 1.
5036
5037 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
5038
5039 Pacify ./configure --enable-gcc-warnings.
5040 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
5041 `char const *' instead of `char *'.
5042 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
5043 local variable `sep'.
5044
5045 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5046
5047 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
5048 elsewhere.
5049 * src/print-xml.c: Prefer "const" after types; that's more consistent.
5050 (xml_printf): Indent just 1 space for level.
5051 (e_char, xlate_char): Remove.
5052 (xml_escape_string): Rewrite to avoid undefined behavior (used
5053 storage that was freed from the stack).
5054 (xml_escape_n): Don't bother checking for subscript error.
5055
5056 2007-09-21 Wojciech Polak <polak@gnu.org>
5057
5058 Add Bison XML Automaton Report.
5059
5060 Add support for an -x option to generate an XML report.
5061 It is not documented yet.
5062 * src/print-xml.c: New file.
5063 * src/print-xml.h: Likewise.
5064 * lib/timevar.def (TV_XML): New var.
5065 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
5066 * src/conflicts.c: Include print-xml.h.
5067 (solved_conflicts_xml_obstack): New var.
5068 (log_resolution, conflicts_solve, conflicts_free):
5069 Add support for XML report.
5070 (conflicts_output_val): New function.
5071 * src/conflicts.h (conflicts_output_val): New decl.
5072 * src/files.c (spec_xml_file): New var.
5073 (compute_output_file_names, output_file_names_free): Add XML support.
5074 * src/files.h (spec_xml_file): New decl.
5075 * src/getargs.c (xml_flag): New var.
5076 (usage, short_options, long_options, getargs): Add XML support.
5077 * src/getargs.h (xml_flag): New decl.
5078 * src/gram.c: Include print-xml.h.
5079 (rule_lhs_print_xml, rule_rhs_print_xml):
5080 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
5081 New functions.
5082 * src/gram.h: Declare external ones.
5083 * src/main.c: Include print-xml.h.
5084 (main): Add XML support.
5085 * src/reduce.c: Include print-xml.h.
5086 (reduce_xml): New function.
5087 * src/reduce.h: Declare it.
5088 * src/state.c: Include print-xml.h.
5089 (state_new): Add XML support.
5090 (state_rule_lookahead_tokens_print_xml): New function.
5091 * src/state.h: Declare it.
5092 (struct state): New member solved_conflicts_xml.
5093 * src/symtab.c (symbol_class_get_string): New function.
5094 * src/symtab.h: Declare it.
5095
5096 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
5097
5098 * GNUmakefile: Switch to coreutils's version.
5099 * bootstrap: Likewise.
5100 * Makefile.cfg: Adjust to new GNUmakefile.
5101 * README-hacking: Likewise.
5102
5103 Import from gnulib:
5104
5105 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
5106 Bruno Haible <bruno@clisp.org>
5107
5108 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
5109 and is a script that invokes bison. Tighten the code. Add comments.
5110
5111 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
5112
5113 Spell "boolean" as "Boolean". Reported by Akim Demaille.
5114 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
5115 * doc/bison.texinfo (Decl Summary): Fix.
5116 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
5117 * tests/input.at (Boolean %define variables): Update output.
5118 * tests/skeletons.at (%define boolean variables: invalid skeleton
5119 defaults): Rename to...
5120 (%define Boolean variables: invalid skeleton defaults): ... this and
5121 update output.
5122
5123 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
5124
5125 In impure push mode, don't allow more than one yypstate to be allocated
5126 since multiple impure parsers would corrupt yynerrs.
5127 * data/push.c (yypstate_allocated): New static global variable
5128 initialized to 0.
5129 (yypull_parse): If yypstate_new returns 0, don't report it as memory
5130 exhaustion if yypstate_allocated is 1, but still return 2.
5131 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
5132 already 1. Otherwise, set it to 1.
5133 (yypstate_delete): Set it to 0.
5134 * tests/push.at (Push Parsing: Multiple impure instances): New test
5135 case.
5136
5137 2007-08-17 Bob Rossi <bob@brasko.net>
5138
5139 * doc/bison.texinfo (Push Decl): Document the push parser.
5140 (Table of Symbols): Ditto.
5141 (Pure Decl): Ditto.
5142 (Decl Summary): Ditto.
5143 (Multiple Parsers, Push Parser Function, Pull Parser Function,
5144 Parser Create Function, Parser Delete Function):
5145 Add new push parser symbols.
5146 (Table of Symbols): Document push-parser, push-pull-parser,
5147 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
5148
5149 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
5150
5151 Update to GPLv3.
5152 * doc/gpl-3.0.texi: New file.
5153 * doc/gpl.texi: Remove.
5154 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
5155 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
5156 * README-hacking, TODO, bootstrap, bootstrap.conf:
5157 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
5158 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
5159 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
5160 * data/lalr1.cc, data/lalr1.java, data/location.cc:
5161 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
5162 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
5163 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
5164 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
5165 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
5166 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
5167 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
5168 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
5169 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
5170 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
5171 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
5172 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
5173 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
5174 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
5175 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
5176 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
5177 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
5178 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
5179 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
5180 * src/complain.c, src/complain.h, src/conflicts.c:
5181 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
5182 * src/files.h, src/flex-scanner.h, src/getargs.c:
5183 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
5184 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
5185 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
5186 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
5187 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
5188 * src/print.c, src/print.h, src/print_graph.c:
5189 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
5190 * src/reduce.h, src/relation.c, src/relation.h:
5191 * src/revision.h, src/scan-code.h, src/scan-code.l:
5192 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
5193 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
5194 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
5195 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
5196 * tests/Makefile.am, tests/actions.at, tests/c++.at:
5197 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
5198 * tests/existing.at, tests/glr-regression.at:
5199 * tests/headers.at, tests/input.at, tests/java.at:
5200 * tests/local.at, tests/output.at, tests/push.at:
5201 * tests/reduce.at, tests/regression.at, tests/sets.at:
5202 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
5203 * tests/torture.at:
5204 Update to GPLv3.
5205
5206 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5207
5208 Get rid of broken %no-parser, -n, and --no-parser implementation and
5209 documentation.
5210 * TODO: Don't mention them.
5211 * doc/bison.1: Likewise.
5212 * doc/bison.texinfo (Decl Summary): Likewise.
5213 (Bison Options): Likewise.
5214 (Option Cross Key): Likewise.
5215 * src/getargs.c (no_parser_flag): Remove global variable.
5216 (usage): Don't print description of -n and --no-parser.
5217 (long_options): Remove --no-parser entry here.
5218 (getargs): Remove -n case in the switch here.
5219 * src/getargs.h (no_parser_flag): Remove extern.
5220 * tests/regression.at (Web2c Actions): Remove comment that mentions
5221 --no-parser.
5222
5223 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
5224
5225 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
5226 name user variables starting with `yy'. Just pass NULL instead of a
5227 dummy local &yylval to yypush_parse.
5228 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
5229 starting with `yy'.
5230
5231 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
5232
5233 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
5234 true since it's then always used regardless of whether yyoverflow is
5235 defined. Reported by Christian Burger at
5236 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
5237 * THANKS: Add Christian Burger.
5238
5239 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5240 node names: say "Decl Summary" not "Bison Declaration Summary".
5241
5242 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
5243
5244 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
5245 determine whether this function has already complained about an invalid
5246 value for a %define boolean variable, don't check whether Bison has
5247 ever examined the value. As written, the check was a tautology.
5248 Instead, record and check for this complaint using a separate muscle.
5249
5250 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
5251
5252 Fix push parsing memory leak reported by Brandon Lucia at
5253 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
5254 * THANKS: Add Brandon Lucia.
5255 * data/push.c (yypstate_delete): Free the stack if it was reallocated
5256 but the parse never completed and thus freed it.
5257 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
5258 * tests/testsuite.at: Include push.at.
5259 * test/push.at: New.
5260 (Push Parsing: Memory Leak for Early Deletion): New test case.
5261
5262 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
5263
5264 Improve handling of multiple S/R conflicts in the same state and of S/R
5265 conflicts involving multiple reductions.
5266 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
5267 set for a state here or Bison will abort if it is reassigned on a
5268 later conflicted reduction in the same state.
5269 Similarly, don't finalize and assign the solved conflicts report here
5270 or it will be lost if it is reassigned on a later conflicted reduction
5271 in the same state.
5272 (set_conflicts): Instead, assign them both here after all S/R conflicts
5273 in the state have been fully examined.
5274 * src/print.c (shift_set): Rename to...
5275 (no_reduce_set): ... this.
5276 (print_reductions): Update for rename, and add %nonassoc error action
5277 tokens to no_reduce_set so that, when printing the first remaining
5278 reduction on an error action token, the reduction is enclosed in
5279 brackets.
5280 (print_results): Update for rename.
5281 * tests/conflicts.at (Solved conflicts report for multiple reductions
5282 in a state): New test case.
5283 (%nonassoc error actions for multiple reductions in a state): New test
5284 case.
5285
5286 * src/main.c (main): Don't depend on C99 features.
5287
5288 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
5289
5290 * build-aux/.cvsignore: Add compile.
5291 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
5292 uniwidth.
5293
5294 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
5295
5296 * bootstrap (slurp): Create target directories that don't exist.
5297 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
5298
5299 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
5300
5301 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
5302 than item number.
5303 * closure.c (closure): Likewise.
5304 * state.h (reductions): Comment sorting of rules.
5305 (state): Comment sorting of items.
5306
5307 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
5308
5309 Fix C++ test cases after recent Gnulib changes. Discussed starting at
5310 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
5311 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
5312 definition in order to avoid Gnulib headers since we don't use config.h
5313 here.
5314 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
5315 rather than AT_DATA so that config.h is included.
5316
5317 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
5318
5319 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
5320 instead of fprintf. Guard these functions with #if YYDEBUG instead of
5321 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
5322 and so that YYFPRINTF is guaranteed to be defined here.
5323
5324 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
5325
5326 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
5327 with...
5328 (muscle_percent_define_check_values): ... this more helpful function.
5329 Again, it's not used yet, but it will be.
5330 * src/muscle_tab.h: Likewise.
5331
5332 Improve some comments in parser table construction.
5333 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
5334 (generate_states): Don't mention ruleset, which is internal to closure.
5335 * src/closure.c (closure): Explain sorting of core and itemset, which
5336 is required for this function to behave correctly.
5337 * src/closure.h (closure): Mention sorting.
5338
5339 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
5340
5341 * src/lalr.c (state_lookahead_tokens_count): For code readability,
5342 move the check for disabled transitions to an aver since conflict
5343 resolution hasn't happened yet.
5344
5345 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
5346 labels a state as inconsistent just because it has error transitions.
5347 The original form of this check appeared in revision 1.1 of lalr.c,
5348 which was committed on 1991-12-21. Now (at least), changing the
5349 consistency label on such a state appears to have no useful effect in
5350 any of the places it is examined, which I enumerate below. The key
5351 point to understanding each item in this enumeration is that a state
5352 with an error transition is labelled consistent in the first place only
5353 if it has no rules, so the check cannot matter for states that have
5354 rules. (1) Labelling a state as inconsistent will cause set_conflicts
5355 to try to identify its conflicts, and a state must have *rules* to have
5356 conflicts. (2) Labelling a state as inconsistent will affect how
5357 action_row sets the default *rule* for the state. (3) Labelling a
5358 state as inconsistent will cause build_relations to add lookback edges
5359 to *rules* in that state.
5360 * src/state.h (struct state): Word the comment for member consistent
5361 more carefully.
5362
5363 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
5364
5365 Don't depend on C99 features.
5366 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
5367 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
5368 * src/reader.c (check_and_convert_grammar): Fix for-loop.
5369 * src/state.c (state_mark_reachable_states): Fix for-loop.
5370 (state_remove_unreachable_states): Fix for-loop.
5371
5372 Don't widen struct state with member reachable just to temporarily
5373 record reachability. Instead, use a local bitset.
5374 * src/state.h (struct state): Remove member.
5375 * src/state.c (state_new): Don't initialize it.
5376 (state_mark_reachable_states): Rename to...
5377 (state_record_reachable_states): ... this, and use bitset.
5378 (state_remove_unreachable_states): Use bitset.
5379
5380 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
5381
5382 * src/Makefile.am (yacc): Quote target action commands properly so
5383 that the yacc script isn't corrupt. Reported by Hans Aberg at
5384 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
5385
5386 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
5387 the case of pure parsers. Reported by Frans Englich at
5388 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
5389 * THANKS: Add Frans Englich.
5390
5391 * NEWS (2.3a+): In the %code entry, reference section `Bison
5392 Declaration Summary' from the manual now since the %code summary has
5393 moved there.
5394 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
5395 in the rules section must be terminated by semicolons.
5396
5397 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
5398
5399 Extend the front-end API for %define variables to more completely
5400 mirror the back-end. This will be useful in the future.
5401 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
5402 Update comments to mention the new front-end counterparts of these
5403 macros.
5404 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
5405 for muscle_string_decode and muscle_location_decode.
5406 (muscle_string_decode): New static function.
5407 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
5408 (muscle_percent_define_get, muscle_percent_define_ifdef): New
5409 functions.
5410 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
5411 muscle_percent_define_get to mimic the b4_percent_define_flag_if
5412 implementation more closely.
5413 (muscle_percent_define_invalid_value): New function.
5414 * src/muscle_tab.h (muscle_percent_define_get,
5415 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
5416 Prototype.
5417
5418 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
5419
5420 * NEWS (2.3a+): Mention yesterday's state-removal change.
5421 (2.3a): Remove the %language entry, which was added after 2.3a.
5422 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
5423 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
5424 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
5425 tests/existing.at: Update copyright date.
5426
5427 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5428
5429 If conflict resolution makes states unreachable, remove those states,
5430 report rules that are then unused, and don't report conflicts in those
5431 states.
5432 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
5433 New global function.
5434 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
5435 function.
5436 * src/main.c (main): After conflict resolution, remove the unreachable
5437 states and update all data structures that reference states by number.
5438 * src/state.c (state_new): Initialize each state's reachable member to
5439 false.
5440 (state_mark_reachable_states): New static function.
5441 (state_remove_unreachable_states): New global function.
5442 * src/state.h (struct state): Add member bool reachable.
5443 (state_remove_unreachable_states): Prototype.
5444 * tests/conflicts.at (Unreachable States After Conflict Resolution):
5445 New test case.
5446 * tests/existing.at (GNU pic Grammar): Update test case output now that
5447 an unused rule is discovered.
5448
5449 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
5450
5451 Minor code cleanup in parser table construction.
5452 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
5453 (new_itemsets, save_reductions): Update for rename to nitemset.
5454 * src/closure.c (nritemset): Rename to...
5455 (nitemset): ... this since the "r" appears to meaningless and isn't
5456 used in the comments.
5457 (closure): Update for rename.
5458 * src/closure.h (nritemset): Update extern to...
5459 (nitemset): ... this.
5460 * src/lalr.c (LA): Fix a typo in comments.
5461 * src/print.c (print_core): Update for rename to nitemset.
5462 * src/print_graph.c (print_graph): Likewise.
5463 * src/state.h: Fix some typos in header comments.
5464
5465 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
5466
5467 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
5468 still sticks to ASCII. Sorry!
5469
5470 * README-hacking: New file, taken mostly from coreutils, with changes
5471 for Bison. Contains much of the contents of:
5472 * README-cvs: Remove.
5473 * bootstrap: Sync from gnulib.
5474 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
5475 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
5476
5477 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
5478
5479 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
5480 Setzer.
5481 (Java Differences): Fix some typos.
5482 * THANKS: Add Sebastian Setzer.
5483
5484 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
5485
5486 * data/java.m4 (b4_single_class_if): Remove.
5487 (b4_abstract_if): Look at "%define abstract".
5488 (b4_lexer_if): New.
5489 (b4_union_name): Rename...
5490 (b4_yystype): ... to this. Map to "%define stype".
5491 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
5492 b4_maybe_throws): Fix quoting.
5493 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
5494 * data/lalr1.java (Lexer interface): Always define.
5495 (Lexer interface within parser class): Remove.
5496 (YYLexer class): New, used when "%code lexer" is present.
5497 (constructor): When "%code lexer" is used, pass %lex-param
5498 to the lexer constructor.
5499 (yylex, yyparse): Remove %lex-param from method invocations
5500 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
5501
5502 * doc/bison.texinfo (Java Bison Interface): Mention "%define
5503 abstract". Rename "%define union_name" to "%define stype".
5504 Rename method names according to previous patch.
5505 (Java Scanner Interface): Describe "%code lexer" instead of
5506 "%pure-parser" and "%define single_class".
5507 (Java Differences): Mention "%code lexer".
5508
5509 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
5510 Include scanner here, using macros from tests/local.at.
5511 (AT_DATA_CALC_Y): Remove final argument.
5512 (_AT_CHECK_JAVA_CALC): Likewise.
5513 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
5514 of %locations and %error-verbose.
5515 (main): Test with and without %lex-param.
5516 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
5517 (AT_BISON_OPTION_POPDEFS): Pop it.
5518
5519 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5520
5521 DJGPP spefic issue. Inhibit the use of disallowed characters for
5522 file name genertion on Win98, WinXP, etc. These are |<>":?*\
5523 and concern testsuite case 46.
5524 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
5525 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
5526 * djgpp/config.bat: Inhibit the use of disallowed characters.
5527
5528 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
5529
5530 Miscellaneous %define and %code cleanup.
5531 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
5532 values are interpreted.
5533 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
5534 documentation a little more.
5535 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
5536 muscle_percent_define_insert, muscle_percent_code_grow): New
5537 functions/macros.
5538 * src/muscle_tab.h (muscle_percent_define_insert,
5539 muscle_percent_code_grow): Prototype.
5540 * src/parse-gram.y (prologue_declaration): Use
5541 muscle_percent_define_insert and muscle_percent_code_grow when parsing
5542 %define and %code directives.
5543
5544 Make it easy to share %define boolean variables between the front-end
5545 and back-end. Though not used yet, this will be useful in the future.
5546 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
5547 Bison uses of names rather than just skeleton uses of names.
5548 (b4_percent_define_get, b4_percent_define_ifdef): Rename
5549 b4_percent_define_skeleton_variables(VARIABLE) to
5550 b4_percent_define_bison_variables(VARIABLE).
5551 (b4_percent_code_get, b4_percent_code_ifdef): Rename
5552 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
5553 b4_percent_code_bison_qualifiers(QUALIFIER).
5554 (b4_check_user_names_wrap): Update for renames.
5555 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
5556 muscle_percent_define_default): New functions mimicking
5557 b4_percent_define_flag_if and b4_percent_define_default.
5558
5559 For %define variables, report locations for invalid values and
5560 redefinitions.
5561 * data/bison.m4 (b4_percent_define_flag_if): Read
5562 b4_percent_define_loc(VARIABLE) to report the location of an invalid
5563 value for VARIABLE.
5564 (b4_percent_define_default): Save a special location in
5565 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
5566 must later be reported as invalid.
5567 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
5568 functions.
5569 (muscle_percent_define_insert): Record the location of VARIABLE in
5570 muscle percent_define_loc(VARIABLE), and use it to report the previous
5571 location for a redefinition.
5572 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
5573 (muscle_percent_define_default): Update like b4_percent_define_default.
5574 (muscle_grow_user_name_list): Rename to...
5575 (muscle_user_name_list_grow): ... this for consistency and use
5576 muscle_location_grow.
5577 * src/muscle_tab.h (muscle_location_grow): Prototype.
5578 * tests/input.at (%define errors): Update expected output.
5579 * tests/skeletons.at (%define boolean variables: invalid skeleton
5580 defaults): New test case.
5581
5582 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
5583
5584 * src/print.c (lookahead_set, state_default_rule): Remove.
5585 (print_reductions): Replace state_default_rule invocation with
5586 equivalent use of yydefact, which was computed in token_actions in
5587 tables.c.
5588 (print_results): Don't allocate lookahead_set.
5589
5590 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
5591
5592 * data/lalr1.java: Prefix all private members with yy.
5593
5594 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
5595
5596 Use YYFPRINTF instead of fprintf where appropriate. Reported by
5597 Sebastien Fricker at
5598 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
5599 * THANKS: Add Sebastien Fricker.
5600 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
5601 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
5602 accept a variable number of arguments.
5603
5604 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
5605
5606 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
5607
5608 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5609
5610 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
5611 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
5612 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
5613
5614 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
5615
5616 Undo my 2007-02-07 change, switching back to the c-strcase module
5617 introduced in the 2007-02-03 change. Bruno Haible reported that
5618 the 2007-02-07 change would be dangerous in Turkish if we add a
5619 language whose name contains "i", since "i" is not lowercase "I"
5620 in Turkish.
5621 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
5622 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
5623 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
5624 * m4/.cvsignore: Remove strcase.m4.
5625 * src/getargs.c: Revert 2007-02-07 change, as follows.
5626 Include c-strcase.h.
5627 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
5628
5629 2007-02-11 Bruno Haible <bruno@clisp.org>
5630
5631 Enable the Java related testsuite tests when the only Java compiler
5632 found is a gcj < 4.3. Discussed at
5633 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
5634 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
5635
5636 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
5637
5638 * data/Makefile.am: Update copyright date.
5639 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
5640 yypstate_new returns NULL.
5641 (yypstate_new): Return NULL if malloc does.
5642 * src/reader.c (packgram): Move translation of rule actions from the
5643 beginning of packgram to...
5644 (check_and_convert_grammar): ... here right before packgram is invoked
5645 so it's easier to write more complete comments, and remove redundant
5646 code.
5647
5648 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
5649
5650 As in semantic actions, make @$ in %initial-action, %destructor, and
5651 %printer imply %locations.
5652 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
5653 scanning @$.
5654 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
5655 (@$ in %initial-action implies %locations,
5656 @$ in %destructor implies %locations,
5657 @$ in %printer implies %locations): ... these new test cases.
5658
5659 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
5660
5661 Undo most of the 2007-02-03 change, switching to the strcase module
5662 now that gnulib strcase has been fixed.
5663 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
5664 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
5665 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
5666 * m4/.cvsignore: Add strcase.m4.
5667 * src/getargs.c: Revert 2007-02-03 change, as follows.
5668 Don't include c-strcase.h.
5669 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
5670 strcasecmp has "unspecified behavior" outside the POSIX locale,
5671 but it works fine in practice if at least one argument is ASCII,
5672 as is the case in Bison.
5673
5674 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
5675
5676 * tests/java.at: Skip tests if only one of javac/java is present.
5677 Reported by Joel E. Denny.
5678 * tests/atlocal.in: Adjust copyright years.
5679
5680 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
5681
5682 * data/lalr1.java (Stack): Work around old verifiers that disallow
5683 access to the private fields of an inner class, from the outer class.
5684 We can make Stack's fields public because user code doesn't have access
5685 to the instance of Stack used by parse(). Reported by Paul Eggert.
5686
5687 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
5688
5689 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
5690 the right spot for these files?
5691 * bootstrap.conf (gnulib_modules): Add c-strcase.
5692 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
5693 c-strncasecmp.c.
5694 * src/getargs.c: Include c-strcase.h.
5695 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
5696 to avoid unspecified behavior.
5697
5698 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
5699
5700 * doc/bison.texinfo (Decl Summary): Correct typo.
5701
5702 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
5703
5704 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
5705 Complain if the value does not match empty, "true" or "false".
5706 * data/c++.m4: Adjust default definitions of %define variables.
5707 * data/java.m4: Adjust default definitions of %define variables.
5708 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
5709 to above behavior.
5710 * tests/input.at (Boolean %define variables): Test new behavior.
5711
5712 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
5713
5714 * NEWS: Mention java.
5715 * TODO: Remove things that are done.
5716 * bootstrap.conf: Add javacomp-script and javaexec-script.
5717 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
5718
5719 * data/Makefile.am: Add new files.
5720 * data/java-skel.m4: New.
5721 * data/java.m4: New.
5722 * data/lalr1.java: New.
5723
5724 * doc/bison.texinfo: Put "A Complete C++ Example" under
5725 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
5726 under Other Languages.
5727
5728 * src/getargs.c (valid_languages): Add Java.
5729 * src/getargs.h (struct bison_language): Update size of string fields.
5730
5731 * tests/Makefile.am: Add java.at.
5732 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
5733 * tests/java.at: New.
5734 * tests/testsuite.at: Include it.
5735
5736 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
5737
5738 Clean up.
5739 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
5740 at_directive_argv arguments so these no longer have to be global
5741 variables. Also, update the implementation for the following changes.
5742 (fail_for_at_directive_too_many_args,
5743 fail_for_at_directive_too_few_args): Add at_directive_name argument.
5744 (at_directive_name): Remove as at_directive_argv[0] will be used for
5745 this now.
5746 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
5747 for the directive name.
5748 (at_directive_argc, at_directive_argv): Make these local within
5749 skel_lex instead of global.
5750 (INITIAL): Update directive start action for above changes.
5751 (SC_AT_DIRECTIVE_ARG): Rename to...
5752 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
5753 (SC_AT_DIRECTIVE_SKIP_WS): Update.
5754 (scan_skel): Move yylex_destroy to...
5755 (skel_scanner_free): ... here.
5756 * tests/skeletons.at (installed skeleton file name): Rename to...
5757 (installed skeleton file names): ... this.
5758
5759 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
5760
5761 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
5762 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
5763 Summary" not "Directives".
5764 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
5765 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
5766 since the former is now the more complete one.
5767 (Prologue Alternatives): Likewise and do the same for %defines.
5768 (Table of Symbols): Add summary of %code, add summary of %define, and
5769 move full %code documentation to...
5770 (Decl Summary): ... here for consistency with other entries in these
5771 sections.
5772 Move %define entry in order to keep this list alphabetized.
5773 Reword %define entry a little to put less emphasis on the skeleton
5774 concept, which most users shouldn't have to think about.
5775
5776 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
5777
5778 Adjust to recent gnulib changes.
5779 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
5780 Add string.h, string_.h, unistd_.h, wchar_.h.
5781 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
5782 * src/system.h: Don't include <stpcpy.h>; this is now done by
5783 <string.h>.
5784
5785 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
5786
5787 Simplify implementation of unqualified %code, implement macros for
5788 uniform treatment of boolean %define flags. Document %define.
5789 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
5790 b4_percent_code_ifdef): New.
5791 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
5792 * data/c++.m4: Define default value for global_tokens_and_yystype.
5793 * data/glr.cc: Likewise.
5794 * data/location.cc: Use b4_percent_define_flag_if.
5795
5796 * doc/bison.texinfo (Decl Summary): Document %define.
5797
5798 * src/parse-gram.y (Unqualified %code): Change muscle name to
5799 b4_percent_code().
5800 (content.opt): Default to empty.
5801
5802 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5803
5804 Implement support for relative and absolute skeleton file names.
5805 Discussed starting at
5806 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
5807 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
5808 (Bison Options): Document in --skeleton entry.
5809 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
5810 full_skeleton can't necessarily hold all of pkgdatadir.
5811 If the specified skeleton file name contains a `/', don't prepend
5812 pkgdatadir.
5813 * src/parse-gram.y (prologue_declaration): If the specified skeleton
5814 file name contains a `/', prepend the grammar file directory.
5815 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
5816 * skeletons.at: New file.
5817 (relative skeleton file names): New test case.
5818 (installed skeleton file names): New test case.
5819 * tests/testsuite.at: Include skeletons.at.
5820
5821 * bootstrap: Update copyright to 2007.
5822
5823 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
5824
5825 * bootstrap: Remove occurrences of .#bootmp from the files.
5826
5827 2007-01-17 Akim Demaille <akim@epita.fr>
5828
5829 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
5830 nonterminals.
5831 Use per-type %printer.
5832
5833 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
5834
5835 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
5836 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5837 djgpp/config.site, src/files.c, src/files.h, src/main.c,
5838 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
5839 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
5840 tests/glr-regression.at, tests/input.at, tests/local.at,
5841 tests/output.at, tests/torture.at: Update copyright to 2007.
5842
5843 2007-01-16 Akim Demaille <akim@epita.fr>
5844
5845 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
5846 error code.
5847 (Calc++ Scanner): Exit with failure if we can't open the input
5848 file.
5849 Accept "-" standing for stdin.
5850 (Calc++ Top Level): Print the result only if the parsing was
5851 successful.
5852
5853 2007-01-16 Akim Demaille <akim@epita.fr>
5854
5855 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
5856
5857 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
5858 and Joel E. Denny <jdenny@ces.clemson.edu>
5859
5860 Clean up %define and %code implementation in M4 some. Most
5861 importantly, rename all related macros to be in the b4_percent_define
5862 and b4_percent_code namespaces. Also, complete support for `.' in
5863 %define variable names and %code qualifiers.
5864 * data/bison.m4 (b4_check_user_names): Check for special
5865 "SKELETON-NAMESPACE(name)" macros instead of using two nested
5866 m4_foreach loops.
5867 (b4_get_percent_define, b4_get_percent_code): Rename to...
5868 (b4_percent_define_get, b4_percent_code_get): ... these.
5869 Extend documentation with examples.
5870 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
5871 b4_percent_define_skeleton_variables and
5872 b4_percent_code_skeleton_qualifiers.
5873 Expect any value for the %define variable `foo' to be stored in the
5874 macro named `b4_percent_define(foo)'; expect any %code blocks for the
5875 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
5876 expect any unqualified %code blocks to be stored in a macro named
5877 `b4_percent_code_unqualified'.
5878 Use m4_indir so that %define variable names and %code qualifiers can
5879 contain `.', which is allowed by the grammar parser.
5880 (b4_percent_define_default): New macro to set a default value for a
5881 %define variable.
5882 (m4_wrap): Update wrapped code, and fix some underquoting.
5883 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
5884 Expect grammar uses of %define variables and %code qualifiers to be
5885 defined in b4_percent_define_user_variables and
5886 b4_percent_code_user_qualifiers.
5887 * data/c++.m4: Use b4_percent_define_default rather than
5888 m4_define_default. Fix some underquoting. Skeleton usage of %define
5889 variable define_location_comparison now implies skeleton usage of
5890 %define variable filename_type.
5891 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
5892 data/push.c, data/yacc.c: Update macro names.
5893 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
5894 muscle names.
5895
5896 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5897
5898 DJGPP specific issues.
5899
5900 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
5901 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
5902
5903 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5904
5905 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
5906 run parsers in all tests so that Valgrind is invoked during
5907 maintainer-check-valgrind.
5908 (Duplicate representation of merged trees): Free all semantic values.
5909 (Duplicated user destructor for lookahead): Likewise.
5910
5911 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5912
5913 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
5914 command-line prefix.
5915 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
5916 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
5917 miss Valgrind messages.
5918 (Exploding the Stack Size with Malloc): Likewise.
5919
5920 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
5921
5922 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
5923 locals. Reported by Juan Manuel Guerrero at
5924 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
5925 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
5926 Fix some indentation also.
5927 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
5928 explaining this issue.
5929
5930 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
5931 and Joel E. Denny <jdenny@ces.clemson.edu>
5932
5933 Simplify union and prologue handling, and escape union and lex/parse
5934 params with digraphs.
5935 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
5936 values to the empty string since these are no longer guaranteed
5937 initialized by the front-end.
5938 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
5939 braces around b4_user_stype since this is no longer done by the
5940 front-end.
5941 * src/files.c, src/files.h (pre_prologue_obstack,
5942 post_prologue_obstack): Remove.
5943 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
5944 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
5945 with digraphs. This fixes lex params and parse params.
5946 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
5947 * src/output.c (prepare): Remove muscle insertion of the prologues.
5948 (output): Remove freeing of pre_prologue_obstack and
5949 post_prologue_obstack.
5950 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
5951 than prologue_augment for prologue parsing so you don't need prologue
5952 obstacks.
5953 (grammar_declaration): For %union RHS, use `braceless' instead of
5954 "{...}" so that braces are already stripped and code is escaped with
5955 digraphs.
5956 * src/reader.c (prologue_augment): Remove.
5957 (reader): Remove initialization of pre_prologue_obstack and
5958 post_prologue_obstack.
5959 * src/reader.h (prologue_augment): Remove.
5960
5961 * data/c.m4: Remove stray parenthesis.
5962
5963 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5964
5965 Remove quotes from variables names in %define directives and from
5966 qualifiers in %code directives, and restrict the characters that are
5967 allowed in them to M4-friendly ones. For %define, continue to support
5968 the quoted form as a deprecated feature. Discussed starting at
5969 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
5970 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
5971 %code.
5972 * doc/bison.texinfo (Prologue Alternatives): Update.
5973 (Decl Summary): In %defines entry, update mention of `%code requires'
5974 and `%code provides'.
5975 (C++ Location Values): Update %define uses.
5976 (Calc++ Parser Interface): Likewise.
5977 (Calc++ Parser): Likewise, and update `%code requires' uses.
5978 (Table of Symbols): Update %code documentation.
5979 * src/parse-gram.y (prologue_declaration): For %define variables, use
5980 `variable' instead of `STRING'.
5981 (grammar_declaration): For %code qualifiers, use `ID' instead of
5982 `STRING'.
5983 (variable): New nonterminal that takes an `ID' or a `STRING'.
5984 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
5985 and %define uses.
5986 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
5987 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
5988 (%define errors): Update %define uses.
5989
5990 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5991
5992 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
5993 instead of muscle_insert for %define values so that M4-special
5994 characters are replaced with digraphs.
5995 * tests/input.at (%define errors): Extend to check weird values.
5996
5997 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5998
5999 Instead of having skeletons declare all valid %define variables and
6000 %code qualifiers, provide macros that retrieve the associated values
6001 and build these lists automatically. Thus Bison will now warn when a
6002 variable or qualifier is not used by the skeleton in the current
6003 invocation regardless of whether it might sometimes be used by that
6004 skeleton in other invocations. Also, move all %define value macros to
6005 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
6006 form, which is replaced by %code.
6007 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
6008 (b4_check_user_names): ... this, and change the series of valid name
6009 arguments to a single list argument for names used in the skeleton
6010 similar to the existing list argument for names used in the grammar.
6011 Warn instead of complaining.
6012 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
6013 values and %code code, to format %code code properly, and to build
6014 lists of all %define variables and %code qualifiers used in the
6015 skeleton: b4_skeleton_percent_define_variables and
6016 b4_skeleton_percent_code_qualifiers.
6017 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
6018 Remove, and...
6019 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
6020 the skeleton names lists can finish building first. In place of
6021 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
6022 expect the lists b4_user_percent_define_variables and
6023 b4_user_percent_code_qualifiers.
6024 * data/c++.m4: Where setting default values for b4_parser_class_name,
6025 b4_location_type, b4_filename_type, b4_namespace, and
6026 b4_define_location_comparison, update their names to the
6027 b4_percent_define_ namespace.
6028 * data/glr.c: Don't use b4_check_percent_define_variables and
6029 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6030 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
6031 (b4_parser_class_name, b4_namespace): Define these using
6032 b4_get_percent_define for parser_class_name and namespace.
6033 * data/location.cc: Use b4_get_percent_define.
6034 * data/push.c: Don't use b4_check_percent_define_variables and
6035 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
6036 * data/yacc.c: Likewise, and don't call m4_exit in
6037 b4_use_push_for_pull_if or m4_wrap code will never execute.
6038 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
6039 Rename to...
6040 (muscle_grow_user_name_list): ... this for consistency with the
6041 terminology used in bison.m4.
6042 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
6043 %define variable names, and rename muscle used_percent_define_variables
6044 to user_percent_define_variables.
6045 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
6046 user_percent_code_qualifiers.
6047 (content): Remove.
6048 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
6049 {CODE} form is no longer accepted.
6050 * tests/input.at (Reject bad %code qualifiers): Rename to...
6051 (Reject unused %code qualifiers): ... this, and update test output.
6052 (%define error): Update test output.
6053
6054 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
6055
6056 Check for unrecognized %define variables similar to checking for
6057 unrecognized %code qualifiers. Check for redefined %define variables.
6058 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
6059 generalizes...
6060 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
6061 (b4_check_percent_define_variables): New, also wraps it.
6062 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
6063 variables using b4_check_percent_define_variables.
6064 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
6065 all those exercised in the test suite and all those listed in the
6066 `Default values' section of c++.m4. Are there others?
6067 * data/push.c, data/yacc.c: Declare no valid %define variables.
6068 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
6069 similar to muscle_find, but it works even when the muscle stores a
6070 const value.
6071 (muscle_grow_used_name_list): New function for constructing the used
6072 name list muscles that b4_check_for_unrecognized_names requires.
6073 * src/parse-gram.y (prologue_declaration): Warn if a variable is
6074 %define'd more than once. Define the b4_used_percent_define_variables
6075 muscle with muscle_grow_used_name_list.
6076 (grammar_declaration): Abbreviate %code code with
6077 muscle_grow_used_name_list.
6078 * tests/input.at (%define errors): New.
6079
6080 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6081
6082 Provide warn_at, complain_at, and fatal_at function callbacks to the
6083 skeletons, and use this for %code qualifier complaints.
6084 * data/bison.m4 (b4_error_at): New, invoked by...
6085 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
6086 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
6087 @fatal_at(...@) directives.
6088 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
6089 qualifiers in b4_used_percent_code_qualifiers and to use
6090 b4_complain_at.
6091 * src/location.c, src/location.h (boundary_set_from_string): New global
6092 function.
6093 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
6094 function.
6095 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
6096 to b4_used_percent_code_qualifiers.
6097 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
6098 function.
6099 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
6100 (lineno): Rename to...
6101 (out_lineno): ... this so I don't misunderstand it again.
6102 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
6103 here; these newlines are in the input but not the output file.
6104 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
6105 (at_directive_perform): ... this new static function, and add handling
6106 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
6107 directives.
6108 * tests/input.at (Reject bad %code qualifiers): Update test output with
6109 locations and extend.
6110
6111 * tests/output.at (Output file name: [, Output file name: ]): Remove
6112 bogus comment about these tests failing.
6113
6114 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
6115
6116 Clean up b4_check_percent_code_qualifiers a little.
6117 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
6118 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
6119 documentation and add examples.
6120 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
6121 qualifiers here.
6122
6123 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
6124
6125 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
6126 unreliable -- especially when they're hidden inside another macro.
6127 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
6128 data/c.m4: Remove m4_divert(-1).
6129 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
6130 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
6131 m4_divert_push(0) and m4_divert_pop(0).
6132 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
6133 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
6134 pushed and popped by m4sugar, should be first on the stack.
6135
6136 Provide warn, complain, and fatal function callbacks to the skeletons.
6137 This provides more flexibility than m4_fatal, improves the error
6138 message format, and captures messages for translation. Discussed
6139 starting at
6140 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
6141 * data/bison.m4 (b4_error): New, invoked by...
6142 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
6143 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
6144 directives. Because these M4 macros might be called when the current
6145 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
6146 the previous removal of uses of m4_divert, which caused trouble.
6147 (b4_check_percent_code_qualifiers): Use b4_complain instead of
6148 m4_fatal to report unrecognized %code qualifiers.
6149 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
6150 push parser requests.
6151 * data/glr.c: Use b4_complain instead of m4_fatal to report
6152 non-deterministic push parser requests.
6153 Update @output usage to @output(...@) form.
6154 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
6155 report missing %defines. Update @output usage to @output(...@) form.
6156 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
6157 @output(...@) form.
6158 * src/main.c (main): Invoke skel_scanner_free.
6159 * src/scan-skel.h (skel_scanner_free): Prototype new function.
6160 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
6161 obstack_for_string from flex-scanner.h.
6162 (YY_DECL): Use to declare skel_lex static.
6163 (decode_at_digraphs): Remove; now handled in the new
6164 SC_AT_DIRECTIVE_ARG start condition.
6165 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
6166 functions.
6167 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
6168 at_directive_argv): New static globals.
6169 (INITIAL): Use fail_for_invalid_at.
6170 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
6171 recognize the start of a generalized `@directive(...@)' form and
6172 start...
6173 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
6174 directive args (using the new obstack_for_string), to decode the
6175 contained @ diagraphs, and to perform the directive. It recognizes
6176 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
6177 @output(...@).
6178 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
6179 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
6180 `@,'.
6181 (scan_skel): Initialize obstack_for_string on the first call.
6182 (skel_scanner_free): New function to free obstack_for_string.
6183 * tests/input.at (Reject bad %code qualifiers): Update test output.
6184
6185 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
6186
6187 Consolidate the 4 prologue alternative directives (%code, %requires,
6188 %provides, and %code-top) into a single %code directive with an
6189 optional qualifier field. Discussed at
6190 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
6191 * NEWS (2.3a+): Rewrite the existing entry for the prologue
6192 alternatives.
6193 * doc/bison.texinfo (Prologue Alternatives): Update.
6194 (Decl Summary): Update to %code "requires" and %code "provides".
6195 (Calc++ Parser): Update to %code "requires".
6196 (Table of Symbols): Remove entries for %requires, %provides, and
6197 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
6198 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
6199 are replaced by b4_percent_code_provides and b4_percent_code_requires,
6200 which are skeleton-specific.
6201 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
6202 declare what %code qualifiers it supports and to complain if any other
6203 qualifiers were used in the grammar.
6204 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
6205 and b4_user_code([b4_percent_code_provides]) in place of
6206 b4_user_requires and b4_user_provides.
6207 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
6208 Add b4_user_code([b4_percent_code_top]) and
6209 b4_user_code([b4_percent_code]).
6210 Invoke b4_check_percent_code_qualifiers.
6211 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6212 PERCENT_REQUIRES): Remove.
6213 (grammar_declaration): Remove RHS's for %code-top, %provides, and
6214 %requires. Rewrite the %code RHS as the unqualified form defining the
6215 muscle b4_percent_code. Add another RHS for the qualified %code form,
6216 which defines muscles of the form b4_percent_code_QUALIFIER and the
6217 b4_used_percent_code_qualifiers muscle.
6218 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
6219 PERCENT_REQUIRES): Remove.
6220 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
6221 %code "requires" and %code "provides".
6222 * tests/input.at (Reject bad %code qualifiers): New.
6223
6224 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6225
6226 Use the new code_props interface for destructors and printers.
6227 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
6228 printer_location members, and change the type of the destructor and
6229 printer members to code_props.
6230 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
6231 symbol_printer_get, semantic_type_destructor_set,
6232 semantic_type_printer_set, default_tagged_destructor_set,
6233 default_tagless_destructor_set, default_tagged_printer_set,
6234 default_tagless_printer_set): Use code_props in arguments and return
6235 types in place of char const * and location.
6236 (symbol_destructor_location_get, symbol_printer_location_get): Remove
6237 since the locations are now contained in the return of
6238 symbol_destructor_get and symbol_printer_get.
6239 * src/output.c (symbol_destructors_output, symbol_printers_output):
6240 Replace with...
6241 (symbol_code_props_output): ... this to eliminate duplicate code.
6242 (output_skeleton): Update to use symbol_code_props_output.
6243 * src/reader.c (symbol_should_be_used): Update use of
6244 symbol_destructor_get.
6245 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
6246 Update uses of the various _destructor_set and _printer_set functions.
6247 * src/symtab.c: (default_tagged_destructor_location,
6248 default_tagless_destructor_location, default_tagged_printer_location,
6249 default_tagless_printer_location): Remove since we...
6250 (default_tagged_destructor, default_tagless_destructor,
6251 default_tagged_printer, default_tagless_printer): ... change the type
6252 of these to code_props.
6253 (symbol_new, semantic_type_new, symbol_destructor_set,
6254 semantic_type_destructor_set, symbol_destructor_get,
6255 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
6256 symbol_check_alias_consistency, default_tagged_destructor_set,
6257 default_tagless_destructor_set, default_tagged_printer_set,
6258 default_tagless_printer_set): Update.
6259 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
6260 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
6261 code_props members.
6262 (symbol_print): Use SYMBOL_CODE_PRINT.
6263
6264 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
6265
6266 Use the new code_props interface for rule actions.
6267 * src/symlist.h (symbol_list): Replace action, action_location, and
6268 used members with a code_props action_props member.
6269 * src/reader.c (symbol_should_be_used, grammar_rule_check,
6270 grammar_midrule_action, grammar_current_rule_merge_set,
6271 grammar_current_rule_symbol_append, packgram): Update.
6272 * src/scan-code.h (translate_rule_action): Remove, no longer used.
6273 * src/scan-code.l (handle_action_dollar): Update.
6274 (translate_rule_action): Remove, no longer used.
6275 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
6276
6277 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6278
6279 Use the new code_props interface in parse-gram.y.
6280 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
6281 Update all uses of translate_* functions to use the new code_props
6282 interface and to use gram_scanner_last_string_free and
6283 code_scanner_last_string_free where possible.
6284 (grammar_declaration): symbol_list_destructor_set and
6285 symbol_list_printer_set now perform the translation, so don't do it
6286 here. Use gram_scanner_last_string_free where possible.
6287 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
6288 translate_code): Remove, no longer used.
6289 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
6290 symbol_list_printer_set): Perform code translation here rather than
6291 depending on the caller to do so.
6292
6293 * src/symlist.h (struct symbol_list): Correct some documentation typos.
6294 * src/scan-gram.h (gram_last_string): Remove declaration.
6295 * src/scan-gram.l (last_string): Declare it static.
6296
6297 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
6298
6299 Encapsulate code properties and related functionality for the various
6300 destructors, printers, and actions into a code_props structure and
6301 interface. This patch merely implements code_props in scan-code.h and
6302 scan-code.l. Future patches will rewrite other modules to use it.
6303 Discussed starting at
6304 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
6305 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
6306 consistently initialize const structs that have an empty location
6307 field.
6308 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
6309 to ensure consistency.
6310 * src/scan-code.h (code_props): New structure.
6311 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
6312 function, macro, and const global variable for initializing a
6313 code_props with no code.
6314 (code_props_plain_init, code_props_symbol_action_init,
6315 code_props_rule_action_init, code_props_translate_code): The rest of
6316 the new code_props functional interface. Among other things, the init
6317 functions set the code_props kind field so that
6318 code_props_translate_code will know whether to behave like
6319 translate_symbol_action, translate_rule_action, or translate_code.
6320 These old translate functions must remain until all other modules are
6321 updated to use the new code_props interface.
6322 (code_scanner_last_string_free): New function similar to
6323 gram_scanner_last_string_free.
6324 (code_scanner_free): Add documentation.
6325 * src/scan-code.l: Implement the new interface.
6326 (code_lex): Make it static, add a code_props* argument, and remove the
6327 rule argument.
6328 (last_string): New static global similar to the one in scan-gram.l.
6329 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
6330 instead of rule.
6331 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
6332 code_props since Bison may one day use this information for destructors
6333 and printers.
6334 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
6335 (handle_action_dollar): Use symbol_list_n_get and set used flag
6336 directly since symbol_list_n_used_set is removed.
6337 (translate_action): Add a code_props* argument and remove the rule,
6338 action, and location arguments. Pass the code_props* on to code_lex.
6339 (translate_rule_action, translate_symbol_action, translate_code):
6340 Rewrite as wrappers around the new code_props interface.
6341 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
6342 it would eventually need to break the encapsulation of code_props.
6343
6344 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6345
6346 * etc/.cvsignore: New.
6347
6348 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
6349
6350 Add maintainer-push-check to run maintainer-check using push parsing in
6351 place of pull parsing where available.
6352 * Makefile.am (maintainer-push-check): New.
6353 * data/bison.m4 (b4_use_push_for_pull_if): New.
6354 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
6355 appropriately based on their existing values.
6356 (yypush_parse): Don't print push-parser-specific diagnostics if push
6357 parsing is being used in place of pull parsing.
6358 * data/yacc.c: If push parsing should replace pull parsing, redirect to
6359 push.c.
6360 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
6361 variable, and insert b4_use_push_for_pull_flag into muscles.
6362 * tests/Makefile.am (maintainer-push-check): New.
6363
6364 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6365
6366 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
6367 (whether successful or failed) so that yypush_parse can be invoked
6368 again to start a new parse using the same yypstate.
6369 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
6370 check multiple yypull_parse invocations on the same yypstate. For pull
6371 mode, extend to check multiple yyparse invocations.
6372 (Exploding the Stack Size with Alloca): Extend to try with
6373 %push-pull-parser.
6374 (Exploding the Stack Size with Malloc): Likewise.
6375
6376 * tests/calc.at (Simple LALR Calculator): Don't specify
6377 %skeleton "push.c" since %push-pull-parser implies that now.
6378 * tests/headers.at (export YYLTYPE): Don't check for the push
6379 declarations. Otherwise, this test case can't be used to see if push
6380 mode can truly emulate pull mode.
6381 * tests/input.at (Torturing the Scanner): Likewise.
6382 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
6383 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
6384 AT_YACC_IF, which now includes the case of push mode since %skeleton
6385 need not be used for push mode. This will be more intuitive once
6386 push.c is renamed to yacc.c.
6387
6388 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
6389
6390 For push mode, convert yyparse from a macro to a function, invoke yylex
6391 instead of passing a yylexp argument to yypull_parse, and don't
6392 generate yypull_parse or yyparse unless %push-pull-parser is declared.
6393 Discussed starting at
6394 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
6395 * data/bison.m4 (b4_pull_if): New.
6396 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
6397 * data/push.c: Improve M4 quoting a little.
6398 (b4_generate_macro_args, b4_parenthesize): Remove.
6399 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
6400 any time a pull parser is requested.
6401 Don't #define this as a wrapper around yypull_parse. Instead, when
6402 both push and pull are requested, make it a function that does that
6403 same thing.
6404 (yypull_parse): If there's a b4_prefix, #define this to
6405 b4_prefix[pull_parse] when both push and pull are requested.
6406 Don't define this as a function unless both push and pull are
6407 requested.
6408 Remove the yylexp argument and hard-code yylex invocation instead.
6409 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
6410 %push-parser.
6411 * src/getargs.c (pull_parser): New global initialized to true.
6412 * getargs.h (pull_parser): extern it.
6413 * src/output.c (prepare): Insert pull_flag muscle.
6414 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
6415 (prologue_declaration): Set both push_parser and pull_parser = true for
6416 %push-pull-parser. Set push_parser = true and pull_parser = false for
6417 %push-parser.
6418 * src/scan-gram.l: Don't accept %push_parser as an alternative to
6419 %push-parser since there's no backward-compatibility concern here.
6420 Scan %push-pull-parser.
6421 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
6422 instead of %push-parser.
6423 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
6424 prototype it in the module that calls yyparse.
6425 * tests/input.at (Torturing the Scanner): Likewise.
6426 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
6427
6428 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
6429
6430 Update etc/bench.pl. Optimize push mode a little (the yyn change
6431 deserves most of the credit).
6432 * Makefile.am (SUBDIRS): Add etc subdirectory.
6433 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
6434 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
6435 yytoken, yyval, and yyloc declarations to...
6436 (yyparse or yypush_parse): ... here to improve performance. For
6437 yypush_parse invocations after the first, be sure to assign yyn its old
6438 value again.
6439 (yypstate_new): Don't bother initializing the yyresult field since the
6440 initial value isn't used.
6441 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
6442 remove the #define that, in push mode, set it to yyps->NAME.
6443 * etc/Makefile.am: New.
6444 * etc/bench.pl: Remove and build it instead from...
6445 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
6446 "tests/bison" from the build directory by default rather than just
6447 invoking "bison" from $PATH.
6448 (calc_grammar): Update push parser code: don't declare yylval globally,
6449 don't define yyparse_wrapper, and don't #define yyparse.
6450 (bench_grammar): Update to check all working combinations of yacc.c,
6451 push.c, impure, pure, pull, and push.
6452
6453 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6454
6455 For push mode, add pull wrappers around yypush_parse.
6456 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
6457 (yypull_parse): New function wrapping yypush_parse.
6458 (yyparse): New #define wrapping yypull_parse.
6459 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
6460 is declared.
6461 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
6462 prototype yylex in the module that calls yyparse, and don't prototype
6463 yyparse there. Otherwise, the yyparse expansion won't compile.
6464 * tests/input.at (Torturing the Scanner): Likewise.
6465
6466 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
6467
6468 Enable push parsers to operate in impure mode. Thus, %push-parser no
6469 longer implies %pure-parser. The point of this change is to move
6470 towards being able to test the push parser code by running the entire
6471 test suite as if %push-parser had been declared.
6472 * data/push.c (yypush_parse): For impure mode, remove the
6473 yypushed_char, yypushed_val, and yypushed_loc arguments.
6474 Instead, declare these as local variables initialized to the global
6475 yychar, yylval, and yylloc.
6476 For the first yypush_parse invocation only, restore the initial values
6477 of these global variables when it's time to read a token since they
6478 have been overwritten.
6479 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
6480 %push-parser.
6481 * tests/calc.at (Simple LALR(1) Calculator): Always declare
6482 %pure-parser along with %push-parser since this test case was designed
6483 for pure push parsers.
6484 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
6485 (AT_YACC_OR_PUSH_IF): New.
6486 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
6487 add a note that it's still wrong for some cases (as it has been for a
6488 while).
6489 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
6490 %push-parser no longer implies %pure-parser.
6491
6492 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6493
6494 Remove some unnecessary differences between the pull parser code and
6495 the push parser code. This patch enables yynerrs in push mode.
6496 * data/push.c: Reformat M4 a little.
6497 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
6498 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
6499 because push mode is on. Instead, if pure mode is on, move yynerrs
6500 to...
6501 (b4_declare_parser_state_variables): ... here.
6502 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
6503 to yyps->NAME so it can be used in yypush_parse.
6504 (yypush_parse): Don't omit uses of yynerrs in push mode.
6505
6506 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6507
6508 Fix bug such that the first pushed token's value and location are
6509 sometimes overwritten (sometimes by %initial-action) before being used.
6510 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
6511 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
6512 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
6513 more closely mimic the pull parser logic.
6514 Don't copy the pushed token to yychar, yylval, and yylloc until it's
6515 time to read a token, which is after any initialization of yylval and
6516 yylloc.
6517 (gottoken): Rename label to...
6518 (yyread_pushed_token): ... for clarity and to avoid infringing on the
6519 user namespace.
6520
6521 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
6522
6523 Rearrange initialization of the parser state variables so that the
6524 skeleton doesn't have to have a copy for pull mode and another for push
6525 mode. This patch also fixes at least a bug such that yylloc was not
6526 initialized (with b4_location_initial_line and
6527 b4_location_initial_column) upon calling yypush_parse. However, that
6528 initialization now overwrites the first token's location;
6529 %initial-action assigning @$ already did the same thing, and both bugs
6530 will be fixed in a later patch.
6531 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
6532 (b4_declare_parser_state_variables): Remove initialization of yytoken,
6533 yyss, yyvs, yyls, and yystacksize.
6534 (yypstate_new): Remove initialization of some yypstate fields: yystate,
6535 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
6536 yylsp.
6537 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
6538 yyps->NAME so it can be used in yypush_parse.
6539 (yyparse or yypush_parse): For yypush_parse, don't print the
6540 "Starting parse" diagnostic for invocations after the first.
6541 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
6542 yypush_parse, only do it for the first invocation.
6543 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
6544 initialization to occur in yypush_parse but only on the first
6545 invocation.
6546
6547 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6548
6549 * data/push.c: Add CPP guards around push parser declarations in both
6550 the header and the code file.
6551 In the code file, move the push parser declarations to the same place
6552 they appear in the header file.
6553 Clean up the M4 some, especially the inconsistent underquoting in
6554 some b4_c_function_def and b4_c_function_decl uses.
6555
6556 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6557
6558 Encapsulate the push parser state variables into an M4 macro so the
6559 push skeleton doesn't have to list them again for pull mode's yyparse.
6560 For push mode, remove yypush_parse's local equivalents of these
6561 variables to eliminate unnecessary copying between the two sets at
6562 run-time. This patch also fixes at least a bug related to multiple
6563 %initial-action invocations in push mode.
6564 * data/push.c (b4_declare_parser_variables): Rename to...
6565 (b4_declare_scanner_communication_variables): ... this for clarity and
6566 update both uses.
6567 (b4_declare_yyparse_variables): Remove and move its contents to the one
6568 spot where it was invoked.
6569 (b4_declare_parser_state_variables): New macro containing the parser
6570 state variables required by push mode.
6571 (struct yypstate): Replace all fields but yynew with
6572 b4_declare_parser_state_variables.
6573 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
6574 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
6575 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
6576 (yyparse or yypush_parse): For yyparse in pull mode, replace local
6577 parser state variable declarations with
6578 b4_declare_parser_state_variables.
6579 Don't initialize parser state variables when calling yypush_parse since
6580 yypstate_new already does that.
6581 Invoke the user's initial action only upon the first yypush_parse
6582 invocation.
6583 Remove all code that copies between the local parser state variables
6584 and the yypstate.
6585
6586 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
6587
6588 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
6589 prevent a name collision in a future patch where these names will
6590 sometimes be #define'd.
6591 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
6592 since it no longer has the same name as the existing argument.
6593 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
6594
6595 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
6596 and Joel E. Denny <jdenny@ces.clemson.edu>
6597
6598 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
6599 that the argument is case-insensitive, and there's no `=' here.
6600 For the %skeleton entry, mention that %language is better.
6601 (Bison Options): Likewise for --language and --skeleton. Move the
6602 --skeleton entry so that the `Tuning the parser' section is sorted
6603 alphabetically on long options.
6604 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
6605 %language directive in detail here; cross-reference the %language
6606 documentation instead.
6607 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
6608 `%require "2.3b"' so that the example is always up-to-date.
6609 (Table of Symbols): Add entries for %language and %skeleton.
6610 * examples/extexi (normalize): Instead of replacing every %require
6611 argument with the current Bison version, just substitute for
6612 `@value{VERSION}'. This guarantees that we're testing what actually
6613 appears in the documentation.
6614 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
6615 rather than `@VERSION@'.
6616
6617 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6618
6619 * NEWS: Reword the %language news a bit, and put it earlier.
6620
6621 * src/getargs.c (skeleton_arg): Last arg is now location const *.
6622 Rewrite to simplify the logic.
6623 (language_argmatch): Likewise.
6624 (program_name): We now own this var.
6625 * src/getargs.h (struct bison_language): Use char[] rather than
6626 const char *.
6627
6628 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
6629 Java is supported.
6630 * src/complain.c (program_name): Remove decl; no longer needed.
6631 * src/main.c (program_name): Remove; now belongs to getargs.
6632
6633 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
6634
6635 * NEWS: Document %language.
6636
6637 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
6638
6639 * data/c-skel.m4, data/c++-skel.m4: New files.
6640 * data/glr.c: Complain on push parsers.
6641
6642 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
6643 over %skeleton.
6644 (Decl Summary): Document %language and %skeleton.
6645 (Command line): Document -L.
6646
6647 * examples/extexi: Rewrite %require directive.
6648 * examples/calc++/Makefile.am: Pass VERSION to extexi.
6649
6650 * src/files.c (compute_exts_from_gc): Look in language structure
6651 for .y extension.
6652 (compute_file_name_parts): Check whether .tab should be added.
6653 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
6654 (language, skeleton_arg, language_argmatch): New.
6655 (long_options): Add --language.
6656 (getargs): Use skeleton_arg, add -L/--language.
6657 * src/getargs.h: Include location.h.
6658 (struct bison_language, language, skeleton_arg, language_argmatch): New.
6659 * src/output.c (prepare): Pick default skeleton from struct language.
6660 Don't dispatch C skeletons here.
6661 * src/parse-gram.y (PERCENT_LANGUAGE): New.
6662 (prologue_declaration): Add "%language" rule, use skeleton_arg.
6663 * src/scan-gram.l ("%language"): New rule.
6664
6665 * tests/calc.at: Test %skeleton and %language.
6666 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
6667 (AT_GLR_IF): Look for %skeleton "glr.cc".
6668 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
6669 (AT_YACC_IF): Reject %language.
6670
6671 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
6672
6673 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
6674 since it wasn't used; only the typedef name 'semantic_type' is needed.
6675 Also, omit trailing white space.
6676
6677 * bootstrap: Sync from coreutils.
6678 (gnulib_extra_files): Add build-aux/announce.gen.
6679 (slurp): Adjust .gitignore files like .cvsignore files.
6680 * build-aux/announce-gen: Remove from CVS, since bootstrap
6681 now creates this.
6682
6683 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
6684
6685 Make %push-parser imply %pure-parser. This fixes several bugs; see
6686 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
6687 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
6688 pure_parser = true.
6689 * data/push.c: Don't bother testing b4_push_if when deciding whether
6690 to expand b4_declare_parser_variables globally.
6691 (yypush_parse): Likewise in here.
6692
6693 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
6694 (yy_reduce_print): Reformat M4 for readability.
6695
6696 2006-12-15 Bob Rossi <bob@brasko.net>
6697 and Joel Denny <jdenny@ces.clemson.edu>
6698
6699 * data/push.c (yypstate): Add typedef, and update all uses of
6700 struct yypstate to just yypstate.
6701 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
6702
6703 2006-12-14 Bob Rossi <bob@brasko.net>
6704
6705 * data/push.c (yypush_parse): Declare prototype regardless of
6706 %locations option.
6707
6708 2006-12-14 Bob Rossi <bob@brasko.net>
6709
6710 * data/push.c (yyparse): Remove the prototype and the #define when in
6711 push-parser mode.
6712
6713 2006-12-13 Bob Rossi <bob@brasko.net>
6714
6715 * data/push.c (yypstate_init): Rename to...
6716 (yypstate_new): ... this and use b4_c_function_def.
6717 (yypstate_delete): New.
6718 (yypush_parse): Change parameters yynval and yynlloc to be const.
6719 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
6720 yypstate_delete functions.
6721
6722 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
6723
6724 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
6725 strange test case titles. Reported by Bob Rossi.
6726
6727 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
6728
6729 * TODO: Add pointer to Sylvain Schmitz's work on static detection
6730 of potential ambiguities in GLR grammers.
6731
6732 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
6733
6734 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
6735 `bison ', use m4_index instead of m4_substr since chopping up a string
6736 containing M4-special characters causes problems here.
6737
6738 Fix a couple of bugs related to special characters in user-specified
6739 file names, and make it easier for skeletons to compute output file
6740 names with the same file name prefix as Bison-computed output file
6741 names.
6742 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
6743 b4_parser_file_name and b4_spec_defines_file instead of
6744 @output_parser_name@ and @output_header_name@, which are now redundant.
6745 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
6746 b4_parser_file_name, b4_spec_defines_file, and the new
6747 @basename(FILENAME@) instead of @output_parser_name@ and
6748 @output_header_name@, which inappropriately escaped the file names as
6749 C string literals.
6750 * src/files.c (all_but_ext): Remove static qualifier.
6751 (compute_output_file_names): Move `free (all_but_ext)' to...
6752 (output_file_names_free): ... here since all_but_ext is needed later.
6753 * src/files.h (all_but_ext): Extern.
6754 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
6755 exactly what MUSCLE_INSERT_STRING used to do.
6756 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
6757 characters are escaped properly.
6758 * src/output.c (prepare): Define muscle file_name_all_but_ext as
6759 all_but_ext.
6760 For pkgdatadir muscle, maintain previous functionality by using
6761 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
6762 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
6763 digraphs would never be expanded. Hopefully no one has M4-special
6764 characters in his Bison installation path.
6765 * src/scan-skel.l: Don't parse @output_header_name@ and
6766 @output_parser_name@ anymore since they're now redundant.
6767 In @output, use decode_at_digraphs.
6768 Parse a new @basename command that invokes last_component.
6769 (decode_at_digraphs): New.
6770 (BASE_QPUTS): Remove unused.
6771 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
6772 (Output file name): New tests.
6773
6774 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
6775
6776 Warn about output files that are generated by the skeletons and that
6777 conflict with other output files.
6778 * data/glr.c: Don't generate the header file here when glr.cc does.
6779 * src/files.c (file_names, file_names_count): New static globals.
6780 (compute_output_file_names): Invoke output_file_name_check for files
6781 not generated by the skeletons and remove existing checks.
6782 (output_file_name_check): New function that warns about conflicting
6783 output file names.
6784 (output_file_names_free): Free file_names.
6785 * src/files.h (output_file_name_check): Declare.
6786 * src/scan-skel.l: Invoke output_file_name_check for files generated by
6787 the skeletons.
6788 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
6789 (Conflicting output files): New tests.
6790
6791 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6792
6793 * doc/bison.texinfo: Fix a couple of typos.
6794
6795 2006-12-08 Bob Rossi <bob@brasko.net>
6796
6797 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
6798 Rename to...
6799 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
6800 update all uses.
6801 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
6802 (yypush_parse): Rename yypvars argument to yyps and remove redundant
6803 local pv.
6804 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
6805 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
6806
6807 2006-12-07 Bob Rossi <bob@brasko.net>
6808 and Joel Denny <jdenny@ces.clemson.edu>
6809
6810 * data/push.c (yypvarsinit): Change return type from void* to struct
6811 yypvars*. No longer cast to void* on return.
6812 (struct yypvars): Remove yylen since it need not be remembered between
6813 yypushparse invocations.
6814 (yypushparse): Don't copy between yylen and pv->yylen.
6815
6816 2006-12-05 Bob Rossi <bob@brasko.net>
6817
6818 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
6819 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
6820 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
6821 (struct yypvars): Remove b4_declare_parser_variables.
6822 (yypvarsinit): Remove init code for removed variables.
6823 (global scope): Do not declare b4_declare_parser_variables if
6824 push or pure mode.
6825 (yypushparse): Add b4_declare_parser_variables.
6826 Init new local variables, and remove init code for removed
6827 yypvars variables.
6828 (yyparse): Delete.
6829 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
6830 and yyparse for other modes.
6831 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
6832 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
6833 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
6834 (AT_PURE_LEX_IF): True if pure or push parser.
6835
6836 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
6837
6838 Document Yacc prologue alternatives and default %destructor's and
6839 %printer's as experimental. Don't mention Java yet. Discussed at
6840 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
6841 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
6842 (2.3a): Annotate this entry to say the old forms of these features were
6843 also experimental.
6844 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
6845 Table of Symbols): Say they're experimental. Comment out any mention
6846 of Java (we'll want this back eventually).
6847
6848 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
6849
6850 Support a file name argument to %defines. Deprecate `=' in
6851 %file-prefix, %name-prefix, and %output. Discussed at
6852 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
6853 * NEWS (2.3a+): Mention.
6854 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
6855 form of %defines, and remove `=' from entries for %file-prefix,
6856 %name-prefix, and %output.
6857 * src/parse-gram.y (prologue_declaration): Implement.
6858 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
6859 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
6860 all but one occurrence of %name-prefix.
6861 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
6862 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
6863 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
6864 occurrence of each of %file-prefix and %output. Add check for %defines
6865 with argument.
6866 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
6867 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
6868 Remove the `=' from %output.
6869
6870 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
6871
6872 Don't escape $ in test case titles since Autoconf 2.61 now does that
6873 correctly.
6874 * tests/actions.at (Default %printer and %destructor are not for error
6875 or $undefined): Here.
6876 (Default %printer and %destructor are not for $accept): Here.
6877 * tests/input.at (Invalid $n and @n): Here.
6878
6879 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
6880
6881 Rename <!> to <>. Discussed starting at
6882 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
6883 * NEWS (2.3a+): Update.
6884 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
6885 Update.
6886 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
6887 * src/scan-gram.l (INITIAL): Implement.
6888 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
6889 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
6890 comment.
6891 * tests/actions.at (Default tagless %printer and %destructor,
6892 Default tagged and per-type %printer and %destructor,
6893 Default %printer and %destructor are not for error or $undefined,
6894 Default %printer and %destructor are not for $accept,
6895 Default %printer and %destructor for mid-rule values): Update.
6896 * tests/input.at (Default %printer and %destructor redeclared,
6897 Unused values with default %destructor): Update.
6898
6899 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
6900
6901 Don't let %prec take a nonterminal.
6902 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
6903 token.
6904 * tests/input.at (%prec takes a token): New test checking that %prec
6905 won't take a nonterminal.
6906
6907 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6908
6909 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
6910 it was double-quoted.
6911 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
6912 grammar is maintained with Bison's highest standards.
6913 * src/getargs.c: Fix some typos in Doxygen comments.
6914
6915 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
6916
6917 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
6918 later. Reported by Paul Eggert in
6919 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
6920 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
6921 * src/scan-code.l (translate_action): Don't bother invoking
6922 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
6923 (code_scanner_free): Instead of invoking
6924 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
6925 which frees more.
6926 * src/scan-gram.l (gram_scanner_free): Likewise.
6927 * src/scan-skel.l (scan_skel): Likewise.
6928
6929 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
6930
6931 * src/files.c (tr): Change return type to void.
6932 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
6933 has been called previously for the same key.
6934 (muscle_find): Return storage instead of value so that
6935 --enable-gcc-warnings doesn't produce warnings that the return discards
6936 const. aver that the value and storage are the same since storage
6937 could potentially be NULL when value is not.
6938 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
6939 same as 0.
6940
6941 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
6942
6943 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
6944 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
6945 us a slightly cleaner distribution, and also works.
6946 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
6947 gnulib changes.
6948
6949 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
6950 and Paul Eggert <eggert@cs.ucla.edu>
6951
6952 Don't let Bison leak memory except when it complains.
6953 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
6954 (spec_defines_file, dir_prefix): Now char *, not const char *,
6955 since they are freed.
6956 * src/files.c: Likewise.
6957 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
6958 Likewise.
6959 (tr): Now operates in-place. All uses changed.
6960 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
6961 values.
6962 (compute_file_name_parts, compute_output_file_names): Don't store
6963 read-only data in variables that will be freed.
6964 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
6965 src_extension, and header_extension.
6966 (output_file_names_free): New public function to free
6967 spec_verbose_file, spec_graph_file, spec_defines_file,
6968 parser_file_name, and dir_prefix.
6969 * src/getargs.c (getargs): Don't store read-only data in variables that
6970 will be freed.
6971 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
6972 (which previously existed but was unused), and quotearg_free.
6973 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
6974 * src/muscle_tab.c: Likewise.
6975 (muscle_entry): Make the value char const *,
6976 and add a new storage member that is char * and can be freed.
6977 (muscle_entry_free): New private function.
6978 (muscle_init): Use it instead of free.
6979 (muscle_insert, muscle_grow): Update and use new storage member.
6980 (muscle_code_grow): Free the string passed to muscle_grow
6981 since it's not needed anymore.
6982 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
6983 add a new `char *code' member.
6984 ("{...}"): Declare semantic type as code.
6985 * src/scan-code.h (translate_rule_action):
6986 (translate_symbol_action, translate_code, translate_action): Return
6987 `char const *' rather than `char *' since external code should not free
6988 these strings.
6989 * src/scan-code.l: Likewise.
6990 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
6991 which is "{...}" in the parser.
6992 * tests/Makefile.am (maintainer-check-valgrind): Set
6993 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
6994 Valgrind.
6995 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
6996 complain.
6997 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
6998 expecting a non-zero exit status sets --leak-check=summary and
6999 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
7000 this case, and we don't want to hear about it.
7001
7002 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
7003
7004 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
7005 instead of from the template, to simplify configuration a bit.
7006 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
7007 and m4/wint_t.m4, as they are needed with the latest gnulib.
7008
7009 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7010
7011 Disable unset/unused mid-rule value warnings by default, and recognize
7012 --warnings=midrule-values to enable them. Discussed starting at
7013 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
7014 * NEWS (2.3a+): Mention.
7015 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
7016 warnings): Add entry for midrule-values subargument.
7017 * src/reader.c (symbol_should_be_used): Don't return true just because
7018 the value is a set/used mid-rule value unless
7019 --warnings=midrule-values was specified.
7020 * tests/input.at (Unused values, Unused values before symbol
7021 declarations): Run tests with and without --warnings=midrule-values.
7022
7023 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
7024 than LIST_FREE directly.
7025
7026 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7027
7028 Finish implementing --warnings=error, which should not be implied by
7029 --warnings=all (or by its synonyms -W and --warnings without
7030 subarguments).
7031 * src/complain.c (set_warning_issued): New function to report that
7032 warnings are being treated as errors and to record an error if so.
7033 Invoke...
7034 (warn_at, warn): ... here.
7035 * src/getargs.c (warnings_args, warnings_types): Reorder so that
7036 "error - warnings are errors" does not appear above "all - all of the
7037 above".
7038 (getargs): For -W and --warnings without subarguments, don't let
7039 FLAGS_ARGMATCH set warnings_error in warnings_flag.
7040 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
7041
7042 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
7043
7044 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
7045 empty subargument list. For example: `bison --warnings= parser.y'.
7046
7047 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7048
7049 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
7050 the parser header file so that gcc doesn't warn.
7051
7052 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7053
7054 Split the default %destructor/%printer into two kinds: <*> and <!>.
7055 Discussed starting at
7056 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
7057 * NEWS (2.3a+): Mention.
7058 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
7059 previous change today related to mid-rules.
7060 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
7061 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
7062 (TYPE_TAG_ANY): Add as <*>.
7063 (TYPE_TAG_NONE): Add as <!>.
7064 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
7065 for <*> and <!>.
7066 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
7067 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
7068 * src/symlist.c (symbol_list_default_new): Split into tagged and
7069 tagless versions.
7070 (symbol_list_destructor_set, symbol_list_printer_set): Split
7071 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
7072 SYMLIST_DEFAULT_TAGLESS.
7073 * src/symlist.h: Update symbol_list_default*_new prototypes.
7074 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
7075 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
7076 * src/symtab.c (default_destructor, default_destructor_location,
7077 default_printer, default_printer_location): Split each into tagged and
7078 tagless versions.
7079 (symbol_destructor_get, symbol_destructor_location_get,
7080 symbol_printer_get, symbol_printer_location_get): Implement tagged
7081 default and tagless default cases.
7082 (default_destructor_set, default_printer_set): Split each into tagged
7083 and tagless versions.
7084 * src/symtab.h: Update prototypes.
7085 * tests/actions.at (Default %printer and %destructor): Rename to...
7086 (Default tagless %printer and %destructor): ... this, and extend.
7087 (Per-type %printer and %destructor): Rename to...
7088 (Default tagged and per-type %printer and %destructor): ... this, and
7089 extend.
7090 (Default %printer and %destructor for user-defined end token): Extend.
7091 (Default %printer and %destructor are not for error or $undefined):
7092 Update.
7093 (Default %printer and %destructor are not for $accept): Update.
7094 (Default %printer and %destructor for mid-rule values): Extend.
7095 * tests/input.at (Default %printer and %destructor redeclared): Extend.
7096 (Unused values with default %destructor): Extend.
7097
7098 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
7099
7100 Don't apply the default %destructor/%printer to an unreferenced midrule
7101 value. Mentioned at
7102 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
7103 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
7104 like $@n instead of just @n so that the default %destructor/%printer
7105 logic doesn't see them as user-defined symbols.
7106 (symbol_is_dummy): Check for both forms of the name.
7107 * src/reader.c (packgram): Remove the `$' from each midrule symbol
7108 name for which the midrule value is referenced in any action.
7109 * tests/actions.at (Default %printer and %destructor for mid-rule
7110 values): New test.
7111 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
7112 for change to dummy symbol names.
7113
7114 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7115
7116 Warn about unset midrule $$ if the corresponding $n is used.
7117 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
7118 $n usage.
7119 (packgram): Before invoking grammar_rule_check on any rule, make sure
7120 all actions have already been scanned in order to set `used' flags.
7121 Otherwise, checking that a midrule's $$ is set will not always work
7122 properly because the midrule check must forward-reference the midrule's
7123 parent rule.
7124 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
7125 warning.
7126
7127 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
7128
7129 More improvements to the documentation of the prologue alternatives:
7130 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
7131 Bison manual.
7132 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
7133 some text to clarify the relative importance of the new directives and
7134 to show how these directives may be viewed as code labels.
7135
7136 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
7137
7138 Similar to the recently removed %before-header, add %code-top as the
7139 alternative to the pre-prologue. Mentioned at
7140 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
7141 Also, let the prologue alternatives appear in the grammar section.
7142 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
7143 (prologue_declaration): Move the existing prologue alternatives to...
7144 (grammar_declaration): ... here and add %code-top.
7145 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
7146
7147 Clean up and extend documentation for the prologue alternatives.
7148 * NEWS (2.3a+): Describe prologue alternatives.
7149 * doc/bison.texinfo (Prologue): Move discussion of prologue
7150 alternatives to...
7151 (Prologue Alternatives): ... this new section, and extend it to discuss
7152 all 4 directives in detail.
7153 (Table of Symbols): Clean up discussion of prologue alternatives and
7154 add %code-top.
7155
7156 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
7157
7158 DJGPP specific issues.
7159
7160 * djgpp/config.bat: config.hin has been moved to lib. Adjust
7161 config.bat accordingly.
7162 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
7163 * djgpp/config.site: Likewise.
7164
7165 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
7166
7167 Replace %*-header with %provides, %requires, %code. See discussion at
7168 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
7169
7170 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
7171 (b4_user_start_header): Remove.
7172 * data/glr.c: Use new macros instead of b4_*start_header
7173 and b4_*end_header.
7174 * data/glr.cc: Likewise.
7175 * data/lalr1.cc: Likewise.
7176 * data/push.c: Likewise.
7177 * data/yacc.c: Likewise.
7178
7179 * doc/bison.texinfo: Remove %before-header, rename
7180 %{start,end,after}-header to %requires, %provides, %code.
7181
7182 * src/parse-gram.y: Likewise (also rename token names accordingly).
7183 * src/scan-gram.l: Likewise.
7184 * tests/actions.at: Likewise.
7185
7186 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
7187
7188 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
7189 Problem reported by Joel E. Denny.
7190
7191 2006-10-14 Jim Meyering <jim@meyering.net>
7192
7193 (Sync from coreutils.)
7194 Work also when the working directory (with e.g. coreutils sources)
7195 is version controlled with git, rather than CVS.
7196 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
7197 rather than CVS.
7198 In messages and comments, say e.g., "checked-out sources",
7199 rather than "CVS sources".
7200 (version_controlled_file): New function. Work for git as well as
7201 for CVS. Don't use grep's -q option.
7202 (slurp): Call it here, in place of CVS-specific code.
7203
7204 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
7205
7206 Fix testsuite for ./configure --enable-gcc-warnings:
7207 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
7208 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
7209 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
7210 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
7211 * test/regression.at (Diagnostic that expects two alternatives):
7212 Likewise.
7213
7214 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7215
7216 * bootstrap.conf (gnulib_modules): Add config-h.
7217 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
7218 worry about HAVE_CONFIG_H.
7219 * lib/abitset.c: Likewise.
7220 * lib/bitset.c: Likewise.
7221 * lib/bitset_stats.c: Likewise.
7222 * lib/bitsetv-print.c: Likewise.
7223 * lib/bitsetv.c: Likewise.
7224 * lib/ebitset.c: Likewise.
7225 * lib/get-errno.c: Likewise.
7226 * lib/lbitset.c: Likewise.
7227 * lib/subpipe.c: Likewise.
7228 * lib/timevar.c: Likewise.
7229 * lib/vbitset.c: Likewise.
7230 * lib/bitset.c: Include "bitset.h" first, to test interface.
7231 * lib/bitset_stats.c: Include "bitset_stats.h" first.
7232 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
7233 * lib/bitsetv.c: Include "bitsetv.h" first.
7234 * lib/get-errno.c: Include "get-errno.h" first.
7235 * m4/.cvsignore: Add config-h.m4.
7236 * tests/actions.at (Default %printer and %destructor for ...):
7237 Adjust expected line numbers in output to reflect removal of #if
7238 HAVE_CONFIG_H lines.
7239 * tests/glr-regression.at (Missed %merge type warnings when ...):
7240 Likewise.
7241 * tests/regression.at (Braced code in declaration in rules section):
7242 Likewise.
7243 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
7244 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
7245 Include <config.h> unconditionally.
7246
7247 * bootstrap: Sync from coreutils, as follows:
7248
7249 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7250
7251 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
7252 variable was sometimes used without being initialized. This
7253 messed up the installation of the INSTALL file in some cases.
7254
7255 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7256
7257 * bootstrap (usage, main program, symlink_to_gnulib): Add option
7258 --copy. Inspired by a suggestion from Bruno Haible.
7259
7260 2006-10-03 Jim Meyering <jim@meyering.net>
7261
7262 * bootstrap: Undo last change to this file, since now gnulib-tool
7263 sticks with the automake default in generating dependencies.
7264
7265 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
7266
7267 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
7268 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
7269
7270 * doc/bison.1: Add copyright notice.
7271
7272 * data/glr.c: Don't include <stdarg.h>; not used.
7273
7274 * NEWS: The -g and --graph options now output graphs in Graphviz
7275 DOT format, not VCG format.
7276 * doc/bison.1: Likewise.
7277 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
7278 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
7279 of this change in
7280 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
7281 * TODO: Remove Graphviz entry.
7282 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
7283 remove vcg.c, vcg.h, vcg_defaults.h.
7284 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
7285 * src/graphviz.c, src/graphviz.h: New files.
7286 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
7287 * src/files.h: Make comment more generic.
7288 * src/main.c (main): Likewise.
7289 * src/print_graph.h: Likewise.
7290 * src/getargs.c (usage): Make usage description more generic.
7291 * src/print_graph.c: Include graphviz.h rather than vcg.h.
7292 (static_graph, fgraph): Remove. All uses changed to pass
7293 arguments instead of sharing a static var.
7294 (print_core, print_actions, print_state, print_graph):
7295 Output graphviz format rather than VCG format.
7296 * tests/.cvsignore: Remove *.vcg; add *.dot.
7297 * tests/output.at: Expect *.dot files, not *.vcg files.
7298
7299 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
7300 accommodates the 2006-10-08 change.
7301
7302 2006-10-11 Bob Rossi <bob@brasko.net>
7303
7304 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
7305 (b4_yyssa, b4_yyerror_range): New macros.
7306 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
7307 (yypvarsinit): Remove init of removed fields.
7308 (yypushparse): Remove use of removed fields; use new macros instead.
7309
7310 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
7311
7312 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
7313 in a push parser. Reindent slightly to match yacc.c better.
7314
7315 2006-10-11 Bob Rossi <bob@brasko.net>
7316
7317 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
7318 yymsg_alloc fields.
7319 (yypvarsinit, yypushparse): Remove init of removed fields.
7320 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
7321
7322 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
7323
7324 * THANKS: Add Paolo Bonzini and Bob Rossi.
7325
7326 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
7327
7328 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
7329 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
7330 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
7331 b4_define_user_cde and uses): Remove.
7332 (b4_comment, b4_prefix, b4_sync_start): New.
7333 * data/bison.m4: New file, with most of the content removed from c.m4.
7334 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
7335 * src/output.c (output_skeleton): Pass bison.m4.
7336 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
7337 only if specified.
7338
7339 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
7340
7341 Fix test failure reported by Tom Lane in
7342 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
7343 and try to make such failures easier to catch in the future.
7344 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
7345 that's now the caller's responsibility.
7346 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
7347 Set yychar = YYEOF if it's negative.
7348 * tests/actions.at (yylex): Abort if asked to read past EOF.
7349 * tests/conflicts.at (yylex): Likewise.
7350 * tests/cxx-type.at (yylex): Likewise.
7351 * tests/glr-regression.at (yylex): Likewise.
7352 * tests/input.at (yylex): Likewise.
7353 * tests/regression.at (yylex): Likewise.
7354 * tests/torture.at (yylex): Likewise.
7355
7356 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
7357
7358 Fix problems with translating English-language diagnostics.
7359 * bootstrap: Fix bug introduced in recent bootstrap changes, with
7360 respect to bison-runtime pot generation. The YY_ stuff
7361 wasn't being captured.
7362 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
7363 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
7364 * runtime-po/POTFILES.in: Add data/push.c.
7365
7366 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
7367
7368 Merge bootstrap changes from coreutils.
7369
7370 2006-09-28 Jim Meyering <jim@meyering.net>
7371
7372 Automatically generated dependencies are important even
7373 when all of the sources in a directory come from gnulib.
7374 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
7375 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
7376
7377 2006-09-23 Jim Meyering <jim@meyering.net>
7378
7379 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
7380
7381 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7382
7383 * bootstrap: Add support for --force.
7384 (usage): New function. Describe usage less tersely.
7385 (CVS_only_file): New var.
7386
7387 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
7388
7389 * data/push.c (YYPUSH_MORE): Make it an enum instead.
7390 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
7391 Adjust white space and comments to match GNU style better.
7392
7393 2006-09-20 Bob Rossi <bob@brasko.net>
7394
7395 * data/push.c (yyresult_get): Remove function.
7396 (YYPUSH_MORE): Add #define.
7397 (yypushparse): Modify return value.
7398
7399 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7400
7401 * stamp-h.in: Remove; no longer needed.
7402 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
7403 Remove config.h, config.hin, intl (no longer created).
7404 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
7405 stamp-h1.
7406
7407 Sync bootstrap from coreutils, as follows:
7408
7409 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
7410
7411 * bootstrap (symlink_to_gnulib): New function.
7412 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
7413 to copies-of-gnulib.
7414 (cp_mark_as_generated, slurp, gnulib_files):
7415 Avoid making a copy if it's the same as the old version.
7416 (gnulib_files): Add support for this variable (used by Bison).
7417
7418 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
7419
7420 * src/getargs.c (usage): Rework to use conventions similar to
7421 coreutils, to make translation a bit easier and the code a bit
7422 smaller. Problem reported by Tim Van Holder.
7423
7424 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
7425
7426 Use some of gnulib's new modules, taken from coreutils.
7427
7428 * bootstrap: Sync from coreutils, except add support for gnulib_files.
7429 * bootstrap.conf: New file.
7430 (gnulib_modules): Add configmake, inttypes, unistd.
7431 (XGETTEXT_OPTIONS): Add complain, complain_at,
7432 fatal, fatal_at, warn, warn_at, unexpected_end.
7433 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
7434 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
7435 (gl_EARLY): Add.
7436 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
7437 (gl_INIT): Add
7438 (GNULIB_AUTOCONF_SNIPPET): Remove.
7439 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
7440 the pickiest.
7441 * lib/.cvsignore: Add inttypes_.h.
7442 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
7443 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
7444 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
7445 no-longer-necessary initializations.
7446 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
7447 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
7448 use the unistd module.
7449 * src/system.h: Likewise.
7450 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
7451 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
7452 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
7453 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
7454 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
7455 * src/system.h: Include inttypes.h unconditionally, now that we
7456 use the inttypes module. Don't bother to include stdint.h, since
7457 inttypes.h now does that for us.
7458 (LOCALEDIR): Remove, now that we use the configmake module.
7459 * src/getargs.c: Include configmake.h.
7460 * src/main.c: Likewise.
7461 * src/output.c: Likewise.
7462 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
7463 not from $abs_top_builddir, since config.h moved.
7464
7465
7466 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
7467 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
7468
7469 * src/parse-gram.y (symbol_declaration): Don't put statements
7470 before declarations; it's not portable to C89.
7471 * src/scan-code.l (handle_action_at): Likewise.
7472
7473 * src/scan-code.l: Always initialize braces_level; the old code
7474 left it uninitialized and therefore had undefined behavior.
7475
7476 Don't attempt to redefine 'assert', since it runs afoul of
7477 systems where standard headers (mistakenly) include <assert.h>.
7478 Instead, define and use our own alternative, called 'aver'.
7479 * src/reader.c: Don't include assert.h, since we no longer
7480 use assert.
7481 * src/scan-code.l: Likewise.
7482 * src/system.h (assert): Remove, replacing with....
7483 (aver): New function, taking a bool arg. All uses changed.
7484 * src/tables.c (pack_vector): Ensure that aver arg is bool,
7485 not merely an integer.
7486
7487 2006-09-15 Bob Rossi <bob@brasko.net>
7488
7489 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
7490 * data/c.m4 (YYPUSH): New.
7491 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
7492 * src/getargs.c (push_parser): New var.
7493 * src/getargs.h (push_parser): New declaration.
7494 * src/output.c (prepare): Add macro insertion of `push_flag'.
7495 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
7496 (prologue_declaration): Parse %push-parser.
7497 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
7498 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
7499 list of removed lines from the traces observed.
7500 (AT_CHECK_CALC_LALR): Added push parser tests.
7501
7502 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 * NEWS: Version 2.3a.
7505 * configure.ac (AC_INIT): Likewise.
7506
7507 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
7508 "#define YYSTYPE int" that caused "make maintainer-check" to fail
7509 due to header ordering dependencies. I don't know why the #define
7510 was there.
7511
7512 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
7513 runtime cost when YYDEBUG is not defined, and so that some tests
7514 that used to fail now work. Problem and initial suggestion by
7515 Paolo Bonzini.
7516 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
7517 * data/glr.cc (b4_parser_class_name):
7518 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
7519 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
7520 (yydebug_) [YYDEBUG]: New member.
7521 (yycdebug_): Now defined only if YYDEBUG.
7522 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
7523 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
7524 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
7525 if YYYDEBUG.
7526 (debug_stream, set_debug_stream, debug_level, set_debug_level):
7527 Define only if YYDEBUG.
7528 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
7529 set_debug_level.
7530 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
7531 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
7532 AT_CHECK_CALC_GLR_CC that are working now.
7533
7534 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
7535
7536 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
7537 We don't need them in glr.cc, and glr.c defines them.
7538 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
7539 assumes that defining it to anything is the same as defining
7540 it to 1. Problem reported by Paolo Bonzini.
7541
7542 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
7543
7544 * data/c.m4 (b4_null, b4_case): Define.
7545 * src/output.c (prepare_symbols): Use b4_null.
7546 (user_actions_output): Use b4_case.
7547
7548 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
7549
7550 * data/glr.c (b4_shared_declarations): Put start-header first,
7551 before any #includes that we generate, so that feature-test
7552 macros work. Problem reported by Michael Deutschmann in
7553 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7554 * data/lalr1.cc: Likewise.
7555 * doc/bison.texinfo (Prologue): Document that feature-test macros
7556 should be defined before any Bison declarations.
7557 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
7558 that depend on location.hh after, not before, Bison decls, since
7559 we now include location.hh after the first user prologue.
7560
7561 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
7562 Sander Brandenburg in
7563 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
7564 Also, fix minor white space and comment issues.
7565 (Prologue): Mention that it's better to define feature-test macros
7566 before Bison declarations. Problem reported by Michael Deutschmann.
7567
7568 * README-cvs: Fix typo: "&" should be "&&". Problem reported
7569 by Jim Meyering.
7570 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
7571 This adjusts to recent gnulib changes.
7572
7573 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7574
7575 Finish implementation of per-type %destructor/%printer. Discussed
7576 starting at
7577 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
7578 and
7579 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
7580 * NEWS (2.3+): Add a description of this feature to the default
7581 %destructor/%printer description.
7582 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
7583 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
7584 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
7585 list node contains a semantic type.
7586 * src/symtab.c, src/symtab.h: Extend with a table that associates
7587 semantic types with their %destructor's and %printer's.
7588 (semantic_type_from_uniqstr, semantic_type_get,
7589 semantic_type_destructor_set, semantic_type_printer_set): New functions
7590 composing the public interface of that table.
7591 (symbol_destructor_get, symbol_destructor_location_get,
7592 symbol_printer_get, symbol_printer_location_get): If there's no
7593 per-symbol %destructor/%printer, look up the per-type before trying
7594 the default.
7595 * tests/actions.at (Per-type %printer and %destructor): New test case.
7596 * tests/input.at (Default %printer and %destructor redeclared):
7597 Extend to check that multiple occurrences of %symbol-default in a
7598 single %destructor/%printer declaration is an error.
7599 (Per-type %printer and %destructor redeclared, Unused values with
7600 per-type %destructor): New test cases.
7601
7602 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
7603
7604 Require default %destructor/%printer to be declared using
7605 %symbol-default instead of an empty symbol list, and start working on
7606 new per-type %destructor/%printer. Discussed at
7607 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
7608 * NEWS (2.3+): Add %symbol-default to example.
7609 * bison.texinfo (Freeing Discarded Symbols): Likewise.
7610 (Table of Symbols): Add entry for %symbol-default.
7611 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
7612 (generic_symlist, generic_symlist_item): New nonterminals for creating
7613 a list in which each item is a symbol, semantic type, or
7614 %symbol-default.
7615 (grammar_declaration): Use generic_symlist in %destructor and %printer
7616 declarations instead of symbols.1 or an empty list.
7617 (symbol_declaration, precedence_declaration, symbols.1): Update actions
7618 for changes to symbol_list.
7619 * src/reader.c: Update for changes to symbol_list.
7620 * src/scan-code.l: Likewise.
7621 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
7622 * src/symlist.c, src/symlist.h: Extend such that a list node may
7623 represent a semantic type or a %symbol-default in addition to just an
7624 ordinary symbol. Add switched functions for setting %destructor's and
7625 %printer's.
7626 * tests/actions.at, tests/input.at: Add %symbol-default to all default
7627 %destructor/%printer declarations.
7628
7629 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
7630
7631 Whether the default %destructor/%printer applies to a particular symbol
7632 isn't a question of whether the user *declares* that symbol (in %token,
7633 for example). It's a question of whether the user by any means
7634 *defines* the symbol at all (by simply using a char token, for
7635 example). $end is defined by Bison whereas any other token with token
7636 number 0 is defined by the user. The error token is always defined by
7637 Bison regardless of whether the user declares it with %token, but we
7638 may one day let the user define error as a nonterminal instead.
7639 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
7640 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
7641 the meaning of "user-defined".
7642 * tests/actions.at (Default %printer and %destructor for user-declared
7643 end token): Rename to...
7644 (Default %printer and %destructor for user-defined end token): ...
7645 this.
7646
7647 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
7648 computation of whether to apply the default, don't maintain a list of
7649 every Bison-defined symbol. Instead, just check for a first character
7650 of '$', which a user symbol cannot have, and check for the error token.
7651
7652 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
7653
7654 Don't apply the default %destructor or %printer to the error token,
7655 $undefined, or $accept. This change fits the general rule that the
7656 default %destructor and %printer are only for user-declared symbols,
7657 and it solves several difficulties that are described in the new test
7658 cases listed below.
7659 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
7660 * tests/actions.at (Default %printer and %destructor are not for error
7661 or $undefined, Default %printer and %destructor are not for $accept):
7662 New test cases.
7663
7664 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
7665
7666 Allow %start after the first rule.
7667 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
7668 when parsing the first rule.
7669 (check_and_convert_grammar): Search for it here after all grammar
7670 declarations have been parsed. Skip midrules, which have dummy LHS
7671 nonterminals.
7672 * src/symtab.c (symbol_is_dummy): New function.
7673 * src/symtab.h (symbol_is_dummy): Declare it.
7674 * tests/input.at (%start after first rule): New test.
7675
7676 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7677
7678 Redo some of the previous commit: add back the ability to use
7679 non-aliased/undeclared string literals since it might be useful to
7680 those declaring %token-table.
7681 * src/reader.c (check_and_convert_grammar): Undo changes in previous
7682 commit: don't worry about complaints from symbols_pack.
7683 * src/symtab.c (symbol_new, symbol_class_set,
7684 symbol_check_alias_consistency): Undo changes in previous commit: count
7685 each string literal as a new symbol and token, assign it a symbol
7686 number, and don't complain about non-aliased string literals.
7687 (symbols_pack): Since symbol_make_alias still does not decrement symbol
7688 and token counts but does still set aliased tokens to the same number,
7689 symbol_pack_processor now leaves empty slots in the symbols array.
7690 Remove those slots.
7691 * tests/regression.at (Undeclared string literal): Remove test case
7692 added in previous commit since non-aliased string literals are allowed
7693 again.
7694 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
7695 remove unnecessary string literal declarations.
7696 * tests/sets.at (Firsts): Likewise.
7697
7698 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
7699
7700 Don't allow an undeclared string literal, but allow a string literal to
7701 be used before its declaration.
7702 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
7703 symbols_pack complained.
7704 * src/symtab.c (symbol_new): Don't count a string literal as a new
7705 symbol.
7706 (symbol_class_set): Don't count a string literal as a new token, and
7707 don't assign it a symbol number since symbol_make_alias does that.
7708 (symbol_make_alias): It's not necessary to decrement the symbol and
7709 token counts anymore. Don't assume that an alias declaration occurs
7710 before any uses of the identifier or string, and thus don't assert that
7711 one of them has the highest symbol number so far.
7712 (symbol_check_alias_consistency): Complain if there's a string literal
7713 that wasn't declared as an alias.
7714 (symbols_pack): Bail if symbol_check_alias_consistency failed since
7715 symbol_pack asserts that every token has been assigned a symbol number
7716 although undeclared string literals have not.
7717 * tests/regression.at (String alias declared after use, Undeclared
7718 string literal): New test cases.
7719 (Characters Escapes, Web2c Actions): Declare string literals as
7720 aliases.
7721 * tests/sets.at (Firsts): Likewise.
7722
7723 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
7724
7725 In the grammar scanner, STRING_FINISH unclosed constructs and return
7726 them to the parser in order to improve error messages.
7727 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
7728 SC_BRACED_CODE, SC_PROLOGUE): Implement.
7729 * tests/input.at (Unclosed constructs): New test case.
7730 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
7731 seen.
7732
7733 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
7734 unused global.
7735
7736 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
7737
7738 Handle string aliases for character tokens correctly.
7739 * src/symtab.c (symbol_user_token_number_set): If the token has an
7740 alias, check and set its alias's user token number instead of its own,
7741 which is set to indicate the alias. Previously, every occurrence of
7742 the character token in the grammar overwrote that alias indicator with
7743 the character code.
7744 * tests/input.at (String aliases for character tokens): New test.
7745
7746 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
7747
7748 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
7749
7750 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
7751
7752 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
7753 to prevent failures when building on older platforms.
7754 Check for autopoint failure.
7755 Set XGETTEXT_OPTIONS to values that check for C format strings,
7756 so that translators are warned about them (this also helps
7757 prevent core dumps).
7758
7759 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
7760 function, since it simplifies our code a bit.
7761
7762 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
7763 rather than -W, so we don't get bogus warnings about sign comparisons.
7764 Add -Wpointer-arith, since that warning is useful (it reports code
7765 that does not conform to C89 and that some compilers reject).
7766 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
7767 since it's no longer needed.
7768
7769 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
7770
7771 Clean up scanners a bit.
7772 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
7773 definitions so gcc won't warn when obstack_for_string is unused.
7774 * src/scan-code.l: config.h and system.h are already #include'd by
7775 scan-code-c.c, so get rid of them here.
7776 * src/scan-gram.l: Likewise.
7777 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
7778 definitions rather than duplicating the rest of it.
7779 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
7780
7781 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
7782
7783 Suppress signed/unsigned comparison warnings for yycheck.
7784 * data/c.m4 (b4_safest_int_type): New macro.
7785 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
7786 a signed int type, cast it to b4_safest_int_type first.
7787 * data/yacc.c: Likewise.
7788 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
7789 also overwritten.
7790
7791 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
7792
7793 * doc/bison.texinfo: Fix some typos.
7794
7795 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
7796
7797 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
7798 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
7799
7800 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
7801 the latest gnulib does this a different way.
7802 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
7803 translation was patched, so stop omitting it.
7804
7805 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7806
7807 Enable declaration of default %printer/%destructor. Make the parser
7808 use these for all user-declared grammar symbols for which the user does
7809 not declare a specific %printer/%destructor. Thus, the parser uses it
7810 for token 0 if the user declares it but not if Bison generates it as
7811 $end. Discussed starting at
7812 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
7813 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
7814 and
7815 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
7816 * NEWS (2.3+): Mention.
7817 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
7818 declare a %destructor for a mid-rule's semantic value. It's just
7819 impossible to declare one specific to it.
7820 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
7821 code. Describe default %destructor form.
7822 * src/parse-gram.y (grammar_declaration): Parse default
7823 %printer/%destructor declarations.
7824 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
7825 and symbol_destructor_location_get rather than accessing the destructor
7826 and destructor_location members of struct symbol.
7827 (symbol_printers_output): Likewise but for %printer's.
7828 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
7829 again.
7830 * src/symtab.c (default_destructor, default_destructor_location,
7831 default_printer, default_printer_location): New static global
7832 variables to record the default %destructor and %printer.
7833 (symbol_destructor_get, symbol_destructor_location_get,
7834 symbol_printer_get, symbol_printer_location_get): New functions to
7835 compute the appropriate %destructor and %printer for a symbol.
7836 (default_destructor_set, default_printer_set): New functions to set the
7837 default %destructor and %printer.
7838 * src/symtab.h: Prototype all those new functions.
7839 * tests/actions.at (Default %printer and %destructor): New test to
7840 check that the right %printer and %destructor are called, that they're
7841 not called for $end, and that $$ and @$ work correctly.
7842 (Default %printer and %destructor for user-declared end token): New
7843 test to check that the default %printer and %destructor are called for
7844 a user-declared end token.
7845 * tests/input.at (Default %printer and %destructor redeclared, Unused
7846 values with default %destructor): New tests to check related grammar
7847 warnings and errors.
7848
7849 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
7850
7851 Clean up handling of %destructor for the end token (token 0).
7852 Discussed starting at
7853 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
7854 and
7855 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
7856
7857 Make the skeletons consistent in how they pop the end token and invoke
7858 its %destructor.
7859 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
7860 state, which has token number 0, since this would invoke the
7861 %destructor for the end token.
7862 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
7863 until after shifting the end token, or else it won't be popped.
7864 * data/yacc.c (yyparse): Likewise.
7865
7866 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
7867 it's the end token. Upon termination, destroy an unshifted lookahead
7868 even when it's the end token.
7869 * data/lalr1.cc (yy::parser::parse): Likewise.
7870 * data/yacc.c (yyparse): Likewise.
7871
7872 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
7873 value warnings for the end token when the user gives the end token a
7874 %destructor.
7875
7876 * tests/actions.at (Printers and Destructors): Test all the above.
7877
7878 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
7879
7880 Update to latest gnulib and gettext versions.
7881 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
7882 Add fopen-safer.
7883 (gnulib_files): Add m4/warning.m4. Don't worry about files
7884 overwritten by autopoint.
7885 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
7886 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
7887 rejects them.
7888 Don't use autoreconf; instead, invoke autopoint etc. by hand,
7889 so that we can remove the intl files at a better time.
7890 (intl_files_to_remove): Remove aclocal.m4, since it gets
7891 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
7892 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
7893 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
7894 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
7895 Remove datarootdir hack; no longer needed.
7896 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
7897 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
7898 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
7899 strdup.h.
7900 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
7901 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
7902
7903 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
7904
7905 * bootstrap: Adjust to today's change to gnulib-tool by invoking
7906 it with --assume-autoconf='latest-stable'.
7907
7908 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
7909
7910 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
7911 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
7912 YYSTYPE' and `{'.
7913 * src/muscle_tab.h (muscle_grow): Replace the header comments with
7914 those from muscle_tab.c since the old ones are misleading.
7915
7916 2006-07-13 Akim Demaille <akim@epita.fr>
7917
7918 Support %define "KEY" {VALUE}.
7919 * src/scan-code.h, src/scan-code.l (translate_action)
7920 (translate_rule_action, translate_symbol_action, translate_code):
7921 Return char *, not const char *.
7922 * src/parse-gram.y (declaration): Rename as...
7923 (prologue_declaration): this.
7924 (string_content): Remove this nonterminal, use STRING.
7925 (braceless, content, content.opt): New nonterminal.
7926 Use them.
7927 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
7928 as value.
7929 * src/scan-gram.l (getargs.h): Don't include it.
7930
7931 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
7932
7933 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
7934 rather than a for-loop that declares a local bool variable. This
7935 should work around a compatibility problem with a Cray x1e C++
7936 compiler reported by Hung Nguyen in
7937 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
7938 The for-loop was introduced in the 2004-11-17 change but I don't
7939 know why it was needed.
7940
7941 2006-07-12 Akim Demaille <akim@epita.fr>
7942
7943 * data/c.m4: Comment changes.
7944
7945 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
7946
7947 * src/complain.c (error_message, ERROR_MESSAGE): New.
7948 To factor...
7949 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
7950 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
7951
7952 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
7953
7954 * NEWS: Instead of %union, you can define and use your own union type
7955 YYSTYPE if your grammar contains at least one <type> tag.
7956 Your YYSTYPE need not be a macro; it can be a typedef.
7957 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
7958 (Union Decl, Decl Summary): Document this.
7959 * data/glr.c (YYSTYPE): Implement this.
7960 * data/glr.cc (YYSTYPE): Likewise.
7961 * data/lalr1.cc (YYSTYPE): Likewise.
7962 * data/yacc.c (YYSTYPE): Likewise.
7963 * src/output.c (prepare): Output tag_seen_flag.
7964 * src/parse-gram.y (declaration, grammar_declaration):
7965 Use 'union_seen' rather than 'typed' to determine whether
7966 %union has been seen, since grammars can now be typed without
7967 %union.
7968 (symbol_declaration, type.opt, symbol_def):
7969 Keep track of whether a tag has been seen.
7970 * src/reader.c (union_seen, tag_seen): New vars.
7971 (typed): remove.
7972 * src/reader.h (union_seen, tag_seen, typed): Likewise.
7973 * src/scan-code.l (untyped_var_seen): New variable.
7974 (handle_action_dollar): Adjust to above changes.
7975 (handle_action_dollar, handle_action_at):
7976 Improve overflow checking for outlandish numbers.
7977 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
7978 avoid new diagnostics generated by above changes.
7979 * tests/regression.at (YYSTYPE typedef): Add test to check
7980 for type tags without %union.
7981
7982 * src/symlist.c (symbol_list_length): Return int, not unsigned
7983 int, since callers expect int. This may need to get revisited
7984 once we have proper integer overflow checking.
7985
7986 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
7987 object is now static.
7988
7989 * src/getargs.c (flags_argmatch): Return void, not int,
7990 to pacify ./configure --enable-gcc-warnings.
7991
7992 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
7993 since last_string is already defined to FLEX_PREFIX (last_string).
7994
7995 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
7996
7997 Implement --warnings/-W.
7998 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
7999 replaced by...
8000 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
8001 Adjust callers.
8002 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
8003 (warnings_args, warnings_types): New.
8004 (getargs, short_options, long_options): Accept -W/--warnings.
8005 Sort the options by alphabetical order, upper case letter right
8006 before its lower case.
8007
8008 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
8009
8010 Change %merge result type clash warnings to errors. Discussed at
8011 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
8012 * src/reader.c (record_merge_function_type): Use complain_at.
8013 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8014 declared later): Update test case results.
8015
8016 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
8017
8018 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
8019 to be in alphabetical order.
8020 (trace_args): Spelling fixes.
8021
8022 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
8023
8024 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
8025 so they don't collide with user-defined macros.
8026 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
8027 this was never guaranteed, and now that we're using gnulib stdint,
8028 which defines int_fast16_t to long int, the problem is exposed.
8029
8030 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
8031
8032 * data/c.m4 (b4_basename): Simplify a bit, since we don't
8033 need the full POSIX semantics (and weren't implementing them
8034 anyway).
8035
8036 Adjust to Autoconf 2.60 and today's gnulib.
8037 * bootstrap (gnulib_modules): Add stdint.
8038 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
8039 no longer copies it.
8040 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
8041 since stdint needs the former and wcwidth (which is now required
8042 by mbswidth) needs the latter.
8043 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
8044 work around a compatibility glitch between gettext 0.14.6 and
8045 Autoconf 2.60.
8046 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
8047 Do not check for uintptr_t, since new stdint module does the right
8048 thing.
8049 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
8050 Add stdint.h, stdint_.h, wcwidth.h.
8051 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
8052 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
8053 stdint.m4, wchar_t.m4, wcwidth.m4.
8054 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
8055 usual order for ../lib/*.h files.
8056 (file_name_split): Use last_component, not base_name, to adjust
8057 to gnulib changes.
8058 * src/parse-gram.h: Include <strverscmp.h> in the usual order
8059 for ../lib/*.h files.
8060 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
8061 Define unconditionally, since we now assume the stdint module.
8062 * src/scan-skel.l: Include <dirname.h>.
8063 (BASE_QPUTS): Use last_component, not base_name.
8064 * src/system.h: Include <unlocked-io.h> in the usual order
8065 for ../lib/*.h files. Include <stdint.h> unconditionally,
8066 since we now use the stdint module.
8067 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
8068 HAVE_UINTPTR_T, since we now use the stdint module.
8069 (base_name): Remove decl, since files now include <dirname.h>
8070 to get the decl.
8071
8072 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
8073
8074 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
8075 New, default to 1.
8076 * data/yacc.c, data/glr.c, data/location.cc: Use them.
8077 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
8078 default.
8079 * tests/calc.at: Adjust.
8080
8081 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
8082
8083 * data/c.m4 (b4_basename): New.
8084 (b4_syncline): Also output the location of its invocation (from
8085 the skeleton).
8086 (b4_user_action, b4_define_user_action, b4_user_actions)
8087 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
8088 (b4_user_stype): New.
8089 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
8090
8091 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8092
8093 In the grammar file, the first column is 1 not 0 on the first line as
8094 on every other line.
8095 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
8096 * tests/input.at (Torturing the Scanner): Update output.
8097
8098 * src/scan-gram.l (scanner_cursor): Declare it static.
8099
8100 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
8101
8102 In warnings, say "previous declaration" rather than "first
8103 declaration".
8104 * src/symtab.c (redeclaration): Do that here.
8105 * src/reader.c (record_merge_function_type): In the case of a result
8106 type clash, report the previous declaration rather than the very first
8107 one in the grammar file.
8108 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8109 declared later): Add a third declaration to check this behavior.
8110 * tests/input.at (Incompatible Aliases): Update output.
8111
8112 2006-06-27 Akim Demaille <akim@epita.fr>
8113
8114 * doc/Doxyfile.in: New.
8115 * doc/Makefile.am: Use it.
8116 * src/lalr.h, src/symtab.h: Initial doxygenation.
8117
8118 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8119
8120 Don't miss %merge result type warnings just because the LHS types are
8121 declared after the %merge. This continues the effort of the previous
8122 patch.
8123 * src/reader.c (get_merge_function): Don't set the merger type yet.
8124 (record_merge_function_type): New function for setting the merger type
8125 and checking for clashes.
8126 (grammar_current_rule_merge_set): Set the location of the %merge for
8127 the current rule.
8128 (packgram): Invoke record_merge_function_type for each rule now that
8129 all symbol type declarations have been parsed.
8130 * src/reader.h (merger_list.type_declaration_location): New member
8131 storing the location of the first %merge from which the type for this
8132 merging function was derived.
8133 * src/symlist.h (symbol_list.merger_declaration_location): New member
8134 storing the location of a rule's %merge, if any.
8135 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
8136 declared later): New test to catch the error fixed by the above patch.
8137
8138 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8139
8140 Get action warnings (grammar_rule_check) right even when symbol
8141 declarations appear after the rules. Discussed at
8142 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
8143 and
8144 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
8145 Don't mistake the type of $$ in a midrule to be that of its parent
8146 rule's $$.
8147 * src/reader.c (grammar_current_rule_end): Don't invoke
8148 grammar_rule_check yet since not all symbol declarations may have been
8149 parsed yet.
8150 (grammar_midrule_action): Likewise.
8151 Don't record whether the midrule's $$ has been used yet since actions
8152 haven't been translated yet.
8153 Record the midrule's parent rule and its RHS index within the parent
8154 rule.
8155 (grammar_current_rule_action_append): Don't translate the action yet
8156 since not all symbol declarations may have been parsed yet and, thus,
8157 warnings about types for $$, $n, @$, and @n can't be reported yet.
8158 (packgram): Translate the action and invoke grammar_rule_check now that
8159 all symbol declarations have been parsed.
8160 * src/scan-code.l (handle_action_dollar): Now that this is invoked
8161 after parsing the entire grammar file, the symbol list here in the case
8162 of a midrule is actually the midrule's empty RHS, so reference its
8163 parent rule's RHS where necessary.
8164 On the other hand, now that you can already know it's a midrule, you
8165 aren't forced to think $$ has the same type as its parent rule's $$.
8166 (handle_action_at): In the case of a midrule, reference the parent rule
8167 where necessary.
8168 * src/symlist.c (symbol_list_new): Initialize new midrule-related
8169 members.
8170 (symbol_list_length): Now that this is invoked after all rules have
8171 been parsed, a NULL symbol (rather than a NULL symbol list node)
8172 terminates a rule. symbol_list_print already does this correctly.
8173 * src/symlist.h (symbol_list.midrule_parent_rule,
8174 symbol_list.midrule_parent_rhs_index): New members so that midrules can
8175 remember their relationships with their parents.
8176 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
8177 fixed by the above patch.
8178 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
8179 implementing...
8180 (Unused values): ... this old test case and...
8181 (Unused values before symbol declarations): ... this new test case.
8182 This one is the same as `Unused values' except that all symbol
8183 declarations appear after the rules in order to catch the rest of the
8184 errors fixed by the above patch.
8185
8186 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
8187
8188 More cleanup.
8189 * src/reader.c (current_rule): Declare it static since it's no longer
8190 used outside this file.
8191 (grammar_current_rule_action_append): Remove redundant arguments from
8192 translate_rule_action invocation.
8193 * src/reader.h (current_rule): Remove this unused extern.
8194 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
8195 * src/scan-code.l (translate_rule_action): Likewise.
8196
8197 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
8198
8199 Clean up yesterday's patch.
8200 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
8201 to...
8202 * src/reader.c (grammar_current_rule_action_append): ... here for
8203 consistency with grammar_current_rule_symbol_append.
8204 * tests/regression.at (Braced code in declaration in rules section):
8205 Make yyerror and yylex static as usual.
8206
8207 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
8208
8209 Fix bug that mistakes braced code in a declaration in the rules section
8210 to be a rule action. Mentioned at
8211 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
8212 * src/scan-gram.l: Move midrule action detection from the start of the
8213 scanning of any braced code to...
8214 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
8215 action. For readability, use $2 and @2 rather than the equivalent
8216 global variables.
8217 * tests/regression.at (Braced code in declaration in rules section):
8218 New test to catch the error fixed by the above patch.
8219
8220 Work on code readability some.
8221 * src/scan-code.l (current_rule): Get rid of this misleading and
8222 redundant declaration: it's actually extern'ed in reader.h.
8223 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
8224 translate_action): Add a rule argument and use it instead of the global
8225 current_rule.
8226 (translate_rule_action): This already receives current_rule through an
8227 argument, so pass it on to translate_action instead of assigning
8228 current_rule to current_rule.
8229 (translate_symbol_action, translate_code): Pass rule = NULL to
8230 translate_action.
8231
8232 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
8233
8234 Rename %before-definitions to %start-header and %after-definitions to
8235 %end-header. Don't use these declarations to separate pre-prologue
8236 blocks from post-prologue blocks. Add new order-independent
8237 declarations %before-header and %after-header as alternatives to the
8238 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
8239 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
8240 * NEWS (2.3+): Update for these changes.
8241 * data/glr.c (b4_before_definitions): Update to...
8242 (b4_start_header): ... this.
8243 (b4_after_definitions): Update to...
8244 (b4_end_header): ... this.
8245 * data/glr.cc: Likewise.
8246 * data/lalr1.cc: Likewise.
8247 * data/yacc.c: Likewise.
8248 * doc/bison.texinfo (The prologue): Update names, and replace remaining
8249 prologue blocks with %*-header declarations.
8250 (Calc++ Parser): Likewise.
8251 (Decl Summary): Update names.
8252 (Table of Symbols): Update description.
8253 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
8254 (PERCENT_END_HEADER): ... this.
8255 (PERCENT_BEFORE_DEFINITIONS): Update to...
8256 (PERCENT_START_HEADER): ... this.
8257 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8258 (declaration): Update token names and m4 macro names.
8259 When parsing %end-header and %start-header, invoke translate_code
8260 before muscle_code_grow, and no longer set global booleans to remember
8261 whether these declarations have been seen.
8262 Parse new %after-header and %before-header.
8263 * src/reader.c (before_definitions, after_definitions): Remove.
8264 (prologue_augment): Accept a new bool argument to specify whether to
8265 augment the pre-prologue or post-prologue.
8266 * src/reader.h (before_definitions, after_definitions): Remove these
8267 extern's.
8268 (prologue_augment): Add new bool argument.
8269 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
8270 (PERCENT_END_HEADER): ... this.
8271 (PERCENT_BEFORE_DEFINITIONS): Update to...
8272 (PERCENT_START_HEADER): ... this.
8273 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
8274 * tests/actions.at (Printers and Destructors): Update names.
8275
8276 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
8277
8278 Add comparison operators for C++ location classes. Discussed at
8279 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
8280 * data/c++.m4 (b4_define_location_comparison): New boolean %define
8281 declaration indicating whether filename_type has an operator==. If
8282 filename_type is `std::string', it defaults to `1', `0' otherwise.
8283 * data/location.cc: Iff b4_define_location_comparison is `1', add
8284 operator== and operator!= for class position and for class location.
8285
8286 Some minor fixes.
8287 * src/scan-action.l: Remove unused file.
8288 * src/symtab.c (symbol_printer_set): Use printer_location not
8289 destructor_location.
8290 * src/symtab.h (struct symbol): Replace incorrect source comment for
8291 printer members.
8292 * tests/input.at (Incompatible Aliases): Update output with correct
8293 printer location.
8294
8295 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
8296
8297 Don't put the pre-prologue in the header file. For the yacc.c code
8298 file and the glr.c header and code files, move the pre-prologue before
8299 the token definitions. Add new %before-definitions and
8300 %after-definitions to declare code that will go in both the header file
8301 and code file. Discussed at
8302 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
8303 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
8304 and
8305 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
8306 * NEWS (2.3+): Describe these changes.
8307 * data/glr.c (b4_pre_prologue): Move from within to before...
8308 (b4_shared_declarations): ... this.
8309 Add new b4_before_definitions before b4_token_enums.
8310 Add new b4_after_definitions at the end.
8311 * data/glr.cc (b4_pre_prologue): Replace with...
8312 (b4_before_definitions): ... this in the header file.
8313 (b4_after_definitions): New near the end of the header file.
8314 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
8315 code file right before including the header file.
8316 (b4_before_definitions): New in the previous position of
8317 b4_pre_prologue in the header file.
8318 (b4_after_definitions): New near the end of the header file.
8319 * data/yacc.c: Clean up some m4 quoting especially in the header file.
8320 (b4_token_enums_defines): In the code file, move to right before
8321 YYSTYPE for consistency with the header file.
8322 (b4_before_definitions): New right before b4_token_enums_defines in
8323 both the header and code file.
8324 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
8325 header and code file.
8326 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
8327 of prologues for %union dependencies.
8328 (Decl Summary): In %defines description, mention the effect of
8329 %before-definitions and %after-definitions on the header file.
8330 (Calc++ Parser): Forward declare driver in a %before-definitions rather
8331 than in the pre-prologue so that make check succeeds.
8332 (Table of Symbols): Add entries for %before-definitions and
8333 %after-definitions.
8334 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
8335 %before-definitions.
8336 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
8337 (declaration): Parse those declarations and append to
8338 b4_before_definitions and b4_after_definitions, respectively.
8339 * src/reader.c (before_definitions, after_definitions): New bools to
8340 track whether those declarations have been seen.
8341 (prologue_augment): Add to the post-prologue if %union,
8342 %before-definitions, or %after-definitions has been seen.
8343 * src/reader.h (before_definitions, after_definitions): New extern's.
8344 * src/scan-gram.l: Scan the new declarations.
8345 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
8346 prologue block in a %before-definitions or a %after-definitions based
8347 on whether the %union is declared.
8348 * tests/regression.at (Early token definitions with --yacc, Early token
8349 definitions without --yacc): Move tests for token definitions into the
8350 post-prologue since token names are no longer defined in the
8351 pre-prologue.
8352
8353 2006-06-20 Akim Demaille <akim@epita.fr>
8354
8355 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
8356 (symbol_get): Use it.
8357 * src/parse-gram.y: Use it.
8358
8359 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
8360
8361 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
8362 build succeeds when configured with --enable-gcc-warnings.
8363
8364 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
8365
8366 * src/parse-gram.y (char_name): New function.
8367 (CHAR, STRING, string_content): For %printer, properly escape.
8368 (ID): Prefer fputs to fprintf.
8369 (id): Reindent to be consistent with other rules.
8370 Properly quote char.
8371
8372 The Translation Project changed its way of publishing translations
8373 to maintainers. I haven't received any responses to my request
8374 for supporting the old way, or for documenting the new way. I
8375 have modified 'bootstrap' to use screen scraping
8376 (in this case, HTML scraping). This is unreliable and inelegant,
8377 but I don't see any better way. Yuck.
8378 * bootstrap (TP_URL, WGET_COMMAND): New vars.
8379 (get_translations): New function, which uses HTML scraping to
8380 deduce locations of latest translations.
8381 Use this function to grab both bison and bison-runtime .po files.
8382 Don't bother priming the pump for the runtime-po domain any more,
8383 as it's now translated better than bison is.
8384
8385 2006-06-19 Akim Demaille <akim@epita.fr>
8386
8387 * src/scan-gram.l: No longer "parse" things after `%union' until
8388 `{'. Rather, return a single "%union" token.
8389 No longer make symbols: return strings, and leave the conversion
8390 to symbols to the parser.
8391 (SC_PRE_CODE, token_type): Remove.
8392 * src/parse-gram.y (%union): New field `character'.
8393 Sort tokens.
8394 (CHAR): New token.
8395 (ID, ID_COLON): Now that the scanner no longer makes them
8396 identifiers, adjust all uses to invoke symbol_get.
8397 (id_colon): New, wraps the conversion from string to symbol.
8398 (%union): Accept a possible union_name.
8399 (symbol): Now can be a char.
8400 * data/c.m4 (b4_union_name): Leave a default value.
8401 * data/glr.c, data/yacc.c: Use it.
8402
8403 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
8404
8405 For associating token numbers with token names for "yacc.c", don't use
8406 #define statements unless `--yacc' is specified; always use enum
8407 yytokentype. Most important discussions start at:
8408 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
8409 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
8410 and
8411 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
8412 * NEWS (2.3+): Mention.
8413 * data/c.m4 (b4_yacc_if): New.
8414 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
8415 token #define's.
8416 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
8417 on token name definitions.
8418 * src/getargs.c (usage): Capitalize `Yacc' in English.
8419 * src/output.c (prepare): Define b4_yacc_flag.
8420 * tests/regression.at (Early token definitions): Test that tokens names
8421 are defined before the pre-prologue not just before the post-prologue.
8422 Remove this test case and copy to...
8423 (Early token definitions with --yacc): ... this to test #define's.
8424 (Early token definitions without --yacc): ... and this to test enums.
8425
8426 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
8427
8428 * NEWS: Reword the post-2.3 change to not be so optimistic about
8429 removing the old "look-ahead" spelling.
8430 Update previous look-ahead/lookahead change reports.
8431 * REFERENCES: look-ahead -> lookahead (since that's
8432 what he actually wrote).
8433 * doc/refcard.tex: look ahead -> lookahead,
8434 look-ahead -> lookahead
8435
8436 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
8437
8438 For consistency, use `lookahead' instead of `look-ahead' or
8439 `look_ahead'. Discussed starting at
8440 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
8441 and then at
8442 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
8443 * NEWS: For the next release, note the change to `--report'.
8444 * TODO, doc/bison.1: Update English.
8445 * doc/bison.texinfo: Update English.
8446 (Understanding Your Parser, Bison Options): Document as
8447 `--report=lookahead' rather than `--report=look-ahead'.
8448 * src/conflicts.c: Update English in comments.
8449 (lookahead_set): Rename from look_ahead_set.
8450 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
8451 (resolve_sr_conflict): Rename local look_ahead_tokens to
8452 lookahead_tokens, and update other uses.
8453 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
8454 count_rr_conflicts, conflicts_free): Update uses.
8455 * src/getargs.c (report_args): Move "lookahead" before alternate
8456 spellings.
8457 (report_types): Update uses.
8458 (usage): For `--report' usage description, state `lookahead' spelling
8459 rather than `look-ahead'.
8460 * src/getargs.h (report.report_lookahead_tokens): Rename from
8461 report_look_ahead_tokens.
8462 * src/lalr.c: Update English in comments.
8463 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
8464 (state_lookahead_tokens_count): Rename from
8465 state_look_ahead_tokens_count.
8466 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8467 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
8468 Rename local n_look_ahead_tokens to n_lookahead_tokens.
8469 Update other uses.
8470 Update English in output.
8471 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
8472 * src/print.c: Update English in comments.
8473 (lookahead_set): Rename from look_ahead_set.
8474 (print_reduction): Rename argument lookahead_token from
8475 look_ahead_token.
8476 (print_core, state_default_rule, print_reductions, print_results):
8477 Update uses.
8478 * src/print_graph.c: Update English in comments.
8479 (print_core): Update uses.
8480 * src/state.c: Update English in comments.
8481 (reductions_new): Update uses.
8482 (state_rule_lookahead_tokens_print): Rename from
8483 state_rule_look_ahead_tokens_print, and update other uses.
8484 * src/state.h: Update English in comments.
8485 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
8486 (state_rule_lookahead_tokens_print): Rename from
8487 state_rule_look_ahead_tokens_print.
8488 * src/tables.c: Update English in comments.
8489 (conflict_row, action_row): Update uses.
8490 * tests/glr-regression.at
8491 (Incorrect lookahead during deterministic GLR,
8492 Incorrect lookahead during nondeterministic GLR): Rename
8493 print_look_ahead to print_lookahead.
8494 * tests/torture.at: Update English in comments.
8495 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
8496 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
8497 (Many lookahead tokens): Update uses.
8498 * data/glr.c: Update English in comments.
8499 * lalr1.cc: Likewise.
8500 * yacc.c: Likewise.
8501 * src/conflicts.h: Likewise.
8502 * src/lalr.h: Likewise.
8503 * src/main.c: Likewise.
8504 * src/output.c: Likewise.
8505 * src/parse-gram.c: Likewise.
8506 * src/tables.h: Likewise.
8507 * tests/calc.at: Likewise.
8508
8509 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
8510
8511 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
8512
8513 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
8514
8515 * TODO: Add request from Nelson H. F. Beebe to be able to install
8516 Bison without installing the yacc script.
8517
8518 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8519
8520 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
8521 and yytext if they're already #define'd.
8522 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
8523 * src/scan-code-c.c: ... here.
8524 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
8525 <config.h>.
8526
8527 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
8528
8529 Get Bison to build again when configured with --enable-gcc-warnings.
8530 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
8531 missing #include's.
8532 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
8533 loc argument as it shadows a global.
8534 * src/scan-gram.l: Remove stray comma that prevents boundary_set
8535 invocation.
8536
8537 * src/.cvsignore: Add scan-code.c.
8538
8539 2006-06-07 Akim Demaille <akim@epita.fr>
8540
8541 * src/scan-gram.l: Move the "add a trailing ; to actions" code
8542 to...
8543 * src/scan-code.l: here.
8544 * tests/input.at (Torturing the Scanner): Fix another location
8545 error.
8546
8547 2006-06-07 Akim Demaille <akim@epita.fr>
8548
8549 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
8550
8551 2006-06-06 Akim Demaille <akim@epita.fr>
8552
8553 Extract the parsing of user actions from the grammar scanner.
8554 As a consequence, the relation between the grammar scanner and
8555 parser is much simpler. We can also split "composite tokens" back
8556 into simple tokens.
8557 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
8558 * src/scan-gram.l (add_column_width, adjust_location): Move to and
8559 rename as...
8560 * src/location.h, src/location.c (add_column_width)
8561 (location_compute): these.
8562 Fix the column count: the initial column is 0.
8563 (location_print): Be robust to ending column being 0.
8564 * src/location.h (boundary_set): New.
8565 * src/main.c: Adjust to scanner_free being renamed as
8566 gram_scanner_free.
8567 * src/output.c: Include scan-code.h.
8568 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
8569 Use boundary_set.
8570 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
8571 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
8572 which is now, again, a separate token.
8573 Adjust all dependencies.
8574 Whereever actions with $ and @ are used, use translate_code.
8575 (action): Remove this nonterminal which is now useless.
8576 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
8577 (grammar_current_rule_action_append): Use translate_code.
8578 (packgram): Bound check ruleno, itemno, and rule_length.
8579 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
8580 (last_string, last_braced_code_loc, max_left_semantic_context)
8581 (scanner_initialize, scanner_free, scanner_last_string_free)
8582 (gram_out, gram_lineno, YY_DECL_): Move to...
8583 * src/scan-gram.h: this new file.
8584 (YY_DECL): Rename as...
8585 (GRAM_DECL): this.
8586 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
8587 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
8588 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
8589 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
8590 Move these declarations, and...
8591 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
8592 these to...
8593 * src/flex-scanner.h: this new file.
8594 * src/scan-gram.l (rule_length, rule_length_overflow)
8595 (increment_rule_length): Remove.
8596 (last_braced_code_loc): Rename as...
8597 (gram_last_braced_code_loc): this.
8598 Adjust to the changes of the parser.
8599 Move all the handling of $ and @ into...
8600 * src/scan-code.l: here.
8601 * src/scan-gram.l (handle_dollar, handle_at): Remove.
8602 (handle_action_dollar, handle_action_at): Move to...
8603 * src/scan-code.l: here.
8604 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
8605 scan-code.h, scan-code-c.c, scan-gram.h.
8606 (EXTRA_bison_SOURCES): Add scan-code.l.
8607 (BUILT_SOURCES): Add scan-code.c.
8608 (yacc): Be robust to white spaces.
8609
8610 * tests/conflicts.at, tests/input.at, tests/reduce.at,
8611 * tests/regression.at: Adjust the column numbers.
8612 * tests/regression.at: Adjust the error message.
8613
8614 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8615
8616 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8617 Use Akim's wording from
8618 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
8619
8620 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
8621
8622 Between Bison releases, manually append `+' to the previous Bison
8623 release number, and use that as a signal to automatically print the
8624 ChangeLog's CVS Id keyword from --version. Discussed starting at
8625 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
8626 * ChangeLog: Add Id header.
8627 * configure.ac (AC_INIT): Append `+' to `2.3'.
8628 * src/.cvsignore: Add revision.c.
8629 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
8630 (BUILT_SOURCES): Add revision.c.
8631 (revision.c): New target rule. This file defines a new global variable
8632 named revision. It initializes it with either the Id from ChangeLog
8633 or, if VERSION doesn't contain `+', with the empty string.
8634 * src/getargs.c (version): Print the value of revision.
8635 * src/revision.h: Extern revision.
8636
8637 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
8638
8639 * NEWS: Version 2.3.
8640 * configure.ac (AC_INIT): Likewise.
8641
8642 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
8643
8644 * data/glr.c (YYRECOVERING): Define to be a function-like macro
8645 with no arguments, not as an object-like macro. This is for
8646 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
8647 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
8648 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
8649 Document this.
8650
8651 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
8652
8653 * src/getargs.c (usage): Back out yesterday's modification of the
8654 --help output so that we don't have to wait for translation before
8655 releasing 2.3.
8656
8657 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
8658
8659 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
8660 Problem reported by Akim Demaille.
8661
8662 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
8663
8664 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
8665
8666 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
8667
8668 * data/yacc.c (yy_reduce_print): Omit trailing white space in
8669 generated source code. Problem reported by Frans Englich in
8670 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
8671
8672 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
8673
8674 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
8675 shell, not within 'make', so that 'make' by an ordinary builder
8676 (using GNU make) does not worry about configuring gzip. This also
8677 works around a bug reported independently by Keith Thompson and by
8678 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
8679 stderr rather than stdout, messing up the build logs.
8680
8681 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8682
8683 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
8684 to make sure that YYID will never be unused. This fixes a 'make
8685 maintainer-check' failure caused by the recent changes to the 'Trivial
8686 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
8687 not used.
8688 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
8689
8690 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
8691
8692 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
8693 state before an empty RHS is always resolved here. Only the location
8694 of that state is guaranteed to be resolved, and that's enough. This
8695 fixes the remaining bug reported by Derek M. Jones in
8696 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8697 * tests/glr-regression.at (Uninitialized location when reporting
8698 ambiguity): Test the above case.
8699 Also, the embedded comments in this test case claim it checks the case
8700 of an empty RHS that has inherited the initial location. However, the
8701 corresponding LHS was already resolved, so yyresolveLocations didn't
8702 actually have reason to modify it. Fix this by forcing
8703 nondeterministic operation at the beginning of the parse.
8704
8705 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
8706
8707 * data/c.m4 (b4_yy_symbol_print_generate):
8708 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
8709 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
8710 of the bugs reported today by Derek M Jones in
8711 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
8712 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
8713 defined to be a type name without parens or brackets.
8714 (Location Type): Similarly for YYLTYPE.
8715 * tests/regression.at (Trivial grammars): Put in a test for this
8716 bug that will be caught by 'make maintainer-check' (though not,
8717 alas, by 'make check' unless your compiler is picky).
8718
8719 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
8720
8721 * NEWS: Version 2.2.
8722 * configure.ac (AC_INIT): Likewise.
8723
8724 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
8725
8726 * data/glr.c (yyreportTree): Make room in yystates for the state
8727 preceding the RHS. This fixes the segmentation fault reported by Derek
8728 M. Jones in
8729 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
8730 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
8731 to the user. Reported for yyreportTree by Derek M. Jones later in the
8732 same thread.
8733 * THANKS: Add Derek M. Jones.
8734 Update my email address.
8735 Fix typo in Steve Murphy's name.
8736
8737 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
8738
8739 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
8740 checking against YYLAST that caused the parser to miss a potential
8741 alternative in its diagnostic.
8742 Problem reported by Maria Jose Moron Fernandez in
8743 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
8744 * data/lalr1.cc (yysyntax_error_): Likewise.
8745 * data/yacc.c (yysyntax_error): Likewise.
8746 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
8747 tokens, in case we run into an older C compiler.
8748 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
8749 Use them to check for the off-by-one error fixed above.
8750
8751 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
8752 YYSIZE_T, not size_t.
8753 * tests/regression.at (Trivial grammars): New test, to catch
8754 the error fixed by the above patch.
8755
8756 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8757
8758 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
8759 scheme.
8760 Reported by Steve Murphy.
8761
8762 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8763
8764 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
8765 * data/glr.cc: b4_location_flag is now b4_locations_flag.
8766
8767 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8768
8769 Implement --trace=m4.
8770 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
8771 * src/output.c (output_skeleton): When set, pass -dV to m4.
8772
8773 Factor the handling of flags in m4.
8774 * src/output.c (prepare): Rename the muscle names debug, defines,
8775 error_verbose to debug_flag, defines_flag, error_verbose_flag.
8776 * data/c.m4: Adjust.
8777 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
8778 Use b4_define_flag_if to define other b4_FLAG_if macros.
8779 (b4_location_if): As a consequence, rename as...
8780 (b4_locations_if): this, for consistency.
8781 Adjust all the skeletons.
8782
8783 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8784
8785 * etc/bench.pm: Shorten bench names.
8786
8787 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
8788
8789 * src/output.h, src/output.c (error_verbose): Move to...
8790 * src/getargs.h, src/getargs.c: here.
8791 Sort the flags.
8792 Adjust dependencies.
8793
8794 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
8795
8796 * data/c.m4 (b4_copyright): Put the special exception for Bison
8797 skeletons here, so we don't have to put it in each skeleton. All
8798 uses changed. Suggested by Akim Demaille. Also, wrap the
8799 copyright notice, in case it is longer than 80 columns. Replace
8800 comma by newline after title.
8801
8802 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
8803
8804 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
8805 incompatibility, not a bug. Mention that it wasn't fixed as of
8806 flex 2.5.33.
8807
8808 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
8809
8810 * examples/extexi: Enforce the precedence of concatenation over
8811 >>.
8812 Reported by Tommy Nordgren.
8813
8814 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
8815
8816 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
8817 with the member "token".
8818 Reported by Martin Nylin.
8819
8820 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
8821
8822 * data/glr.c: Switch to Bison 2.2 special-exception language in
8823 the copyright notice. Use more-regular format for titles and
8824 copyright notices.
8825 * data/glr.cc: Likewise.
8826 * data/location.cc: Likewise.
8827 * data/yacc.cc: Likewise.
8828 * doc/bison.texinfo (Conditions): Document this.
8829 * NEWS: likewise. Upgrade version to 2.2.
8830
8831 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
8832
8833 * data/glr.cc: Remove dead code.
8834
8835 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
8836
8837 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
8838 that variable and the line breaks the bootstrap. Problem reported
8839 by Juan M. Guerrero.
8840
8841 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
8842
8843 * doc/bison.texinfo (Multiple start-symbols): New.
8844
8845 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
8846
8847 * etc/README, etc/bench.pl: New.
8848
8849 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
8850
8851 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
8852 rule.
8853 Reported by Mickael Labau.
8854 * tests/input.at (Torturing the Scanner): Test it.
8855
8856 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
8857
8858 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
8859 Problem reported by Bob Rossi.
8860
8861 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
8862
8863 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
8864 and didn't really work.
8865 For the index, use @ifnotinfo, not @iftex.
8866 Minor cleanups of spacing and terminology.
8867
8868 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
8869
8870 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
8871 of AT_NAME_PREFIX when %name-prefix is not used.
8872
8873 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
8874
8875 Apply --prefix to C++ skeletons too: they change the namespace.
8876 The test suite already exercize these cases.
8877 * data/c++.m4 (b4_namespace): New.
8878 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
8879 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
8880 * data/yacc.c, data/glr.c: Remove a useless `[]'.
8881 * doc/bison.texinfo: Document it.
8882 (Option Cross Key): Use @multitable in all formats. It looks
8883 nicer, even in TeX outputs.
8884 (Rules): Use the same code whatever the output type is.
8885 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
8886 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
8887 * tests/calc.at: Use it, instead of hard coding `yy'.
8888
8889 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8890
8891 * TODO: Remove dead items.
8892
8893 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8894
8895 * doc/FAQ: Remove, merged into...
8896 * doc/bison.texinfo (FAQ): this.
8897 * doc/Makefile.am (EXTRA_DIST): Adjust.
8898
8899 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
8900
8901 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
8902 even if empty.
8903 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
8904 * doc/bison.texinfo (Calc++ Scanner): Use it.
8905
8906 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
8907
8908 Fix two nits reported by twlevo, plus one more that I discovered.
8909
8910 * src/assoc.h (assoc_to_string): Give a name to the arg, as
8911 this is the usual Bison style.
8912 * src/location.h (location_print): Likewise.
8913
8914 * src/reader.h (token_name): Likewise.
8915
8916 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
8917
8918 Fix some nits reported by twlevo.
8919 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
8920 and "POSIX". Use more-modern syntax for URLs. Mention C++
8921 and ask for Java. Don't hardwire OS version numbers. Add
8922 copyright notice.
8923 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
8924 * src/conflicts.c (solved_conflicts_obstack): Now static.
8925
8926 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
8927
8928 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
8929 page. Say "you can use it" not "you may use it" as on the web page;
8930 we're describing capabilities not granting permission.
8931
8932 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
8933
8934 * data/glr.c (yyresolveLocations): Rename local variables to avoid
8935 shadowing warnings. Use usual patter for iterating through RHS.
8936 * tests/glr-regression.at
8937 (Uninitialized location when reporting ambiguity):
8938 Modify yylex so that it uses its argument, rather than trying
8939 to rely on ARGSUSED (which doesn't work for gcc with warnings).
8940 const char -> char const.
8941
8942 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
8943 Don't use tabs inside commands; it messes up 'ps'.
8944 Problem reported by twlevo.
8945
8946 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
8947
8948 * tests/glr-regression.at (Uninitialized location when reporting
8949 ambiguity): New test case.
8950 * data/glr.c (yyresolveLocations): New function, which uses
8951 YYLLOC_DEFAULT.
8952 (yyresolveValue): Invoke yyresolveLocations before reporting an
8953 ambiguity.
8954 * doc/bison.texinfo (Default Action for Locations): Note
8955 YYLLOC_DEFAULT's usage for ambiguity locations.
8956 (GLR Semantic Actions): Cross-reference those notes.
8957
8958 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
8959
8960 * tests/glr-regression.at (Leaked semantic values when reporting
8961 ambiguity): Remove unnecessary union and type declarations.
8962 (Leaked lookahead after nondeterministic parse syntax error): New test
8963 case.
8964 * data/glr.c (yyparse): Check for zero stacks remaining before
8965 attempting to shift the lookahead so that you don't lose it.
8966
8967 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8968
8969 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
8970 * tests/glr-regression.at (Leaked semantic values when reporting
8971 ambiguity): New test case.
8972 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
8973 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
8974 now unnecessary yystackp parameter.
8975 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
8976 destructors can be called.
8977
8978 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
8979 in existing testcases.
8980
8981 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
8982
8983 Don't leak semantic values for parent RHS when a user action cuts the
8984 parser, and clean up related code a bit.
8985 * tests/glr-regression.at (Leaked merged semantic value if user action
8986 cuts parse): Rename to...
8987 (Leaked semantic values if user action cuts parse): ... this. Add check
8988 for leaked parent RHS values.
8989 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
8990 between an unresolved state (non-empty chain of semantic options) and
8991 an incomplete one (signaled by an empty chain).
8992 (yyresolveStates): Document the interface. Move all manipulation of a
8993 successfully or unsuccessfully resolved yyGLRState to...
8994 (yyresolveValue): ... here so that yyresolveValue always leaves a
8995 yyGLRState with consistent data and thus is easier to understand.
8996 Remove the yyvalp and yylocp parameters since they are always just
8997 taken from the yys parameter. When reporting a discarded merged value
8998 in debugging output, note that it is incompletely merged. Document the
8999 interface.
9000 (yyresolveAction): If resolving any of the RHS states fails, destroy
9001 them all rather than leaking them. Thus, as long as user actions are
9002 written to clean up the RHS correctly, yyresolveAction always cleans up
9003 the RHS of a semantic option. Document the interface.
9004
9005 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
9006
9007 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
9008 led to a segmentation fault in GNU Pascal. Problem reported
9009 by Waldek Hebisch.
9010
9011 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
9012
9013 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
9014 mid-rule action inside a nonterminal symbol in order to declare a
9015 destructor for its semantic value.
9016
9017 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
9018
9019 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
9020 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
9021 __cplusplus && ! defined _STDLIB_H && !
9022 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
9023 defined free))]: Include <stdlib.h> rather than rolling our own
9024 declarations of malloc and free, to avoid problems with
9025 incompatible declarations (using 'throw') C++'s stdlib.h. This
9026 should fix Debian bug 340012
9027 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
9028 reported by Guillaume Melquiond.
9029
9030 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9031
9032 * NEWS: Clarify symbols versus types in unused-value warnings.
9033
9034 * configure.ac (AC_INIT): Bump version number.
9035
9036 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
9037
9038 * NEWS: Version 2.1a.
9039 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
9040 since C99 requires this.
9041
9042 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
9043
9044 * m4/c-working.m4: New file.
9045 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
9046
9047 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
9048
9049 * Makefile.maint: Merge from coreutils.
9050
9051 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
9052
9053 More portability fixes for problems summarized by Nelson H. F. Beebe.
9054
9055 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
9056 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
9057 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
9058 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
9059 messes up because C++ code is compiled in 32-bit mode but linked
9060 in 64-bit mode.
9061
9062 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
9063
9064 More portability fixes for problems summarized by Nelson H. F. Beebe.
9065
9066 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
9067 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
9068
9069 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
9070 nodist_PROGRAMS, since we don't need to actually compile the
9071 example if we're just doing a plain 'make'. This avoids bothering
9072 the installer unnecessarily about problems due to weird C++
9073 compilers.
9074
9075 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
9076
9077 More portability fixes for problems summarized by Nelson H. F. Beebe.
9078
9079 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
9080 than #include "...", and compile with -I'.'. The old method was
9081 not portable, according to Posix and the C standard, and it does
9082 not work with Sun C 5.7, where previous #line directives affect
9083 the working directory used in later #include "..." directives.
9084
9085 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9086
9087 Various DJGGP specific issues in /djgpp
9088
9089 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
9090
9091 More portability fixes for problems summarized by Nelson H. F. Beebe.
9092
9093 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
9094 '#include <map>' works and that you can apply ++ to iterators.
9095
9096 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
9097
9098 Work around portability problems summarized by Nelson H. F. Beebe in
9099 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
9100
9101 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9102 that '#include <string>' works.
9103
9104 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
9105 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
9106 "warning: sorry: semantics of inline function static data `const
9107 unsigned char translate_table[262]' are wrong (you'll wind up with
9108 multiple copies)".
9109
9110 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
9111 or, xor to not_, and_, or_, and xor_, respectively. This works
9112 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
9113 random system header somewhere that includes the equivalent of
9114 <iso646.h>.
9115
9116 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
9117 -E" works; it apparently doesn't work with PathScale EKO Compiler
9118 Suite Version 2.0.
9119
9120 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
9121
9122 During deterministic GLR operation, user actions should be able to
9123 influence the parse by changing yychar. To make this easier to fix and
9124 to make glr.c easier to evolve in general, don't maintain yytoken in
9125 parallel with yychar; just compute yytoken when needed.
9126 * tests/glr-regression.at (Incorrect lookahead during deterministic
9127 GLR): Check that setting yychar in a user action has the intended
9128 effect.
9129 * data/glr.c (yyGLRStack): Remove yytokenp member.
9130 (yyclearin): Don't set *yytokenp.
9131 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
9132 yychar rather than *yytokenp to determine the current lookahead.
9133 Compute yytoken locally when needed.
9134 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
9135 point to.
9136
9137 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
9138 after `--report' documentation.
9139
9140 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
9141
9142 * src/parse-gram.y (grammar_declaration): Location of printer
9143 symbol is @1, not list->location. Bug reported by twlevo.
9144 * tests/input.at (Incompatible Aliases): Adjust to above change.
9145
9146 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
9147
9148 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
9149 all the test at once. This makes the output easier to read in the
9150 normal case.
9151
9152 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
9153 got from <http://bro-ids.org/download.html>. The bug is that
9154 when two actions appeared in succession, the second one was
9155 scanned before the first one was added to the grammar rule
9156 as a midrule action. Bison then output the incorrect warning
9157 "parse.y:905.17-906.36: warning: unused value: $3".
9158 * src/parse-gram.y (BRACED_CODE, action): These are no longer
9159 associated with a value.
9160 (rhs): Don't invoke grammar_current_rule_action_append.
9161 (action): Invoke it here instead.
9162 * src/reader.c (grammar_midrule_action): Now extern.
9163 (grammar_current_rule_action_append): Don't invoke
9164 grammar_midrule_action; that is now the scanner's job.
9165 * src/reader.h (last_string, last_braced_code_loc):
9166 (grammar_midrule_action): New decls.
9167 * src/scan-gram.l (last_string): Now extern, sigh.
9168 (last_braced_code_loc): New extern variable.
9169 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
9170 rule already has an action.
9171 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
9172 * tests/input.at (AT_CHECK_UNUSED_VALUES):
9173 Add some tests to check that the above changes fixed the bug.
9174
9175 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
9176
9177 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
9178 All used changed. Check whether the symbol has a destructor,
9179 not whether it is typed.
9180 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
9181 that the values are still reported as unused. All line numbers
9182 adjusted.
9183
9184 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
9185
9186 Work around a bug in bro 0.8, which underparenthesizes its
9187 definition of YYLLOC_DEFAULT.
9188 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
9189 their arguments.
9190 * data/lalr1.cc: Likewise.
9191 * data/yacc.cc: Likewise.
9192
9193 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
9194
9195 Work around a bug in Pike 7.0, and give the Pike folks a
9196 better way to override the usual int widths.
9197 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
9198 user can override the types.
9199 (short): #undef, to work around a bug in Pike 7.0.
9200 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
9201 (union yyalloc.yyss): Use yytype_int16 rather than short.
9202 All uses changed.
9203 (yysigned_char): Remove.
9204 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
9205 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
9206 * tests/regression.at (Web2c Actions): Adjust to above changes.
9207
9208 * src/reader.c (check_and_convert_grammar): New function.
9209 (reader): Close the input file even if something went wrong during
9210 parsing. Minor file descriptor leak reported by twlevo.
9211
9212 * src/assoc.c (assoc_to_string): Use a default: abort (); case
9213 to pacify gcc -Wswitch-default.
9214 * src/scan-gram.l (adjust_location): Use a default: break; case
9215 to pacify gcc -Wswitch-default.
9216 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
9217 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
9218 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
9219 Move these decls to scan-skel.l, since they don't need to be
9220 visible elsewhere.
9221 * src/scan-skel.l: Accept the above decls.
9222 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
9223 is used.
9224
9225 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
9226
9227 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
9228 since we don't want to insist on a version number at the start
9229 of the changelog every time.
9230 * Makefile.maint: Sync from coreutils a bit better.
9231 (sc_trailing_blank): Renamed from sc_trailing_space.
9232 All uses changed.
9233 (sc_no_if_have_config_h, sc_require_config_h):
9234 (sc_prohibit_assert_without_use): New rules.
9235 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
9236 (sc_dd_max_sym_length): Fix leading spaces in rule.
9237 (sc_system_h_headers): Prefix with @.
9238 (sc_useless_cpp_parens, m4-check): Output line numbers.
9239 (changelog-check): Allow version only in head.
9240 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
9241 satisfy new Makefile.maint rule.
9242 * data/glr.c: Likewise.
9243 * data/glr.cc: Likewise.
9244 * data/lalr1.cc: Likewise.
9245 * data/yacc.c: Likewise.
9246 * lib/ebitsetv.c: Likewise.
9247 * lib/lbitset.c: Likewise.
9248 * lib/subpipe.c: Likewise.
9249 * lib/timevar.c: Likewise.
9250 * src/system.h: Likewise.
9251 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
9252 * djgpp/Makefile.maint: Add copyright notice.
9253 * djgpp/README.in: Likewise.
9254 * djgpp/config.bat: Likewise.
9255 * djgpp/config.site: Likewise.
9256 * djgpp/config_h.sed: Likewise.
9257 * djgpp/djunpack.bat: Likewise.
9258 * djgpp/config.sed: Fix copyright notice to match standard format.
9259 * djgpp/subpipe.h: Likewise.
9260 * lib/bitsetv-print.c: Likewise.
9261 * lib/bitsetv.c: Likewise.
9262 * lib/subpipe.h: Likewise.
9263 * lib/timevar.c: Likewise.
9264 * lib/timevar.h: Likewise.
9265 * djgpp/subpipe.c: Use standard recipe for config.h.
9266 * lib/abitset.c: Likewise.
9267 * lib/bitset.c: Likewise.
9268 * lib/bitset_stats.c: Likewise.
9269 * lib/bitsetv-print.c: Likewise.
9270 * lib/bitsetv.c: Likewise.
9271 * lib/ebitsetv.c: Likewise.
9272 * lib/get-errno.c: Likewise.
9273 * lib/lbitset.c: Likewise.
9274 * lib/subpipe.c: Likewise.
9275 * lib/timevar.c: Likewise.
9276 * lib/vbitset.c: Likewise.
9277 * tests/local.at: Likewise.
9278 * src/scan-gram.l: Don't include verify.h, since system.h does
9279 that for us.
9280 * .x-sc_require_config_h: New file.
9281 * .x-sc_unmarked_diagnostics: New file.
9282
9283 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
9284
9285 Be a bit more systematic about using 'abort'.
9286 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
9287 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
9288 Put 'default: abort ();' before some other case, to satisfy older
9289 pedantic compilers.
9290 * lib/bitset_stats.c (bitset_stats_init): Likewise.
9291 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
9292 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
9293 * src/conflicts.c (resolve_sr_conflict): Likewise.
9294 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
9295 (get_decision_str, get_orientation_str, get_node_alignment_str):
9296 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
9297 (get_linestyle_str, get_arrowstyle_str): Likewise.
9298 * src/conflicts.c (resolve_sr_conflict):
9299 Use a default case rather than one for the one remaining enum
9300 value, to catch invalid enum values as well.
9301 * src/lalr.c (set_goto_map, map_goto):
9302 Prefer "assert (FOO);" to "if (!FOO) abort ();".
9303 * src/nullable.c (nullable_compute, token_definitions_output):
9304 Likewise.
9305 * src/reader.c (packgram, reader): Likewise.
9306 * src/state.c (transitions_to, state_new, state_reduction_find):
9307 Likewise.
9308 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
9309 (symbol_pack): Likewise.
9310 * src/tables.c (conflict_row, pack_vector): Likewise.
9311 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
9312 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
9313 * src/system.h: Don't include <assert.h>.
9314 (assert): New macro.
9315
9316 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
9317 (Destructor Decl, Parser Function, Pure Calling):
9318 Describe rules for braces inside C code more carefully.
9319
9320 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
9321
9322 Fix some porting glitches found by Nelson H. F. Beebe.
9323 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
9324 compilers that don't understand that abort () does not return.
9325 * src/state.c (transitions_to): Likewise.
9326 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
9327 that '#include <cstdlib>' works.
9328 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
9329 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
9330 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
9331 for the benefit of some pre-C99 compilers.
9332
9333 * bootstrap: Undo changes to gnulib files that autoreconf made.
9334
9335 Minor fixups to get 'make maintainer-check' to work.
9336 * configure.ac: Don't use -Wnested-externs, as it's incompatible
9337 with the new verify.h implementation.
9338 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
9339 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
9340 * data/yacc.c (YYUSE): Likewise.
9341 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
9342 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
9343 * src/parse-gram.y (declaration): Don't pass a string constant
9344 to a function that expects char *, since GCC might complain
9345 about the constant value.
9346 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
9347 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
9348 before #defining them.
9349 * tests/glr-regression.at
9350 (Incorrectly initialized location for empty right-hand side in GLR):
9351 In yyerror, use the msg arg.
9352 (Corrupted semantic options if user action cuts parse):
9353 (Incorrect lookahead during deterministic GLR):
9354 (Incorrect lookahead during nondeterministic GLR):
9355 Don't name a local var 'index'; it shadows string.h's 'index'.
9356
9357 2006-01-19 Akim Demaille <akim@epita.fr>
9358
9359 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
9360 location, not just parts of it.
9361
9362 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
9363
9364 * NEWS: Document the fact that multiple %unions are now allowed.
9365 * doc/bison.texinfo (Union Decl): Likewise.
9366 * TODO: This feature is now implemented, so remove it from
9367 the wishlist.
9368
9369 * Makefile.maint: Merge with coreutils Makefile.maint.
9370 (CVS_LIST): Use build-aux version if available.
9371 (VERSION_REGEXP): New macro.
9372 (syntax-check-rules): Add sc_no_if_have_config_h,
9373 sc_prohibit_assert_without_use, sc_require_config_h,
9374 sc_useless_cpp_parens.
9375 (sc_obsolete_symbols): Check for O_NDELAY.
9376 (sc_dd_max_sym_length): Track coreutils.
9377 (sc_unmarked_diagnostics): Look in all files, not just *.c.
9378 (sc_useless_cpp_parens): New rule.
9379 (news-date-check): Look for version or today's date.
9380 (changelog-check): Don't require version number near head.
9381 (copyright-check): Use current year instead of hardwiring 2005.
9382 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
9383 (announcement): Add --gpg-key-ID.
9384
9385 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
9386 with "file system".
9387
9388 Avoid undefined behavior that addressed just before the start of an
9389 array. Problem reported by twlevo.
9390 * src/reader.c (packgram): Prepend a new sentinel before ritem.
9391 * src/lalr.c (build_relations): Rely on new sentinel.
9392 * src/gram.c (gram_free): Adjust to new sentinel.
9393
9394 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
9395
9396 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
9397 yylookaheadNeeds. All uses updated.
9398 (yysplitStack): Rename local yynewLookaheadStatuses to
9399 yynewLookaheadNeeds.
9400 * data/glr-regression.at (Incorrect lookahead during nondeterministic
9401 GLR): In comments, change `lookahead status' to `lookahead need'.
9402
9403 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9404
9405 * data/glr.c (yysplitStack): A little stylistic rewrite.
9406
9407 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
9408
9409 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
9410
9411 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
9412
9413 * doc/bison.texinfo: Fix some typos.
9414 (GLR Semantic Actions): New subsection discussing special
9415 considerations because GLR semantic actions might be deferred.
9416 (Actions): Mention look-ahead usage of yylval.
9417 (Actions and Locations): Mention look-ahead usage of yylloc.
9418 (Special Features for Use in Actions): Add YYEOF entry and mention it
9419 in the yychar entry.
9420 In the yychar entry, remove mention of the local yychar case (pure
9421 parser) since this is irrelevant information when writing semantic
9422 actions and since it's already discussed in `Table of Symbols' where
9423 yychar is otherwise described as an external variable.
9424 In the yychar entry, don't call it the `current' look-ahead since it
9425 isn't when semantic actions are deferred.
9426 In the yychar and yyclearin entries, add note about deferred semantic
9427 actions.
9428 Add yylloc and yylval entries discussing look-ahead usage.
9429 (Look-Ahead Tokens): When discussing yychar, don't call it the
9430 `current' look-ahead, and do mention yylval and yylloc.
9431 (Error Recovery): Cross-reference `Action Features' when mentioning
9432 yyclearin.
9433 (Table of Symbols): In the yychar entry, don't call it the `current'
9434 look-ahead.
9435 In the yylloc and yylval entries, mention look-ahead usage.
9436
9437 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
9438
9439 * tests/glr-regression.at: Update copyright year to 2006.
9440
9441 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9442
9443 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
9444 use during nondeterministic operation to track which stacks have
9445 actually needed the current lookahead.
9446 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
9447 Allocate, deallocate, resize, and otherwise shuffle space for
9448 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
9449 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
9450 appropriately during nondeterministic operation.
9451 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
9452 members to store the current lookahead to be used by the deferred
9453 user action.
9454 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
9455 from which the RHS is taken. Set the lookahead members of the new
9456 yySemanticOption according to the lookahead status for stack yyk.
9457 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
9458 yyaddDeferredAction.
9459 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
9460 members of yySemanticOption before invoking yyuserAction, and then set
9461 them back to their current values afterward.
9462 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
9463 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
9464 * tests/glr-regression.at: Remove `.' from the ends of recent test case
9465 titles for consistency.
9466 (Leaked merged semantic value if user action cuts parse): In order to
9467 suppress lint warnings, use arguments in merge function, and assign
9468 char value < 128 in main.
9469 (Incorrect lookahead during deterministic GLR): New test case.
9470 (Incorrect lookahead during nondeterministic GLR): New test case.
9471
9472 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9473
9474 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
9475 !yyvaluep as signal that no semantic value is available to print.
9476 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
9477 to print a semantic value.
9478
9479 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
9480
9481 * tests/glr-regression.at: For consistency with my newer test cases,
9482 don't thank myself.
9483
9484 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
9485
9486 * data/glr.c (yyresolveValue): When merging semantic options, if at
9487 least one user action succeeds but a later one cuts the parse, then
9488 destroy the semantic value before returning rather than leaking it.
9489 (yyresolveStates): If a user action cuts the parse and thus
9490 yyresolveValue fails, ignore the (unset) semantic value rather than
9491 corrupting the yyGLRState, and empty the semantic options list since
9492 the user actions should have called all necessary destructors.
9493 Simplify code with YYCHK.
9494 * tests/glr-regression.at (Corrupted semantic options if user action
9495 cuts parse): New test case.
9496 (Undesirable destructors if user action cuts parse): New test case.
9497 Before applying any of this patch, this test case never actually failed
9498 for me... but only because the corrupted semantic options usually
9499 masked this bug.
9500 (Leaked merged semantic value if user action cuts parse): New test
9501 case.
9502
9503 2006-01-05 Akim Demaille <akim@epita.fr>
9504
9505 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
9506
9507 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
9508
9509 * data/c.m4 (b4_c_modern): New macro, with a new provision for
9510 _MSC_VER. Problem reported by Cenzato Marco.
9511 (b4_c_function_def): Use it.
9512 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
9513 b4_c_modern.
9514 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
9515 than rolling our own.
9516
9517 2006-01-04 Akim Demaille <akim@epita.fr>
9518
9519 Also warn about non-used mid-rule values.
9520 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
9521 member.
9522 (symbol_list_new): Adjust.
9523 * src/reader.c (symbol_typed_p): New.
9524 (grammar_rule_check): Use it.
9525 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
9526 Check its rule.
9527 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
9528 Use it.
9529 * tests/actions.at (Exotic Dollars): Adjust.
9530
9531 2006-01-04 Akim Demaille <akim@epita.fr>
9532
9533 * src/reader.c (grammar_midrule_action): If $$ is set in a
9534 mid-rule, move the `used' bit to its lhs.
9535 * tests/input.at (Unused values): New.
9536 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
9537
9538 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
9539
9540 * doc/bison.texinfo (Bison Options): Say more accurately what
9541 --yacc does.
9542 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
9543 about declarations in the grammar when in Yacc mode, as POSIX does
9544 not require a diagnostic when the grammar uses extensions.
9545
9546 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
9547
9548 Warn about dubious constructions like "%token T T".
9549 Reported by twlevo.
9550 * src/symtab.h (struct symbol.declared): New member.
9551 * src/symtab.c (symbol_new): Initialize it to false.
9552 (symbol_class_set): New arg DECLARING, specifying whether
9553 this is a declaration that we want to warn about, if there
9554 is more than one of them. All uses changed.
9555
9556 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
9557 Allow multiple %union directives, whose contents concatenate.
9558 * src/parse-gram.y (grammar_declaration): Likewise.
9559 Use muscle_code_grow, so that we don't need stype_line any more.
9560 All uses changed.
9561
9562 * src/muscle_tab.c (muscle_grow): Fix comment.
9563
9564 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
9565 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
9566 Update copyright year to 2006.
9567
9568 2006-01-03 Akim Demaille <akim@epita.fr>
9569
9570 Have glr.cc pass (some of) the calc.at tests.
9571 * data/glr.cc (b4_parse_param_orig): New.
9572 (b4_parse_param): Improve its definition, and bound it more
9573 clearly in the skeleton.
9574 (b4_epilogue): Append, instead of prepending, in order to keep
9575 #line consistency.
9576 Simplify the generation of auxiliary functions: locations and
9577 purity are mandated.
9578 (b4_global_tokens_and_yystype): Honor it.
9579 * data/location.cc (c++.m4): Don't include it.
9580 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
9581 and AT_SKEL_CC_IF.
9582 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
9583 AT_LALR1_CC_IF.
9584 Be sure to initialize the first position's filename.
9585 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
9586 mandated anyway.
9587 (AT_CHECK_CALC_GLR_CC): New.
9588 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
9589
9590 2006-01-02 Akim Demaille <akim@epita.fr>
9591
9592 * src/output.c (output_skeleton): Don't hard wire the inclusion of
9593 c.m4.
9594 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
9595 * data/glr.cc: Do not include stack.hh.
9596
9597 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
9598
9599 * data/glr.c: Reformat whitespace with tabs.
9600 (b4_lpure_formals): Remove this unused m4 macro.
9601 * tests/cxx-type.at: Reformat whitespace with tabs.
9602 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
9603 since it's a member. Rename type to isNterm for clarity.
9604
9605 2005-12-29 Akim <akim@sulaco.local>
9606
9607 Let glr.cc catch up with symbol_value_print.
9608 * data/glr.cc (b4_yysymprint_generate): Replace by...
9609 (b4_yy_symbol_print_generate): this.
9610 (yy_symbol_print, yy_symbol_value_print): Declare them.
9611
9612 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
9613
9614 * src/location.h (boundary): Note that a line or column equal
9615 to INT_MAX indicates an overflow.
9616 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
9617 (rule_length_overflow, increment_rule_length, add_column_width):
9618 New functions.
9619 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
9620 (<SC_BRACED_CODE>"}"):
9621 Use increment_rule_length rather than incrementing it by hand.
9622 (adjust_location, handle_syncline): Diagnose overflow.
9623 (handle_action_dollar, handle_action_at):
9624 Fix bug with monstrosities like $-2147483648.
9625 Remove now-unnecessary checks.
9626 (scan_integer): Verify assumptions and remove now-unnecessary checks.
9627 (convert_ucn_to_byte): Verify assumptions.
9628 (handle_syncline): New arg LOC. All callers changed.
9629 Don't store through a value derived from char const * pointer.
9630
9631 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
9632 GCC warnings.
9633
9634 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
9635
9636 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
9637 Remove unnecessary forward static decls.
9638
9639 2005-12-27 Akim Demaille <akim@epita.fr>
9640
9641 * src/reader.c (grammar_current_rule_check): Also check that $$
9642 is used.
9643 Take the rule to check as argument, hence rename as...
9644 (grammar_rule_check): this.
9645 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
9646 Rename as...
9647 (grammar_rule_begin, grammar_rule_end): these, for consistency.
9648 (grammar_midrule_action, grammar_symbol_append): Now static.
9649 * tests/torture.at (input): Don't rely on the default action
9650 being always performed.
9651 * tests/calc.at: "Set" $$ even when the action is "cut" with
9652 YYERROR or other.
9653 * tests/actions.at (Exotic Dollars): Instead of using unused
9654 values, check that the warning is issued.
9655
9656 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
9657
9658 * NEWS: Improve wording for unused-value warnings.
9659
9660 2005-12-22 Akim Demaille <akim@epita.fr>
9661
9662 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
9663 (b4_yysymprint_generate): Rename as...
9664 (b4_yy_symbol_print_generate): this.
9665 Generate yy_symbol_print instead of yysymprint.
9666 Generate also yy_symbol_value_print, and use it.
9667
9668 2005-12-22 Akim Demaille <akim@epita.fr>
9669
9670 * NEWS: Warn about unused values.
9671 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
9672 a `used' member.
9673 (symbol_list_n_get, symbol_list_n_used_set): New.
9674 (symbol_list_n_type_name_get): Use symbol_list_n_get.
9675 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
9676 * src/reader.c (grammar_current_rule_check): Check that values are
9677 used.
9678 * src/symtab.c (symbol_print): Accept 0.
9679 * tests/existing.at: Remove the type information.
9680 Empty the actions.
9681 Remove useless actions (beware of mid-rule actions: perl -000
9682 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
9683 * tests/actions.at (Exotic Dollars): Use unused values.
9684 * tests/calc.at: Likewise.
9685 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9686 Likewise.
9687
9688 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
9689 rule_useful_p.
9690
9691 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
9692
9693 Undo 2005-12-01 tentative license wording change. The wording is
9694 still being reviewed by the lawyers, and we don't want to wait for
9695 them before publishing a test release. For now, revert to the
9696 previous wording.
9697 * NEWS: Undo 2005-12-01 change.
9698 * data/glr.c: Revert to previous license wording.
9699 * data/glr.cc: Likewise.
9700 * data/lalr1.cc: Likewise.
9701 * data/location.cc: Likewise.
9702 * data/yacc.c: Likewise.
9703
9704 * NEWS: Reword %destructor vs YYABORT etc.
9705 * data/glr.c: Use American spacing, for consistency.
9706 * data/glr.cc: Likewise.
9707 * data/lalr1.cc: Likewise.
9708 * data/yacc.c: Likewise.
9709 * data/yacc.c: Reformat comments slightly.
9710 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
9711 for consistency. Fix some spelling errors and reword recently-included
9712 text slightly.
9713 * tests/cxx-type.at: Cast results of malloc, for C++.
9714
9715 2005-12-21 Joel E. Denny <address@hidden>
9716
9717 * tests/cxx-type.at: Construct a tree, count the parents of shared
9718 nodes, and free each node once and only once. Previously, the memory
9719 for semantic values was leaked instead.
9720
9721 2005-12-21 Joel E. Denny <address@hidden>
9722
9723 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
9724 (yylval, yylloc): If pure, #define to yystackp->yyval and
9725 yystackp->yyloc similar to yychar and yynerrs.
9726 (yyparse): If pure, remove local yylval and yylloc. Add local
9727 yystackp to accommodate pure definitions of yylval and yylloc.
9728 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
9729 yylvalp and yyllocp to &yylval and &yylloc.
9730 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
9731 namespace. Previously, nerrs and char were missing, but lval and lloc
9732 weren't necessary.
9733 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
9734 yylvalp and yyllocp parameters since, if pure, these are now always
9735 accessible through yystackp. If not pure, they are still accessible
9736 globally.
9737 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
9738 `if (YYID (N))' to pacify lint.
9739
9740 2005-12-21 Akim Demaille <akim@epita.fr>
9741
9742 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
9743 destroy the RHS symbols of a rule.
9744 * data/yacc.c (yylen): Initialize to 0.
9745 Keep its value to the number of items to possibly shift.
9746 In particular, a regular successful parse that ends on YYFINAL by
9747 a (internal) YYACCEPT must not have yylen != 0.
9748 (yyerrorlab, yyreturn): Pop the RHS.
9749 Reorder a bit to emphasize the `shifting' bits of code.
9750 (YYPOPSTACK): Now accept a number of items to pop.
9751 * data/lalr1.cc: Likewise.
9752 * data/glr.c: Formatting changes.
9753 Use goto instead of fall through.
9754 * doc/bison.texinfo (Destructor Decl): Complete.
9755
9756 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
9757
9758 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
9759 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
9760 * djgpp/config.bat: Replace every occurence of the file name
9761 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9762 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9763 * djgpp/config.sed: Replace every occurence of the file name
9764 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
9765 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
9766 * djgpp/djunpack.bat: DJGPP specific file.
9767 * djgpp/fnchange.lst: DJGPP specific file.
9768 * djgpp/README.in: Add new information about how to unpack the bison
9769 source on MSDOS and other systems which have 8.3 file name restrictions
9770 using djunpack.bat and fnchange.lst.
9771
9772 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
9773
9774 * bootstrap (build_cvs_prefix): Remove; unused.
9775 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
9776 when getting gnulib.
9777
9778 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
9779
9780 * data/glr.c: Reorder typedef declarations for structs to match order
9781 of struct declarations.
9782 Rename yystack everywhere to yystackp except in yyparse where it's not
9783 a pointer.
9784 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
9785 consistency.
9786 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
9787 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
9788 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
9789 lint.
9790
9791 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
9792
9793 * tests/sets.at (Accept): Fix typos in regular expression used to
9794 sed out the final state number.
9795
9796 Work around portability problem on Solaris 10: flex-generated
9797 files include <stdio.h> before <config.h>, which messes up
9798 because the latter defines __EXTENSIONS__. Address the problem
9799 by creating two new little files that include <config.h> first,
9800 then include the flex-generated files. Rewrite everyone else
9801 to include <config.h> first, as well.
9802 * lib/timevar.c: Always include "config.h".
9803 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
9804 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
9805 (EXTRA_bison_SOURCES): New macro.
9806 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
9807 * src/system.h: Don't include config.h.
9808 * src/LR0.c: Include <config.h> first.
9809 * src/assoc.c: Likewise.
9810 * src/closure.c: Likewise.
9811 * src/complain.c: Likewise.
9812 * src/conflicts.c: Likewise.
9813 * src/derives.c: Likewise.
9814 * src/files.c: Likewise.
9815 * src/getargs.c: Likewise.
9816 * src/gram.c: Likewise.
9817 * src/lalr.c: Likewise.
9818 * src/location.c: Likewise.
9819 * src/main.c: Likewise.
9820 * src/muscle_tab.c: Likewise.
9821 * src/nullable.c: Likewise.
9822 * src/output.c: Likewise.
9823 * src/parse-gram.y: Likewise.
9824 * src/print.c: Likewise.
9825 * src/print_graph.c: Likewise.
9826 * src/reader.c: Likewise.
9827 * src/reduce.c: Likewise.
9828 * src/relation.c: Likewise.
9829 * src/state.c: Likewise.
9830 * src/symlist.c: Likewise.
9831 * src/symtab.c: Likewise.
9832 * src/tables.c: Likewise.
9833 * src/uniqstr.c: Likewise.
9834 * src/vcg.c: Likewise.
9835
9836 * src/parse-gram.y: Fix minor problems uncovered by lint.
9837 (current_lhs, current_lhs_location): Now static.
9838 (current_assoc): Remove unused variable.
9839
9840 Cleanups so that Bison-generated parsers have less lint.
9841 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
9842 Prepend /*ARGSUSED*/, for lint's sake.
9843 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
9844 definition if 'lint' is defined.
9845 (YYID): New macro (or function, if lint).
9846 All uses of /*CONSTCOND*/0 replaced by YYID(0).
9847 * data/yacc.c: Likewise.
9848 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
9849 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
9850 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
9851 is C++ only.
9852 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
9853 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
9854 Use YYID(0) rather than 0, for lint.
9855 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
9856 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
9857
9858 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
9859
9860 * tests/glr-regression.at
9861 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
9862 Close memory leak reported by twlevo.
9863
9864 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
9865
9866 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
9867 all stacks.
9868 (yyparse): Iterate another stack in order to call user destructors.
9869 * tests/glr-regression.at (No users destructors if stack 0 deleted):
9870 New test case.
9871 (Duplicated user destructor for lookahead): This test now is expected
9872 to succeed.
9873
9874 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
9875
9876 * NEWS: Document the following change.
9877 * data/yacc.c: Say "parser skeleton" rather than "file", since
9878 it's no longer just a file.
9879 * data/glr.c: Grant a special exception for C GLR parsers, that
9880 reads like the already-existing exception for C LALR(1) parsers.
9881 * data/glr.cc: Likewise.
9882 * data/lalr1.cc: Likewise.
9883 * data/location.cc: Likewise.
9884 * data/yacc.c: Reword the "written by" statement to clarify that
9885 it was the parser skeleton, not the entire output file.
9886 * data/glr.c: Written by Paul Hilfinger.
9887 * data/glr.cc: Written by Akim Demaille.
9888 * data/lalr1.cc: Likewise.
9889
9890 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
9891
9892 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
9893 Fix typos in previous change that broke 'make check'.
9894 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
9895 supported in C.
9896 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
9897 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
9898 We can revert this once things settle down.
9899
9900 * src/conflicts.c (conflicts_print): Don't print file name twice
9901 when %expect fails because there were no conflicts.
9902 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
9903 change.
9904 * tests/conflicts.at (%expect not enough, %expect too much):
9905 (%expect with reduce conflicts): Adjust to new behavior.
9906
9907 2005-11-18 Akim Demaille <akim@epita.fr>
9908
9909 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
9910 errors.
9911 * NEWS: Document this.
9912 * doc/bison.texinfo (Expect Decl): Likewise.
9913
9914 2005-11-16 Akim Demaille <akim@epita.fr>
9915
9916 Generalize the display of semantic values and locations in traces.
9917 * data/glr.c (yy_reduce_print): Fix indices (again).
9918 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
9919 literal integers.
9920 * data/lalr1.cc (yyreduce_print): Rename as...
9921 (yy_reduce_print): this.
9922 Display values and locations.
9923 * data/yacc.c (yy_reduce_print): Likewise.
9924 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
9925 (yysymprint): Move higher to be visible from yy_reduce_print).
9926 (yyparse): Adjust.
9927 * tests/calc.at: Adjust the expected length of the traces.
9928
9929 2005-11-14 Akim Demaille <akim@epita.fr>
9930
9931 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
9932 from 1 to N, while values and location start at 0.
9933 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
9934
9935 2005-11-14 Akim Demaille <akim@epita.fr>
9936
9937 * data/glr.c (yy_reduce_print): Fix the $ number.
9938
9939 2005-11-14 Akim Demaille <akim@epita.fr>
9940
9941 "Use" parse parameters.
9942 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
9943 * data/glr.c, data/glr.cc: Use them.
9944 * data/glr.c (YYUSE): Have a C++ definition that supports
9945 non-pointer types.
9946
9947 2005-11-14 Akim Demaille <akim@epita.fr>
9948
9949 * data/glr.c (yyexpandGLRStack): Declare only if defined.
9950
9951 2005-11-14 Akim Demaille <akim@epita.fr>
9952
9953 * data/glr.cc: New.
9954 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
9955
9956 2005-11-12 Akim Demaille <akim@epita.fr>
9957
9958 Let position and location be PODs.
9959 * data/location.cc (position::initialize, location::initialize): New.
9960 (position::position, location::location): Define only if
9961 b4_location_constructors is defined.
9962 * data/lalr1.cc (b4_location_constructors): Define it for backward
9963 compatibility.
9964 * doc/bison.texinfo (Initial Action Decl): Use initialize.
9965
9966 2005-11-12 Akim Demaille <akim@epita.fr>
9967
9968 * data/lalr1.cc: Move the body of the ctor and dtor into the
9969 parser file (instead of the header).
9970 Wrap the implementations in a "namespace yy".
9971
9972 2005-11-12 Akim Demaille <akim@epita.fr>
9973
9974 Have glr.c include its header file when created.
9975 * data/glr.c (b4_shared_declarations): New.
9976 Output them verbatim in the parser if !%defines, otherwise
9977 output then in the header file, and include it instead.
9978
9979 2005-11-11 Akim Demaille <akim@epita.fr>
9980
9981 * data/glr.c: Comment changes.
9982
9983 2005-11-11 Akim Demaille <akim@epita.fr>
9984
9985 When yydebug, report semantic and location values for reductions.
9986 * data/glr.c (yy_reduce_print): Report the semantic values and the
9987 locations.
9988 (YY_REDUCE_PRINT): Adjust.
9989 (yyglrReduce): Use them.
9990 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
9991 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
9992 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
9993 traces.
9994
9995 2005-11-10 Akim Demaille <akim@epita.fr>
9996
9997 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
9998 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
9999 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
10000
10001 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
10002
10003 * m4/cxx.m4, examples/Makefile.am: Don't build
10004 examples/calc++ if no C++ compiler is available. (trivial change)
10005
10006 2005-11-09 Akim Demaille <akim@epita.fr>
10007
10008 * src/scan-skel.l: Use a couple of asserts.
10009
10010 2005-11-03 Akim Demaille <akim@epita.fr>
10011
10012 In some (weird) cases, the final state number is incorrect.
10013 Reported by Alexandre Duret-Lutz.
10014 * src/LR0.c (state_list_append): Remove the computation of
10015 final_state.
10016 (save_reductions): Do it here.
10017 (get_state): Alpha conversion.
10018 (generate_states): Use a for loop.
10019 * src/gram.h (item_number_is_rule_number)
10020 (item_number_is_symbol_number): New.
10021 * src/state.c: Use assert.
10022 * src/system.h: Include assert.h.
10023 * tests/sets.at (Accept): New.
10024
10025 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
10026
10027 * data/glr.c (yyfill): Adjust comment.
10028 (yyresolveAction): Initialize default location properly
10029 for empty right-hand sides.
10030 (yydoAction): Ditto.
10031 Add comment explaining apparently dead code.
10032 * tests/glr-regression.at
10033 (Incorrectly initialized location for empty right-hand side in GLR):
10034 New test.
10035
10036 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
10037
10038 * bootstrap (cleanup_gnulib): New function. Use it to clean up
10039 gnulib when interrupted. This fixes some race conditions and
10040 works around some portability problems (one noted by Paul
10041 Hilfinger).
10042
10043 2005-10-22 Akim <akim@epita.fr>
10044
10045 * Makefile.cfg: Adjust to config -> build-aux.
10046 Reported by twledo.
10047
10048 2005-10-21 Akim Demaille <akim@epita.fr>
10049
10050 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
10051 the %parse-params.
10052 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
10053 * data/yacc.c (b4_Pure_if): Rename as...
10054 (b4_yacc_pure_if): this.
10055 (YY_SYMBOL_PRINT, yyparse): Adjust.
10056 * doc/bison.texinfo: Formatting changes.
10057
10058 2005-10-21 Akim Demaille <akim@epita.fr>
10059
10060 Finish the transition config -> build-aux.
10061 * configure.ac, Makefile.am: Use build-aux.
10062 * config/prev-version, config/announce-gen, config/Makefile.am:
10063 Move to...
10064 * build-aux/prev-version, build-aux/announce-gen,
10065 * build-aux/Makefile.am: here.
10066
10067 2005-10-14 Akim Demaille <akim@epita.fr>
10068
10069 * examples/calc++/test: Use set -x only when VERBOSE.
10070
10071 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
10072
10073 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
10074 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
10075
10076 2005-10-13 Akim Demaille <akim@epita.fr>
10077
10078 * src/scan-skel.l: Output the base name parts of the parser and
10079 header file names.
10080 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
10081 additional checks.
10082 Use this to exercise C++ outputs in subdirs.
10083 Reported by Oleg Smolsky.
10084
10085 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
10086
10087 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
10088 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
10089 Problem reported by John P. Hartmann.
10090 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
10091 already defined it.
10092
10093 2005-10-12 Akim Demaille <akim@epita.fr>
10094
10095 * src/parse-gram.y (version_check): Exit 63 to please missing
10096 (stands for "version mismatch).
10097 * tests/input.at, doc/bison.texinfo: Adjust.
10098
10099 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
10100
10101 Work around portability problems with Visual Age C compiler
10102 (xlc and xlC_r) reported by John P. Hartmann.
10103 * data/location.cc (initial_column, initial_line): Remove.
10104 All uses replaced by 0 and 1.
10105 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
10106 that xlc complains about.
10107 * src/scan-skel.l (skel_wrap): Likewise.
10108 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
10109 as __STDC__.
10110 * data/yacc.c (YYMODERN_C): New macro, which also looks at
10111 __STDC_VERSION__. Use it everywhere instead of looking at
10112 __STDC__ and __cplusplus.
10113
10114 2005-10-10 Akim Demaille <akim@epita.fr>
10115
10116 * examples/calc++/test: Be quiet unless VERBOSE.
10117
10118 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
10119
10120 * data/c.m4 (yydestruct, yysymprint):
10121 Use YYUSE instead of casting to void.
10122 * data/glr.c (YYUSE): New macro.
10123 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10124 Use it instead of rolling our own.
10125 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10126 (YYCHK1):
10127 Use /*CONSTCOND*/ to suppress lint warnings.
10128 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
10129 (YY_STACK_PRINT): Use 'false' not '0'.
10130 (YYUSE): New macro.
10131 (yysymprint_, yydestruct_): Use it instead of rolling our own.
10132 * data/yacc.c (YYUSE): New macro.
10133 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
10134 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
10135 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
10136
10137
10138 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
10139 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
10140
10141 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
10142
10143 Undo the parts of the unlocked-I/O change that substituted
10144 putc or puts for printf. This might hurt performance a bit,
10145 but some people prefer the printf style.
10146 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
10147 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
10148 All uses replaced by YYFPRINTF and YYDPRINTF.
10149 * data/yacc.c: Likewise.
10150 * lib/bitset.c (bitset_print): Likewise.
10151 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
10152 putc and puts.
10153 * lib/lbitset.c (debug_lbitset): Likewise.
10154 * src/closure.c (print_firsts, print_fderives): Likewise.
10155 * src/gram.c (grammar_dump): Likewise.
10156 * src/lalr.c (look_ahead_tokens_print): Likewise.
10157 * src/output.c (escaped_output): Likewise.
10158 (user_actions_output): Break apart two printfs.
10159 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
10160 * src/reduce.c (reduce_print): Likewise.
10161 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10162 * src/system.h: Include unlocked-io.h rathe than stdio.h.
10163
10164 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
10165 Use assignments rather than casts-to-void to suppress
10166 unused-variable warnings. This pacifies 'lint'.
10167 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
10168 unused-variable warnings.
10169
10170 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10171
10172 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
10173
10174 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
10175
10176 Use unlocked I/O for a minor performance improvement on hosts like
10177 GNU/Linux and Solaris that support unlocked I/O. The basic idea
10178 is to use the gnlib unlocked-io module, and to prefer putc and
10179 puts to printf when either will work (since the latter doesn't
10180 come in an unlocked flavor).
10181 * bootstrap (gnulib_modules): Add unlocked-io.
10182 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
10183 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
10184 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
10185 and similarly for puts and putc and printf.
10186 * data/yacc.c: Likewise.
10187 * lib/bitset.c (bitset_print): Likewise.
10188 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
10189 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
10190 to printf.
10191 * lib/lbitset.c (debug_lbitset): Likewise.
10192 * src/closure.c (print_firsts, print_fderives): Likewise.
10193 * src/gram.c (grammar_dump): Likewise.
10194 * src/lalr.c (look_ahead_tokens_print): Likewise.
10195 * src/output.c (escaped_output): Likewise.
10196 (user_actions_output): Coalesce two printfs.
10197 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
10198 * src/reduce.c (reduce_print): Likewise.
10199 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
10200 * src/system.h: Include unlocked-io.h rather than stdio.h.
10201
10202 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
10203 this confuses xgettext.
10204
10205 2005-10-02 Akim Demaille <akim@epita.fr>
10206
10207 * bootstrap (gnulib_modules): Add strverscmp.
10208 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
10209 * m4/.cvsignore: Add strverscmp.m4.
10210 * src/parse-gram.y (%require): New token, new rule.
10211 (version_check): New.
10212 * src/scan-gram.l (%require): Adjust.
10213 * tests/input.at (AT_REQUIRE): New.
10214 Use it.
10215 * doc/bison.texinfo (Require Decl): New.
10216 (Calc++ Parser): Use %require.
10217
10218 2005-10-02 Akim Demaille <akim@epita.fr>
10219
10220 * data/location.cc: New.
10221
10222 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
10223 Akim Demaille <akim@epita.fr>
10224
10225 Make sure -odir/foo.cc creates dir/location.hh etc.
10226 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
10227 (spec_file_prefix, spec_verbose_file, spec_graph_file)
10228 (spec_defines_file): Now const.
10229 (dir_prefix): New.
10230 (short_base_name): Remove.
10231 * src/files.c: Adjust.
10232 (dirname.h): Include.
10233 (base_name): Don't prototype it.
10234 (finput): Remove, duplicates gram_in.
10235 (full_base_name, short_base_name): Replace by...
10236 (all_but_ext, all_but_tab_ext): these.
10237 (compute_base_names): Rename as...
10238 (compute_file_name_parts): this.
10239 Update to compute the new variables, including dir_prefix.
10240 Adjust dependencies.
10241 * src/output.c (prepare): Output them.
10242 * src/reader.c: Adjust to use gram_in, not finput.
10243 * src/scan-skel.l (@dir_prefix@): New.
10244
10245 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
10246
10247 * lib/subpipe.c: New function end_of_output_subpipe() added
10248 to allow support for non-posix systems. This is a no-op function
10249 for posix systems.
10250
10251 * lib/subpipe.h: New function end_of_output_subpipe() added
10252 to allow support for non-posix systems. This is a no-op function
10253 for posix systems.
10254
10255 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
10256 handle the lack of pipe/fork functionality on non-posix systems.
10257
10258 * djgpp/Makefile.maint: DJGPP specific file.
10259
10260 * djgpp/README.in: DJGPP specific file.
10261
10262 * djgpp/config.bat: DJGPP specific configuration file.
10263
10264 * djgpp/config.sed: DJGPP specific configuration file.
10265
10266 * djgpp/config.site: DJGPP specific configuration file.
10267
10268 * djgpp/config_h.sed: DJGPP specific configuration file.
10269
10270 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
10271
10272 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
10273
10274 2005-10-02 Akim Demaille <akim@epita.fr>
10275
10276 * data/location.cc: New, extract from...
10277 * data/lalr1.cc: here.
10278 (location.hh): Include it after the user prologue, in case the
10279 filename type is defined by the user.
10280 Forward declation location and position before the pre-prologue.
10281 (yyresult_): Rename as...
10282 (yyresult): this, it's a local variable, not an attribute.
10283 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
10284
10285 2005-10-01 Akim Demaille <akim@epita.fr>
10286
10287 * examples/extexi: Restore the #line generation.
10288
10289 2005-09-30 Akim Demaille <akim@epita.fr>,
10290 Alexandre Duret-Lutz <adl@gnu.org>
10291
10292 Move the token type and YYSTYPE in the parser class.
10293 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
10294 (parser::token): New, from the moved free definition of tokens.
10295 (parser::semantic_value): Now a full definition instead of an
10296 indirection to YYSTYPE.
10297 (b4_post_prologue): No longer included in the header file, but
10298 in the implementation file.
10299 * doc/bison.texi (C+ Language Interface): Update.
10300 * src/parse-gram.y: Support unary %define.
10301 * tests/actions.at: Define global_tokens_and_yystype for backward
10302 compatibility until we update the tests.
10303 * tests/calc.at: Idem.
10304 (first_line, first_column, last_line, last_column): Define for lalr1.cc
10305 to simplify the code.
10306
10307 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
10308
10309 Port to SunOS 4.1.4, which lacks strtoul and strerror.
10310 Ah, the good old days! Problem reported by Peter Klein.
10311 * bootstrap (gnulib_modules): Add strerror, strtoul.
10312 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
10313 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
10314
10315 2005-09-29 Akim Demaille <akim@epita.fr>
10316
10317 * data/c.m4 (b4_error_verbose_if): New.
10318 * data/lalr1.cc: Use it.
10319 (YYERROR_VERBOSE_IF): Remove.
10320 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
10321 parser members, replaced by...
10322 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
10323 local variables.
10324 (yysyntax_error_): Takes the state number as argument.
10325 (yyreduce_print_): Use the argument yyrule, not the former
10326 attribute yyn_.
10327
10328 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
10329
10330 * bootstrap (gnulib_modules): Add verify.
10331 * lib/.cvsignore: Add verify.h.
10332 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
10333 * src/system.h (verify): Remove.
10334 Include verify.h instead.
10335 * src/tables.c (tables_generate): Use new API for 'verify'.
10336
10337 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
10338
10339 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
10340 local variables whose names begin with 'yy'.
10341 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10342 Trivial changes from Joel E. Denny.
10343
10344 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
10345 it itself.
10346 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
10347 don't use alloca any more.
10348
10349 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
10350 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
10351 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
10352 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
10353 to match yacc.c, to test more hosts.
10354
10355 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
10356
10357 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
10358 doesn't affect behavior.
10359 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
10360 Solaris, AIX, MSC.
10361 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
10362 This works a bit better with glibc, if user code has already included
10363 stdlib.h.
10364 * doc/bison.texinfo (Bison Parser): Document that users can't
10365 arbitrarily use malloc and free for other purposes. Document
10366 that <alloca.h> and <malloc.h> might be included.
10367 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
10368 user must declare alloca.
10369
10370 * HACKING (release): Forwarn the Translation Project about
10371 stable releses.
10372
10373 2005-09-20 Akim Demaille <akim@epita.fr>
10374
10375 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
10376
10377 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
10378
10379 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
10380 (YYSTACK_ALLOC_MAXIMUM): Use it.
10381 (yysyntax_error): New function.
10382 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
10383 multiple syntax errors are reported, and alloca is being used.
10384 Instead, reallocate buffers twice as big each time, so that
10385 we waste at most half the allocated memory. Start with a small
10386 (128-byte) buffer that will suffice in most cases anyway.
10387 Use yysyntax_error to do most of the work.
10388
10389 * doc/bison.texinfo (Error Reporting, Table of Symbols):
10390 yynerrs is the number of errors reported, not the number of
10391 errors encountered.
10392
10393 * tests/glr-regression.at (Duplicated user destructor for lookahead):
10394 Mark it as expected to fail.
10395 Cast result of malloc; problem reported by twlevo@xs4all.nl.
10396 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
10397 Don't start user-code symbols with "yy", to avoid name space problems.
10398
10399 2005-09-19 Akim Demaille <akim@epita.fr>
10400
10401 Remove the traits, failed experiment.
10402 It never proved useful, and anyway because of the current
10403 definition, it was not possible to have several specialization of
10404 this traits, making it useless.
10405 * data/lalr1.cc (yy:traits): Remove.
10406 Inline its definitions in the parser class.
10407
10408 2005-09-19 Akim Demaille <akim@epita.fr>
10409
10410 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
10411 least Mac OSX with a /usr/local install of gettext.
10412
10413 2005-09-19 Akim Demaille <akim@epita.fr>
10414
10415 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
10416 and yytoken for similarity with the other skeletons.
10417
10418 2005-09-19 Akim Demaille <akim@epita.fr>
10419
10420 * NEWS, configure.ac: update version number to 2.1a.
10421
10422 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
10423
10424 * NEWS: Version 2.1.
10425
10426 * NEWS: Remove notice of yytname change, since it was never in an
10427 official release.
10428 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
10429 diagnostic.
10430 * src/output.c (prepare): Likewise.
10431 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
10432 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
10433 is not defined. This is an awful hack, but it's enough for now.
10434 All callers changed.
10435 * tests/glr-regression-at (make_value): Args are const pointers now,
10436 to avoid GCC warning.
10437 (Duplicated user destructor for lookahead): New test. Currently
10438 skipped. It fails on my host but I'm not sure it'll always fail.
10439
10440 2005-09-16 Akim Demaille <akim@epita.fr>
10441
10442 * src/symtab.h (struct symbol): Declare the printer and destructor
10443 as const, to avoid accidental calls to free.
10444 (symbol_destructor_set, symbol_printer_set): Adjust.
10445 * src/symtab.c: Adjust.
10446
10447 2005-09-16 Akim Demaille <akim@epita.fr>
10448
10449 * data/c.m4 (b4_token_enums): New.
10450 (b4_token_defines): Rename as...
10451 (b4_token_enums_defines): this.
10452 (b4_token_defines): New, output only the #defines.
10453 * data/yacc.c, data/glr.c: Adjust.
10454 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
10455 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
10456 as default values.
10457
10458 2005-09-16 Akim Demaille <akim@epita.fr>
10459
10460 * data/lalr1.cc (yylex_): Remove, inline its code.
10461 (yyreport_syntax_error_): Remove, replaced by...
10462 (yysyntax_error_): this which returns a string and leaves to the
10463 caller the call to the users' error function.
10464 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
10465 Move from members of the parser object...
10466 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
10467 to local variables of the parse function.
10468
10469 2005-09-16 Akim Demaille <akim@epita.fr>
10470
10471 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
10472 since it's in Bison's name space.
10473
10474 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
10475
10476 * data/glr.c (yyresolveValue): Add default case to pacify
10477 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
10478
10479 * NEWS: Document when yyparse started to return 2.
10480 * doc/bison.texinfo (Parser Function): Document when yyparse
10481 returns 2.
10482
10483 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
10484 (b4_filename_type): Renamed back from b4_file_name_type. All uses
10485 changed.
10486 (class position): file_name -> filename (reverting). All uses changed.
10487
10488 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
10489
10490 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
10491 do anything if $@ exists. This reverts part of the 2005-07-07
10492 patch.
10493
10494 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
10495
10496 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
10497 contains obsolete information and isn't worth distributing as a
10498 separate file anyway.
10499 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
10500 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
10501 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
10502 (yyparse): Abort if user code uses longjmp to throw an unexpected
10503 value.
10504
10505 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
10506
10507 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
10508 Suggested by twlevo@xs4all.nl.
10509
10510 * data/glr.c (YYCHK1): Do not assume YYE is in range.
10511 This avoids a diagnostic from gcc -Wswitch-enum.
10512 Problem reported by twlevo@xs4all.nl.
10513
10514 * doc/bison.texinfo: Don't use "filename", as per GNU coding
10515 standards. Use "file name" or "file" or "name", depending on
10516 the context.
10517 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
10518 not to hack/foo.tab.c.
10519 (Calc++ Top Level): 2nd arg of main is not const.
10520 * data/glr.c: b4_filename -> b4_file_name.
10521 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
10522 All uses changed.
10523 (class position): filename -> file_name. All uses changed.
10524 * data/yacc.c: b4_filename -> b4_file_name.
10525 * lib/bitset.h: filename -> file_name in local vars.
10526 * lib/bitset_stats.c: Likewise.
10527 * src/files.c: Likewise.
10528 * src/scan-skel.l ("@output ".*\n): Likewise.
10529 * src/files.c (file_name_split): Renamed from filename_split.
10530 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
10531
10532 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
10533
10534 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
10535 to accommodate latest gnulib.
10536
10537 * tests/glr-regression.at (Duplicate representation of merged trees):
10538 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
10539
10540 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
10541 needed.
10542
10543 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
10544
10545 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
10546 All uses changed. Invoke user destructor after an error during a
10547 split parse (trivial change from Joel E. Denny).
10548
10549 * tests/glr-regression.at
10550 (User destructor after an error during a split parse): New test case.
10551 Problem reported by Joel E. Denny in:
10552 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
10553
10554 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
10555
10556 * README-cvs: Give URLs for recommended tools.
10557 Mention Gzip version problem, and bootstrapping issues.
10558 Remove troubleshooting section, as it's somewhat obsolete.
10559
10560 * bootstrap (no_cache): New var, to accommodate different wget
10561 variants. Use it instead of '-C off'. Problem reported by
10562 twlevo@xs4all.nl.
10563
10564 * data/glr.c (yydestroyStackItem): New function.
10565 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
10566 debugging information. Problem reported by Joel E. Denny.
10567
10568 2005-08-25 Akim Demaille <akim@epita.fr>
10569
10570 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
10571
10572 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
10573
10574 * data/glr.c (yyrecoverSyntaxError, yyreturn):
10575 Don't invoke destructor on unresolved entries.
10576 * tests/glr-regression.at
10577 (User destructor for unresolved GLR semantic value): New test case.
10578 Problem reported by Joel E. Denny in:
10579 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
10580
10581 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
10582
10583 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
10584 Add strnlen.c.
10585 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
10586 lib-prefix.m4, po.m4.
10587
10588 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
10589 in yydestruct diagnostic, since it might not be an error.
10590 Problem reported by Joel Denny near end of
10591 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10592 * data/lalr1.cc (yyerturn): Likewise.
10593 * data/yacc.c (yyreturn): Likewise.
10594 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
10595
10596 * src/files.c: Remove obsolete FIXME comment.
10597
10598 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
10599 with the other templates, and to fix bogus run-on messages such
10600 as the one reported at the end of
10601 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
10602 All callers changed to avoid the newline.
10603 (yyprocessOneStack): Output two lines rather than one, to accommodate
10604 the above change. This changes the debug output format slightly.
10605
10606 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
10607 reported by Joel E. Denny in
10608 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
10609 (trivial change).
10610 * tests/glr-regression.at (Duplicate representation of merged trees):
10611 New test, from Joel E. Denny in:
10612 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
10613 * THANKS: Add Joel E. Denny.
10614
10615 * configure.ac (AC_INIT): Bump to 2.0c.
10616
10617 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
10618
10619 * NEWS: Version 2.0b.
10620
10621 * Makefile.am (SUBDIRS): Put examples before tests, so that
10622 "make check" doesn't finish with "All 1 tests passed".
10623
10624 * tests/regression.at (Token definitions): Don't rely on
10625 AT_PARSER_CHECK for data that contains backslashes. It currently
10626 uses 'echo', and 'echo' isn't portable if its argument contains
10627 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
10628 that the byte '\0xff' is not printable in the C locale; it is,
10629 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
10630 not printable, so use '\0x81' to test.
10631
10632 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
10633 version of GCC, since the macro is used with non-GCC compilers.
10634
10635 Fix core dump reported by Pablo De Napoli in
10636 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
10637 * tests/regression.at (Invalid inputs with {}): New test.
10638 * src/parse-gram.y (token_name): Translate type before using
10639 it as an index.
10640
10641 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
10642 the user's name space. All uses changed to __attribute__
10643 ((__unused__)).
10644 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
10645 Add __attribute__ ((__noreturn__)).
10646
10647 * etc/clcommit: Remove. We weren't using it, and it failed
10648 "make maintainer-distcheck".
10649 * Makefile.maint: Merge from coreutils.
10650 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
10651 (syntax-check-rules): Change list of rules as described below.
10652 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
10653 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
10654 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
10655 (sc_trailing_space): New rules.
10656 (sc_xalloc_h_in_src): Remove.
10657 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
10658 (sc_space_tab, sc_error_exit_success, sc_changelog):
10659 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
10660 (makefile-check, po-check, author_mark_check):
10661 (makefile_path_separator_check, copyright-check):
10662 Use grep -n, to make it easier to find violations.
10663 Use CVS_LIST and CVS_LIST_EXCEPT.
10664 (header_regexp, h_re): Remove.
10665 (dd_c): New macro.
10666 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
10667 (my-distcheck): Use more-modern GCC flags.
10668 (signatures, %.asc): Remove.
10669 (rel-files, announcement): Remove signatures.
10670 Restore old updating code, even though we don't use it, so
10671 that we're the same as coreutils.
10672 (alpha, beta, major): Depend on news-date-check.
10673 Make the upload commands.
10674
10675 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
10676 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
10677 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
10678 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
10679 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
10680 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
10681 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
10682 * tests/sets.at: Likewise.
10683
10684 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
10685 we comment out the Autoconf version number.
10686 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
10687 it's error-prone and "make maintainer-distcheck" rejects it.
10688
10689 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
10690 Indent calls to "error" to pacify "make maintainer-distcheck",
10691 when the calls are not intended to be translated.
10692 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
10693
10694 * src/Makefile.am (DEFS): Use +=, to pacify
10695 "make maintainer-distcheck".
10696 (bison_SOURCES): Add scan-skel.h.
10697 (sc_tight_scope): New rule, from coreutils.
10698
10699 * src/files.c (src_extension, header_extension):
10700 Now static, not extern.
10701 * src/getargs.c (short_options): Likewise.
10702 * src/muscle_tab.c (muscle_table): Likewise.
10703 * src/parse-gram.y (current_class, current_type, current_prec):
10704 Likewise.
10705 * src/reader.c (grammar_end, previous_rule_end): Likewise.
10706 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
10707 * src/main.c (main): Cast bindtextdomain and textdomain calls to
10708 void, to avoid warning when NLS is disabled.
10709 * src/output.c: Include scan-skel.h.
10710 (scan_skel): Remove decl, since scan-skel.h does this.
10711 (output_skeleton):
10712 Indent calls to "error" to pacify "make maintainer-distcheck".
10713 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
10714 * src/reader.h (gram_end, gram_lineno): New decls to pacify
10715 "make maintainer-distcheck".
10716 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
10717 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
10718 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
10719 (skel_lex_destroy, scan_skel): Move these decls to...
10720 * src/scan-skel.h: New file.
10721 * src/uniqstr.c (uniqstr_assert):
10722 Indent calls to "error" to pacify "make maintainer-distcheck".
10723
10724 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
10725 not @VAR@.
10726
10727 * tests/torture.at: Revamp to avoid misuse of atoi that
10728 "make maintainer-distcheck" complained about.
10729
10730 * examples/extexi (message): Don't print a message more than once,
10731 and omit line-number decoration that makes Emacs compile think
10732 that informative messages are worth worrying about.
10733
10734 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
10735
10736 * configure.ac: Update version number.
10737
10738 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
10739 accidentally.
10740 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
10741 autogenerated by the maintainer.
10742 * examples/calc++/.cvsignore: Add *.yy.
10743
10744 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
10745 * lib/bitset_stats.c (bitset_stats_init): Likewise.
10746 * lib/bitsetv.c (bitsetv_alloc): Likewise.
10747
10748 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
10749
10750 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
10751 from maintainer-distcheck about casting the argument of 'free'.
10752
10753 * NEWS: Mention recent yytname changes.
10754 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
10755
10756 * bootstrap: For translations that have not yet been upgraded to
10757 the new runtime-po domain, prime the pump by extracting the
10758 relevant strings from the obsolete translations. This code can be
10759 removed once the bison-runtime domain has been translated by each
10760 team.
10761
10762 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
10763 now that token names are already quoted.
10764
10765 Fix problem reported by Anthony Heading.
10766 * data/glr.c (YYTOKEN_TABLE): New macro.
10767 (yytname): Define if YYTOKEN_TABLE.
10768 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
10769 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
10770 (YYERROR_VERBOSE): Define the same way the other skeletons do.
10771 * src/output.c (prepare_symbols): Output token_table_flag.
10772
10773 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
10774
10775 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
10776 again if the first call fails.
10777
10778 * data/glr.c (yytnamerr): New function.
10779 (yyreportSyntaxError): Use it to dequote most string literals.
10780 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
10781 with other skeletons. All uses changed.
10782 (yytnameerr_): New function.
10783 (yyreport_syntax_error): Use it to dequote most string literals.
10784 * data/yacc.c (yytnamerr): New function.
10785 (yyerrlab): Use it to decode most string literals.
10786 * doc/bison.texinfo (Decl Summary, Calling Convention):
10787 Clarify quoting convention of yytname.
10788 * src/output.c (prepare_symbols): Quote all names. This undoes
10789 the 2005-04-17 change, which is now accomplished (mostly) via
10790 changes in the parsers as described above.
10791 * tests/regression.at (Token definitions, Web2c Actions):
10792 Undo most 2005-04-17 change here, too.
10793
10794 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
10795
10796 Fix more problems reported by twlevo@xs4all.nl.
10797 * tests/cxx-type.at: Don't pipe output of ./types through sed to
10798 remove trailing spaces. This loses the exit status of ./types,
10799 and isn't needed since ./types shouldn't be emitting trailing
10800 spaces.
10801 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
10802 as the stack isn't valid in that case.
10803
10804 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
10805 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
10806 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
10807 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
10808 is used.
10809 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
10810 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
10811 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
10812 Likewise.
10813
10814 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
10815 overly-picky compilers that reject 'char *foo = "bar";'.
10816
10817 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
10818 to FILE * parameter, not to stderr. This fixes a typo introduced
10819 in the 2005-07-12 change.
10820
10821 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
10822 warnings from GCC 4.
10823
10824 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
10825 (yyglrShiftDefer, yysplitStack):
10826 Remove unused parameters b4_pure_formals. All uses changed.
10827 (yyglrShift): Remove unused parameters b4_user_formals.
10828 All uses changed.
10829 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
10830
10831 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
10832
10833 Destructor cleanups and regularization among the three skeletons.
10834 * NEWS: Document the behavior changes.
10835 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
10836 stack before failing, as the cleanup code will do it for us now.
10837 * data/lalr1.cc (yyerrlab): Likewise.
10838 * data/glr.c (yyparse): Pop everything off the stack before
10839 freeing it, so that destructors get called properly.
10840 * data/lalr1.cc (yyreturn): Likewise.
10841 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
10842 This is more consistent.
10843 * doc/bison.texinfo (Destructor Decl): Mention more reasons
10844 why destructors might be called. 1.875 -> 2.1.
10845 (Destructor Decl, Decl Summary, Table of Symbols):
10846 Some English-language cleanups for %destructor.
10847 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
10848 Add output line for destructor of start symbol.
10849 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
10850 because of that same extra output line.
10851
10852 * NEWS: Document minor wording changes in diagnostics of
10853 Bison-generated parsers.
10854 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
10855 Remove unused formals. All uses changed.
10856 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
10857 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
10858 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
10859 Rename yyoverflowab to yyexhaustedlab.
10860 When memory exhaustion occurs during syntax-error reporting,
10861 report it separately rather than in a single diagnostic; this
10862 eases translation.
10863 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
10864 (Memory Exhausted): Renamed from Parser Stack Overflow.
10865 Revamp wording slightly to prefer "memory exhaustion".
10866 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
10867
10868 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
10869
10870 Add i18n support to the GLR skeleton. Partially fix the C++
10871 skeleton; a C++ expert needs to finish this. Remove debugging
10872 msgids; there's little point to having them translated, since they
10873 can be understood only by someone who can read the
10874 (English-language) source code.
10875
10876 Generate runtime-po/bison-runtime.pot automatically, so that we
10877 don't have to worry about garbage getting in that file. We'll
10878 make sure after the next official release that old msgids don't
10879 get lost. See
10880 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
10881
10882 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
10883 Now auto-generated.
10884 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
10885 Fix typos in explanations of the runtime file.
10886 * bootstrap: Change gettext keyword from YYI18N to YY_.
10887 Use standard Makefile.in.in in runtime-po, since we'll arrange
10888 for backward-compatible bison-runtime.po files in a different way.
10889 * data/glr.c (YY_): New macro, from yacc.c.
10890 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
10891 Translate messages intended for users.
10892 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
10893 the wording in the other skeletons. We don't know that the memory
10894 is virtual.
10895 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
10896 Use same method that yacc.c uses.
10897 Don't translate debugging messages.
10898 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
10899 it doesn't work (yet), and requires C++ expertise to fix.
10900 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
10901 Move defn to a more logical place, to be consistent with other
10902 skeletons.
10903 Don't translate debugging messages.
10904 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
10905 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
10906 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
10907 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
10908
10909 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
10910 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
10911 void, not int.
10912 * tests/glr-regression.at (Badly Collapsed GLR States):
10913 Likewise.
10914 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10915 yylex should return 0 at EOF rather than aborting.
10916
10917 Improve tests for stack overflow in GLR parser.
10918 Problem reported by twlevo@xs4all.nl.
10919 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
10920 All uses removed.
10921 (yyStackOverflow): Just longjmp, but with value 2 so that caller
10922 can handle the problem.
10923 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
10924 (yyparse): New local variable yyresult to record the result.
10925 Use result of setjmp to set it, rather than storing itinto
10926 struct.
10927 (yyDone): Remove label.
10928 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
10929 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
10930 if YYABORT is used).
10931 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
10932 yyparse status; put status > 1 into diagnostic.
10933 Check that status==2 works.
10934 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
10935 Use exit status 3 for failure to open (which shouldn't happen).
10936
10937 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
10938
10939 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
10940 1 on syntax error; just let yyparse do its thing.
10941 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
10942 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
10943 (Exploding the Stack Size with Alloca):
10944 (Exploding the Stack Size with Malloc):
10945 Expect exit status 2, not 1, since the parser is supposed to blow
10946 its stack. Problem reported by twlevo@xs4all.nl.
10947
10948 * data/glr.c (yyparse): Don't assume that the initial calls
10949 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
10950 Print a stack-overflow message and fail instead.
10951 Initialize the line-number information before creating the stack,
10952 so that the stack-overflow message can report line zero safely.
10953
10954 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
10955
10956 Fix problems reported by twlevo@xs4all.nl.
10957 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
10958 (yyuserMerge): Provide a default case if b4_mergers is empty.
10959 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
10960 * tests/glr-regression.at
10961 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
10962 Add casts to pacify C++ compilers.
10963 * tests/glr-regression.at (Improper merging of GLR delayed action
10964 sets): Declare yylex before using it.
10965 * tests/Makefile.am (maintainer-check-g++): Fix a stray
10966 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
10967 test for valgrind; valgrind is independent of g++.
10968 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
10969 for compatibility with POSIX 1003.1-2001 (if running coreutils).
10970 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
10971 Use a destructor, so that we can expand the stack. Change
10972 YYSTYPE to char * so that we can free it. Cast result of malloc.
10973
10974 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
10975
10976 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
10977 a valgrind failure. Problem reported by twlevo@xs4all.nl.
10978
10979 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
10980
10981 * PACKAGING: New file, suggested by Bruno Haible and taken from
10982 similar wording in gettext's PACKAGING file.
10983 * NEWS: Mention PACKAGING.
10984 * Makefile.am (EXTRA_DIST): Add PACKAGING.
10985
10986 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
10987
10988 * NEWS: Document recent i18n improvements.
10989 * bootstrap: Get runtime translations into runtime-po.
10990 Create runtime-po files automatically, if possible.
10991 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
10992 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
10993 does not infringe on the user's name space.
10994 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
10995 * doc/bison.texinfo (Internationalization): Revamp the English
10996 and Texinfo syntax a bit, to try to make it clearer.
10997 (Bison Options, Option Cross Key): Mention --print-localedir.
10998 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
10999 YYENABLE_NLS. Quote a bit more.
11000 * runtime-po/.cvsignore: New file.
11001 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
11002 * runtime-po/Rules-quot: Remove; now created by bootstrap.
11003 * runtime-po/quot.sed: Likewise.
11004 * runtime-po/boldquot.sed: Likewise.
11005 * runtime-po/en@quot.header: Likewise.
11006 * runtime-po/en@boldquot.header: Likewise.
11007 * runtime-po/insert-header.sin: Likewise.
11008 * runtime-po/remove-potcdate.sin: Likewise.
11009 * runtime-po/Makevars: Likewise.
11010 * runtime-po/LINGUAS: Likewise.
11011 * runtime-po/de.po: Likewise; we will rely on the translation project
11012 to maintain this, so "bootstrap" should get it.
11013 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
11014 its value.
11015 * src/main.c (main): Bind the bison-runtime domain, too.
11016
11017 2005-07-12 Bruno Haible <bruno@clisp.org>
11018
11019 * data/yacc.c: Include <libintl.h> when NLS is enabled.
11020 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
11021 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
11022 * runtime-po: New directory.
11023 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
11024 $(DOMAIN).pot-update rule, so that old messages are never dropped.
11025 * runtime-po/Rules-quot: New file, copied from po/.
11026 * runtime-po/quot.sed: Likewise.
11027 * runtime-po/boldquot.sed: Likewise.
11028 * runtime-po/en@quot.header: Likewise.
11029 * runtime-po/en@boldquot.header: Likewise.
11030 * runtime-po/insert-header.sin: Likewise.
11031 * runtime-po/remove-potcdate.sin: Likewise.
11032 * runtime-po/Makevars: New file.
11033 * runtime-po/POTFILES.in: New file.
11034 * runtime-po/LINGUAS: New file.
11035 * runtime-po/bison-runtime.pot: New file.
11036 * runtime-po/de.po: New file.
11037 * m4/bison.m4: New file.
11038 * Makefile.am (SUBDIRS): Add runtime-po.
11039 (aclocaldir, aclocal_DATA): New variables.
11040 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
11041 Define aclocaldir.
11042 * src/getargs.c (usage): Document --print-localedir option.
11043 (PRINT_LOCALEDIR_OPTION): New enum item.
11044 (long_options): Add --print-localedir option.
11045 (getargs): Handle --print-localedir option.
11046 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
11047 (Internationalization): New section.
11048
11049 2005-07-12 Akim Demaille <akim@epita.fr>
11050
11051 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
11052 for consistency with the rest of the code.
11053 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
11054 Add separators.
11055
11056 2005-07-12 Akim Demaille <akim@epita.fr>
11057
11058 * src/parse-gram.y: Use %printer instead of YYPRINT.
11059
11060 2005-07-12 Akim Demaille <akim@epita.fr>
11061
11062 * src/symtab.h, src/symtab.c (symbol_print): New.
11063 * src/symlist.h, src/symlist.c (symbol_list_print): New.
11064 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
11065
11066 2005-07-12 Akim Demaille <akim@epita.fr>
11067
11068 * data/glr.c (b4_syncline): Fix (swap) the definitions of
11069 b4_at_dollar and b4_dollar_dollar.
11070
11071 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
11072
11073 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
11074 and Pennello's paper.
11075
11076 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
11077
11078 * data/yacc.c (yyparse): Undo previous patch. Instead,
11079 set yylsp[0] and yyvsp[0] only if the initial action
11080 sets yylloc and yylval, respectively.
11081
11082 * data/yacc.c (yyparse): In the initial action, set
11083 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
11084 This avoids the use of undefined variables if the initial
11085 action does not set yylloc and/or yylval.
11086
11087 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
11088
11089 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
11090 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
11091 Remove from CVS. These files are automatically generated.
11092 * examples/extexi: Clarify that this file is now part of Bison,
11093 not GNU M4, and that it works with any POSIX-compatible Awk.
11094 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
11095 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
11096 so that we also get calc++-parser.yy. Geneate it.
11097 Use $(AWK), not gawk, since any conforming Awk will do.
11098 Put comment before action, since older 'make' can't handle comment
11099 in action.
11100 $(BUILT_SOURCES): List all built sources, not just some of them.
11101 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
11102 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
11103 $($(calc_sources_generated)): Remove unnecessary test for existence
11104 of target. (This had a shell syntax error anyway; a stray "x".)
11105 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
11106 calc++-parser.yy.
11107 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
11108
11109 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
11110 implied by the other modules.
11111
11112 2005-07-06 Akim Demaille <akim@epita.fr>
11113
11114 Bind examples/calc++ to the package.
11115 * examples/calc++/Makefile: Remove, replaced by...
11116 * examples/calc++/Makefile.am: ... this new file.
11117 * examples/calc++/test: Remove input.
11118 * examples/calc++/compile: Remove.
11119 * examples/Makefile.am: New.
11120 * configure.ac, Makefile.am: Adjust.
11121 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
11122
11123 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
11124
11125 * data/glr.c (yyFail): Drastically simplify; since the format argument
11126 never had any % directives, we can simply pass it to yyerror.
11127 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
11128 be modified later, as that is the usual style in glr.c.
11129 Problems reported by Paul Hilfinger.
11130
11131 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
11132 and size overflow errors.
11133 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
11134 in case the user prolog sets feature-test macros like _GNU_SOURCE.
11135 (YYSIZEMAX): New macro.
11136 (yystpcpy): New function, taken from yacc.c.
11137 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
11138 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
11139 so that we don't have to maintain their signatures.
11140 (yyFail): Check for buffer overflow, by using vsnprintf rather
11141 than vsprintf. Allocate a bigger buffer if possible.
11142 Report an error if buffer allocation fails.
11143 (yyStackOverflow): New function.
11144 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
11145 the initialization was successful. It might fail if storage was
11146 exhausted.
11147 (yyexpandGLRStack): Add more checks for storage allocation failure.
11148 Use yyStackOverflow to report failures.
11149 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
11150 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
11151 Don't assume stack number fits in int.
11152 (yysplitStack): Check for storage allocation failure.
11153 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
11154 can print diagnostics on storage allocation failure. All callers
11155 changed.
11156 (yyresolveValue): Use yybool for boolean.
11157 (yyreportSyntaxError): Check for size-calculation overflow.
11158 This code is taken from yacc.c.
11159 (yyparse): Check for storage allocation errors when allocating
11160 the initial stack.
11161
11162 2005-07-05 Akim Demaille <akim@epita.fr>
11163
11164 Extract calc++ from the documentation.
11165 * doc/bison.texinfo (Calc++): Add the extraction marks.
11166 * examples/extexi: New, from the aborted GNU Programming 2E.
11167 Separate the different paragraph of a file with empty lines.
11168 * examples/Makefile: Use it to extract the whole calc++ example.
11169
11170 2005-06-24 Akim Demaille <akim@epita.fr>
11171
11172 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
11173 class typedefs.
11174
11175 2005-06-22 Akim Demaille <akim@epita.fr>
11176
11177 * doc/bison.texinfo (C++ Language Interface): First stab.
11178 (C++ Parsers): Remove.
11179
11180 2005-06-22 Akim Demaille <akim@epita.fr>
11181
11182 * data/lalr1.cc (yylex_): Honor %lex-param.
11183
11184 2005-06-22 Akim Demaille <akim@epita.fr>
11185
11186 Start a set of simple examples.
11187 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
11188 * examples/calc++/calc++-driver.hh,
11189 * examples/calc++/calc++-parser.yy,
11190 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
11191 * examples/calc++/compile, examples/calc++/test: New.
11192
11193 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
11194
11195 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
11196 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
11197 which stems from the 2005-05-27 patch.
11198
11199 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
11200
11201 * data/glr.c: Modify treatment of unused parameters to permit use
11202 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
11203
11204 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
11205
11206 Fix infringement on user name space reported by Janos Zoltan Szabo.
11207 * data/yacc.c (yyparse): strlen -> yystrlen.
11208
11209 2005-05-30 Akim Demaille <akim@epita.fr>
11210
11211 * data/lalr1.cc (_): New.
11212 Translate the various messages.
11213
11214 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
11215
11216 Fix infringement on user name space reported by Bruno Haible.
11217 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
11218 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
11219 the user's name space.
11220 (alloca): Include <stdlib.h> to get it, if it's not built in.
11221 (YYMALLOC, YYFREE): Define only if needed.
11222 (malloc, free): Declare, but only if needed, as this infringes on
11223 the user name space.
11224
11225 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
11226
11227 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
11228 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
11229 with %d format.
11230 * lib/ebitset.c (min, max): Undef before defining.
11231 * lib/vbitset.c (min, max): Likewise.
11232 * lib/subpipe.c (create_subpipe): Save local variables in case
11233 vfork clobbers them.
11234
11235 2005-05-24 Bruno Haible <bruno@clisp.org>
11236
11237 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
11238 error message syntax used by gcc-4.0.
11239
11240 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
11241
11242 * README: Mention m4 1.4.3. Remove obsolete advice about
11243 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
11244
11245 * bootstrap: Remove workaround for problem I encountered with
11246 gettext 0.14.1; it seems to be fixed now.
11247
11248 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
11249
11250 * NEWS: Version 2.0a.
11251
11252 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
11253 the previous change.
11254
11255 Various maintainer cleanups.
11256 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
11257 conftest*, for benefit of CVS commands run at the same time as
11258 "configure". Add build-aux, since "bootstrap" now creates it and
11259 its subfiles.
11260 * Makefile.cfg (move_if_change): Remove.
11261 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
11262 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
11263 (po_repo, do-po-update, po-update, wget_files, get-targets):
11264 (config.guess-url_prefix, config.sub-url_prefix):
11265 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
11266 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
11267 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
11268 Remove.
11269 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
11270 this is now the recommended name.
11271 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
11272 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
11273 ylwrap. These files now go into build-aux.
11274 * config/move-if-change: Remove.
11275 * config/prev-version.txt: Bump from 1.75 to 2.0.
11276
11277 * bootstrap: Add stdio-safer, unistd-safer modules.
11278 Remove m4/glibc2.m4 (introduced by latest gnulib, but
11279 we don't need it).
11280 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
11281 fopen-safer.c, stdio-safer.h, unistd-safer.h.
11282 * lib/subpipe.c: Include "unistd-safer.h".
11283 (create_subpipe): Make sure all the newly-created
11284 file descriptors are > 2, so that diagnostics don't
11285 get sent down them (which might cause Bison to hang, in theory).
11286 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
11287 * src/files.c (xfopen): Use fopen_safer, not fopen.
11288
11289 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
11290 yesterday's yacc.c fix.
11291
11292 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
11293
11294 * data/glr.c, data/lalr1.cc: Update copyright date.
11295
11296 Fix a destructor bug reported by Wolfgang Spraul in
11297 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
11298 * data/yacc.c (yyabortlab): Don't call destructor, and
11299 don't set yychar to EMPTY.
11300 (yyoverflowlab): Don't call destructor.
11301 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
11302 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
11303 since we no longer output the message "discarding lookahead token
11304 end of input ()".
11305
11306 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
11307
11308 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
11309 fix a small glitch in debugging output.
11310 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
11311 after YY_SYMBOL_PRINT where needed.
11312
11313 (struct yyGLRState): Add some comments.
11314 (struct yySemanticOption): Add some comments.
11315 (union yyGLRStackItem): Add comment.
11316
11317 (yymergeOptionSets): Correct this to properly perform the union,
11318 avoiding infinite reported by Michael Rosien.
11319 Update comment.
11320
11321 * tests/glr-regression.at: Add test for GLR merging error reported
11322 by M. Rosien.
11323
11324 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
11325
11326 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
11327 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
11328 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
11329 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
11330 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
11331 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
11332 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
11333 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
11334 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
11335 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
11336 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
11337 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
11338 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
11339 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
11340 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
11341 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
11342 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
11343 src/derives.h, src/files.c, src/files.h, src/getargs.c,
11344 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
11345 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
11346 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
11347 src/output.h, src/parse-gram.c, src/parse-gram.h,
11348 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
11349 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
11350 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
11351 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
11352 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
11353 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
11354 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
11355 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
11356 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
11357 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
11358 tests/reduce.at, tests/regression.at, tests/sets.at,
11359 tests/synclines.at, tests/testsuite.at, tests/torture.at:
11360 Update FSF postal mail address.
11361
11362 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
11363
11364 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
11365 Problem reported by Ralf Menzel.
11366
11367 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
11368
11369 * tests/actions.at: Test that stack overflow invokes destructors.
11370 From Marcus Holland-Moritz.
11371 * data/yacc.c (yyerrlab): Move the code that destroys the stack
11372 from here....
11373 (yyreturn): to here. That way, destructors are called properly
11374 even if the stack overflows, or the user calls YYACCEPT or
11375 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
11376 (yyoverflowlab): Destroy the lookahead.
11377
11378 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
11379
11380 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
11381
11382 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
11383
11384 * NEWS: Bison-generated C parsers no longer quote literal strings
11385 associated with tokens.
11386 * src/output.c (prepare_symbols): Don't escape strings,
11387 since users don't want to see C escapes.
11388 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
11389 in diagnostics.
11390 * tests/input.at (Torturing the Scanner): Likewise.
11391 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
11392
11393 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
11394
11395 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
11396 the data size is known to be too small and we can't increase it.
11397 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
11398
11399 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
11400
11401 * src/parse-gram.y: Include quotearg.h.
11402 (string_as_id): Quote $1 before using it as a key, since the
11403 lexer no longer quotes it for us.
11404 (string_content): Don't strip quotes, since lexer no longer
11405 quotes it for us.
11406 * src/scan-gram.l: Include quotearg.h.
11407 ("\""): Omit quote.
11408 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
11409 a key, since the rest of the lexer doesn't quote it.
11410 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
11411 * tests/regression.at (Token definitions): Check for backslashes
11412 in token strings.
11413
11414 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
11415 (YYSIZE_T): Define to unsigned long int when using an older compiler.
11416 (yyparse): Revamp code to generate long syntax error message, to
11417 make it easier to translate, and to avoid problems with arithmetic
11418 overflow. Change "virtual memory" to "memory" in diagnostic, since
11419 we don't know whether the memory is virtual.
11420
11421 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
11422
11423 * NEWS: Bison-generated C parsers now use the _ macro to
11424 translate strings.
11425 * data/yacc.c (_) [!defined _]: New macro.
11426 All English strings wrapped inside this macro.
11427 * doc/bison.texinfo (Bison Parser): Document _.
11428 * po/POTFILES.in: Include src/parse-gram.c, since it now
11429 includes translateable strings that parse-gram.y doesn't.
11430
11431 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
11432
11433 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
11434 reverting the 2004-10-11 change to this function.
11435 (symbol_check_alias_consistency): Don't call symbol_type_set
11436 if the type name is already correct.
11437 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
11438
11439 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
11440
11441 * tests/regression.at (Token definitions): Don't use a token named
11442 c, as that generates a "#define c ..." that runs afoul of buggy
11443 stdlib.h that uses the identifier c as a member of struct
11444 drand48_data. Problem reported by Horst Wente.
11445
11446 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
11447
11448 * bootstrap: Change translation URL from
11449 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
11450 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
11451 redirection glitches. Problem reported by twlevo@xs4all.nl.
11452
11453 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
11454
11455 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
11456 after operands; POSIX says this isn't portable for the c99 command.
11457
11458 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
11459
11460 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
11461 immediately if a data overrun has occurred; this may help us track
11462 down what may be a spurious failure on MacOS.
11463
11464 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
11465
11466 Respond to problems reported by twlevo@xs4all.nl.
11467
11468 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
11469
11470 * src/vcg.h: Comment fix.
11471 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
11472 (G_CMAX): Change to -1 instead of INT_MAX.
11473
11474 * data/yacc.c (yyparse): Omit spaces before #line.
11475
11476 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
11477
11478 * src/tables.c (state_number_to_vector_number): Put it inside an
11479 "#if 0", since it's not currently used. Problem reported by
11480 Roland McGrath.
11481
11482 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
11483
11484 * src/output.c (escaped_output): Renamed from
11485 escaped_file_name_output, since we now use it for symbol tags as
11486 well. All uses changed.
11487 (symbol_destructors_output, symbol_printers_output):
11488 Escape symbol tags too.
11489 Problem reported by Matyas Forstner in
11490 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
11491
11492 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
11493 not needed.
11494 * src/output.c (user_actions_output, token_definitions_output,
11495 symbol_destructors_output, symbol_printers_output): Likewise.
11496 * src/reader.c (prologue_augment): Likewise.
11497 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
11498
11499 * src/vcg.c (output_edge): Don't quote linestyle arg.
11500 Problem reported by twlevo@xs4all.nl.
11501
11502 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
11503
11504 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
11505 example, reported by Derek M Jones. Also, make the example even
11506 more outrageous, to better illustrate how bad the problem is.
11507
11508 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
11509
11510 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
11511 putsym. Typo reported by Sebastian Piping.
11512
11513 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
11514
11515 * doc/bison.texinfo (Language and Grammar): some -> same
11516 (Epilogue): int he -> in the
11517 Typos reported by Sebastian Piping via Justin Pence.
11518
11519 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
11520
11521 * tests/glr-regression.at (Improper handling of embedded actions
11522 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
11523 embedded actions and $-N in GLR parsers", work around an Autoconf bug
11524 with dollar signs in test names.
11525 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
11526 for a similar reason.
11527
11528 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
11529
11530 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
11531 wants to redefine G_VIEW.
11532
11533 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
11534
11535 * src/vcg.c (get_view_str): Remove case for normal_view.
11536 Problem reported by twlevo@xs4all.nl.
11537
11538 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
11539
11540 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
11541 Problem reported by twlevo@xs4all.nl.
11542
11543 * doc/bison.texinfo: Change @dircategory from "GNU programming
11544 tools" to "Software development". Requested by Richard Stallman
11545 via Karl Berry.
11546
11547 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
11548
11549 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
11550 Problem reported by twlevo@xs4all.nl.
11551
11552 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
11553
11554 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
11555 keyword; it's not needed with modern compilers, and it doesn't
11556 affect correctness with older compilers. Suggested by
11557 twlevo@xs4all.nl.
11558
11559 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
11560
11561 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
11562 gcc -Wswitch-default.
11563 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
11564 * data/yacc.c (yyparse): Likewise.
11565
11566 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
11567
11568 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
11569 already. Let config.h define any nonstandard values.
11570
11571 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
11572
11573 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
11574 for the benefit of slower hosts. Problem reported by
11575 Nelson H. F. Beebe.
11576
11577 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
11578
11579 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
11580 being defined and not used.
11581 * data/lalr1.cc (yyparse): Likewise.
11582 Use "if (false)" rather than "if (0)".
11583
11584 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
11585
11586 * TODO: Mention that we should allow NUL bytes in tokens.
11587
11588 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
11589
11590 * src/scan-skel.l (<<EOF>>): Don't close standard output.
11591 Problem reported by Hans Aberg.
11592
11593 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
11594
11595 * src/getargs.c (version): Happy new year; update overall
11596 program copyright date from 2004 to 2005.
11597
11598 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
11599 Problem reported by Hans Aberg.
11600 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
11601 (Output file names.): Add a test for the case when standard output
11602 is closed.
11603
11604 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
11605
11606 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
11607 to fix an oversight in the Bison 2.0 manual.
11608
11609 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
11610
11611 * NEWS: Version 2.0. Reformat the existing news items since
11612 1.875, so that related items are grouped together.
11613 * configure.ac (AC_INIT): Bump version to 2.0.
11614 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
11615
11616 * tests/torture.at (Exploding the Stack Size with Alloca): Set
11617 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
11618 otherwise, we're not testing alloca. Unfortunately there's no
11619 simple way to consult HAVE_ALLOCA here.
11620
11621 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
11622 for yymsg, too.
11623
11624 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
11625 hand. This avoids a warning about comparing int to size_t when
11626 GCC warnings are enabled.
11627
11628 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
11629
11630 * NEWS: Bison-generated parsers no longer default to using the
11631 alloca function (when available) to extend the parser stack, due
11632 to widespread problems in unchecked stack-overflow detection.
11633 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
11634 responsibility to set it to a positive value. This lets the user
11635 specify a value that is not a preprocessor constant.
11636 * data/yacc.c (YYMAXDEPTH): Likewise.
11637 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
11638 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
11639 to be a compile-time constant. However, explain the constraints on it.
11640 Also, explain the constraints on YYINITDEPTH.
11641 (Table of Symbols): Explain that alloca is no longer the default.
11642 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
11643 to 1.
11644
11645 * doc/bison.texinfo (Location Default Action): Mention that n must
11646 be zero when k is zero. Suggested by Frank Heckenbach.
11647
11648 2004-12-22 Akim Demaille <akim@epita.fr>
11649
11650 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
11651 (parser::state_type, parser::semantic_type, parser::location_type):
11652 Private, not public.
11653 (parser::parse): Return ints, not bool.
11654 Returning a bool introduces a problem: 0 corresponds to false, and
11655 it seems weird to return false on success. Returning true changes
11656 the conventions for yyparse.
11657 Alternatively we could return void and send an exception.
11658 There is no clear consensus (yet?).
11659 (state_stack, semantic_stack, location_stack): Rename as...
11660 (state_stack_type, semantic_stack_type, location_stack_type): these.
11661 Private, not public.
11662 * tests/c++.at: New.
11663 * tests/testsuite.at, tests/Makefile.am: Adjust.
11664
11665 2004-12-21 Akim Demaille <akim@epita.fr>
11666
11667 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
11668
11669 2004-12-21 Akim Demaille <akim@epita.fr>
11670
11671 Don't impose std::string for filenames.
11672
11673 * data/lalr1.cc (b4_filename_type): New.
11674 (position::filename): Use it.
11675 (parser.hh): Move the inclusion of stack.hh and location.hh below
11676 the user code, so that needed headers for the filename type can be
11677 included first.
11678 Forward declare them before the user code.
11679 * tests/Makefile.am (check-local, installcheck-local): Pass
11680 TESTSUITEFLAGS to the TESTSUITE.
11681
11682 2004-12-20 Akim Demaille <akim@epita.fr>
11683
11684 Use more STL like names: my_class instead of MyClass.
11685
11686 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
11687 (SemanticStack, SemanticType, StateStack, StateType)
11688 (TokenNumberType, Stack, Slice, Traits, Parser::location)
11689 (Parser::value): Rename as...
11690 (location_stack, location_type, rhs_number_type, semantic_stack)
11691 (semantic_type, state_stack, state_type, token_number_type, stack)
11692 (slice, traits, parser::yylloc, parser::yylval): these.
11693
11694 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
11695
11696 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
11697
11698 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
11699 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
11700
11701 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
11702
11703 Remove uses of 'short int' and 'unsigned short int'. This raises
11704 some arbitrary limits. It uses more memory but nowadays that's
11705 not much of an issue.
11706
11707 This change does not affect the generated parsers; that's a different
11708 task, as some users will want to conserve memory there.
11709
11710 Ideally we should use size_t to represent all object counts, and
11711 something like ptrdiff_t to represent signed differences of object
11712 counts; but that will require more code-cleanup than I have the
11713 time to do right now.
11714
11715 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
11716 Use size_t, not int or short int, to count objects.
11717 * src/closure.c (nritemset, closure): Likewise.
11718 * src/closure.h (nritemset, closure): Likewise.
11719 * src/nullable.c (nullable_compute): Likewise.
11720 * src/print.c (print_core): Likewise.
11721 * src/print_graph.c (print_core): Likewise.
11722 * src/state.c (state_compare, state_hash): Likewise.
11723 * src/state.h (struct state): Likewise.
11724 * src/tables.c (default_goto, goto_actions): Likewise.
11725
11726 * src/gram.h (rule_number, rule): Use int, not short int.
11727 * src/output.c (prepare_rules): Likewise.
11728 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
11729 errs, reductions): Likewise.
11730 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
11731 Likewise.
11732 * src/tables.c (vector_number, tally, action_number,
11733 ACTION_NUMBER_MINIMUM): Likewise.
11734 * src/output.c (muscle_insert_short_int_table): Remove.
11735
11736 2004-12-17 Akim Demaille <akim@epita.fr>
11737
11738 * data/lalr1.cc: Extensive Doxygenation.
11739 (error_): Rename as...
11740 (error): this, since it is visible to the user.
11741 Adjust callers.
11742 (Parser::message): Now an automatic variable from...
11743 (Parser::yyreport_syntax_error_): here.
11744 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
11745 Parser::error.
11746 * tests/input.at: Escape $.
11747
11748 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
11749
11750 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
11751 Parenthesize rhs to avoid obscure problems with mistakes like
11752 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
11753 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11754 b4_rhs_location): Likewise.
11755 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
11756 b4_rhs_location): Likewise.
11757
11758 2004-12-16 Akim Demaille <akim@epita.fr>
11759
11760 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
11761 yacc.c: be sure to stay within yycheck_.
11762 * tests/actions.at: Re-enable C++ tests.
11763
11764 2004-12-16 Akim Demaille <akim@epita.fr>
11765
11766 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
11767 real.
11768
11769 2004-12-16 Akim Demaille <akim@epita.fr>
11770
11771 Use #define to handle the %name-prefix.
11772
11773 * data/glr.c, data/yacc.c: Comment changes.
11774 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
11775 so that one can refer to yylex in the parser file, and have it
11776 renamed, as is the case with other skeletons.
11777
11778 2004-12-16 Akim Demaille <akim@epita.fr>
11779
11780 Move lalr1.cc internals into yy*.
11781
11782 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
11783 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
11784 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
11785 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
11786 (empty_, final_, terror_, errcode_, ntokens_)
11787 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
11788 (looka_, ilooka_, error_range_, nerrs_):
11789 Rename as...
11790 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
11791 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
11792 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
11793 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
11794 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
11795 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
11796 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
11797 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
11798 these.
11799
11800 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
11801
11802 Fix some problems reported by twlevo at xs4all.
11803 * src/symtab.c (symbol_new): Report an error if the input grammar
11804 contains too many symbols. This is better than calling abort() later.
11805 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
11806 (struct node, struct graph):
11807 Rename member expand to stretch. All uses changed.
11808 (struct graph): Remove member layoutalgorithm. All uses removed.
11809 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
11810 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
11811 All uses changed.
11812 (N_STRETCH): Rename from N_EXPAND. All uses changed.
11813
11814 2004-12-15 Akim Demaille <akim@epita.fr>
11815
11816 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
11817 Add more Doxygen comments.
11818 (symprint_, stack_print_, reduce_print_, destruct_, pop)
11819 (report_syntax_error_, translate_): Rename as...
11820 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
11821 (yypop_, yyreport_syntax_error_, yytranslate_): this.
11822
11823 2004-12-15 Akim Demaille <akim@epita.fr>
11824
11825 * data/lalr1.cc (lex_): Rename as...
11826 (yylex_): this.
11827 Move the trace here.
11828 Take the %name-prefix into account.
11829 Reported by Alexandre Duret-Lutz.
11830
11831 2004-12-15 Akim Demaille <akim@epita.fr>
11832
11833 Simplify the C++ parser constructor.
11834
11835 * data/lalr1.cc (debug_): Rename as...
11836 (yydebug_): so that the parser's internals are always in the yy*
11837 pseudo namespace.
11838 Adjust uses.
11839 (b4_parse_param_decl): Remove the leading comma as it is now only
11840 called as unique argument list.
11841 (Parser::Parser): Remove the constructor accepting a location and
11842 an initial debugging level.
11843 Remove from the other ctor the argument for the debugging level.
11844 (debug_level_type, debug_level, set_debug_level): New.
11845
11846 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
11847 constructor calls.
11848
11849 2004-12-15 Akim Demaille <akim@epita.fr>
11850
11851 Remove b4_root related material: failure experiment
11852 (which goal was to allow to derive from a class).
11853
11854 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
11855 definitions and uses.
11856
11857 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
11858
11859 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
11860 not 2, since it's not portable to subtract 1 from the start of an
11861 array. The new item 0 is never set or used. All uses changed.
11862
11863 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
11864 the default definition of YYLLOC_DEFAULT. Problem reported
11865 by Frank Heckenbach.
11866
11867 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
11868
11869 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
11870 the normal case and one for the error case. Just use the
11871 first one uniformly. Problem reported by Frank Heckenbach.
11872 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
11873 use exactly the same macro in both places.
11874 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
11875 so that the normal-case YYRHSLOC works for the error case too.
11876 All uses changed.
11877 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
11878 (YYLLOC_DEFAULT): Use the same macro as glr.c.
11879 * doc/bison.texinfo (Location Default Action): Don't claim that
11880 we have an array of locations. Use the same macro for both glr
11881 and lalr parsers. Mention YYRHSLOC. Mention what happens when
11882 the index is 0.
11883
11884 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11885
11886 * HACKING: Update email addresses to send announcements to.
11887
11888 * configure.ac (AC_INIT): Bump version to 1.875f.
11889
11890 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
11891
11892 * NEWS: Version 1.875e.
11893 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
11894
11895 * src/scan-skel.l: Include "complain.h", for "fatal".
11896
11897 * src/relation.h (relation_print, relation_digraph):
11898 Relation sizes are of type relation_node, not size_t (this is
11899 merely a doc fix, since the two types are equivalent).
11900 (relation_transpose): Relation sizes are of type relation_node,
11901 not int.
11902 * src/relation.c: Likewise.
11903 (top, infinity): Now of type relation_node, not int.
11904 (traverse, relation_transpose): Use relation_node, not int.
11905
11906 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
11907 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
11908 (yyparse): Remove unused local introduced in 2004-10-25 patch.
11909
11910 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
11911 specifying whether the test should be skipped. Use it tp
11912 specify that the [%defines %skeleton "lalr1.cc"] tests currently
11913 fail on some hosts, and should be skipped.
11914
11915 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
11916
11917 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
11918 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
11919 unless otherwise specified below.
11920
11921 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
11922 to allocate kernel_base, kernel_items, kernel_size, since
11923 they needn't be initialized to 0.
11924 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
11925 * src/closure.c (new_closure): Likewise, for itemset.
11926 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
11927 * src/lalr.c (set_goto_map): Likewise, for temp_map.
11928 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
11929 (build_relations): Likewise for edge, states1, includes.
11930 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
11931 * src/reader.c (packgram): Likewise, for ritem, rules.
11932 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
11933 * src/relation.c (relation_digraph): Likewise for VERTICES.
11934 (relation_transpose): Likewise for new_R, end_R.
11935 * src/symtab.c (symbols_token_translations_init): Likewise for
11936 token_translations.
11937 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
11938 (token_actions): Likewise for yydefact, actrow, conflrow,
11939 conflict_list.
11940 (save_column): Likewise for froms[symno], tos[symno].
11941 (goto_actions): Likewise for state_count.
11942 (pack_table): Likewise for base, pos, check.
11943 (tables_generate): Likewise for width.
11944
11945 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
11946 for initial core. Just have a separate core, so we needn't worry
11947 about whether kernel_size and kernel_base are initialized.
11948
11949 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
11950 kernel_size, kernel_items): Remove unnecessary initialization.
11951 * src/conflicts.c (conflicts): Likewise.
11952 * src/derives.c (derives): Likewise.
11953 * src/muscle_tablc (muscle_insert): Likewise.
11954 * src/relation.c (relation_digraph): Likewise.
11955 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
11956 conflrow, conflict_table, conflict_list, table, check):
11957 Likewise.
11958
11959 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
11960 This is because all callers pass unsigned int.
11961 * src/closure.h (new_closure): Likewise.
11962
11963 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
11964 (build_relations): Initialize includes[i] in all cases.
11965 * src/reader.c (packgram): Always initialize rules[ruleno].prec
11966 and rules[ruleno].precsym. Initialize members in order.
11967 * src/relation.c (relation_transpose): Always initialize new_R[i]
11968 and end_R[i].
11969 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
11970
11971 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
11972 conflict_list[0] was always 0, but now it isn't initialized.
11973
11974 * src/table.c (table_grow): When conflict_table grew, the grown
11975 area wasn't cleared. Fix this.
11976
11977 * lib/.cvsignore: Add strdup.c, strdup.h.
11978 * m4/.cvsignore: Add strdup.m4.
11979
11980 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
11981
11982 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
11983 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
11984 GOTO_NUMBER_MAXIMUM, since we occasionally compute
11985 ngotos + 1 without checking for overflow.
11986 (build_relations): Use END_NODE, not -1, to denote end of edges.
11987 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
11988 build_relations): Use goto_number, not int, for goto numbers.
11989 * src/tables.c (save_column, default_goto): Likewise.
11990
11991 2004-11-23 Akim Demaille <akim@epita.fr>
11992
11993 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
11994 of #defining from yystype.
11995 Don't typedef yystype, C++ does not need it.
11996 This lets it possible to forward declare it as union.
11997
11998 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
11999
12000 * bootstrap (gnulib_modules): Add extensions.
12001 Problem reported by Jim Meyering.
12002
12003 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
12004
12005 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
12006 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
12007 src/system.h, src/tables.c: XFREE -> free, to accommodate
12008 recent change to gnulib xalloc.h.
12009 Problem reported by Jim Meyering.
12010
12011 2004-11-17 Akim Demaille <akim@epita.fr>
12012
12013 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
12014
12015 2004-11-17 Akim Demaille <akim@epita.fr>,
12016 Alexandre Duret-Lutz <adl@gnu.org>
12017
12018 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
12019 changes.
12020 (YYCDEBUG): Adjust.
12021 Use it instead of cdebug_.
12022 (Parser::debug_stream, Parser::set_debug_stream): New.
12023 (Parser::symprint_): Define cdebug_ for temporary backward
12024 compatibility.
12025 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
12026 debug_stream ().
12027
12028 2004-11-17 Akim Demaille <akim@epita.fr>
12029
12030 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
12031 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
12032 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
12033 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
12034
12035 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
12036
12037 * data/glr.c (yyloc_default): Remove; not used.
12038 Problem reported by Frank Heckenbach.
12039
12040 2004-10-25 Akim Demaille <akim@epita.fr>
12041
12042 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
12043 Introduce another definition to address simple location arrays.
12044 (yyGLRStack): New member: yyerror_range.
12045 (yyrecoverSyntaxError, yyparse): Update it.
12046 (yyrecoverSyntaxError): Use it when shifting the error token to
12047 have an accurate range, equivalent to the one computed by both
12048 yacc.c and lalr1.cc.
12049 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
12050 that column numbers start at column 0, as per GNU Coding
12051 Standards, the others tests, and the doc.
12052 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
12053 Adjust to the above change (first column is 0).
12054 And adjust the location of the "<error>", now covering the whole
12055 line.
12056
12057 2004-10-22 Akim Demaille <akim@epita.fr>
12058 and Paul Eggert <eggert@cs.ucla.edu>
12059
12060 Remove some arbitrary limits on goto numbers and relations.
12061 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
12062 initial values, since they're never used.
12063 (set_goto_map): ngotos is now unsigned, so test for overflow
12064 by seeing whether it wraps around to zero.
12065 * src/lalr.h (goto_number): Now size_t, not short int.
12066 (GOTO_NUMBER_MAXIMUM): Remove.
12067 * src/relation.c (relation_print, traverse, relation_transpose):
12068 Check for END_NODE rather than looking at sign.
12069 * src/relation.h (END_NODE): New macro.
12070 (relation_node): Now size_t, not short int.
12071
12072 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
12073
12074 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
12075 keyword, not an identifier. Problem reported by Baron Schwartz in
12076 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
12077
12078 2004-10-11 Akim Demaille <akim@epita.fr>
12079
12080 * src/symtab.c (symbol_check_alias_consistency): Also check
12081 type names, destructors, and printers.
12082 Reported by Alexandre Duret-Lutz.
12083 Recode the handling of associativity and precedence in terms
12084 of symbol_precedence_set.
12085 Accept no redeclaration at all, not even equal to the previous
12086 value.
12087 (redeclaration): New.
12088 Use it to factor redeclaration complaints.
12089 (symbol_make_alias): Don't set the type of the alias, let
12090 symbol_check_alias_consistency do it as for other features.
12091 * src/symtab.h (symbol): Add new member prec_location, and
12092 type_location.
12093 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
12094 * tests/input.at (Incompatible Aliases): New.
12095
12096 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
12097
12098 .cvsignore fixes to accommodate gnulib changes,
12099 and the practice of naming build directories "_build".
12100 * .cvsignore: Add "_*". Sort.
12101 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
12102 * m4/.cvsignore: Add "*_gl.m4".
12103
12104 2004-10-06 Akim Demaille <akim@epita.fr>
12105
12106 * src/parse-gram.y (add_param): Fix the truncation of trailing
12107 spaces.
12108
12109 2004-10-05 Akim Demaille <akim@epita.fr>
12110
12111 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
12112 whether the reducion was empty or not. This leaves room to
12113 improve the use of YYLLOC_DEFAULT in such a case.
12114 lalr1.cc is still experimental, so changing this is acceptable.
12115 And finally, there are probably not many users who changed the
12116 handling of locations in GLR, so changing is admissible too.
12117
12118 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
12119 empty reduction, set @$ to an empty location ending the previously
12120 stacked symbol.
12121 Adjust uses to make sure the code is triggered on empty
12122 reductions.
12123 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
12124 expected output: empty reductions have empty locations.
12125
12126 2004-09-29 Akim Demaille <akim@epita.fr>
12127
12128 * data/lalr1.cc: Move towards a more standard C++ coding style
12129 for templates: Class < T > -> Class<T>.
12130
12131 2004-09-29 Akim Demaille <akim@epita.fr>
12132
12133 * data/lalr1.cc: Reinstall the former ctor, for sake of
12134 compatibility, but warn it will be removed.
12135 Move towards a more standard C++ coding style (i.e., type *var ->
12136 type* var).
12137
12138 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
12139
12140 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
12141 since it's less likely to work if NULs are involved in the future.
12142
12143 2004-09-27 Akim Demaille <akim@epita.fr>
12144
12145 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
12146
12147 2004-09-27 Akim Demaille <akim@epita.fr>
12148
12149 * data/lalr1.cc (b4_parse_param_decl_1): New.
12150 (b4_parse_param_decl): Use it to have different names between attribute
12151 and argument names.
12152 (b4_cc_constructor_call): Likewise.
12153
12154 2004-09-24 Akim Demaille <akim@epita.fr>
12155
12156 * src/parse-gram.y (add_param): Strip the leading and trailing
12157 blanks from a formal argument declaration.
12158 (YY_LOCATION_PRINT): New.
12159
12160 2004-09-24 Akim Demaille <akim@epita.fr>
12161
12162 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
12163 after the location.
12164
12165 2004-09-24 Akim Demaille <akim@epita.fr>
12166
12167 * doc/bison.texinfo (Table of Symbols): Sort.
12168
12169 2004-09-21 Akim Demaille <akim@epita.fr>
12170
12171 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
12172 the useless parentheses.
12173 Suggested by Paul Eggert.
12174
12175 2004-09-20 Akim Demaille <akim@epita.fr>
12176
12177 Let the initial-action act on the look-ahead, and use it for the
12178 "initial push" (corresponding to an hypothetical beginning-of-file).
12179 And let lalr1.cc honor %initial-action.
12180
12181 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
12182 example.
12183 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
12184 (Parser::Parser): Remove the ctor that used to initialize it.
12185 (Parser::parse): Like in the other skeletons, issue the "starting
12186 parse" message before any action.
12187 Honor %initial-action.
12188 Initialize the stacks with the lookahead.
12189 * data/yacc.c: Let $$ and @$ in %initial-action designate the
12190 look-ahead.
12191 Push them in the stacks.
12192 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
12193
12194 2004-09-20 Akim Demaille <akim@epita.fr>
12195
12196 * doc/bison.texinfo (Initial Action Decl): New.
12197
12198 2004-09-20 Akim Demaille <akim@epita.fr>
12199
12200 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
12201 clearer criterion to define it.
12202 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
12203 When reducing on an empty RHS, use the latest stacked location as
12204 location.
12205 yylloc is not always available.
12206 * data/glr.c: Likewise.
12207 Also, honor initial-actions.
12208
12209 2004-09-20 Akim Demaille <akim@epita.fr>
12210
12211 * data/yacc.c (YY_LOCATION_PRINT): New.
12212 Define when we know YYLTYPE's structure, i.e., when the default
12213 YYLLOC_DEFAULT is used.
12214 * data/c.m4 (b4_yysymprint_generate): Use it.
12215 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
12216 value of the result.
12217 (error_start_): Replace with...
12218 (error_range_): this location array.
12219 This allows to replace code relying on the implementation of
12220 locations by portable code.
12221 * data/yacc.c (yylerrsp): Replace with...
12222 (yyerror_range): this.
12223 Every time a token is popped, update yyerror_range[0], to have an
12224 accurate location for the error token.
12225 * data/glr.c (YY_LOCATION_PRINT): New.
12226 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
12227 deference a pointer.
12228 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
12229 report the location in %printers.
12230
12231 * src/scan-skel.l: Instead of abort, report error messages to ease
12232 understanding skeleton scanning failures.
12233
12234 2004-09-16 Akim Demaille <akim@epita.fr>
12235
12236 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
12237 (iterator, const_iterator): these, to be more in the C++ spirit.
12238 Also, return reverse iterators so that when displaying the stack
12239 we display its bottom first.
12240 (Parser::stack_print_, Parser::reduce_print_): Match the messages
12241 from yacc.c.
12242 We should probably use vector here though.
12243
12244 2004-09-16 Akim Demaille <akim@epita.fr>
12245
12246 Have more complete shift traces.
12247
12248 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
12249 to report Shifts instead of ad hoc YYDPRINTF invocations,
12250 including for the error token.
12251 * data/lalr1.cc (symprint_): Output the location.
12252 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
12253 output the location within the %printer.
12254 Activate GLR tests, at least to make sure they compile properly.
12255 They still don't pass though.
12256 * tests/calc.at: Adjust expect verbose output, since now "Entering
12257 state..." is on a different line than the "Shifting" message.
12258
12259 2004-09-08 Akim Demaille <akim@epita.fr>
12260
12261 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
12262 Bison directive from the Bison file to the invocation of this
12263 macro, so that these directives are passed to
12264 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
12265 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
12266 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
12267 the extra Bison directives instead of the whole series.
12268 Change the grammar so that there are recoverable errors, and
12269 unrecoverable errors. Now we can have the parser give up before
12270 consuming the whole input. As a result we now can observe that
12271 the lookahead is freed when needed.
12272 Change the parser source to parse argv[1] instead of a hard coded
12273 string.
12274 Simplify yylex, and give a value and location to EOF.
12275 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
12276 passed directives already coded in the file.
12277 Add some tests to check the location of "error".
12278 For some tests, the C++ parser is correct, and not yacc.c.
12279 For other tests, they provide different, but unsatisfying, values,
12280 so keep the C++ value so that at least one parser is "correct"
12281 according to the test suite.
12282 (Actions after errors): Remove, this is subsumed by the
12283 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
12284
12285 2004-09-06 Akim Demaille <akim@epita.fr>
12286
12287 * data/lalr1.cc: Adjust the indentation of the labels.
12288 (Parser::pop): New.
12289 Use it.
12290
12291 2004-09-06 Akim Demaille <akim@epita.fr>
12292
12293 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
12294 argument, an informative message.
12295 Call YY_SYMBOL_PRINT.
12296 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
12297 * data/lalr1.cc (destruct_): Likewise.
12298 In addition, no longer depend on b4_yysymprint_generate and
12299 b4_yydestruct_generate to generate these functions, do it "by
12300 hand".
12301
12302 2004-09-03 Akim Demaille <akim@epita.fr>
12303
12304 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
12305 invoked, yydestruct the lookahead.
12306 * tests/calc.at (Calculator $1): Update the expected lengths of
12307 traces: there is an added line for the discarded lookahead.
12308 * doc/bison.texinfo (Destructor Decl): Some rewording.
12309 Define "discarded" symbols.
12310
12311 2004-09-02 Akim Demaille <akim@epita.fr>
12312
12313 * data/lalr1.cc (translate_, destruct_): No reason to be static.
12314
12315 2004-09-02 Akim Demaille <akim@epita.fr>
12316
12317 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
12318 (YYDSYMPRINTF): Rename as...
12319 (YY_SYMBOL_PRINT): this.
12320 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
12321 two.
12322 Use it instead of direct symprint_ calls.
12323 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
12324 one.
12325
12326 2004-09-02 Akim Demaille <akim@epita.fr>
12327
12328 * data/lalr1.cc (b4_yysymprint_generate): New.
12329 (symprint_): New member function, defined when YYDEBUG.
12330 Use it consistently instead of token/nterm debugging output by
12331 hand.
12332 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
12333 %printer calls to use cdebug_ when using lalr1.cc.
12334
12335 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
12336
12337 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
12338 with #ifdef YYDEBUG.
12339
12340 2004-08-26 Akim Demaille <akim@epita.fr>
12341
12342 * doc/bison.texinfo (Implementing Loops): Rename as...
12343 (Implementing Gotos/Loops): this.
12344
12345 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
12346
12347 Adjust to latest gnulib.
12348 * bootstrap (gnulib_modules): Add xalloc-die.
12349 Set LC_ALL=C so that file names sort consistently.
12350 Prefer the gnulib copies of gettext.m4, glibc21.m4,
12351 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
12352 uintmax_t.m4, ulonglong.m4.
12353 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
12354 po.m4 since we are now using _gl.m4 instead.
12355
12356 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
12357
12358 * src/scan-action.l: Remove. Scanning of semantic actions is
12359 handled in scan-gram.l.
12360
12361 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
12362
12363 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
12364
12365 * src/location.h (struct): The file member is a uniqstr.
12366 (equal_boundaries): Use UNIQSTR_EQ for comparison.
12367
12368 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
12369
12370 Fix bug with non-%union parsers that have printers or destructors,
12371 which led to a Bison core dump. Reported by Peter Fales in
12372 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
12373
12374 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
12375 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
12376 not to our own type.
12377 * src/output.c (symbol_destructors_output, symbol_printers_output):
12378 Don't assume %union.
12379 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
12380 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
12381 UNION-FLAG. All callers changed.
12382 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
12383 Use type char, not unsigned int, when declaring an array of char;
12384 this lets us remove a cast.
12385 (Printers and Destructors): Add non-%union test cases.
12386
12387 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12388
12389 * doc/bison.texinfo: Minor editorial changes, mostly to the new
12390 GLR writeups. E.g., avoid frenchspacing and the future tense,
12391 change "lookahead" to "look-ahead", and change "wrt" to "with
12392 respect to".
12393
12394 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12395
12396 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
12397 New sections, split off from the GLR Parsers section. Put the new
12398 Simple GLR Parser near the start of the GLR section, for clarity.
12399 Rewrite connective text.
12400
12401 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
12402
12403 * doc/bison.texinfo (Simple GLR Parsers): New section.
12404
12405 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
12406
12407 * NEWS, TODO, doc/bison.texinfo:
12408 Use "look-ahead" instead of "lookahead", to be consistent.
12409 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
12410 while we're fixing "look-ahead".
12411 * src/conflicts.c (shift_set): Renamed from shiftset.
12412 (look_ahead_set): Renamed from lookaheadset.
12413 * src/print.c: Likewise.
12414 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
12415 name for "lookahead".
12416 (report_types, usage): Likewise.
12417 * src/getargs.h (report_look_ahead_tokens): Renamed from
12418 report_lookaheads.
12419 * src/lalr.c (compute_look_ahead_tokens): Renamed from
12420 compute_lookaheads.
12421 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
12422 (look_ahead_tokens_print): Renamed from lookaheads_print.
12423 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
12424 state_rule_lookaheads_print.
12425 * src/state.h: Likewise.
12426 (reductions.look_ahead_tokens): Renamed from lookaheads.
12427 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
12428 AT_DATA_LOOKAHEADS_GRAMMAR.
12429
12430 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
12431
12432 * README: Update location of patched M4 distribution.
12433
12434 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
12435
12436 Don't assume the C++ compiler takes the same arguments as the C compiler
12437 (trivial change).
12438 * configure.ac (O0CXXFLAGS): New var.
12439 * tests/atlocal.in (CXXFLAGS): Use it.
12440
12441 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
12442
12443 Fix some "make check" problems with C++ reported by
12444 Albert Chin-A-Young for Tru64 C++ in this thread:
12445 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
12446
12447 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
12448 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
12449 Output to a .cc file for C++, not to a .c file.
12450 * tests/calc.at (AT_CHECK_CALC): Likewise.
12451 * tests/regression.at (AT_CHECK_DANCER): Likewise.
12452 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
12453
12454 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
12455
12456 * tests/calc.at, tests/actions.at: Workaround for SGI
12457 C++ compiler. (trivial change)
12458
12459 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
12460
12461 Spent a few hours checking out which prerequisite versions the
12462 current sources actually require. I went all the way back to
12463 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
12464 a seemingly endless set of combinations of versions more recent
12465 than that. The bottom line is that the current sources require
12466 fairly recent versions of the build tools, and it'll be some work
12467 to change this.
12468 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
12469 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
12470 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
12471 Add comments explaining why those particular versions are
12472 currently needed.
12473
12474 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
12475 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
12476 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
12477
12478 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
12479 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
12480
12481 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
12482
12483 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
12484 0.11.5. Suggested by Bruno Haible.
12485 * bootstrap: Remove gettext version checking.
12486
12487 * doc/bison.texinfo (Decl Summary): Also mention that %union
12488 can depend on prerequisite types. Problem reported by Tim
12489 Van Holder.
12490
12491 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
12492
12493 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
12494 * README-alpha: Don't tell people not to package this.
12495
12496 * bootstrap: Don't assume $(...) works; use `...` instead.
12497 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
12498 gettext better.
12499
12500 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
12501 put into the -d output file, and mention what to do if YYSTYPE is
12502 defined as a macro.
12503
12504 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
12505
12506 Undo change made earlier today: it caused autopoint to not bring
12507 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
12508 autopoint's.
12509
12510 * bootstrap: Check that gettext version matches what's in
12511 configure.ac. Warn users to ignore robots.txt ERROR 404.
12512 * bootstrap: Undo today's earlier change (logged below).
12513 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
12514
12515 The gettext version checking is causing more trouble than it's
12516 curing; remove it. Problem reported by Paul Hilfinger.
12517
12518 * bootstrap: Issue a warning that one can expect a message
12519 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
12520 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
12521
12522 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
12523
12524 Ensure that the C++ compiler used for testing actually works on a
12525 simple test program; if not, skip the C++-related tests. Problem
12526 reported by Vin Shelton in:
12527 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
12528
12529 * m4/cxx.m4: New file.
12530 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
12531 * tests/atlocal.in (BISON_CXX_WORKS): Add.
12532 * tests/local.at (AT_COMPILE_CXX): Use it.
12533
12534 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12535
12536 * data/glr.c (yylloc): Output this macro even if locations are not
12537 being generated, as the GLR parser needs it even in that case.
12538 Problem reported by Troy A. Johnson
12539 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
12540
12541 * configure.ac (AC_INIT): Update to 1.875e.
12542
12543 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
12544
12545 * NEWS: Version 1.875d.
12546 * configure.ac (AC_INIT): Likewise.
12547 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
12548
12549 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
12550 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
12551 lalr1.cc runs afoul of the first, and the last two are no longer
12552 supported by GCC 3.4.0.
12553 * README: Mention GNU m4 1.4 or later; mention m4 patches.
12554 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
12555
12556 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
12557
12558 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
12559 unsigned int, for compatibility with latest gnulib hash module.
12560 * src/state.c (state_hash, state_hasher): Likewise.
12561 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
12562 * src/uniqstr.c (hash_uniqstr): Likewise.
12563
12564 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
12565
12566 * NEWS: Unescaped newlines are no longer allowed in char & strings.
12567
12568 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
12569 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
12570 character and string literals.
12571 (unexpected_end): New function.
12572 (unexpected_eof): Use it.
12573 (unexpected_newline): New function.
12574 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
12575 actions.
12576
12577 * NEWS: Document %expect-rr.
12578
12579 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
12580 Fix typo by replacing $1 with $option.
12581 Remove more 'intl'-related files.
12582 Don't DEFUN AM_INTL_SUBDIR twice.
12583
12584 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
12585 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
12586 strtoul.c.
12587 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
12588 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
12589 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
12590 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
12591 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
12592 * src/.cvsignore: Add *.output.
12593
12594 * src/parse-gram.y: Put copyright notice inside %{ %} so it
12595 gets copied to the output file.
12596
12597 2004-04-28 Paul Eggert <eggert@twinsun.com>
12598
12599 Get files from the gnulib and po repositories, instead of relying
12600 on them being in our CVS. Upgrade to latest versions of gnulib
12601 and Automake.
12602
12603 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
12604 * bootstrap: Bootstrap from gnulib and po repositories.
12605 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
12606 * README-cvs: Document these changes. Remove version numbers from
12607 mentions of build tools, since they change so often. Mention Flex.
12608
12609 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
12610 (gl_USE_SYSTEM_EXTENSIONS): Add.
12611 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
12612 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
12613 does this for us.
12614 (AC_ISC_POSIX): Remove; we no longer support this
12615 ancient OS, as it gets in the way of latest Autoconf & gnulib.
12616 (AC_HEADER_STDC): Remove: we now assume C89 or better.
12617 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
12618 Do not check for C89 headers, except for locale.h which is used
12619 by the Yacc library and must port to K&R hosts.
12620 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
12621 Do not check for C89 functions, except for setlocale which is
12622 used by the Yacc library.
12623 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
12624 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
12625 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
12626 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
12627 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
12628 AM_GNU_GETTEXT): Remove; now done by:
12629 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
12630 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
12631 for us.
12632
12633 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
12634 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
12635 Define to empty, as gnulib.mk will do the rest for us.
12636 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
12637 for us.
12638 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
12639 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
12640
12641 * src/files.c: Include gnulib's xstrndup.h.
12642
12643 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
12644 (REALLOC): Use xnrealloc, for likewise.
12645 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
12646 (strnlen, memrchr): Remove decls; functions no longer used.
12647 Include <stpcpy.h>.
12648
12649 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
12650 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12651 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
12652 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
12653 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
12654 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
12655 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
12656 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
12657 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
12658 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
12659 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
12660 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
12661 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
12662 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
12663 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
12664 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
12665 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
12666 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
12667 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
12668 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
12669 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
12670 Remove, as these files are now generated automatically
12671 by bootstrap or automake.
12672
12673 * po/ChangeLog: Remove: all but one entry was a duplicate
12674 of this file, and I moved that 2000-11-02 entry here.
12675
12676 * config/.cvsignore: Add Makefile, depcomp, install-sh.
12677 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
12678 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
12679 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
12680 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
12681 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
12682 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
12683 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
12684 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
12685 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
12686 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
12687 xstrndup.h.
12688 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
12689 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
12690 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
12691 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
12692 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
12693 * src/.cvsignore: Remove *_.c.
12694
12695
12696 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
12697 support it. (The latest stable gzip doesn't.)
12698
12699 2004-04-27 Paul Eggert <eggert@twinsun.com>
12700
12701 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
12702 case, as stos_ is now used by destructors due to the 2004-02-09
12703 change.
12704
12705 Remove more K&R C support.
12706 * lib/libiberty.y (PARAMS): Remove. All uses removed.
12707 * lib/subpipe.c (errno): Remove decl.
12708 Include <stdlib.h> unconditionally.
12709 (EXIT_FAILURE): Remove macro.
12710 * src/complain.c (vfprintf, strerror): Remove.
12711 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
12712 unconditionally.
12713 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
12714 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
12715 (strchr, strspn, memchr): Remove decls.
12716 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
12717 unconditionally. Do not declare perror.
12718 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
12719 unconditionally.
12720
12721 * src/complain.c (_): Remove useless defn, as system.h defines this.
12722
12723 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
12724 with latest obstack.h.
12725 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
12726 to procedure types, as obstack.h now does that for us.
12727 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
12728
12729 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
12730 so that this include file can stand alone.
12731 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
12732 does this now. Include subpipe.h first after config.h, to
12733 test whether it can stand alone.
12734
12735 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
12736 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
12737 unused declaration.
12738
12739 * tests/synclines.at (%union synch line): Put a dummy member in
12740 the union, because empty unions aren't allowed in C. Caught
12741 by GCC 3.4.0.
12742
12743 2004-04-13 Jim Meyering <jim@meyering.net>
12744
12745 * src/conflicts.c (conflicts_print): Correct format string typo:
12746 use `%%' to produce literal `%'. (trivial change)
12747
12748 2004-03-30 Paul Eggert <eggert@twinsun.com>
12749
12750 * src/getargs.c (version): Update copyright year to 2004.
12751
12752 * data/c.m4 (b4_int_type): Use 'short int' rather than
12753 'short', and similarly for 'long', 'unsigned', etc.
12754 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
12755 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
12756 yy_yypstack, yydumpstack): Likewise.
12757 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
12758 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
12759 Likewise.
12760 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
12761 yy_stack_print, yyparse): Likewise.
12762 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
12763 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
12764 * lib/bitset.c (bitset_print): Likewise.
12765 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
12766 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12767 * lib/bitsetv.c (bitsetv_dump): Likewise.
12768 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
12769 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
12770 Likewise.
12771 * src/LR0.c (allocate_itemsets): Likewise.
12772 * src/gram.h (rule_number, rule): Likewise.
12773 * src/lalr.h (goto_number): Likewise.
12774 * src/nullable.c (nullable_compute): Likewise.
12775 * src/output.c (prepare_rules): Likewise.
12776 * src/relation.c (relation_print, relation_digraph): Likewise.
12777 * src/relation.h (relation_node): Likewise.
12778 * src/state.h (state_number, transitions, errs, reductions,
12779 struct state): Likewise.
12780 * src/symtab.h (symbol_number, struct symbol): Likewise.
12781 * src/tables.c (vector_number, tally, action_number,
12782 default_goto, goto_actions): Likewise.
12783 * tests/existing.at (GNU Cim Grammar): Likewise.
12784 * tests/regression.at (Web2c Actions): Likewise.
12785
12786 * src/output.c (muscle_insert_short_int_table): Renamed from
12787 muscle_insert_short_table. All uses changed.
12788
12789 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
12790
12791 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
12792 (declaration): Replace expected_conflicts with expected_sr_conflicts.
12793 Add %expect-rr rule.
12794
12795 * src/scan-gram.l: Recognize %expect-rr.
12796
12797 * src/conflicts.h (expected_sr_conflicts): Rename from
12798 expected_conflicts.
12799 (expected_rr_conflicts): Declare.
12800
12801 * src/conflicts.c (expected_sr_conflicts): Rename from
12802 expected_conflicts.
12803 (expected_rr_conflicts): Define.
12804 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
12805 for GLR parsers.
12806 Use expected_sr_conflicts in place of expected_conflicts.
12807 Warn if expected_rr_conflicts used in non-GLR parser.
12808
12809 * doc/bison.texinfo: Add documentation for %expect-rr.
12810
12811 2004-03-08 Paul Eggert <eggert@gnu.org>
12812
12813 Add support for hex token numbers. Suggested by Odd Arild Olsen in
12814 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
12815
12816 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
12817 in lalr1.cc.
12818 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
12819 * src/scan-gram.l (scan_integer): New function.
12820 ({int}): Use it.
12821 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
12822 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
12823 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
12824 Say "long int", not "long", for uniformity with GNU style.
12825
12826 2004-02-25 Paul Eggert <eggert@twinsun.com>
12827
12828 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
12829 compilers. This fixes a problem with Intel's C++ compiler being
12830 chatty, reported by Guido Trentalancia in
12831 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
12832
12833 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
12834
12835 Support %destructor and merge error locations in lalr1.cc.
12836
12837 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
12838 (Parser::stos_): Define unconditionally.
12839 (Parser::destruct_): New method. Generate its body with
12840 b4_yydestruct_generate.
12841 (Parser::error_start_): New attribute.
12842 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
12843 token which are discarded.
12844 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
12845 error_start_ when erroneous token are discarded.
12846 (Parser::parse) <yyerrlab1>: Compute the location of the error
12847 token so that it covers all the discarded tokens.
12848 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
12849 it can be called with `%skeleton "lalr1.cc"', and do that.
12850
12851 2004-02-02 Paul Eggert <eggert@twinsun.com>
12852
12853 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
12854 $(top_srcdir)/lib and ../lib. This fixes a bug reported
12855 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
12856 There's no need to mention top_builddir since Automake does that
12857 for us.
12858 (INCLUDES): Remove, as Automake says it's obsolescent.
12859 Contents migrated into AM_CPPFLAGS as described above.
12860 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
12861
12862 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
12863
12864 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
12865 (yyreportSyntaxError): Handle case where lookahead token is
12866 YYEMPTY.
12867
12868 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12869
12870 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
12871 resulting parsers are compilable with C++.
12872
12873 2003-12-23 Paul Eggert <eggert@twinsun.com>
12874
12875 * config/depcomp, config/install-sh: Sync with Automake 1.8.
12876 * src/output.c (output_skeleton): Rename local var.
12877 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
12878 Bison tokens, as this runs afoul of the 2003-10-07 change that
12879 disallowed NUL bytes in character constants or string literals.
12880
12881 * tests/local.at: Require Autoconf 2.59's Autotest.
12882 * tests/testsuite.at: Don't include local.at, since we now assume
12883 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
12884 including it.
12885 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
12886 multiple inclusion warnings.
12887
12888 2003-12-02 Akim Demaille <akim@epita.fr>
12889
12890 * doc/bison.texinfo (How Can I Reset the Parser): More about start
12891 conditions.
12892 From Bruno Haible.
12893
12894 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
12895
12896 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
12897
12898 2003-10-07 Paul Eggert <eggert@twinsun.com>
12899
12900 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
12901 if testsuite doesn't exist.
12902
12903 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
12904 literals, unfortunately.
12905 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
12906 Complain about NUL bytes in character constants or string literals.
12907
12908 2003-10-05 Paul Eggert <eggert@twinsun.com>
12909
12910 * NEWS: Don't document %no-default-prec, as it's still
12911 too experimental.
12912 * doc/bison.texinfo: Document %no-default-prec only if
12913 the defaultprec flag is set. Normally it's not.
12914
12915 2003-10-04 Paul Eggert <eggert@twinsun.com>
12916
12917 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
12918 non-modifiable lvalue, instead of a modifiable one.
12919 * doc/bison.texinfo (Actions): Document that $$ can
12920 be assigned to. Do not claim that $$ and $N are
12921 array element references: user code should not rely on this.
12922
12923 2003-10-01 Paul Eggert <eggert@twinsun.com>
12924
12925 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
12926 (grammar_declaration): Use it.
12927 * src/scan-gram.l: New token %no-default-prec.
12928 * tests/conflicts.at: Revamp tests to use %no-default-prec.
12929 * NEWS, doc/bison.texinfo: Document the above.
12930
12931 2003-10-01 Akim Demaille <akim@epita.fr>
12932
12933 VCG no longer supports long_straight_phase.
12934
12935 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
12936 * src/print_graph.c (print_graph): Adjust.
12937
12938 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
12939 and Paul Eggert <eggert@twinsun.com>
12940
12941 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
12942 Table of Symbols): Document %default-prec.
12943 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
12944 (grammar_declaration): Set default_prec on %default-prec.
12945 * src/scan-gram.l (%default-prec): New token.
12946 * src/reader.h (default_prec): New flag.
12947 * src/reader.c: Likewise.
12948 (packgram): Handle it.
12949 * tests/conflicts.at (%default-prec without %prec,
12950 %default-prec with %prec, %default-prec 1): New tests.
12951
12952 2003-09-30 Paul Eggert <eggert@twinsun.com>
12953
12954 * tests/testsuite.at: Include local.at, not input.at, fixing
12955 a typo in the 2003-08-25 patch.
12956
12957 2003-08-27 Akim Demaille <akim@epita.fr>
12958
12959 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
12960 GCC warnings.
12961
12962 2003-08-26 Akim Demaille <akim@epita.fr>
12963
12964 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
12965 "<\#" to avoid magic from Gnus when posting parts of this script.
12966
12967 2003-08-26 Akim Demaille <akim@epita.fr>
12968
12969 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
12970 (Parser::parse): here.
12971 Adjust: nerrs and errstatus is now replaced by...
12972 (Parser::nerrs_, Parser::errstatus_): New.
12973
12974 2003-08-25 Akim Demaille <akim@epita.fr>
12975
12976 * config/announce-gen, Makefile.cfg: New.
12977 * Makefile.am: Adjust.
12978 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
12979 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
12980
12981 2003-08-25 Akim Demaille <akim@epita.fr>
12982
12983 When reducing initial empty rules, Bison parser read an initial
12984 location that is not defined. This results in garbage, and that
12985 affects Bison's own parser. Therefore we need (i) to extend Bison
12986 to support a means to initialize this location, and (ii) to use
12987 this CVS Bison to fix CVS Bison's parser.
12988
12989 * src/reader.h, reader.c (epilogue_augment): Remove, replace
12990 with...
12991 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
12992 * src/parse-gram.y: Adjust.
12993 (%initial-action): New.
12994 (%error-verbose): Since we require CVS Bison, there is no reason
12995 not to use it.
12996 * src/scan-gram.l: Adjust.
12997 * src/Makefile.am (YACC): New, to make sure we use our own parser.
12998 * data/yacc.c (yyparse): Use b4_initial_action.
12999
13000 2003-08-25 Akim Demaille <akim@epita.fr>
13001
13002 * doc/bison.texinfo: Don't promote stdout for error messages.
13003
13004 2003-08-25 Akim Demaille <akim@epita.fr>
13005
13006 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
13007 From Alexandre Duret-Lutz.
13008
13009 2003-08-25 Akim Demaille <akim@epita.fr>
13010
13011 Version 1.875c.
13012
13013 2003-08-25 Akim Demaille <akim@epita.fr>
13014
13015 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
13016 Use them.
13017
13018 2003-08-25 Akim Demaille <akim@epita.fr>
13019
13020 * data/lalr1.cc (Parser::reduce_print_): New.
13021 Use it.
13022
13023 2003-08-25 Akim Demaille <akim@epita.fr>
13024
13025 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
13026 error recovery loops. This patch is based on
13027 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
13028 Also, augment the similarity between lalr1.cc and yacc.c.
13029 Note: the locations of error recovery rules are not correct yet.
13030
13031 * data/lalr1.cc: Comment changes to augment the similarity between
13032 lalr1.cc and yacc.c.
13033 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
13034 (yyerrlab1): Remove, but where it used to be (now the bottom part of
13035 yyerrlab), when hitting EOF, pop the whole stack here instead of
13036 merely falling thru the default error handling mechanism.
13037 (yyerrorlab): New label, with the old contents of YYERROR,
13038 plus the following change: pop the stack of rhs corresponding
13039 to the production that invoked YYERROR. That is how Yacc
13040 behaves (required by POSIX).
13041 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
13042 fail.
13043
13044 2003-08-25 Akim Demaille <akim@epita.fr>
13045
13046 Tune local.at so that people can "autom4te -l autotest calc.at -o
13047 calc" for instance, to extract a sub test suite.
13048
13049 * tests/testsuite.at: Move the initialization, Autotest version
13050 requirement, and AT_TESTED invocation into...
13051 * tests/local.at: here.
13052 * tests/testsuite.at: Include it for compatibility with Autoconf
13053 2.57.
13054 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
13055 be ignore.
13056
13057 2003-08-04 Paul Eggert <eggert@twinsun.com>
13058
13059 Rework code slightly to avoid gcc -Wtraditional warnings.
13060 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
13061 The returned value is now stored in *YY0. All callers changed.
13062 * src/output.c (merge_output): Adjust to the above change.
13063
13064 2003-07-26 Paul Eggert <eggert@twinsun.com>
13065
13066 * data/glr.c (YYASSERT): New macro.
13067 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
13068 yyresolveStates, yyprocessOneStack):
13069 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
13070 Derived from a suggestion by Frank Heckenbach.
13071
13072 2003-07-25 Paul Eggert <eggert@twinsun.com>
13073
13074 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
13075 for portability to K&R C (after ansi2knr, presumably). See
13076 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
13077 by Frank Heckenbach, though I have omitted the structure-initialization
13078 part of his glr-knr.diff patch since I recall that the Portable
13079 C Compiler didn't require that change.
13080
13081 Let the user specify how to allocate and free memory.
13082 Derived from a suggestion by Frank Heckenbach in
13083 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
13084 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
13085 All uses of free, malloc, realloc changed to use these macros,
13086 and unnecessary casts removed.
13087 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
13088
13089 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
13090
13091 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
13092 use s.empty() rather than s == "" to test for empty string; see
13093 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
13094 (trivial change)
13095
13096 2003-06-25 Akim Demaille <akim@epita.fr>
13097
13098 * config/depcomp, config/install-sh: Update from masters.
13099
13100 2003-06-20 Paul Eggert <eggert@twinsun.com>
13101
13102 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
13103 and return properly parenthesized result.
13104 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
13105 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
13106 Remove unnecessary parentheses from uses.
13107 * doc/bison.texinfo (Location Default Action): Describe the
13108 conventions for parentheses.
13109
13110 2003-06-19 Paul Eggert <eggert@twinsun.com>
13111
13112 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
13113 yyreportTree): Do not assume that size_t is the same width as int,
13114 when printing sizes. Print sizes using an unsigned format.
13115 Problem reported by Frank Heckenbach in
13116 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
13117
13118 Port to Forte Developer 7 C compiler.
13119 * data/glr.c (struct YYLTYPE): If locations are not being used,
13120 declare a single dummy member, as empty structs do not conform
13121 to the C standard.
13122 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
13123 the Forte Developer 7 C compiler complains that end-of-loop
13124 code is not reached.
13125
13126 2003-06-17 Paul Eggert <eggert@twinsun.com>
13127
13128 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
13129 avoid warnings from picky compilers about redefinition of PARAMS.
13130
13131 2003-06-17 Paul Eggert <eggert@twinsun.com>
13132
13133 Version 1.875b.
13134
13135 * NEWS: Document 1.875b.
13136
13137 * lib/bbitset.h: Do not include config.h; that's the includer's job.
13138 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
13139 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
13140 Don't use 'index' in comments, as it's a builtin fn on some hosts.
13141 * lib/bitset_stats.c: Include gettext.h unconditionally, as
13142 per recent gettext manual's suggestion.
13143 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
13144 Use prototypes, not old-style definitions.
13145 * lib/lbitset.c (lbitset_unused_clear): Likewise.
13146 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
13147 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
13148 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
13149 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
13150 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
13151 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
13152 vbitset_or_and_cmp, vbitset_copy): Likewise.
13153
13154 * lib/libiberty.h: Do not include config.h; that's the includer's job.
13155 Do not include <stdlib.h>.
13156 (PARAMS): Define unconditionally for C89.
13157 (ATTRIBUTE_NORETURN): Remove.
13158 (ATTRIBUTE_UNUSED): Define unconditionally.
13159
13160 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
13161 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
13162 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
13163 * lib/vbitset.c, lib/vbitset.h: New files.
13164 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
13165 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
13166 from libbitset.
13167
13168 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
13169 `How Can I Reset @code{yyparse}', since texinfo does not allow
13170 arbitrary @ in node names.
13171
13172 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
13173 shouldn't be needed according to the gettext 0.12.1 documentation
13174 but which seem to be needed anyway: codeset.m4 glibc21.m4
13175 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
13176 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
13177 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
13178
13179 * lib/.cvsignore: Add stdbool.h.
13180 * m4/.cvsignore: Add nls.m4, po.m4.
13181
13182 Upgrade to CVS gnulib.
13183 * stdbool_.h: File renamed from stdbool.h.in.
13184 * configure.ac (AM_STDBOOL_H): Invoke this instead of
13185 AC_HEADER_STDBOOL.
13186 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
13187 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
13188 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
13189 (MOSTLYCLEANFILES): New var.
13190 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
13191 (stdbool.h): New rule.
13192 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
13193 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
13194 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
13195 m4/quote.m4: Upgrade to today's gnulib.
13196
13197 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
13198 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
13199 the tests right now.
13200 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
13201 yyerror are declared before use; C99 requires this.
13202
13203 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13204
13205 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
13206 first.
13207 (yyrecoverSyntaxError): Correct the logic for setting and testing
13208 yyerrState.
13209 Correct comment on handling EOF.
13210 Allow states with only a default reduction, rather than failing
13211 (I can't quite reconstruct why these were not allowed before).
13212
13213 Fixes to avoid problem that $-N rules in GLR parsers can cause
13214 buffer overruns, corrupting state.
13215
13216 * src/output.c (prepare_rules): Output max_left_semantic_context
13217 definition.
13218 * src/reader.h (max_left_semantic_context): New variable declaration.
13219 * src/scan-gram.l (max_left_semantic_context): Define.
13220 (handle_action_dollar): Update max_left_semantic_context.
13221 * data/glr.c (YYMAXLEFT): New definition.
13222 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
13223 (yyresolveAction): Ditto.
13224
13225 Fixes to problems with location handling in GLR parsers reported by
13226 Frank Heckenbach (2003/06/05).
13227
13228 * data/glr.c (YYLTYPE): Make trivial if locations not used.
13229 (YYRHSLOC): Add parentheses, and define only if locations used.
13230 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
13231 locations not used.
13232 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
13233 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
13234
13235 * tests/cxx-type.at: Exercise location information; update tests
13236 to differentiate output with and without locations.
13237 Remove forward declarations of yylex and yyerror---caused errors
13238 because default YYLTYPE not yet defined.
13239 Change semantic actions to compute strings, rather than printing
13240 them directly (to test proper passing of semantics values). Change
13241 output to prefix notation and update test data and expected results.
13242 (yylex): Track locations.
13243 (stmtMerge): Return value rather than printing, and include arguments
13244 in value.
13245
13246 2003-06-03 Paul Eggert <eggert@twinsun.com>
13247
13248 Avoid warnings generated by GCC 2.95.4 when Bison is
13249 configured with --enable-gcc-warnings.
13250 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
13251 yy::]b4_parser_class_name[::translate_,
13252 yy::Stack::operator[] (unsigned),
13253 yy::Stack::operator[] (unsigned) const,
13254 yy::Slice::operator[] (unsigned),
13255 yy::Slice::operator[] (unsigned) const):
13256 Rename local vars to avoid warnings.
13257 * tests/glr-regression.at (Improper handling of embedded actions
13258 and $-N in GLR parsers): Remove unused local variable from yylex.
13259 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
13260 (void) as arg when not pure, since we now assume C89 when building
13261 Bison. Pacify GCC by using parameter.
13262
13263 2003-06-02 Paul Eggert <eggert@twinsun.com>
13264
13265 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
13266 yy::Location::lines, yy::Location::columns): Rename arguments
13267 to avoid shadowing; this removes a warning generated by GCC 3.3.
13268
13269 2003-06-01 Paul Eggert <eggert@twinsun.com>
13270
13271 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
13272 to g++, as GCC 3.3 complains if you do it.
13273 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
13274 everything that WARNING_CFLAGS has, except omit warnings
13275 not suitable for C++.
13276 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
13277 * tests/atlocal.in (CXXFLAGS): New var.
13278 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
13279
13280 Fix a GLR parser bug I reported in February; see
13281 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
13282 The problem was that GLR parsers did not conform to the C standard,
13283 because actions like { $1 = $2 + $3; } expanded to expressions
13284 that invoked YYFILL in separate subexpressions, and YYFILL assigned
13285 to a local variable. The C standard says that expressions
13286 like (var = f ()) + (var = f ()) have undefined behavior.
13287 Another problem was that GCC sometimes issues warnings that
13288 yyfill and its parameters are unused.
13289
13290 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
13291 as possibly unused.
13292 (yyfill): New function.
13293 (YYFILL): Use it.
13294 (yyuserAction): Change type of yynormal to bool, so that it matches
13295 the new yyfill signature. Mark it as possibly unused.
13296
13297
13298 Follow up on a bug I reported in February, where a Bison-generated
13299 parser can loop. Provide a test case and a fix for yacc.c. I
13300 don't have a fix for lalr1.cc or for glr.c, unfortunately.
13301 The original bug report is in:
13302 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
13303
13304 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
13305 macro's size was becoming unwieldy.
13306 (yyerrlab): Do not discard an empty lookahead symbol, as this
13307 might destroy garbage.
13308 (yyerrorlab): New label, with the old contents of YYERROR,
13309 plus the following change: pop the stack of rhs corresponding
13310 to the production that invoked YYERROR. That is how Yacc
13311 behaves, and POSIX requires this behavior.
13312 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
13313 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
13314 Define 'alarm' to do nothing if unistd.h is not available.
13315 Add a new rule "exp: '-' error;" to test the above change to
13316 data/yacc.c. Use 'alarm' to abort any test taking longer than
13317 10 seconds, as it's probably looping.
13318 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
13319 Also, the new yacc.c generates two fewer diagnostics for an
13320 existing test.
13321
13322 2003-05-24 Paul Eggert <eggert@twinsun.com>
13323
13324 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
13325 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
13326 This fixes a problem reported by John Bowman when the Compaq/HP
13327 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
13328 -ansi -Wall -gall).
13329 * data/yacc.c (union yyalloc): Likewise.
13330 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
13331
13332 Switch from 'int' to 'bool' where that makes sense.
13333
13334 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
13335 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
13336 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
13337 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
13338 Return or accept bool, not int. All callers changed.
13339 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
13340 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
13341 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
13342 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
13343 bitset_or_and_cmp_): Likewise.
13344 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
13345 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
13346 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
13347 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
13348 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
13349 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
13350 bitset_stats_or_and_cmp): Likewise.
13351 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
13352 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
13353 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
13354 ebitset_xor_cmp): Likewise.
13355 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
13356 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
13357 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
13358 lbitset_xor_cmp): Likewise.
13359 * lib/bbitset.h: Include <stdbool.h>.
13360 (struct bitset_vtable): The following members now return bool, not
13361 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
13362 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
13363 or_and_cmp).
13364 * src/conflicts.c (count_rr_conflicts): Likewise.
13365 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
13366 All uses changed.
13367 * lib/ebitset.c (ebitset_obstack_init): Likewise.
13368 * lib/lbitset.c (lbitset_obstack_init): Likewise.
13369 * src/getargs.c (debug_flag, defines_flag, locations_flag,
13370 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13371 graph_flag): Likewise.
13372 * src/getargs.h (debug_flag, defines_flag, locations_flag,
13373 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
13374 graph_flag): Likewise.
13375 * src/output.c (error_verbose): Likewise.
13376 * src/output.h (error_verbose): Likewise.
13377 * src/reader.c (start_flag, typed): Likewise.
13378 * src/reader.h (typed): Likewise.
13379 * src/getargs.c (LOCATIONS_OPTION): New constant.
13380 (long_options, getargs): Use it.
13381 * src/lalr.c (build_relations): Use bool, not int.
13382 * src/nullable.c (nullable_compute): Likewise.
13383 * src/print.c (print_reductions): Likewise.
13384 * src/tables.c (action_row, pack_vector): Likewise.
13385 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
13386 * src/output.c (prepare): Use it.
13387 * src/output.c (token_definitions_output,
13388 symbol_destructors_output, symbol_destructors_output): Use string,
13389 not boolean integer, to keep track of whether to output separator.
13390 * src/print_graph.c (print_core): Likewise.
13391 * src/state.c (state_rule_lookaheads_print): Likewise.
13392
13393 * config/install-sh: Sync from automake 1.7.5.
13394
13395 2003-05-14 Paul Eggert <eggert@twinsun.com>
13396
13397 * src/parse-gram.y (rules_or_grammar_declaration): Require a
13398 semicolon after a grammar declaration, in the interest of possible
13399 future changes to the Bison input language.
13400 Do not allow a stray semicolon at the start of the grammar.
13401 (rhses.1): Allow one or more semicolons after any rule, including
13402 just before "|" as required by POSIX.
13403 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
13404 grammar.
13405
13406 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
13407
13408 %parse-param support for lalr1.cc.
13409
13410 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
13411 b4_cc_constructor_calls, b4_cc_constructor_call,
13412 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
13413 definitions.
13414 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
13415 parse-param arguments.
13416 (yy::b4_parser_class_name): Declare instance variables to
13417 hold parse-param arguments.
13418 * tests/calc.at: s/value/semantic_value/ because value clashes
13419 with a member of yy::b4_parser_class_name. Adjust C++ code
13420 to handle %parse-param. Enable %parse-param test in C++.
13421
13422 2003-05-12 Paul Eggert <eggert@twinsun.com>
13423
13424 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
13425 English a bit. Fix fclose typo. Change "const char" to "char
13426 const", and use ANSI C rather than K&R for "main". Suggest
13427 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
13428 and suggest yy_switch_to_buffer.
13429
13430 2003-05-05 Paul Eggert <eggert@twinsun.com>
13431
13432 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
13433 C89. This avoids a diagnostic on compilers that define __STDC__
13434 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
13435 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
13436
13437 2003-05-03 Paul Eggert <eggert@twinsun.com>
13438
13439 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
13440 Do not overrun array bounds.
13441 This should fix a bug reported today by Olatunji Oluwabukunmi in
13442 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
13443
13444 2003-04-29 Akim Demaille <akim@epita.fr>
13445
13446 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
13447 * src/getargs.c, src/getargs.h: here, as bool, not int.
13448 (nondeterministic_parser): New.
13449 * src/parse-gram.y, src/scan-gram.l: Support
13450 %nondeterministic-parser.
13451 * src/output.c (prepare): Use nondeterministic_parser instead
13452 of glr_parser where appropriate.
13453 * src/tables.c (conflict_row, action_row, save_row)
13454 (token_actions, token_actions, pack_vector): Ditto.
13455
13456 2003-04-29 Akim Demaille <akim@epita.fr>
13457
13458 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
13459
13460 2003-04-29 Akim Demaille <akim@epita.fr>
13461
13462 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
13463 with %pure-parser and %locations to exercise the patch from Yakov
13464 Markovitch below.
13465
13466 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
13467
13468 * data/yacc.c: (b4_lex_param): Corrected for the case where
13469 %lex-param is provided and %pure-parser isn't.
13470
13471 2003-04-27 Paul Eggert <eggert@twinsun.com>
13472
13473 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
13474 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
13475 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
13476 if it is not defined.
13477 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
13478
13479 2003-04-26 Paul Eggert <eggert@twinsun.com>
13480
13481 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
13482 Declare to be of type suitable for the ninf value itself, not of
13483 type suitable for the corresponding table, since the latter might
13484 be unsigned but the ninf value might be negative. This fixes a
13485 bug reported by Alexandre Duret-Lutz in
13486 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
13487
13488 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
13489 invokes it. We shouldn't invoke it twice because it will attempt
13490 to put error.o in the archive twice. This fixes a glitch reported
13491 by Martin Mokrejs in
13492 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
13493
13494 2003-04-21 Paul Eggert <eggert@twinsun.com>
13495
13496 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
13497 to gnulib.
13498
13499 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
13500
13501 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
13502 Fix obvious typo that results in uncompilable GLR parsers
13503 when both %pure-parser and %locations are used. (trivial change)
13504
13505 2003-04-17 Paul Eggert <eggert@twinsun.com>
13506
13507 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
13508 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
13509 Do not insert the expected token via unput, as this runs afoul
13510 of a POSIX-compatibility bug in flex 2.5.31.
13511 All uses changed to BEGIN the parent state,
13512 since we no longer insert the expected token via unput.
13513 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
13514 that is no longer emitted after the above change.
13515
13516 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
13517 the first one. This change is from Paul Hilfinger, and it fixes
13518 regression reported by Werner Lemberg in
13519 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
13520
13521 (resolve_sr_conflict): Don't invoke state_errs_set
13522 unless one or more tokens have been explicitly made errors.
13523 Otherwise, the above change causes Bison to abort.
13524
13525 * tests/existing.at (GNU pic Grammar): New test case, taken from
13526 Lemberg's email.
13527
13528 2003-03-31 Akim Demaille <akim@epita.fr>
13529
13530 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
13531
13532 2003-03-31 Akim Demaille <akim@epita.fr>
13533
13534 * src/output.c (prepare_symbols): Avoid trailing spaces in the
13535 output.
13536
13537 2003-03-31 Akim Demaille <akim@epita.fr>
13538
13539 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
13540 From Paul Hilfinger.
13541
13542 2003-03-29 Akim Demaille <akim@epita.fr>
13543
13544 * m4/error.m4: Do not put under dynamic conditions some code which
13545 expansion is under static control.
13546
13547 2003-03-29 Akim Demaille <akim@epita.fr>
13548
13549 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
13550
13551 2003-03-29 Akim Demaille <akim@epita.fr>
13552
13553 * doc/bison.texinfo (Strings are Destroyed): New.
13554
13555 2003-03-13 Paul Eggert <eggert@twinsun.com>
13556
13557 * .cvsignore: Add configure.lineno.
13558 * src/.cvsignore: Add yacc.
13559 * tests/.cvsignore: Add testsuite.log.
13560 * doc/fdl.texi: Sync with latest FSF version.
13561
13562 2003-03-12 Paul Eggert <eggert@twinsun.com>
13563
13564 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
13565 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
13566 cursor, instead of leaving it undefined. This fixes a bug
13567 reported by Tim Van Holder in
13568 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
13569 * tests/input.at (Torturing the Scanner): Test the scanner on
13570 an empty input file, which was Tim Van Holder's test case.
13571
13572 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
13573 <sys/resource.h> can be included, include sys/time.h and
13574 sys/times.h first, if available. This works around the SunOS
13575 4.1.4 porting bug reported by Bruce Becker in
13576 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
13577
13578 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
13579 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
13580 AC_HEADER_SYS_WAIT.
13581
13582 Merge changes from gnulib. This was prompted because the CVS
13583 snapshot didn't build on Solaris 7 due to strnlen problems.
13584
13585 These changes need to be merged back into gnulib:
13586 * lib/hash.c: Include <stdbool.h> unconditionally.
13587 * m4/onceonly.m4 (m4_quote): New macro.
13588 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
13589 Quote AC_FOREACH variable-expansions properly.
13590 The 2003-01-03 obstack.h change also needs merging.
13591 {end of changes requiring merging}
13592
13593 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
13594 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
13595 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
13596 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
13597 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
13598 New files, imported from gnulib.
13599 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
13600 above.
13601
13602 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
13603 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
13604 gnulib sources.
13605
13606 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
13607 Add.
13608 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
13609 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
13610 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
13611 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
13612 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
13613 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
13614 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
13615 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
13616 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
13617 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
13618 (jm_PREREQ_ARGMATCH): Remove.
13619 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
13620 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
13621
13622 * src/system.h: Include <stdbool.h> unconditionally.
13623
13624 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
13625 assuming at least C89 in the bitset code for some time now.
13626
13627 2003-03-03 Akim Demaille <akim@epita.fr>
13628
13629 * ro.po: New.
13630
13631 2003-03-02 Akim Demaille <akim@epita.fr>
13632
13633 * doc/bison.texinfo (Table of Symbols): Reactivate the
13634 documentation for %lex-param, and %parse-param.
13635
13636 2003-03-02 Akim Demaille <akim@epita.fr>
13637
13638 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
13639 generate verbose error messages.
13640 Use the number of tokens as an upper bound in yytname, as it
13641 cannot be a non terminal.
13642
13643 2003-03-02 Akim Demaille <akim@epita.fr>
13644
13645 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
13646 message.
13647
13648 2003-03-02 Akim Demaille <akim@epita.fr>
13649
13650 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
13651 Use them to exercise yycheck overrun.
13652 Based on Andrew Suffield's grammar.
13653
13654 2003-03-02 Akim Demaille <akim@epita.fr>
13655
13656 Create tests/local.at for Bison generic testing macros.
13657
13658 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
13659 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
13660 This new file.
13661 * tests/calc.at (AT_CHECK_CALC): Adjust.
13662 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
13663 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
13664 * tests/local.at: here.
13665 (AT_COMPILE_CXX): Tags the tests using it as c++.
13666 Ignore the test if CXX is not functional.
13667
13668 2003-03-01 Paul Eggert <eggert@twinsun.com>
13669
13670 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
13671 not loc->end, since loc->end might contain garbage and this leads
13672 to undefined behavior on some platforms.
13673 (id_loc, token_start): Use (IF_LINTed) initial values that do not
13674 depend on *loc, so that the reader doesn't give the the false
13675 impression that *loc is initialized.
13676 (<INITIAL>"%%"): Do not bother setting code_start, since its value
13677 does not survive the return.
13678
13679 2003-03-01 Akim Demaille <akim@epita.fr>
13680
13681 * src/scan-gram.l (code_start): Always initialize it when entering
13682 into yylex, as SC_EPILOGUE is activated *before* the corresponding
13683 yylex invocation. An alternative would be making it static, but
13684 then it starts with the second %%'s beginning, instead of its end.
13685
13686 2003-02-28 Paul Eggert <eggert@twinsun.com>
13687
13688 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
13689 around a UnixWare 7.1.1 porting bug reported by John Hughes in
13690 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
13691
13692 2003-02-26 Paul Eggert <eggert@twinsun.com>
13693
13694 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
13695 Remove Sequent/Pyramid discussion (nobody uses them any more).
13696 Merge VMS and MS-DOS discussion; these ports may well be dead
13697 but let's keep mentioning them for now. Put <> around email
13698 addresses. Add copyright notice.
13699
13700 2003-02-24 Paul Eggert <eggert@twinsun.com>
13701
13702 * data/glr.c (yy_reduce_print): yylineno -> yylno,
13703 to avoid collision with flex use of yylineno.
13704 Problem reported by Bruce Lilly in
13705 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
13706 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
13707 * data/yacc.c (yy_reduce_print): Likewise.
13708
13709 * config/depcomp: Sync with Automake 1.7.3.
13710
13711 2003-02-21 Akim Demaille <akim@epita.fr>
13712
13713 * data/lalr1.cc: Use temporary variables instead of casts to
13714 change integer types.
13715 Suggested by Paul Eggert.
13716
13717 2003-02-21 Akim Demaille <akim@epita.fr>
13718
13719 * doc/bison.texinfo: Use "location" consistently to refer to @n,
13720 to avoid confusions with lalr1.cc's notion of Position.
13721 Suggested by Paul Eggert.
13722
13723 2003-02-20 Akim Demaille <akim@epita.fr>
13724
13725 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
13726 before initial_columns.
13727 (location.hh): Use consistent variable names when defining the
13728 operator<<.
13729 Use "last" so that we subtract from Positions, not from unsigned.
13730
13731 2003-02-20 Akim Demaille <akim@epita.fr>
13732
13733 * data/lalr1.cc (position.hh): New subfile, including the extended
13734 and Doxygen'ed documentation of class Position.
13735 (location.hh): Use it.
13736 Document a` la Doxygen.
13737 With the help of Benoit Perrot.
13738
13739 2003-02-20 Akim Demaille <akim@epita.fr>
13740
13741 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
13742 AT_YACC_IF.
13743 Redefine AT_YYERROR_SEES_LOC_IF using it.
13744 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
13745 not defined.
13746 Don't use the location in yy::Parser::error_ and
13747 yy::Parser::print_ when not %locations.
13748 Activate more lalr1.cc tests.
13749
13750 2003-02-19 Akim Demaille <akim@epita.fr>
13751
13752 * data/lalr1.cc: When displaying a line number, be sure to make it
13753 an int.
13754
13755 2003-02-19 Akim Demaille <akim@epita.fr>
13756
13757 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
13758 Remove, useless.
13759 (YYABORT, YYACCEPT, YYERROR): New.
13760 * tests/calc.at: Renable the lalr1.cc test.
13761
13762 2003-02-19 Akim Demaille <akim@epita.fr>
13763
13764 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
13765 error recovery, mixing with/without pops and discarding of the
13766 lookahead.
13767 Exercise YYERROR.
13768 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
13769
13770 2003-02-17 Paul Eggert <eggert@twinsun.com>
13771
13772 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
13773 * tests/testsuite.at (AT_COMPILE): Use them.
13774 This fixes the testsuite problem reported by Robert Lentz in
13775 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
13776
13777 2003-02-12 Paul Eggert <eggert@twinsun.com>
13778
13779 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
13780 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
13781 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
13782 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
13783 Check for malloc failure, for consistency with yacc.c.
13784 (yytname_size): Remove, for consistency with yacc.c.
13785
13786 The bug still remains in data/lalr1.cc, as I didn't have time
13787 to fix it there.
13788
13789 2003-02-06 Akim Demaille <akim@epita.fr>
13790
13791 * configure.ac (GXX): Rename as...
13792 (CXX): this, to keep the original Autoconf semantics.
13793 Require 2.57.
13794 * data/lalr1.cc: Fix b4_copyright invocations.
13795 If YYDEBUG is not defined, don't depend upon name_ being defined.
13796 (location.hh): Include string and iostream.
13797 (Position::filename): New member.
13798 (Position::Position ()): New.
13799 (operator<< (Position)): New.
13800 (operator- (Position, int)): New.
13801 (Location::first, Location::last): Rename as...
13802 (Location::begin, Location::end): these, to mock the conventional
13803 iterator names.
13804 (operator<< (Location)): New.
13805 * tests/atlocal.in (CXX): New.
13806 * tests/testsuite.at (AT_COMPILE_CXX): New.
13807 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
13808 locations in a more synthetic way.
13809 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
13810 lalr1.cc is used.
13811 Adjust the C locations to match those from Emacs: first column is
13812 column 0.
13813 Change all the expected results.
13814 Conform to the GCS: simplify the locations when applicable.
13815 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
13816 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
13817 these CPP macros with the m4 macros new defined by...
13818 (AT_CHECK_PUSHDEFS): this, i.e.:
13819 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
13820 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
13821 New macros.
13822 (AT_CHECK_POPDEFS): Undefine them.
13823 (AT_CHECK_CALC_LALR1_CC): New.
13824 Use it for the first lalr1.cc test.
13825
13826 2003-02-04 Akim Demaille <akim@epita.fr>
13827
13828 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
13829 Location as is defined.
13830
13831 2003-02-04 Akim Demaille <akim@epita.fr>
13832
13833 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
13834 name_ being defined.
13835
13836 2003-02-03 Paul Eggert <eggert@twinsun.com>
13837
13838 * src/gram.h (start_symbol): Remove unused decl.
13839
13840 Use more-consistent naming conventions for local vars.
13841
13842 * src/derives.c (derives_compute): Change type of local var from
13843 int to rule_number.
13844 * src/gram.c (grammar_rules_partial_print): Likewise.
13845 * src/print.c (print_core): Likewise.
13846 * src/reduce.c (reduce_grammar_tables): Likewise.
13847
13848 * src/gram.c (grammar_dump): Change name of item_number *
13849 local var from r to rp.
13850 * src/nullable.c (nullable_compute): Likewise.
13851
13852 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
13853
13854 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
13855 for symbol or symbol_number var.
13856 * src/reader.c (grammar_start_symbol_set): Likewise.
13857 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
13858 Likewise.
13859 * src/state.c (transitions_to): Likewise.
13860 * src/state.h: Likewise.
13861 * src/tables.c (symbol_number_to_vector_number): Likewise.
13862
13863 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
13864 char * var.
13865
13866 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
13867 var.
13868
13869 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
13870 var.
13871
13872 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
13873 Use str, not s, for char * var. Use ch, not c, for character var.
13874 Use size for size var.
13875
13876 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
13877 char * var.
13878 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
13879 uniqstr var.
13880 * src/uniqstr.h: Likewise.
13881
13882 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
13883 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
13884 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
13885 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
13886 param to have same name as that of enum, so that we don't use
13887 "s" to stand for a non-state.
13888
13889 2003-02-02 Akim Demaille <akim@epita.fr>
13890
13891 * src/scan-skel.l: Scan more than one inert character per yylex
13892 invocation.
13893
13894 2003-02-01 Paul Eggert <eggert@twinsun.com>
13895
13896 Version 1.875a.
13897
13898 * po/LINGUAS: Add ms.
13899
13900 2003-01-30 Akim Demaille <akim@epita.fr>
13901
13902 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
13903
13904 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13905
13906 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
13907 of $1.
13908
13909 Changes in response to error report by S. Eken: GLR mode does not
13910 handle negative $ indices or $ indices in embedded rules correctly.
13911 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
13912
13913 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
13914 (b4_rhs_location): Ditto.
13915 (yyfill): New function to copy from stack tree into array
13916 incrementally.
13917 (yyuserAction): Modify to allow incremental move of semantic values
13918 to rhs array when in GLR mode.
13919 Define YYFILL to use in user-defined actions to fill semantic array
13920 as needed.
13921 Remove dummy use of yystack, as there is now a guaranteed use.
13922 (yydoAction): Modify to allow incremental move of semantic values
13923 to rhs array when in GLR mode.
13924 (yyresolveAction): Ditto.
13925 (yyglrShiftDefer): Update comment.
13926 (yyresolveStates): Use X == NULL for pointers, not !X.
13927 (yyglrReduce): Ditto.
13928 (yydoAction): Ditto
13929
13930 * tests/glr-regr1.at: Rename to ...
13931 * tests/glr-regression.at: Add new regression test for the problems
13932 described above (adapted from S. Eken).
13933 Update copyright notice.
13934 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
13935 * tests/Makefile.am: Ditto.
13936
13937 2003-01-28 Paul Eggert <eggert@twinsun.com>
13938
13939 * data/lalr1.cc: Do not use @output_header_name@ unless
13940 b4_defines_flag is set. This fixes two bugs reported by
13941 Tim Van Holder in
13942 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
13943 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
13944
13945 2003-01-21 Paul Eggert <eggert@twinsun.com>
13946
13947 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
13948 we don't need to worry about yyerrlab1 being reported as an
13949 "unused label" by non-GCC C compilers. The downside is that if
13950 locations are used then a couple of statements are duplicated each
13951 time YYERROR is invoked, but the upside is that the warnings
13952 should vanish.
13953 (yyerrlab1): Move code to YERROR.
13954 (yyerrlab2): Remove. Change uses back to yyerrlab1.
13955 This reverts some of the 2002-12-27 change.
13956
13957 2003-01-17 Paul Eggert <eggert@twinsun.com>
13958
13959 * src/output.c (symbol_printers_output): Fix typo that led
13960 to core dump. Problem reported by Antonio Rus in
13961 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
13962
13963 2003-01-13 Akim Demaille <akim@epita.fr>,
13964 Quoc Peyrot <chojin@lrde.epita.fr>,
13965 Robert Anisko <anisko_r@lrde.epita.fr>
13966
13967 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
13968 when the stacks contain one element, as the loop would otherwise
13969 free the last state, and then use the top state (the one we just
13970 popped). This means that the initial elements will not be freed
13971 explicitly, as is the case in yacc.c; it is not a problem, as
13972 these elements have fake values.
13973
13974 2003-01-11 Paul Eggert <eggert@twinsun.com>
13975
13976 * NEWS: %expect-violations are now just warnings, reverting
13977 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
13978 bootstrapping problem reported by Matthias Klose; see
13979 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
13980 * src/conflicts.c (conflicts_print): Likewise.
13981 * tests/conflicts.at (%expect not enough, %expect too much,
13982 %expect with reduce conflicts): Likewise.
13983 * doc/bison.texinfo (Expect Decl): Document this. Also mention
13984 that the warning is enabled if the number of conflicts changes
13985 (not necessarily increases).
13986
13987 * src/getargs.c (version): Update copyright year.
13988
13989 2003-01-09 Akim Demaille <akim@epita.fr>
13990
13991 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
13992
13993 2003-01-08 Paul Eggert <eggert@twinsun.com>
13994
13995 * Makefile.maint (WGETFLAGS):
13996 New macro, containing "-C off" to disable proxy caches.
13997 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
13998 (rel-check): Use $(WGET) instead of wget.
13999
14000 2003-01-06 Paul Eggert <eggert@twinsun.com>
14001
14002 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
14003 the GLR paper of Scott, Johnstone and Hussain.
14004
14005 2003-01-04 Paul Eggert <eggert@twinsun.com>
14006
14007 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
14008 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
14009 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
14010 (EXTRA_LIBRARIES): New var, for liby.a.
14011 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
14012 (EXTRA_SCRIPTS): New var, for yacc.
14013
14014 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
14015 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
14016 Problem reported by Nelson H. F. Beebe.
14017
14018 2003-01-03 Paul Eggert <eggert@twinsun.com>
14019
14020 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
14021 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
14022 when compiling Bison 1.875's `bitset bset = obstack_alloc
14023 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
14024
14025 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
14026 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
14027 grow to a huge size with typical invocation.
14028
14029 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
14030 Use the pattern recommended by Autoconf 2.57, except also protect
14031 against double-definition.
14032 * src/system.h: Likewise.
14033 Portability issues reported by Nelson H. F. Beebe.
14034
14035 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
14036 All uses changed. Provide a definition in both C and C++.
14037 (yytrue, yyfalse): Define even if defined (__cplusplus).
14038
14039 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
14040 Reported by Nelson H. F. Beebe.
14041
14042 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
14043
14044 2003-01-02 Paul Eggert <eggert@twinsun.com>
14045
14046 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
14047 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
14048 Bug reported by Nelson H. F. Beebe.
14049
14050 2003-01-01 Paul Eggert <eggert@twinsun.com>
14051
14052 * Version 1.875.
14053
14054 2002-12-30 Paul Eggert <eggert@twinsun.com>
14055
14056 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
14057 Moved here from...
14058 (<INITIAL>","): Here. This causes stray "," to be treated
14059 more uniformly.
14060
14061 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
14062 last brace in braced code when not in Yacc mode, for compatibility
14063 with Bison 1.35. This resurrects the 2001-12-15 patch to
14064 src/reader.c.
14065
14066 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
14067 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
14068
14069 2002-12-28 Paul Eggert <eggert@twinsun.com>
14070
14071 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
14072 that of SYM's type. This fixes Debian bug 168069, reported by
14073 Thomas Olsson.
14074
14075 2002-12-28 Paul Eggert <eggert@twinsun.com>
14076
14077 Version 1.75f.
14078
14079 Switch back to the Yacc style of conflict reports, undoing some
14080 of the 2002-07-30 change.
14081 * doc/bison.texinfo (Understanding): Use Yacc style for
14082 conflict reports. Also, use new way of locating rules.
14083 * src/conflicts.c (conflict_report):
14084 Renamed from conflict_report_yacc, removing the old
14085 'conflict_report'. Translate the entire conflict report at once,
14086 so that we don't assume that "," has the same interpretation in
14087 all languages.
14088 (conflicts_output): Use Yacc-style conflict report for each state,
14089 instead of our more-complicated style.
14090 (conflicts_print): Use Yacc-style conflict report, except print
14091 the input file name when not emulating Yacc.
14092 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
14093 Conflicted Reduction, %expect not enough, %expect too much,
14094 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
14095 * tests/existing.at (GNU Cim Grammar): Likewise.
14096 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
14097
14098 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
14099 fatal): Don't invoke fflush; it's not needed and it might even be
14100 harmful for stdout, as stdout might not be open.
14101 * src/reduce.c (reduce_print): Likewise.
14102
14103 2002-12-27 Paul Eggert <eggert@twinsun.com>
14104
14105 Fix a bug where error locations were not being recorded correctly.
14106 This problem was originally reported by Paul Hilfinger in
14107 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
14108
14109 * data/yacc.c (yyparse): New local var yylerrsp, to record the
14110 top of the location stack's error locations.
14111 (yyerrlab): Set it. When discarding a token, push its location
14112 onto yylerrsp so that we don't lose track of the error's end.
14113 (yyerrlab1): Now is only the target of YYERROR, so that we can
14114 properly record the location of the action that failed. For GCC
14115 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
14116 GCC warning about yyerrlab1 being unused if YYERROR is unused.
14117 (yyerrlab2): New label, which yyerrlab now falls through to.
14118 Compute the error's location by applying YYLLOC_DEFAULT to
14119 the locations of all the symbols that went into the error.
14120 * doc/bison.texinfo (Location Default Action): Mention that
14121 YYLLOC_DEFAULT is also invoked for syntax errors.
14122 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
14123 Error locations include the locations of all the tokens that were
14124 discarded, not just the last token.
14125
14126 2002-12-26 Paul Eggert <eggert@twinsun.com>
14127
14128 * src/files.c: Include quote.h.
14129 (compute_output_file_names): Warn if we detect conflicting
14130 outputs to the same file. This should catch the misunderstanding
14131 exemplified by Debian Bug 165349, reported by Bruce Stephens..
14132
14133 * src/conflicts.c (conflicts_print): If the user specifies
14134 "%expect N", report an error if there are any reduce/reduce
14135 conflicts. This is what the manual says should happen.
14136 This fixes Debian bug 130890, reported by Anthony DeRobertis.
14137 * tests/conflicts.at (%expect with reduce conflicts): New test.
14138
14139 Don't use m4_include on relative file names, as it doesn't work as
14140 desired if there happens to be a file with that name under ".".
14141
14142 * m4sugar/version.m4: Remove; it was included but it wasn't used.
14143 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
14144 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
14145 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
14146 * src/output.c (output_skeleton): Use full path names when
14147 specifying a file to include; don't rely on include path, as
14148 it's unreliable when the working file contains a file with
14149 that name.
14150
14151 2002-12-25 Paul Eggert <eggert@twinsun.com>
14152
14153 Remove obsolete references to bison.simple and bison.hairy.
14154 Problem mentioned by Aubin Mahe in
14155 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
14156 * data/glr.c: Comment fix.
14157 * doc/bison.1: Remove references. Also, mention "yacc".
14158
14159 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
14160 with -g option.
14161
14162 * src/parse-gram.y (declaration): Use enum "report_states" rather
14163 than its numeric value 1.
14164
14165 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
14166 opening a new one. This fixes Debian bug 165349, reported by
14167 Bruce Stephens.
14168
14169 2002-12-24 Paul Eggert <eggert@twinsun.com>
14170
14171 Version 1.75e.
14172
14173 * Makefile.maint (cvs-update): Don't assume that the shell
14174 supports $(...), as Solaris sh doesn't.
14175
14176 * src/parse-gram.y (lloc_default): Remove test for empty
14177 nonterminals at the end, since it didn't change the result.
14178
14179 2002-12-24 Paul Eggert <eggert@twinsun.com>
14180
14181 If the user does not define YYSTYPE as a macro, Bison now declares it
14182 using typedef instead of defining it as a macro. POSIX requires this.
14183 For consistency, YYLTYPE is also declared instead of defined.
14184
14185 %union directives can now have a tag before the `{', e.g., the
14186 directive `%union foo {...}' now generates the C code
14187 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
14188 The default union tag is `YYSTYPE', for compatibility with Solaris 9
14189 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
14190 instead of `yyltype'.
14191
14192 `yystype' and `yyltype' are now obsolescent macros instead of being
14193 typedefs or tags; they are no longer documented and will be
14194 withdrawn in a future release.
14195
14196 * data/glr.c (b4_location_type): Remove.
14197 (YYSTYPE): Renamed from yystype.
14198 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
14199 (struct YYLTYPE): Renamed from struct yyltype.
14200 (YYLTYPE): Renamed from yyltype.
14201 (yyltype, yystype): New (and obsolescent) macros,
14202 for backward compatibility.
14203 * data/yacc.c: Likewise.
14204
14205 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
14206 does not specify a union tag. This is for compatibility with
14207 Solaris 9 yacc.
14208
14209 * src/parse-gram.y (add_param): 2nd arg is now char * not char
14210 const *, since it is now modified by stripping surrounding { }.
14211 (current_braced_code): Remove.
14212 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
14213 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
14214 trailing " {...}". Now of type <chars>.
14215 (grammar_declaration): Adjust to bundled tokens.
14216 (code_content): Remove; stripping is now done by add_param.
14217 (print_token_value): Print contents of bundled tokens.
14218 (token_name): New function.
14219
14220 * src/reader.h (braced_code, current_braced_code): Remove.
14221 (token_name): New decl.
14222
14223 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
14224 token_type, not braced_code code_kind. All uses changed.
14225 (SC_PRE_CODE): New state, for scanning after a keyword that
14226 has (or usually has) an immediately-following braced code.
14227 (token_type): New local var, to keep track of which token type
14228 to return when scanning braced code.
14229 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
14230 <INITIAL>"%parse-param", <INITIAL>"%printer",
14231 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
14232 instead of returning a token type immediately.
14233 (<INITIAL>"{"): Set token type.
14234 (<SC_BRACED_CODE>"}"): Use it.
14235 (handle_action_dollar, handle_action_at): Now returns bool
14236 indicating success. Fail if ! current_rule; this prevents a core dump.
14237 (handle_symbol_code_dollar, handle_symbol_code_at):
14238 Remove; merge body into caller.
14239 (handle_dollar, handle_at): Complain in invalid contexts.
14240
14241 * NEWS, doc/bison.texinfo: Document the above.
14242 * NEWS: Fix years and program names in copyright notice.
14243
14244 2002-12-17 Paul Eggert <eggert@twinsun.com>
14245
14246 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
14247 Reporting, Table of Symbols): Omit mentions of %lex-param and
14248 %parse-param from the documentation for now.
14249
14250 2002-12-15 Paul Eggert <eggert@twinsun.com>
14251
14252 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
14253 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
14254 lookahead symbol, and which sets yychar in parser actions) and it
14255 disagreed with the Bison documentation. Bug
14256 reported by Andrew Walrond.
14257
14258 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
14259 as the caller now does that.
14260 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
14261 (YYEMPTY): Parenthesize right hand side, since others use it.
14262 (yyparse): Don't assume that our generated code is the only code
14263 that sets yychar.
14264
14265 2002-12-13 Paul Eggert <eggert@twinsun.com>
14266
14267 Version 1.75d.
14268
14269 POSIX requires a "yacc" command.
14270 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
14271 (MOSTLYCLEANFILES): Add yacc.
14272 (yacc): New rule.
14273 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
14274 as an alias for bison y.
14275
14276 * po/LINGUAS: Add da.
14277
14278 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
14279 problem with latest <getopt.h>.
14280 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
14281
14282 * doc/fdl.texi: Upgrade to 1.2.
14283 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
14284 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
14285 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
14286 gnulib.
14287 * config/install-sh: Sync with autotools.
14288
14289 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
14290 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
14291 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
14292 locations are requested.
14293 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
14294 locations are requested.
14295
14296 2002-12-12 Paul Eggert <eggert@twinsun.com>
14297
14298 Remove unportable casts and storage allocation tricks.
14299 While we're at it, remove almost all casts, since they
14300 usually aren't needed and are a sign of trouble.
14301
14302 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
14303
14304 * src/derives.c (derives_compute): Do not subtract NTOKENS from
14305 the pointer DSET returned by malloc; this isn't portable.
14306 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
14307 Similarly for DERIVES.
14308 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
14309 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
14310 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
14311
14312 * src/derives.c (derives_compute): Do not bother invoking
14313 int_of_rule_number, since rule numbers are integers.
14314
14315 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
14316 rather than XMALLOC (char, N).
14317
14318 * src/files.c (filename_split): Rewrite to avoid cast.
14319
14320 * src/gram.h (symbol_number_as_item_number,
14321 item_number_as_symbol_number, rule_number_as_item_number,
14322 item_number_as_rule_number):
14323 Now inline functions rather than macros, to avoid casts.
14324 * src/state.h (state_number_as_int): Likewise.
14325 * src/tables.c (state_number_to_vector_number,
14326 symbol_number_to_vector_number): Likewise.
14327
14328 * src/gram.h (int_of_rule_number): Remove; no longer used.
14329
14330 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
14331 since the resulting storage is always stored into.
14332
14333 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
14334 where it's needed.
14335
14336 * src/muscle_tab.c (muscle_m4_output):
14337 Now inline. Return bool, not int.
14338 * src/state.c (state_compare): Likewise.
14339 * src/symtab.c (symbol_check_defined,
14340 symbol_check_alias_consistency, symbol_pack, symbol_translation,
14341 hash_compare_symbol, hash_symbol):
14342 Likewise.
14343 * src/uniqstr.c (uniqstr_print): Likewise.
14344 * src/muscle_tab.c (muscle_m4_output_processor):
14345 New function, to avoid casts.
14346 * src/state.c (state_comparator, stage_hasher): Likewise.
14347 * src/symtab.c (symbol_check_defined_processor,
14348 symbol_check_alias_consistency_processor, symbol_pack_processor,
14349 symbol_translation_processor, hash_symbol_comparator,
14350 hash_symbol_hasher): Likewise.
14351 * src/uniqstr.c (uniqstr_print_processor): Likewise.
14352 * src/muscle_tab.c (muscles_m4_output):
14353 Use new functions instead of casting old functions unportably.
14354 * src/state.c (state_hash_new): Likewise.
14355 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
14356 symbols_token_translations_init):
14357 Likewise.
14358 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
14359
14360 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
14361 var instead of casting to long, to avoid casts.
14362 (prepare_states): Use MALLOC rather than alloca, so that we don't
14363 have to worry about alloca.
14364 * src/state.c (state_hash_lookup): Likewise.
14365
14366 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
14367 local var instead of casting to unsigned char, to avoid casts.
14368
14369 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
14370 STATE_ALLOC): Remove.
14371 (transitions_new, errs_new, reductions_new, state_new): Use malloc
14372 rather than calloc, and use offsetof to avoid allocating slightly
14373 too much storage.
14374 (state_new): Initialize all members.
14375
14376 * src/state.c (state_hash): Use unsigned accumulator, not signed.
14377
14378 * src/symtab.c (symbol_free): Remove; unused.
14379 (symbol_get): Remove cast in lhs of assignment.
14380 (symbols_do): Now static. Accept generic arguments, not
14381 hashing-related ones.
14382
14383 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
14384 (symbol_processor): Remove.
14385 (symbols_do): Remove decl; now static.
14386
14387 * src/system.h (alloca): Remove; decl no longer needed.
14388 (<stddef.h>): Include, for offsetof.
14389 (<inttypes.>, <stdint.h>): Include if available.
14390 (uintptr_t): New type, if system lacks it.
14391 (CALLOC, MALLOC, REALLOC): New macros.
14392 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
14393 new macros.
14394
14395 * src/tables.c (table_size): Now int, to pacify GCC.
14396 (table_grow, table_ninf_remap): Use signed table size.
14397 (save_row): Don't bother initializing locals when not needed.
14398 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
14399 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
14400
14401 * src/vcg.h: Correct misspellings.
14402
14403 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
14404
14405
14406 * src/getargs.c (getargs): Don't assume EOF == -1.
14407
14408 2002-12-09 Paul Eggert <eggert@twinsun.com>
14409
14410 Change identifier spellings to avoid collisions with names
14411 that are reserved by POSIX.
14412
14413 Don't use names ending in _t, since POSIX reserves them.
14414 For consistency, remove _e and _s endings -- they're weren't
14415 needed to remove ambiguity. All uses changed.
14416 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
14417 turn was just renamed from struniq_t.
14418 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
14419 which in turn was just renamed from struniq_processor_t.
14420 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
14421 in turn was renamed from hash_compare_struniq_t.
14422 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
14423 (state_list): Renamed from state_list_t.
14424 * src/assoc.h (assoc): Renamed from assoc_t.
14425 * src/conflicts.c (enum conflict_resolution): Renamed from
14426 enum conflict_resolution_e.
14427 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
14428 (rule_list): Renamed from rule_list_t.
14429 * src/getargs.h (enum trace): Renamed from enum trace_e.
14430 (enum report): Renamed from enum report_e.
14431 * src/gram.h (item_number): Renamed from item_number_t.
14432 (rule_number): Renamed from rule_number_t.
14433 (struct rule_s): Remove the "rule_s" part; not used.
14434 (rule): Renamed from rule_t.
14435 (rule_filter): Renamed from rule_filter_t.
14436 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
14437 (goto_list): Renamed from goto_list_t.
14438 * src/lalr.h (goto_number): Renamed from goto_number_t.
14439 * src/location.h (location): Renamed from location_t.
14440 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
14441 and moved here from:
14442 * src/muscle_tab.h (muscle_entry_t): here.
14443 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
14444 (rule_list): Renamed from rule_list_t.
14445 * src/print_graph.c (static_graph): Renamed from graph.
14446 * src/reader.h (braced_code): Renamed from braced_code_t.
14447 Remove brace_code_e tag.
14448 * src/relation.h (relation_node): Renamed from relation_node_t.
14449 (relation_nodes): Renamed from relation_nodes_t.
14450 (relation): Renamed from relation_t.
14451 * src/state.h (state_number): Renamed from state_number_t.
14452 (struct state): Renamed from struct state_s.
14453 (state): Renamed from state_t.
14454 (transitions): Renamed from transitions_t. Unused (and
14455 misspelled) transtion_s tag removed.
14456 (errs): Renamed from errs_t. Unused errs_s tag removed.
14457 (reductions): Renamed from reductions_t. Unused tag
14458 reductions_s removed.
14459 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
14460 (struct symbol_list): Renamed from struct symbol_list_s.
14461 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
14462 (struct symbol): Renamed from struct symbol_s.
14463 (symbol): Renamed from symbol_t.
14464 * src/tables.c (vector_number): Renamed from vector_number_t.
14465 (action_number): Renamed from action_t.
14466 * src/tables.h (base_number): Renamed from base_t.
14467 * src/vcg.h (enum color): Renamed from enum color_e.
14468 (enum textmode): Renamed from enum textmode_e.
14469 (enum shape): Renamed from enum shape_e.
14470 (struct colorentry): Renamed from struct colorentry_s.
14471 (struct classname): Renamed from struct classname_s.
14472 (struct infoname): Renamed from struct infoname_s.
14473 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
14474 (enum decision): Renamed from enum decision_e.
14475 (enum orientation): Renamed from enum orientation_e.
14476 (enum alignment): Renamed from enum alignment_e.
14477 (enum arrow_mode): Renamed from enum arrow_mode_e.
14478 (enum crossing_type): Renamed from enum crossing_type_e.
14479 (enum view): Renamed from enum view_e.
14480 (struct node): Renamed from struct node_s.
14481 (node): Renamed from node_t.
14482 (enum linestyle): Renamed from enum linestyle_e.
14483 (enum arrowstyle): Renamed from enum arrowstyle_e.
14484 (struct edge): Renamed from struct edge.
14485 (edge): Renamed from edge_t.
14486 (struct graph): Renamed from struct graph_s.
14487 (graph): Renamed from graph_t.
14488 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
14489 Rename value_t -> value.
14490 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
14491 value_t_as_yystype -> value_as_yystype.
14492
14493 Don't include <errno.h> in the mainstream code, since it
14494 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
14495 * lib/get-errno.c, lib/get-errno.h: New files.
14496 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
14497 get-errno.c.
14498 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
14499 * src/output.c (output_skeleton): Likewise.
14500 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
14501 instead of errno.
14502 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
14503 Likewise.
14504 (handle_action_dollar, handle_action_at): Likewise.
14505 * src/system.h: Do not include <errno.h>.
14506 (TAB_EXT): Renamed from EXT_TAB.
14507 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
14508
14509 Avoid str[a-z]*, since <string.h> reserves that name space.
14510 Change all instances of "struniq" in names to "uniqstr", and
14511 likewise for "STRUNIQ" and "UNIQSTR".
14512 * src/uniqstr.c: Renamed from src/struniq.c.
14513 * src/uniqstr.h: Renamed from src/struniq.h.
14514 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
14515 * src/files.c (strsuffix): Remove; unused.
14516 (concat2): Renamed from stringappend. Now static.
14517 * src/files.h (strsuffix, stringappend): Remove; unused.
14518 * src/parse-gram.y (<chars>): Renamed from <string>.
14519 (<uniqstr>): Renamed from <struniq>.
14520 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
14521 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
14522 (struct graph_s.expand): Renamed from struct graph_s.stretch.
14523 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
14524 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
14525 (N_EXPAND): Renamed from N_STRETCH.
14526
14527 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
14528 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
14529 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
14530 Remove; unused.
14531 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
14532 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
14533 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
14534 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
14535 (BASE_MAXIMUM): Renamed from BASE_MAX.
14536 (BASE_MINIMUM): Renamed from BASE_MIN.
14537 (ACTION_MAX): Remove; unused.
14538 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
14539 Unnecessary casts removed from above defines.
14540
14541
14542 Fix misspelling in names.
14543 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
14544 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
14545 G_NODE_ALIGNEMENT.
14546
14547
14548 * lib/timevar.c (timevar_report): Renamed from time_report,
14549 for consistency with other names.
14550 * lib/timevar.h (timevar_report): New decl.
14551 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
14552
14553
14554 Sort include-file uses.
14555
14556 Reorder all include files under src to be in the order "system.h".
14557 then the ../lib include files in angle brackets (alphabetized),
14558 then the . include files in double-quotes (alphabetized). Fix
14559 dependency breakages encountered in this process, as follows:
14560 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
14561 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
14562 * src/state.h: Include "symtab.h".
14563
14564 2002-12-08 Paul Eggert <eggert@twinsun.com>
14565
14566 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
14567 since this causes problems when __file__ contains character
14568 sequences like "@" that are treated specially by src/scan-skel.l.
14569 Instead, just use the file's basename. This fixes the bug
14570 reported by Martin Mokrejs in
14571 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
14572
14573 2002-12-06 Paul Eggert <eggert@twinsun.com>
14574
14575 Add support for rules that do not have trailing semicolons, as
14576 POSIX requires. Improve the quality of locations in Bison
14577 diagnostics.
14578
14579 * src/location.c: Include <quotearg.h>.
14580 (empty_location): Now const.
14581 (location_print): New function. Follow the recommendation of the
14582 GNU Coding Standards for locations that span file boundaries.
14583 * src/location.h: Do not include <quotearg.h>; no longer needed.
14584 (boundary): New type.
14585 (location_t): Use it. This allows locations to span file boundaries.
14586 All member uses changed: file -> start.file or end.file (as needed),
14587 first_line -> start.line, first_column -> start.column,
14588 last_line -> end.line, last_column -> end.column.
14589 (equal_boundaries): New function.
14590 (LOCATION_RESET, LOCATION_STEP): Remove.
14591 (LOCATION_PRINT): Remove. All callers changed to use location_print.
14592 (empty_location): Now const.
14593 (location_print): New decl.
14594 * src/parse-gram.y (lloc_default): New function, which handles
14595 empty locations more accurately.
14596 (YYLLOC_DEFAULT): Use it.
14597 (%token COLON): Remove.
14598 (%token ID_COLON): New token.
14599 (rules): Use it.
14600 (declarations, rules): Remove trailing semicolon.
14601 (declaration, rules_or_grammar_declaration):
14602 Allow empty (";") declaration.
14603 (symbol_def): Remove empty actions; no longer needed.
14604 (rules_or_grammar_declaration): Remove trailing semicolon.
14605 (semi_colon.opt): Remove.
14606 * src/reader.h: Include location.h.
14607 (scanner_cursor): New decl.
14608 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
14609 rolling our own.
14610 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
14611 of *loc.
14612 (STEP): Remove. No longer needed, now that adjust_location does
14613 the work. All uses removed.
14614 (scanner_cursor): New var.
14615 (adjust_location): Renamed from extend_location. It now sets
14616 *loc and adjusts the scanner cursor. All uses changed.
14617 Don't bother testing for CR.
14618 (handle_syncline): Remove location arg; now updates scanner cursor.
14619 All callers changed.
14620 (unexpected_end_of_file): Now accepts start boundary of token or
14621 comment, not location. All callers changed. Update scanner cursor,
14622 not the location.
14623 (SC_AFTER_IDENTIFIER): New state.
14624 (context_state): Renamed from c_context. All uses changed.
14625 (id_loc, code_start, token_start): New local vars.
14626 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
14627 processing of Yacc white space and equivalents here.
14628 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
14629 instead of returning ID immediately, since we need to search for
14630 a subsequent colon.
14631 (<INITIAL>"'", "\""): Save token_start.
14632 (<INITIAL>"%{", "{", "%%"): Save code_start.
14633 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
14634 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
14635 BEGIN context_state at end, not INITIAL.
14636 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
14637 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
14638 Return correct token start.
14639 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
14640 the start of a character, string or multiline comment is found.
14641 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
14642 Reduction): Adjust reported locations to match the more-precise
14643 results now expected.
14644 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
14645 * tests/reduce.at (Useless Rules, Reduced Automaton,
14646 Underivable Rules): Likewise.
14647 * tests/regression.at (Invalid inputs): No longer `expecting ";"
14648 or "|"' now that so many other tokens are allowed by the new grammar.
14649
14650 * src/complain.h (current_file): Remove duplicate decl;
14651 current_file is now owned by files.h.
14652 * src/complain.c, src/scan-gram.l: Include files.h.
14653
14654 2002-12-06 Paul Eggert <eggert@twinsun.com>
14655
14656 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
14657 promotes to int; it might be unsigned int.
14658 * data/yacc.c (yy_reduce_print): Likewise.
14659
14660 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
14661 be #defined in the prologue, not in the Bison declarations.
14662 This fixes Debian Bug 102878, reported by Shaul Karl.
14663
14664 2002-12-02 Paul Eggert <eggert@twinsun.com>
14665
14666 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
14667 * lib/strtoul.c: New file, from gnulib.
14668 This fixes a porting bug reported by Peter Klein in
14669 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
14670
14671 2002-11-30 Paul Eggert <eggert@twinsun.com>
14672
14673 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
14674 and put only a forward declaration in the prologue. This is for
14675 consistency with the other scanner helper functions.
14676
14677 Type clashes now generate warnings, not errors, since it
14678 appears that POSIX may allow some grammars with type clashes.
14679 * src/reader.c (grammar_current_rule_check): Warn about
14680 type clashes instead of complaining.
14681 * tests/input.at (Type Clashes): Expect warnings, not complaints.
14682
14683 Add Yacc library, since POSIX requires it.
14684 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
14685 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
14686 * lib/main.c, lib/yyerror.c: New files.
14687
14688 gram_error can be static; it need not be extern.
14689 * src/reader.h (gram_error): Remove decl.
14690 * src/parse-gram.y (gram_error): Now static. Add static decl.
14691 (print_token_value): Omit parameter names from forward decl,
14692 for consistency.
14693
14694 2002-11-29 Paul Eggert <eggert@twinsun.com>
14695
14696 * doc/bison.texinfo: Emphasize that yylex and yyerror must
14697 be declared before being used. E.g., one should typically
14698 declare them in the prologue. Use GNU coding style in examples.
14699 Put "const" consistently after the type it modifies. Mention
14700 that C99 supports "inline". Mention that yyerror traditionally
14701 returns "int".
14702
14703 %parse-param and %lex-param now take just one argument, the
14704 declaration; the argument name is deduced from the declaration.
14705
14706 * doc/bison.texinfo (Parser Function, Pure Calling, Error
14707 Reporting, Table of Symbols): Document this.
14708 * src/parse-gram.y (add_param): New function.
14709 (COMMA): Remove.
14710 (declaration): Implement new rule for %parse-param and %lex-param.
14711 * src/scan-gram.l: "," now elicits a warning, rather than being
14712 a token; this is more compatible with byacc.
14713 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
14714
14715 2002-11-27 Paul Eggert <eggert@twinsun.com>
14716
14717 Rename identifiers to avoid real and potential collisions.
14718
14719 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
14720 to avoid collision with lex macro described by Bruce Lilly in
14721 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
14722 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
14723 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
14724 * src/parse-gram.y (print_token_value): Renamed from yyprint.
14725 All uses changed.
14726 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
14727 The name "yycontrol" violates the name space rules, and this stuff
14728 wasn't being used anyway.
14729 (input): Remove action; this stuff wasn't being used.
14730 (gram_error): Rename local variable yylloc -> loc.
14731 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
14732 (YY_DECL): Don't use "yy" at start of local variables.
14733 All uses changed, e.g., yylloc -> loc.
14734 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
14735 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
14736 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
14737 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
14738
14739 * src/parse-gram.y (gram_error): loc is now const *.
14740 * src/reader.h (gram_error): Likewise.
14741
14742 2002-11-24 Paul Eggert <eggert@twinsun.com>
14743
14744 Version 1.75c.
14745
14746 * tests/actions.at (Actions after errors): Use an output format
14747 more similar to that of the Printers and Destructors test.
14748 Test the position of the ';' token too.
14749 (Printers and Destructors): Likewise.
14750 (Printers and Destructors: %glr-parser): Remove for now, to avoid
14751 unnecessarily alarming people when the test fails.
14752
14753 * data/yacc.c (yyerrlab1): Move this label down, so that the
14754 parser does not discard the lookahead token if the user code
14755 invokes YYERROR. This change is required for POSIX conformance.
14756
14757 * lib/error.c: Sync with gnulib.
14758
14759 2002-11-22 Paul Eggert <eggert@twinsun.com>
14760
14761 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
14762 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
14763 * lib/xmalloc.c: Likewise.
14764
14765 2002-11-20 Paul Eggert <eggert@twinsun.com>
14766
14767 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
14768
14769 2002-11-20 Paul Eggert <eggert@twinsun.com>
14770
14771 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
14772 should use `if (! x) abort ();' rather than `assert (x);', and
14773 anyway it's one less thing to worry about configuring.
14774
14775 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
14776 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
14777 and replace all instances of assert with abort.
14778 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
14779 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
14780
14781 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
14782 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
14783 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
14784 hash_find_entry, hash_rehash, hash_insert): Likewise.
14785 * src/conflicts.c (resolve_sr_conflict): Likewise.
14786 * src/lalr.c (set_goto_map, map_goto): Likewise.
14787 * src/nullable.c (nullable_compute): Likewise.
14788 * src/output.c (prepare_rules, token_definitions_output): Likewise.
14789 * src/reader.c (packgram, reader): Likewise.
14790 * src/state.c (state_new, state_free, state_transitions_set,
14791 state_reduction_find): Likewise.
14792 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
14793 symbol_pack): Likewise.
14794 * src/tables.c (conflict_row, pack_vector): Likewise.
14795 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
14796 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
14797 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
14798 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
14799
14800 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
14801 (ARGMATCH_CONSTRAINT): New macro.
14802 (ARGMATCH_ASSERT): Use it.
14803
14804 * src/system.h (verify): New macro.
14805 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
14806 rather than assert.
14807 * src/tables.c (tables_generate): Likewise.
14808
14809 * src/struniq.c (struniq_assert): Now returns void, and aborts
14810 if the assertion is false.
14811 (struniq_assert_p): Remove.
14812 * src/struniq.h: Likewise.
14813
14814 2002-11-18 Paul Eggert <eggert@twinsun.com>
14815
14816 * data/glr.c (yygetLRActions): Replace `yyindex' with
14817 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
14818 This fixes the regression with Sun ONE Studio 7 cc that I reported in
14819 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
14820
14821 2002-11-18 Akim Demaille <akim@epita.fr>
14822
14823 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
14824 space.
14825 From Tim Van Holder.
14826
14827 2002-11-17 Paul Eggert <eggert@twinsun.com>
14828
14829 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
14830 to "SyntaxError" for consistency with my 2002-11-15 change.
14831
14832 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
14833 not define to {}, since this breaks the common use of `YYDPRINTF
14834 ((...));' if a single statement is desired (e.g. before `else').
14835 Work around GCC warnings by surrounding corresponding calls with
14836 {} if needed.
14837 (yyhasResolvedValue): Remove unused function.
14838 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
14839 loop body.
14840 (yyreportSyntaxError): Renamed from yyreportParseError.
14841 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
14842 All uses changed.
14843 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
14844 extern when possible. Remove unused initializations.
14845
14846 2002-11-16 Akim Demaille <akim@epita.fr>
14847
14848 Augment the similarity between GLR and LALR traces.
14849
14850 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
14851 (YY_REDUCE_PRINT): New.
14852 (yyparse): Use them.
14853 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
14854 YYDPRINT here.
14855 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
14856 state reached after the reduction/recovery, since...
14857 (yyparse, yyprocessOneStack): Report the state we are entering in.
14858
14859 2002-11-16 Akim Demaille <akim@epita.fr>
14860
14861 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
14862 Add support for --trace=skeleton.
14863 * src/scan-skel.l: %option debug.
14864 Scan strings of non-@ or \n instead of character by character.
14865 (scan_skel): Handle trace_skeleton.
14866 (QPUTS): New.
14867 (@output_parser_name@, @output_header_name@): ``Restore'' their
14868 support (used to be M4 macros).
14869 * data/yacc.c: Quote larger chunks, a la glr.c.
14870 * data/lalr1.cc: Likewise.
14871 The header guards are no longer available, so use some other
14872 string than `YYLSP_NEEDED'.
14873
14874 2002-11-16 Akim Demaille <akim@epita.fr>
14875
14876 Make the ``Printers and Destructors'' test more verbose, taking
14877 `yacc.c''s behavior as (possibly wrong) reference.
14878
14879 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
14880 instead of fprint on stdout.
14881 Set and report the last_line of the symbols.
14882 Consistently display values and locations.
14883
14884 2002-11-16 Paul Eggert <eggert@twinsun.com>
14885
14886 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
14887
14888 2002-11-15 Paul Eggert <eggert@twinsun.com>
14889
14890 * tests/actions.at (Actions after errors): New test case.
14891
14892 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
14893 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
14894 tests/action.at, tests/calc.at, tests/conflicts.at,
14895 tests/cxx-type.at, tests/regression.at:
14896 "parse error" -> "syntax error" for POSIX compatibility.
14897 "parsing stack overflow..." -> "parser stack overflow" so
14898 that code matches Bison documentation.
14899
14900 2002-11-15 Akim Demaille <akim@epita.fr>
14901
14902 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
14903 take two BRACED_CODE, not two string_content.
14904 Free the scanner's obstack when we are done.
14905 (code_content): New.
14906 * tests/calc.at: Adjust.
14907 * doc/bison.texinfo: Adjust.
14908 Also, make sure to include the `,' for these declarations.
14909
14910 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
14911
14912 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
14913 definition; avoids potential autoreconf problems.
14914
14915 2002-11-15 Akim Demaille <akim@epita.fr>
14916
14917 Always check the value returned by yyparse.
14918
14919 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
14920 returned by yyparse.
14921 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
14922 Adjust calls.
14923 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
14924 returned by yyparse.
14925
14926 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14927
14928 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
14929 on input.at test.
14930
14931 2002-11-14 Paul Eggert <eggert@twinsun.com>
14932
14933 * src/output.c (output_skeleton): Call xfopen instead of
14934 duplicating xfopen's body.
14935
14936 Fix bugs reported by Nelson H. F. Beebe in
14937 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
14938
14939 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
14940 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
14941 Group compiler. Instead, use "$CC -E bar.c". Include the .h
14942 file twice in the grammar, as an extra check.
14943
14944 * tests/input.at (Torturing the Scanner): Surround the
14945 backslash-newline tests with "#if 0", to make it less likely that
14946 we'll run into compiler bugs. Bring back solitary \ inside
14947 comment, but add a closing comment to work around HP C bug. Don't
14948 test backslash-newline in C character constant.
14949
14950 2002-11-14 Akim Demaille <akim@epita.fr>
14951
14952 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
14953 status of the compiler.
14954 Calling `exit 1' is no longer needed.
14955 Reported by Nelson H. F. Beebe.
14956
14957 2002-11-14 Akim Demaille <akim@epita.fr>
14958
14959 * tests/atlocal.in (CPPFLAGS): We have config.h.
14960 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
14961 New.
14962 * tests/actions.at, tests/calc.at, tests/conflicts.at,
14963 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
14964 * tests/regression.at, tests/torture.at: Use them for all the
14965 grammars that are to be compiled.
14966 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
14967 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
14968 * doc/bison.texinfo (GLR Parsers): Document `inline'.
14969
14970 2002-11-14 Akim Demaille <akim@epita.fr>
14971
14972 * doc/bison.texinfo: Various formatting changes (alignments in
14973 samples, additional @group/@end group, GCS in samples.
14974 Use @deffn instead of simple @table to define the directives,
14975 macros, variables etc.
14976
14977 2002-11-13 Paul Eggert <eggert@twinsun.com>
14978
14979 Fix some bugs reported by Albert Chin-A-Young in
14980 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
14981
14982 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
14983 -o c"; the HP C compiler chatters during compilation.
14984 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
14985 * tests/headers.at (export YYLTYPE): Likewise.
14986
14987 * tests/input.at (Torturing the Scanner): Remove lines containing
14988 solitary backslashes, as they tickle a bug in the HP C compiler.
14989
14990 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
14991 comments, since they're not portable. Use GNU coding style.
14992
14993 2002-11-13 Akim Demaille <akim@epita.fr>
14994
14995 * data/yacc.c: Leave bigger chunks of quoted text.
14996 (YYDSYMPRINTF): New.
14997 Use it to report symbol activities.
14998 * data/glr.c (YYDSYMPRINTF): New.
14999 Use it.
15000
15001 2002-11-12 Paul Eggert <eggert@twinsun.com>
15002
15003 Version 1.75b.
15004
15005 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
15006 (yyglrReduce): Return yyok, not 0.
15007 This should avoid the enumerated-type warnings reported
15008 by Nelson H. F. Beebe in
15009 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
15010
15011 * lib/bbitset.h (BITSET_INLINE): Remove.
15012 * lib/bitset.h [! BITSET_INLINE]: Remove.
15013 (bitset_set, bitset_reset, bitset_test): Rename local vars
15014 to avoid shadowing warnings by GCC.
15015
15016 * data/glr.c (inline): Remove #define. It's the user's
15017 responsibility to #define it away, just like 'const'.
15018 This fixes one of the bugs reported by Nelson H. F. Beebe in
15019 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
15020
15021 * Makefile.maint (po-check): Scan .l and .y files instead of the
15022 .c and the .h files that they generate. This fixes the bug
15023 reported by Tim Van Holder in:
15024 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
15025 Look for N_ as well as for _. Try to avoid matching #define for
15026 N_ and _.
15027 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
15028 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
15029 * src/scan-gram.l: Revamp regular expressions so that " and '
15030 do not confuse xgettext.
15031
15032 * src/struniq.h (struniq_new): Do not declare the return type
15033 to be 'const'; this violates the C standard.
15034 * src/struniq.c (struniq_new): Likewise.
15035
15036 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
15037
15038 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
15039 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
15040 linker.
15041
15042 2002-11-12 Akim Demaille <akim@epita.fr>
15043
15044 * Makefile.maint: Sync with Autoconf:
15045 (local_updates): New.
15046
15047 2002-11-12 Akim Demaille <akim@epita.fr>
15048
15049 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
15050
15051 2002-11-12 Akim Demaille <akim@epita.fr>
15052
15053 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
15054 locations.
15055
15056 2002-11-12 Akim Demaille <akim@epita.fr>
15057
15058 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
15059 not yyvalue.
15060
15061 2002-11-12 Akim Demaille <akim@epita.fr>
15062
15063 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
15064 Use it to test the GLR parser.
15065
15066 2002-11-12 Akim Demaille <akim@epita.fr>
15067
15068 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
15069 defines it.
15070 * data/glr.c (yystos): New.
15071 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
15072 (YYDSYMPRINT): New.
15073 (yyval): Don't define it, it is handled via M4.
15074 (yyrecoverParseError): Free verbosely the discarded symbols.
15075 * data/yacc.c (yysymprint): Remove, rather...
15076 (b4_yysymprint_generate): invoke.
15077 * data/c.m4 (b4_yysymprint_generate): New.
15078 Accept pointers as arguments, as opposed to the version from
15079 yacc.c.
15080 (b4_yydestruct_generate): Likewise.
15081 * tests/cations.at (Printers and Destructors): Use Bison directives
15082 instead of CPP macros.
15083 Don't rely on internal details.
15084
15085 2002-11-12 Akim Demaille <akim@epita.fr>
15086
15087 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
15088 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
15089 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
15090 it against YYEMPTY and so forth), work on yytoken (i.e., set
15091 it to YYEMPTY etc.).
15092 (yydestruct): Replace with a b4_yydestruct_generate invocation.
15093 (b4_symbol_actions): Remove.
15094 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
15095 for 0, end-of-input.
15096
15097 2002-11-12 Akim Demaille <akim@epita.fr>
15098
15099 * doc/bison.texinfo (Destructor Decl): New.
15100
15101 2002-11-12 Akim Demaille <akim@epita.fr>
15102
15103 * src/tables.c (tables_generate): Use free for pointers that
15104 cannot be NULL, not XFREE.
15105 (pack_vector): Use assert, not fatal, for bound violations.
15106 * src/state.c (state_new): Likewise.
15107 * src/reader.c (reader): Likewise.
15108 * src/lalr.c (set_goto_map): Likewise.
15109 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
15110 the file name.
15111
15112 2002-11-12 Akim Demaille <akim@epita.fr>
15113
15114 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
15115 Restore.
15116 * src/scan-gram.l (last_string): Is global to the file, not to
15117 yylex.
15118 * src/parse-gram.y (input): Don't append the epilogue here,
15119 (epilogue.opt): do it here, and free the scanner's obstack.
15120 * src/reader.c (epilogue_set): Rename as...
15121 (epilogue_augment): this.
15122 * data/c.m4 (b4_epilogue): Defaults to empty.
15123
15124 2002-11-12 Akim Demaille <akim@epita.fr>
15125
15126 * src/getargs.c (long_options): Remove duplicates.
15127 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
15128 Remove.
15129 * doc/bison.rnh: Remove.
15130 * doc/bison.texinfo (VMS Invocation): Remove.
15131
15132 2002-11-12 Akim Demaille <akim@epita.fr>
15133
15134 * src/struniq.h, src/struniq.c (struniq_t): Is const.
15135 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
15136
15137 Use struniq for symbols.
15138
15139 * src/symtab.h (symbol_t): The tag member is a struniq.
15140 (symbol_type_set): Adjust.
15141 * src/symtab.c (symbol_new): Takes a struniq.
15142 (symbol_free): Don't free the tag member.
15143 (hash_compare_symbol_t, hash_symbol_t): Rename as...
15144 (hash_compare_symbol, hash_symbol): these.
15145 Use the fact that tags as struniqs.
15146 (symbol_get): Use struniq_new.
15147 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
15148 Returns a strniq.
15149 * src/reader.h (merger_list, grammar_currentmerge_set): The name
15150 and type members are struniqs.
15151 * src/reader.c (get_merge_function)
15152 (grammar_current_rule_merge_set): Adjust.
15153 (TYPE, current_type): Are struniq.
15154
15155 Use struniq for file names.
15156
15157 * src/files.h, src/files.c (infile): Split into...
15158 (grammar_file, current_file): these.
15159 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
15160 * src/reduce.c (reduce_print): Likewise.
15161 * src/getargs.c (getargs): Likewise.
15162 * src/complain.h, src/complain.c: Likewise.
15163 * src/main.c (main): Call struniqs_new early enough to use it for
15164 file names.
15165 Don't free the input file name.
15166
15167 2002-11-12 Akim Demaille <akim@epita.fr>
15168
15169 * src/symtab.c (symbol_free): Remove dead deactivated code:
15170 type_name are properly removed.
15171 Don't use XFREE to free items that cannot be NULL.
15172 * src/struniq.h, src/struniq.c: New.
15173 * src/main.c (main): Initialize/free struniqs.
15174 * src/parse-gram.y (%union): Add astruniq member.
15175 (yyprint): Adjust.
15176 * src/scan-gram.l (<{tag}>): Return a struniq.
15177 Free the obstack bit that used to store it.
15178 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
15179
15180 2002-11-11 Paul Eggert <eggert@twinsun.com>
15181
15182 Revamp to fix many (but not all) of the C- and M4-related quoting
15183 problems. Among other things, this fixes the Bison bug reported
15184 by Jan Hubicka when processing the Bash grammar; see:
15185 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
15186
15187 Use new @ escapes consistently. Represent brackets with @{ and @}
15188 rather than @<:@ and @:>@, since this works a bit better with dumb
15189 editors like vi. Represent @ with @@, since @ is now consistently
15190 an escape. Use @oline@ and @ofile@ rather than __oline__ and
15191 __ofile__, to avoid unexpected expansions. Similarly, use @output
15192 rather than #output.
15193
15194 * data/c.m4 (b4_copyright): Omit file name from comment, since
15195 the file name could contain "*/".
15196 (b4_synclines_flag): Don't quote the 2nd argument; it should already
15197 be quoted. All uses changed.
15198
15199 * data/glr.c: Use new @ escapes consistently.
15200 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
15201 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
15202 Remove, since they couldn't handle arbitrary characters in file
15203 names.
15204 * data/lalr1.cc: Likewise.
15205 * data/yacc.c: Likewise.
15206
15207 * src/files.c (output_infix): Remove; all uses removed.
15208 * src/files.h: Likewise.
15209
15210 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
15211 mishandled funny characters in file names, and anyway it isn't
15212 needed any more.
15213 * data/yacc.c: Likewise.
15214 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
15215
15216 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
15217 * data/yacc.c: Likewise.
15218
15219 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
15220 strings now.
15221 (muscle_init): Quote filename as a C string.
15222 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
15223 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
15224 * src/output.c (escaped_file_name_output): New function.
15225 (prepare_symbols): Quote tokens for M4.
15226 (prepare): Don't insert output_infix, output_prefix,
15227 output_parser_name, output_header_name; this is now down by scan-skel.
15228 Insert skeleton as a C string.
15229
15230 * src/output.c (user_actions_output, symbol_destructors_output,
15231 symbol_printers_output): Quote filenames for C and M4.
15232 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15233
15234 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
15235 escapes other than \\ and \'; this simplifies the code.
15236 (<SC_STRING>): Likewise, for \\ and \".
15237 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
15238 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
15239 Use new escapes @{ and @} for [ and ].
15240
15241 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
15242 them with auto vars.
15243 Switch to new escape scheme, where @ is the escape character uniformly.
15244 Abort if a stray escape character is found. Avoid unbounded input
15245 buffer when parsing non-escaped text.
15246
15247 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
15248 __oline__, #output, $@, and @{ do not have unintended meanings.
15249
15250 2002-11-09 Paul Eggert <eggert@twinsun.com>
15251
15252 Fix the test failure due to GCC warnings described in
15253 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
15254 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
15255 evaluate to 0 if it's impossible for NINF to be in the respective
15256 table.
15257 (yygetLRActions, yyrecoverParseError): Use them.
15258
15259 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
15260 counted in the token inserted at end of file. Now takes
15261 location_t *, not location_t, so that the location can be
15262 adjusted. All uses changed.
15263
15264 * tests/regression.at (Invalid inputs): Adjust wording in
15265 diagnostic to match the new behavior.
15266
15267 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
15268 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
15269 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
15270 abort ();'. This reduces the runtime of the "Many lookaheads"
15271 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
15272 GCC 3.2.
15273
15274 2002-11-07 Paul Eggert <eggert@twinsun.com>
15275
15276 * src/parse-gram.y (CHARACTER): Remove unused token.
15277 All uses removed.
15278
15279 * src/scan-gram.l: Remove stack option. We no longer use the
15280 stack, since the stack was never deeper than 1; instead, use the
15281 new auto var c_context to record the stacked value.
15282
15283 Remove nounput option. At an unexpected end of file, we now unput
15284 the minimal input necessary to end cleanly; this simplifies the
15285 code.
15286
15287 Avoid unbounded token sizes where this is easy.
15288
15289 (unexpected_end_of_file): New function.
15290 Use it to systematize the error message on unexpected EOF.
15291 (last-string): Now auto, not static.
15292 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
15293 (scanner_last_string_free): Remove; not used.
15294 (percent_percent_count): Move decl to just before use.
15295 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
15296 not the (never otherwised-used) CHARACTER.
15297
15298 2002-11-07 Akim Demaille <akim@epita.fr>
15299
15300 Let yyerror always receive the msg as last argument, so that
15301 yyerror can be variadic.
15302
15303 * data/yacc.c (b4_yyerror_args): New.
15304 Use it when calling yyerror.
15305 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
15306 Use it when calling yyerror.
15307 * doc/bison.texinfo (Error Reporting): Adjust.
15308 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
15309 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
15310
15311 2002-11-06 Akim Demaille <akim@epita.fr>
15312
15313 #line should have quoted strings.
15314 Ideally, this should be done by m4_quotearg.
15315
15316 * src/scan-skel.l: Include quotearg.h.
15317 Quote __ofile__.
15318 * src/output.c (symbol_printers_output)
15319 (symbol_destructors_output): Quote the file name.
15320
15321 2002-11-06 Akim Demaille <akim@epita.fr>
15322
15323 * tests/regression.at (Invalid inputs): Adjust to the recent
15324 messages.
15325
15326 2002-11-06 Akim Demaille <akim@epita.fr>
15327
15328 Restore --no-lines.
15329 Reported by Jim Kent.
15330
15331 * data/c.m4 (b4_syncline): New.
15332 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
15333 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
15334 * src/output.c (user_actions_output): Likewise.
15335 (prepare): Define 'b4_synclines_flag'.
15336 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
15337
15338 2002-11-06 Akim Demaille <akim@epita.fr>
15339
15340 * src/main.c (main): Free `infile'.
15341 * src/scan-gram.l (handle_syncline): New.
15342 Recognize `#line'.
15343 * src/output.c (user_actions_output, symbol_destructors_output)
15344 (symbol_printers_output): Use the location's file name, not
15345 infile.
15346 * src/reader.c (prologue_augment, epilogue_set): Likewise.
15347
15348 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15349
15350 * src/tables.c (matching_state): Don't allow states to match if
15351 either has GLR conflict entries.
15352
15353 2002-11-05 Paul Eggert <eggert@twinsun.com>
15354
15355 * src/scan-gram.l: Use more accurate diagnostics, e.g.
15356 "integer out of range" rather than "invalid value".
15357 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
15358 accordingly.
15359
15360 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
15361 Also, remove one static variable in the scanner.
15362
15363 * src/scan-gram.l (braces_level): Now auto, not static.
15364 Initialize to zero if the compiler is being picky.
15365 (INITIAL): Clear braces_level instead of incrementing it.
15366 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
15367 as POSIX 1003.1-2001 requires.
15368 * src/system.h (IF_LINT): New macro, taken from coreutils.
15369 * configure.ac: Define "lint" if --enable-gcc-warnings.
15370
15371 2002-11-05 Akim Demaille <akim@epita.fr>
15372
15373 * src/scan-gram.l: When it starts with `%', complain about the
15374 whole directive, not just that `invalid character: %'.
15375
15376 2002-11-04 Akim Demaille <akim@epita.fr>
15377
15378 * Makefile.maint: Update from Autoconf.
15379 (update, cvs-update, po-update, do-po-update): New.
15380
15381 2002-11-04 Akim Demaille <akim@epita.fr>
15382
15383 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
15384 and yyerror.
15385 Have yyerror `use' its arguments.
15386 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
15387 returns true when location & yacc & pure & parse-param.
15388 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
15389
15390 2002-11-04 Akim Demaille <akim@epita.fr>
15391
15392 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
15393 clashes.
15394 * src/scan-gram.l: Use [\'] instead of ['] to pacify
15395 font-lock-mode.
15396 Use complain_at.
15397 Use quote, not quote_n since LOCATION_PRINT no longer uses the
15398 slot 0.
15399
15400 2002-11-03 Paul Eggert <eggert@twinsun.com>
15401
15402 * src/reader.c (get_merge_function, grammar_current_rule_check):
15403 Use consistent diagnostics for reporting type name clashes.
15404 Quote the types with <>, for consistency with Yacc.
15405 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
15406
15407 2002-11-03 Akim Demaille <akim@epita.fr>
15408
15409 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
15410 New.
15411 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
15412 (b4_parse_param): Remove.
15413 Use b4_identification.
15414 Propagate b4_pure_args where needed to pass them to yyerror.
15415 * data/glr.m4 (b4_parse_param): Remove.
15416 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
15417 (b4_lpure_formals): New.
15418 Use b4_identification.
15419 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
15420 b4_user_formals and b4_user_args.
15421 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
15422 (yyreportAmbiguity): When using a pure parser, also need
15423 the location, and the parse-params.
15424 Adjust callers.
15425 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
15426 When using a pure parser, also need the parse-params.
15427 Adjust callers.
15428 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
15429 (%pure-parser + %parse-param) LALR and GLR parsers.
15430 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
15431 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
15432 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
15433 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
15434 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
15435 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
15436 * doc/bison.texinfo: Untabify the whole file.
15437 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
15438 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
15439 (Error Reporting): Adjust to these new directives.
15440 Document %error-verbose, deprecate YYERROR_VERBOSE.
15441
15442 2002-11-03 Akim Demaille <akim@epita.fr>
15443
15444 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
15445 AT_CHECK_CALC_GLR invocations to use % directives, instead of
15446 command line options.
15447 * tests/cxx-type.at: Formatting changes.
15448
15449 2002-11-03 Paul Eggert <eggert@twinsun.com>
15450
15451 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
15452 to count columns correctly, and to check for invalid inputs.
15453
15454 Use mbsnwidth to count columns correctly. Account for tabs, too.
15455 Include mbswidth.h.
15456 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
15457 (extend_location): New function.
15458 (YY_LINES): Remove.
15459
15460 Handle CRLF in C code rather than in Lex code.
15461 (YY_INPUT): New macro.
15462 (no_cr_read): New function.
15463
15464 Scan UCNs, even though we don't fully handle them yet.
15465 (convert_ucn_to_byte): New function.
15466
15467 Handle backslash-newline correctly in C code.
15468 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
15469 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
15470 all uses changed.
15471 (tag, splice): New EREs. Do not allow NUL or newline in tags.
15472 Use {splice} wherever C allows backslash-newline.
15473 YY_STEP after space, newline, vertical-tab.
15474 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
15475
15476 (letter, id): Don't assume ASCII; e.g., spell out a-z.
15477
15478 ({int}, handle_action_dollar, handle_action_at): Check for integer
15479 overflow.
15480
15481 (YY_STEP): Omit trailing semicolon, so that it's more like C.
15482
15483 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
15484 as well as \000. Check for UCHAR_MAX, not 255.
15485 Allow \x with an arbitrary positive number of digits, as in C.
15486 Check for overflow here.
15487 Allow \? and UCNs, for compatibility with C.
15488
15489 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
15490 with quote slot used by complain_at.
15491
15492 * tests/input.at: Add tests for backslash-newline, m4 quotes
15493 in symbols, long literals, and funny escapes in strings.
15494
15495 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
15496 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
15497 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
15498 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
15499 * m4/mbswidth.m4: New file, from GNU coreutils.
15500
15501 * doc/bison.texinfo (Grammar Outline): Document // comments.
15502 (Symbols): Document that trigraphs have no special meaning in Bison,
15503 nor is backslash-newline allowed.
15504 (Actions): Document that trigraphs have no special meaning.
15505
15506 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
15507 no longer used.
15508
15509 2002-11-02 Paul Eggert <eggert@twinsun.com>
15510
15511 * src/reader.c: Don't include quote.h; not needed.
15512 (get_merge_function): Reword warning to be consistent with
15513 type clash diagnostic in grammar_current_rule_check.
15514
15515 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
15516 bug in trigraph handling.
15517
15518 * src/output.c (prepare_symbols): When printing token names,
15519 escape "[" as "@<:@" and likewise for "]".
15520
15521 * src/system.h (errno): Remove declaration, as we are now
15522 assuming C89 or better, and C89 guarantees errno.
15523
15524 2002-10-30 Paul Eggert <eggert@twinsun.com>
15525
15526 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
15527 Check for close failures.
15528 * src/files.h (xfclose): Return void, not int, since it always
15529 returned zero.
15530 * src/files.c (xfclose): Likewise. Report I/O error if ferror
15531 indicates one.
15532 * src/output.c (output_skeleton): Use xfclose rather than fclose
15533 and ferror. xfclose now checks ferror.
15534
15535 * data/glr.c (YYLEFTMOST_STATE): Remove.
15536 (yyreportTree): Use a stack-based leftmost state. This avoids
15537 our continuing battles with bogus warnings about initializers.
15538
15539 2002-10-30 Akim Demaille <akim@epita.fr>
15540
15541 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
15542 #if.
15543
15544 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
15545
15546 * tests/glr-regr1.at: New test for reported regressions.
15547 * tests/testsuite.at: Add glr-regr1.at test.
15548 * tests/Makefile.am: Add glr-regr1.at test.
15549
15550 2002-10-24 Paul Eggert <eggert@twinsun.com>
15551
15552 Version 1.75a.
15553
15554 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
15555 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
15556 we use malloc. Don't assume 'A' through 'Z' are contiguous.
15557 Don't assume strdup exists; POSIX says its an XSI extension.
15558 Check for buffer overflow on input.
15559
15560 2002-10-24 Akim Demaille <akim@epita.fr>
15561
15562 * src/output.c (output_skeleton): Don't disable M4sugar comments
15563 too soon: it results in comments being expanded.
15564 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
15565 first output.
15566
15567 2002-10-24 Akim Demaille <akim@epita.fr>
15568
15569 * data/yacc.c (m4_int_type): New.
15570 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
15571 char' as only yacc.c wants K&R portability.
15572 * data/glr.c (yysigned_char): Remove.
15573 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
15574 Reported by Quoc Peyrot.
15575
15576 2002-10-23 Paul Eggert <eggert@twinsun.com>
15577
15578 * src/main.c (main): With --trace=time, report times even if a
15579 non-fatal error occurs. Formerly, the times were reported in some
15580 such cases but not in others.
15581 * src/reader.c (reader): Just return if a complaint has been issued,
15582 instead of exiting, so that 'main' can report times.
15583
15584 2002-10-22 Akim Demaille <akim@epita.fr>
15585
15586 * src/system.h: Include sys/types.
15587 Reported by Bert Deknuydt.
15588
15589 2002-10-23 Paul Eggert <eggert@twinsun.com>
15590
15591 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
15592 Suggested by Art Haas.
15593
15594 2002-10-22 Paul Eggert <eggert@twinsun.com>
15595
15596 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
15597 decl; not needed any more.
15598 * src/main.c (main): Use return to exit, undoing yesterday's change.
15599 The last OS that we could find where this wouldn't work is
15600 SunOS 3.5, and that's too old to worry about now.
15601
15602 * data/glr.c (struct yyltype): Define members even when not
15603 doing locations. This is more consistent with yacc.c, and it
15604 works around the following bug reports:
15605 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
15606 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
15607
15608 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
15609 @acronym consistently. Standardize on "Yacc" instead of "YACC",
15610 "Algol" instead of "ALGOL". Give a bit more history about BNF.
15611
15612 2002-10-22 Akim Demaille <akim@epita.fr>
15613
15614 * data/README: New.
15615
15616 2002-10-21 Paul Eggert <eggert@twinsun.com>
15617
15618 Be consistent about 'bool'; the old code used an enum in one
15619 module and an int in another, and this violates the C standard.
15620 * m4/stdbool.m4: New file, from coreutils 4.5.3.
15621 * configure.ac (AC_HEADER_STDBOOL): Add.
15622 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
15623 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
15624 * src/symtab.c (hash_compare_symbol_t): Likewise.
15625 * src/system.h (bool, false, true): Use a definition consistent
15626 with ../lib/hash.c. All uses changed.
15627
15628 * src/complain.c (warning_issued): Renamed from warn_message_count,
15629 so that we needn't worry about integer overflow (!).
15630 Now of type bool. All uses changed.
15631 (complaint_issued): Renamed from complain_message_count; likewise.
15632
15633 * src/main.c (main): Use exit to exit with failure.
15634
15635 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
15636 rather than 1 and 0.
15637 * src/main.c (main): Likewise.
15638 * src/getargs.c (getargs): Likewise.
15639 * src/reader.c (reader): Likewise.
15640
15641 * src/getarg.c (getargs): Remove duplicate code for
15642 "Try `bison --help'".
15643
15644 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
15645 What was that "2" for?
15646
15647 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
15648 * src/getargs.c (usage): Likewise.
15649
15650 * src/getargs.c (getargs): When there are too few operands, report
15651 the last one. When there are too many, report the first extra
15652 one. This is how diffutils does it.
15653
15654 2002-10-20 Paul Eggert <eggert@twinsun.com>
15655
15656 Remove K&R vestiges.
15657 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
15658 * src/complain.c (VA_START): Remove. Assume prototypes.
15659 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
15660 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
15661 fatal): Assume prototypes.
15662 * src/complain.h: Assume prototypes.
15663 * src/system.h (PARAMS): Remove.
15664 Include <limits.h> unconditionally, since it's guaranteeed even
15665 for a freestanding C89 compiler.
15666 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
15667 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
15668
15669 2002-10-20 Akim Demaille <akim@epita.fr>
15670
15671 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
15672 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
15673 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
15674 (yyresolveStates, yyresolveAction, yyresolveStack)
15675 (yyprocessOneStack): Use them.
15676 (yy_reduce_print): New.
15677 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
15678
15679 2002-10-20 Akim Demaille <akim@epita.fr>
15680
15681 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
15682 arguments and output `void'.
15683 (b4_c_function): Rename as...
15684 (b4_c_function_def): this.
15685 (b4_c_function_decl, b4_c_ansi_function_def)
15686 (b4_c_ansi_function_decl): New.
15687 Change the interpretation of the arguments: before `int, foo', now
15688 `int foo, foo'.
15689 * data/yacc.c (yyparse): Prototype and define thanks to these.
15690 Adjust b4_c_function_def uses.
15691 * data/glr.c (yyparse): Likewise, but ANSI only.
15692
15693 2002-10-20 Akim Demaille <akim@epita.fr>
15694
15695 * src/output.c (prepare): Move the definition of `tokens_number',
15696 `nterms_number', `undef_token_number', `user_token_number_max'
15697 to...
15698 (prepare_tokens): Here.
15699 (prepare_tokens): Rename as...
15700 (prepare_symbols): this.
15701 (prepare): Move the definition of `rules_number' to...
15702 (prepare_rules): here.
15703 (prepare): Move the definition of `last', `final_state_number',
15704 `states_number' to...
15705 (prepare_states): here.
15706 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
15707
15708 2002-10-20 Akim Demaille <akim@epita.fr>
15709
15710 * src/tables.h, src/tables.c, src/output.c: Comment changes.
15711
15712 2002-10-20 Akim Demaille <akim@epita.fr>
15713
15714 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
15715 * data/c.m4: here.
15716
15717 2002-10-20 Akim Demaille <akim@epita.fr>
15718
15719 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
15720 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
15721 `pair'.
15722 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
15723 `name' to...
15724 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
15725 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
15726 These.
15727
15728 2002-10-19 Paul Eggert <eggert@twinsun.com>
15729
15730 Do not create a temporary file, as that involves security and
15731 cleanup headaches. Instead, use a pair of pipes.
15732 Derived from a suggestion by Florian Krohm.
15733 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
15734 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
15735 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
15736 (BISON_PREREQ_SUBPIPE): Add.
15737 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
15738 Add subpipe.h, subpipe.c.
15739 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
15740 * po/POTFILES.in: Add lib/subpipe.c.
15741 * src/output.c: Include "subpipe.h".
15742 (m4_invoke): Remove decl.
15743 (scan_skel): New decl.
15744 (output_skeleton): Use pipe rather than temporary file for m4 input.
15745 Check that m4sugar.m4 is readable, to avoid deadlock.
15746 Check for pipe I/O error.
15747 * src/scan-skel.l (readpipe): Remove decl.
15748 (scan_skel): New function, to be used in place of m4_invoke.
15749 Read from stream rather than file.
15750
15751 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
15752 float, as this generates a warning on Solaris 8 + GCC 3.2 with
15753 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
15754 this generates a more-accurate value anyway.
15755
15756 * lib/timevar.c (timervar_accumulate): Rename locals to
15757 avoid confusion with similarly-named more-global.
15758 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
15759
15760 * src/output.c (prepare): Use xstrdup to convert char const *
15761 to char *, to avoid GCC warning.
15762
15763 2002-10-19 Akim Demaille <akim@epita.fr>
15764
15765 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
15766 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
15767 Use them to have `calc.y' ready for %pure-parser.
15768 * data/yacc.c (YYLEX): Pass a yylex return type to
15769 b4_c_function_call.
15770
15771 2002-10-19 Akim Demaille <akim@epita.fr>
15772
15773 Prototype support of %lex-param and %parse-param.
15774
15775 * src/parse-gram.y: Add the definition of the %lex-param and
15776 %parse-param tokens, plus their rules.
15777 Drop the `_' version of %glr-parser.
15778 Add the "," token.
15779 * src/scan-gram.l (INITIAL): Scan them.
15780 * src/muscle_tab.c: Comment changes.
15781 (muscle_insert, muscle_find): Rename `pair' as `probe'.
15782 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
15783 (muscle_entry_s): The `value' member is no longer const.
15784 Adjust all dependencies.
15785 * src/muscle_tab.c (muscle_init): Adjust: use
15786 MUSCLE_INSERT_STRING.
15787 Initialize the obstack earlier.
15788 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
15789 (muscle_pair_list_grow): New.
15790 * data/c.m4 (b4_c_function_call, b4_c_args): New.
15791 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
15792 * tests/calc.at: Use %locations, not --locations.
15793 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
15794
15795 2002-10-19 Akim Demaille <akim@epita.fr>
15796
15797 * src/getargs.c (usage): Take status as argument and exit
15798 accordingly.
15799 Report the traditional `Try ... --help' message when status != 0.
15800 (usage, version): Don't take a FILE * as arg, it is pointless.
15801 (getargs): When there is an incorrect number of arguments, make it
15802 an error, and report it GNUlically thanks to `usage ()'.
15803
15804 2002-10-18 Paul Eggert <eggert@twinsun.com>
15805
15806 * data/glr.c (yyreportParseError): Don't assume that sprintf
15807 yields the length of the printed string, as this is not true
15808 on SunOS 4.1.4. Reported by Peter Klein.
15809
15810 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
15811 * tests/conflicts.at (%nonassoc and eof): Likewise.
15812 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
15813
15814 2002-10-17 Akim Demaille <akim@epita.fr>
15815
15816 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
15817 * src/getargs.c (trace_types, trace_args): Adjust.
15818 * src/reader.c (grammar_current_rule_prec_set)
15819 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
15820 Standardize error messages.
15821 And s/@prec/%prec/!
15822 (reader): Use trace_flag to enable scanner/parser debugging,
15823 instead of an adhoc scheme.
15824 * src/scan-gram.l: Remove trailing debugging code.
15825
15826 2002-10-16 Paul Eggert <eggert@twinsun.com>
15827
15828 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
15829 MUSCLE_TAB_H.
15830
15831 * NEWS: Officially drop support for building Bison with K&R C,
15832 since it didn't work anyway and it's not worth worrying about.
15833 * Makefile.maint (wget_files): Remove ansi2knr.c.
15834 (ansi2knr.c-url_prefix): Remove.
15835 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
15836 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15837 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
15838
15839 2002-10-15 Paul Eggert <eggert@twinsun.com>
15840
15841 Stop using the "enum_" trick for K&R-style function definitions;
15842 it confused me, and I was the author! Instead, assume that people
15843 who want to use K&R C compilers (when using these modules in GCC,
15844 perhaps?) will run ansi2knr.
15845
15846 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
15847 All uses of "enum_" changed to "enum ".
15848 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
15849 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
15850
15851 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
15852 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
15853 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
15854 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
15855 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
15856 abitset_not, abitset_ones, abitset_or, abitset_or_and,
15857 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
15858 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
15859 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
15860 Use function prototypes; this removes the need for declaring
15861 static functions simply to provide their prototypes.
15862 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
15863 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
15864 bitset_count_, bitset_create, bitset_dump, bitset_first,
15865 bitset_free, bitset_init, bitset_last, bitset_next,
15866 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
15867 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
15868 bitset_print, bitset_release_memory, bitset_toggle_,
15869 bitset_type_choose, bitset_type_get, bitset_type_name_get,
15870 debug_bitset): Likewise.
15871 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
15872 * lib/bitset_stats.c (bitset_log_histogram_print,
15873 bitset_percent_histogram_print, bitset_stats_and,
15874 bitset_stats_and_cmp, bitset_stats_and_or,
15875 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
15876 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
15877 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
15878 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
15879 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
15880 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
15881 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
15882 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
15883 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
15884 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
15885 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
15886 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
15887 bitset_stats_zero): Likewise.
15888 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
15889 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
15890 bitsetv_dump, debug_bitsetv): Likewise.
15891 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
15892 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
15893 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
15894 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
15895 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
15896 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
15897 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
15898 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
15899 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
15900 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
15901 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
15902 Likewise.
15903 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
15904 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
15905 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
15906 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
15907 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
15908 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
15909 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
15910 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
15911 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
15912 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
15913 lbitset_xor_cmp, lbitset_zero): Likewise.
15914
15915 2002-10-14 Akim Demaille <akim@epita.fr>
15916
15917 Version 1.75.
15918
15919 2002-10-14 Akim Demaille <akim@epita.fr>
15920
15921 * tests/Makefile.am (maintainer-check-posix): New.
15922
15923 2002-10-14 Akim Demaille <akim@epita.fr>
15924
15925 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
15926 member.
15927
15928 2002-10-14 Akim Demaille <akim@epita.fr>
15929
15930 * src/tables.c (table_ninf_remap): base -> tab.
15931 Reported by Matt Rosing.
15932
15933 2002-10-14 Paul Eggert <eggert@twinsun.com>
15934
15935 * tests/action.at, tests/calc.at, tests/conflicts.at,
15936 tests/cxx-type.at, tests/headers.at, tests/input.at,
15937 tests/regression.at, tests/synclines.at, tests/torture.at:
15938 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
15939 so that the tests still work even if POSIXLY_CORRECT is set.
15940 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
15941
15942 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
15943 for portability to K&R hosts. Fix typo: signed char is guaranteed
15944 only to 127, not to 128.
15945 * data/glr.c (yysigned_char): New type.
15946 * data/yacc.c (yysigned_char): Likewise.
15947 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
15948
15949 2002-10-13 Paul Eggert <eggert@twinsun.com>
15950
15951 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
15952 true due to limited range of data type" warning from GCC.
15953
15954 * data/c.m4 (b4_token_defines): Protect against double-inclusion
15955 by wrapping enum yytokentype's definition inside #ifndef
15956 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
15957
15958 2002-10-13 Akim Demaille <akim@epita.fr>
15959
15960 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
15961 Un yy- yyrhs to avoid the name clash with the global YYRHS.
15962
15963 2002-10-13 Akim Demaille <akim@epita.fr>
15964
15965 * Makefile.maint: Update from Autoconf 2.54.
15966 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
15967
15968 2002-10-13 Akim Demaille <akim@epita.fr>
15969
15970 * src/print.c (print_state): Separate the list of solved conflicts
15971 from the other items.
15972 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
15973
15974 2002-10-13 Akim Demaille <akim@epita.fr>
15975
15976 Let nondeterministic skeletons be usable with deterministic
15977 tables.
15978
15979 With the patch, GAWK compiled by GCC without -O2 passes its test
15980 suite using a GLR parser driven by LALR tables. It fails with -O2
15981 because `struct stat' gives two different answers on my machine:
15982 88 (definition of an auto var) and later 96 (memset on this var).
15983 Hence the stack is badly corrumpted. The headers inclusion is to
15984 blame: if I move the awk.h inclusion before GLR's system header
15985 inclusion, the two struct stat have the same size.
15986
15987 * src/tables.c (pack_table): Always create conflict_table.
15988 (token_actions): Always create conflict_list.
15989 * data/glr.c (YYFLAG): Remove, unused.
15990
15991 2002-10-13 Akim Demaille <akim@epita.fr>
15992
15993 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
15994 (O0FLAGS): New.
15995 (VALGRIND, GXX): New.
15996 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
15997 * tests/bison.in: Run $PREBISON a pre-command.
15998 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
15999 (maintainer-check-g++): New.
16000 * Makefile.am (maintainer-check): New.
16001
16002 2002-10-13 Akim Demaille <akim@epita.fr>
16003
16004 * data/glr.c: Formatting changes.
16005 Tweak some trace messages to match yacc.c's.
16006
16007 2002-10-13 Akim Demaille <akim@epita.fr>
16008
16009 GLR parsers sometimes raise parse errors instead of performing the
16010 default reduction.
16011 Reported by Charles-Henry de Boysson.
16012
16013 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
16014 check the length of the traces when %glr.
16015 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
16016 GLR's traces.
16017 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
16018 Test GLR parsers.
16019 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
16020 (yyltype): Remove the yy prefix from the member names.
16021 (yytable): Complete its comment.
16022 (yygetLRActions): Map error action number from YYTABLE from
16023 YYTABLE_NINF to 0.
16024 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
16025 (which was a bug: it should have been YYTABEL_NINF, and yet it was
16026 not satisfying as we could compare an YYACTION computed from
16027 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
16028 only value for error actions.
16029 (yyreportParseError): In verbose parse error messages, don't issue
16030 `error' in the list of expected tokens.
16031 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
16032 next action to perform to match glr.c's decoding.
16033 (yytable): Complete its comment.
16034
16035 2002-10-13 Paul Eggert <eggert@twinsun.com>
16036
16037 Fix problem reported by Henrik Grubbstroem in
16038 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
16039 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
16040 because the Bison parser reads the second action before reducing
16041 the first one.
16042 * src/scan-gram.l (rule_length): New static var.
16043 Use it to keep track of the rule length in the scanner, since
16044 we can't expect the parser to be in lock-step sync with the scanner.
16045 (handle_action_dollar, handle_action_at): Use this var.
16046 * tests/actions.at (Exotic Dollars): Test for the problem.
16047
16048 2002-10-12 Paul Eggert <eggert@twinsun.com>
16049
16050 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
16051 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
16052 Include <sys/time.h> when checking for clock_t and struct tms.
16053 Use same include order as source.
16054 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
16055 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
16056
16057 * lib/timevar.c: Update copyright date and clarify comments.
16058 (get_time) [IN_GCC]: Keep the GCC version for reference.
16059
16060 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
16061 GCC version as of today, then merge Bison's changes.
16062 Change "GCC" to "Bison" in copyright notice. timevar.def's
16063 author is Akim, so change that too.
16064
16065 * src/reader.c (grammar_current_rule_check):
16066 Don't worry about the default action if $$ is untyped.
16067 Prevents bogus warnings reported by Jim Gifford in
16068 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
16069
16070 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
16071 * data/glr.c, data/lalr1.cc, data/yacc.c:
16072 Output token definitions before the first part of user declarations.
16073 Fixes compatibility problem reported by Jim Gifford for kbd in
16074 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
16075
16076 2002-10-11 Paul Eggert <eggert@twinsun.com>
16077
16078 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
16079 (yyparse): here. This undoes some of the 2002-07-25 change.
16080 Compatibility problem reported by Ralf S. Engelschall with
16081 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
16082
16083 2002-10-11 Akim Demaille <akim@epita.fr>
16084
16085 * tests/regression.at Characters Escapes): New.
16086 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
16087 characters.
16088 Reported by Jan Nieuwenhuizen.
16089
16090 2002-10-11 Akim Demaille <akim@epita.fr>
16091
16092 * po/id.po: New.
16093
16094 2002-10-10 Paul Eggert <eggert@twinsun.com>
16095
16096 Portability fixes for bitsets; this also avoids several GCC
16097 warnings.
16098
16099 * lib/abitset.c: Include <stddef.h>, for offsetof.
16100 * lib/lbitset.c: Likewise.
16101
16102 * lib/abitset.c (abitset_bytes): Return a size that is aligned
16103 properly for vectors of objects. Do not assume that adding a
16104 header size to a multiple of a word size yields a value that is
16105 properly aligned for the whole union.
16106 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16107
16108 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
16109 unique names for structures.
16110 * lib/ebitset.c (ebitset_bytes): Likewise.
16111 * lib/lbitset.c (lbitset_bytes): Likewise.
16112
16113 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
16114 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
16115 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
16116 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
16117 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
16118 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
16119 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
16120 to improve the type-checking that GCC can do.
16121 * lib/bitset.c (bitset_op4_cmp): Likewise.
16122 * lib/bitset_stats.c (bitset_stats_count,
16123 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
16124 bitset_stats_copy, bitset_stats_disjoint_p,
16125 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
16126 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
16127 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
16128 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
16129 bitset_stats_and_or_cmp, bitset_stats_andn_or,
16130 bitset_stats_andn_or_cmp, bitset_stats_or_and,
16131 bitset_stats_or_and_cmp): Likewise.
16132 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
16133 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
16134 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
16135 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
16136
16137 * lib/abitset.h: Include bitset.h, not bbitset.h.
16138 * lib/ebitset.h: Likewise.
16139 * lib/lbitset.h: Likewise.
16140
16141 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
16142 All instances of parameters of type enum bitset_opts are now of
16143 type enum_bitset_opts, to conform to the C Standard, and similarly
16144 for enum_bitset_type.
16145 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
16146 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
16147
16148 Do not use "struct bitset_struct" to mean different things in
16149 different modules. Not only is this confusing, it violates
16150 the C Standard, which requires that structure types in different
16151 modules must be compatible if one is to be passed to the other.
16152 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
16153 All instances of "struct bitset_struct *" replaced with "bitset".
16154 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
16155 (union bitset_union, struct abitset_struct, struct ebitset_struct,
16156 struct lbitset_struct, struct bitset_stats_struct): New types.
16157 All uses of struct bitset_struct changed to union bitset_union,
16158 etc.
16159 * lib/abitset.c (struct abitset_struct, abitset,
16160 struct bitset_struct): Remove.
16161 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
16162 struct bitset_struct): Remove.
16163 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
16164 bitset_struct): Remove.
16165 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
16166 Likewise.
16167
16168 Do not call a function of type T using a call that assumes the
16169 function is of a different type U. Standard C requires that a
16170 function must be called with a type that is compatible with its
16171 definition.
16172 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16173 New decls.
16174 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
16175 New functions.
16176 * lib/ebitset.c (PFV): Remove.
16177 * lib/lbitset.c (PFV): Likewise.
16178 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
16179 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
16180 decls.
16181 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
16182 (ebitset_vtable): Use them.
16183 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
16184 lbitset_xor): New functions.
16185 (lbitset_vtable): Use them.
16186
16187 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
16188 Declare.
16189
16190 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
16191 GCC warning.
16192 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
16193 Use offsetof, for simplicity.
16194
16195 2002-10-06 Paul Eggert <eggert@twinsun.com>
16196
16197 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
16198 the same width as int. This reapplies a hunk of the 2002-08-12 patch
16199 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
16200 which was inadvertently undone by the 2002-09-30 patch.
16201 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
16202 the same width as int.
16203
16204 2002-10-04 Paul Eggert <eggert@twinsun.com>
16205
16206 Version 1.50.
16207
16208 * configure.ac (AC_INIT), NEWS: Increment version number.
16209
16210 * doc/bison.texinfo: Minor spelling, grammar, and white space
16211 fixes.
16212 (Symbols): Mention that any negative value returned from yylex
16213 signifies end-of-input. Warn about negative chars. Mention
16214 the portable Standard C character set.
16215
16216 The GNU coding standard says CFLAGS and YFLAGS are reserved
16217 for the installer to set.
16218 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
16219 * src/Makefile.am (AM_CFLAGS): Likewise.
16220 (AM_YFLAGS): Renamed from YFLAGS.
16221
16222 Fix some MAX and MIN problems.
16223 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
16224 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
16225 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
16226 * src/reader.c (reader): Use it.
16227
16228 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
16229 POSIX 1003.1-2001 has removed fgrep.
16230
16231 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
16232
16233 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
16234 interpreted as signed.
16235 * lib/ebitset.c (ebitset_list): Fix bug.
16236
16237 2002-10-01 Paul Eggert <eggert@twinsun.com>
16238
16239 More fixes for 64-bit hosts and large bitsets.
16240
16241 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
16242 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
16243 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
16244 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
16245 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
16246 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
16247 bitset_count_): Likewise.
16248 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
16249 bitset_first, bitset_last): Likewise.
16250 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
16251 bitset_stats_list_reverse, bitset_stats_size,
16252 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
16253 Likewise.
16254 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16255 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
16256 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
16257 bitsetv_reflexive_transitive_closure): Likewise.
16258 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
16259 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
16260 Likewise.
16261 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
16262 Likewise.
16263
16264 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
16265 Use size_t, not unsigned int, to count bytes.
16266 * lib/abitset.h (abitset_bytes): Likewise.
16267 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
16268 Likewise.
16269 * lib/bitset.h (bitset_bytes): Likewise.
16270 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
16271 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
16272 * lib/bitsetv.c (bitsetv_alloc): Likewise.
16273 * lib/ebitset.c (ebitset_bytes): Likewise.
16274 * lib/ebitset.h (ebitset_bytes): Likewise.
16275 * lib/lbitset.c (lbitset_bytes): Likewise.
16276 * lib/lbitset.h (lbitset_bytes): Likewise.
16277
16278 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
16279 abitset_subset_p, abitset_disjoint_p, abitset_and,
16280 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
16281 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
16282 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
16283 abitset_or_and, abitset_or_and_cmp):
16284 Use bitset_windex instead of unsigned int.
16285 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16286 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
16287 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
16288 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
16289 Likewise.
16290 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
16291
16292 * lib/bitset.c (bitset_print):
16293 Use proper printf formats for widths of integer types.
16294 * lib/bitset_stats.c (bitset_percent_histogram_print,
16295 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
16296 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
16297 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
16298 * lib/lbitset.c (lbitset_bytes): Likewise.
16299
16300 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
16301 BITSET_SIZE_MAX): New macros.
16302 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
16303 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
16304 to BITSET_WINDEX_MAX.
16305
16306 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
16307 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
16308 since we now return the bitset_bindex type (not int).
16309
16310 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
16311 when computing sizes.
16312 * lib/ebitset.c (ebitset_elts_grow): Likewise.
16313
16314 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
16315 and avoid cast to unsigned.
16316
16317 2002-09-30 Akim Demaille <akim@epita.fr>
16318
16319 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
16320 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
16321 Updates from Michael Hayes.
16322
16323 2002-09-30 Art Haas <ahaas@neosoft.com>
16324
16325 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
16326 invocations.
16327 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
16328 defined.
16329
16330 2002-09-27 Akim Demaille <akim@epita.fr>
16331
16332 Version 1.49c.
16333
16334 2002-09-27 Akim Demaille <akim@epita.fr>
16335
16336 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
16337 (Because of AC_LIBSOURCE).
16338
16339 2002-09-27 Akim Demaille <akim@epita.fr>
16340
16341 Playing with Autoscan.
16342
16343 * configure.ac: Remove the old LIBOBJ tweaks.
16344 (AC_REPLACE_FUNCS): Add strrchr and strtol.
16345 * lib/strrchr.c: New.
16346 * lib/strtol.c: New, from the Coreutils 4.5.1.
16347
16348 2002-09-27 Akim Demaille <akim@epita.fr>
16349
16350 Playing with Autoscan.
16351
16352 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
16353 * lib/Makefile.am (libbison_a_SOURCES): No longer include
16354 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
16355 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
16356 Coreutils 4.5.1.
16357
16358 2002-09-24 Akim Demaille <akim@epita.fr>
16359
16360 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
16361 (Frequently Asked Questions, Parser Stack Overflow): New.
16362
16363 2002-09-13 Akim Demaille <akim@epita.fr>
16364
16365 Playing with autoscan.
16366
16367 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
16368 * src/files.c (skeleton_find): Remove, unused.
16369 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
16370 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
16371
16372 2002-09-13 Akim Demaille <akim@epita.fr>
16373
16374 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
16375 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
16376
16377 2002-09-13 Akim Demaille <akim@epita.fr>
16378
16379 * configure.ac: Require 2.54.
16380 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
16381 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
16382 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
16383 Remove, provided by Autoconf macros.
16384
16385 2002-09-12 Akim Demaille <akim@epita.fr>
16386
16387 * m4/prereq.m4: Update, from Coreutils 4.5.1.
16388
16389 2002-09-12 Akim Demaille <akim@epita.fr>
16390
16391 * m4/prereq.m4: Update, from Fileutils 4.1.5.
16392 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
16393 Reported by Martin Mokrejs.
16394
16395 2002-09-10 Akim Demaille <akim@epita.fr>
16396
16397 * src/parse-gram.y: Associate a human readable string to each
16398 token type.
16399 * tests/regression.at (Invalid inputs): Adjust.
16400
16401 2002-09-10 Gary V. Vaughan <gary@gnu.org>
16402
16403 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
16404 with an Autoconf-2.5x style configure.ac.
16405
16406 2002-09-06 Paul Eggert <eggert@twinsun.com>
16407
16408 * doc/bison.texinfo (Conditions): Make explicit that the GPL
16409 exception applies only to yacc.c. This is a modification of a
16410 patch originally suggested by Akim Demaille.
16411
16412 2002-09-06 Akim Demaille <akim@epita.fr>
16413
16414 * data/c.m4 (b4_copyright): Move the GPL exception comment from
16415 here to...
16416 * data/yacc.c: here.
16417
16418 * data/lalr1.cc (struct yyltype): Don't define it, since we use
16419 LocationType.
16420 (b4_ltype): Default to yy::Location from location.hh.
16421
16422 2002-09-04 Jim Meyering <jim@meyering.net>
16423
16424 * data/yacc.c: Guard the declaration of yytoknum also with
16425 `#ifdef YYPRINT', so it is declared only when used.
16426
16427 2002-09-04 Akim Demaille <akim@epita.fr>
16428
16429 * configure.in: Rename as...
16430 * configure.ac: this.
16431 Bump to 1.49c.
16432
16433 2002-09-04 Akim Demaille <akim@epita.fr>
16434
16435 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
16436 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
16437 translate maintainer only messages.
16438
16439 2002-08-12 Paul Eggert <eggert@twinsun.com>
16440
16441 Version 1.49b.
16442
16443 * Makefile.am (SUBDIRS): Remove intl.
16444 (DISTCLEANFILES): Remove.
16445 * NEWS: Mention that GNU M4 is now required. Clarify what is
16446 meant by "larger grammars". Mention the pt_BR translation.
16447 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
16448 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
16449 Bump version from 0.11.2 to 0.11.5.
16450 (BISON_PREREQ_STAGE): Remove.
16451 (AM_GNU_GETTEXT): Use external gettext.
16452 (AC_OUTPUT): Remove intl/Makefile.
16453
16454 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
16455
16456 * data/glr.c: Include string.h, for strlen.
16457 (yyreportParseError): Use size_t for yysize.
16458 (yy_yypstack): No longer nested inside yypstates, as nested
16459 functions are not portable. Do not assume size_t is the
16460 same width as int.
16461 (yypstates): Do not assume that ptrdiff_t is the same width
16462 as int, and similarly for yyposn and YYINDEX.
16463
16464 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
16465
16466 * lib/Makefile.am (INCLUDES): Do not include from the intl
16467 directory, which has been removed.
16468 * src/Makefile.am (INCLUDES): Likewise.
16469
16470 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
16471 (bitsets_sources, additional_bitsets_sources, timevars_sources):
16472 New vars.
16473
16474 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
16475 * tests/Makefile.am (EXTRA_DIST): Likewise.
16476
16477 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
16478 Do not assume that bitset_windex is the same width as unsigned.
16479
16480 * lib/abitset.c (abitset_unused_clear): Do not assume that
16481 bitset_word is the same width as int.
16482 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
16483 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
16484 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
16485 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
16486 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
16487
16488 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
16489 portability to one's complement hosts!).
16490 * lib/ebitset.c (ebitset_op1): Likewise.
16491 * lib/lbitset.c (lbitset_op1): Likewise.
16492
16493 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
16494 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
16495 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
16496 Sync with fileutils.
16497 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
16498 lib/gettext.h: Sync with diffutils.
16499
16500 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
16501 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
16502
16503 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
16504 PROTOTYPES to check for prototypes, and "defined __STDC__" to
16505 check for void *.
16506
16507 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
16508 size_t; the old version tried to do this but casted improperly.
16509 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
16510 (bitset_test): Now returns int, not unsigned long.
16511
16512 * lib/bitset_stats.c: Include "gettext.h".
16513 (_): New macro.
16514 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
16515 name locals "index", as it generates unnecessary warnings on some
16516 hosts that have an "index" function.
16517
16518 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
16519 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
16520 they need translation.
16521 * src/LR0.c (state_list_append, new_itemsets, get_state,
16522 append_states, generate_states): Likewise.
16523 * src/assoc.c (assoc_to_string): Likewise.
16524 * src/closure.c (print_closure, set_firsts, closure): Likewise.
16525 * src/gram.c (grammar_dump): Likewise.
16526 * src/injections.c (injections_compute): Likewise.
16527 * src/lalr.c (lookaheads_print): Likewise.
16528 * src/relation.c (relation_transpose): Likewise.
16529 * src/scan-gram.l: Likewise.
16530 * src/tables.c (table_grow, pack_vector): Likewise.
16531
16532 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
16533 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
16534 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
16535 * m4/mbstate_t.m4: Sync with fileutils.
16536 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
16537
16538 * po/LINGUAS: Add pt_BR.
16539 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
16540 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
16541 lib/timevar.c.
16542 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
16543 manual recommends.
16544 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
16545
16546 * src/complain.c (strerror_r): Remove decl; not needed.
16547 (strerror): Use same pattern as ../lib/error.c.
16548
16549 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
16550
16551 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
16552
16553 * src/main.c (main): Cast result of bindtextdomain and textdomain
16554 to void, to avoid a GCC warning when --disable-nls is in effect.
16555
16556 * src/scan-gram.l: Use strings rather than escapes when possible,
16557 to minimize the number of warnings from xgettext.
16558 (handle_action_dollar, handle_action_at): Don't use isdigit,
16559 as it mishandles negative chars and it may not work as expected
16560 outside the C locale.
16561
16562 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
16563 this is a GCC extension and is not portable to other compilers.
16564
16565 * src/system.h (alloca): Use same pattern as ../lib/error.c.
16566 Do not include <ctype.h>; no longer needed.
16567 Do not include <malloc.h>; no longer needed (and generates
16568 warnings on OpenBSD 3.0).
16569
16570 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
16571 it's not portable.
16572
16573 * tests/regression.at: Do not use 'cc -c input.c -o input';
16574 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
16575
16576 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
16577 exit status as failure, not just exit status 1. Sun C exits
16578 with status 2 sometimes.
16579
16580 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
16581 Use it for the two large tests.
16582
16583 2002-08-02 Akim Demaille <akim@epita.fr>
16584
16585 * src/conflicts.c (conflicts_output): Don't output rules never
16586 reduced here, since anyway that computation doesn't work.
16587 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
16588 (rule_useless_p, rule_never_reduced_p): New.
16589 (grammar_rules_partial_print): Use a filter instead of a range.
16590 Display the title only if needed.
16591 (grammar_rules_print): Adjust.
16592 (grammar_rules_never_reduced_report): New.
16593 * src/tables.c (action_row): Move the computation of rules never
16594 reduced to...
16595 (token_actions): here.
16596 * src/main.c (main): Make the parser before making the report, so
16597 that rules never reduced are computed.
16598 Call grammar_rules_never_reduced_report.
16599 * src/print.c (print_results): Report rules never reduced.
16600 * tests/conflicts.at, tests/reduce.at: Adjust.
16601
16602 2002-08-01 Akim Demaille <akim@epita.fr>
16603
16604 Instead of attaching lookaheads and duplicating the rules being
16605 reduced by a state, attach the lookaheads to the reductions.
16606
16607 * src/state.h (state_t): Remove the `lookaheads',
16608 `lookaheads_rule' member.
16609 (reductions_t): Add a `lookaheads' member.
16610 Use a regular array for the `rules'.
16611 * src/state.c (reductions_new): Initialize the lookaheads member
16612 to 0.
16613 (state_rule_lookaheads_print): Adjust.
16614 * src/state.h, src/state.c (state_reductions_find): New.
16615 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
16616 (count_rr_conflicts): Adjust.
16617 * src/lalr.c (LArule): Remove.
16618 (add_lookback_edge): Adjust.
16619 (state_lookaheads_count): New.
16620 (states_lookaheads_initialize): Merge into...
16621 (initialize_LA): this.
16622 (lalr_free): Adjust.
16623 * src/main.c (main): Don't free nullable and derives too early: it
16624 is used by --verbose.
16625 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
16626
16627 2002-08-01 Akim Demaille <akim@epita.fr>
16628
16629 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
16630 `rule_number_t**'.
16631 (set_derives, free_derives): Rename as...
16632 (derives_compute, derives_free): this.
16633 Adjust all dependencies.
16634 * src/nullable.c (set_nullable, free_nullable): Rename as...
16635 (nullable_compute, nullable_free): these.
16636 (rule_list_t): Store rule_t *, not rule_number_t.
16637 * src/state.c (state_rule_lookaheads_print): Directly compare rule
16638 pointers, instead of their numbers.
16639 * src/main.c (main): Call nullable_free, and derives_free earlier,
16640 as they were lo longer used.
16641
16642 2002-08-01 Akim Demaille <akim@epita.fr>
16643
16644 * lib/timevar.c (get_time): Include children time.
16645 * src/lalr.h (LA, LArule): Don't export them: used with the
16646 state_t.
16647 * src/lalr.c (LA, LArule): Static.
16648 * src/lalr.h, src/lalr.c (lalr_free): New.
16649 * src/main.c (main): Call it.
16650 * src/tables.c (pack_vector): Check whether loc is >= to the
16651 table_size, not >.
16652 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
16653 (tables_generate): do it, since that's also it which allocates
16654 them.
16655 Don't free LA and LArule, main does.
16656
16657 2002-07-31 Akim Demaille <akim@epita.fr>
16658
16659 Separate parser tables computation and output.
16660
16661 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
16662 (conflict_list, conflict_list_cnt, table, check, table_ninf)
16663 (yydefgoto, yydefact, high): Move to...
16664 * src/tables.h, src/tables.c: here.
16665 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16666 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16667 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
16668 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
16669 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
16670 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
16671 (action_row, save_row, token_actions, save_column, default_goto)
16672 (goto_actions, sort_actions, matching_state, pack_vector)
16673 (table_ninf_remap, pack_table, prepare_actions): Move to...
16674 * src/tables.c: here.
16675 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
16676 * src/output.c (token_actions, output_base, output_conflicts)
16677 (output_check): Merge into...
16678 (prepare_actions): this.
16679 (actions_output): Rename as...
16680 (user_actions_output): this.
16681 * src/main.c (main): Call tables_generate and tables_free.
16682
16683 2002-07-31 Akim Demaille <akim@epita.fr>
16684
16685 Steal GCC's --time-report support.
16686
16687 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
16688 stolen/adjusted from GCC.
16689 * m4/stage.m4: Remove time related checks.
16690 * m4/timevar.m4: New.
16691 * configure.in: Adjust.
16692 * src/system.h: Adjust to using timevar.h.
16693 * src/getargs.h, src/getargs.c: Support trace_time for
16694 --trace=time.
16695 * src/main.c (stage): Remove.
16696 (main): Replace `stage' invocations with timevar calls.
16697 * src/output.c: Insert pertinent timevar calls.
16698
16699 2002-07-31 Akim Demaille <akim@epita.fr>
16700
16701 Let --trace have arguments.
16702
16703 * src/getargs.h (enum trace_e): New.
16704 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
16705 (long_options, short_options): --trace/-T takes an optional
16706 argument.
16707 Change all the uses of trace_flag to reflect the new flags.
16708 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
16709
16710 Strengthen `stage' portability.
16711
16712 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
16713 * configure.in: Use it.
16714 Don't check for malloc.h and sys/times.h.
16715 * src/system.h: Include them when appropriate.
16716 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
16717 times and struct tms are available.
16718
16719 2002-07-30 Akim Demaille <akim@epita.fr>
16720
16721 In verbose parse error message, don't report `error' as an
16722 expected token.
16723 * tests/actions.at (Printers and Destructors): Adjust.
16724 * tests/calc.at (Calculator $1): Adjust.
16725 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
16726 error message, do not report the parser accepts the error token in
16727 that state.
16728
16729 2002-07-30 Akim Demaille <akim@epita.fr>
16730
16731 Normalize conflict related messages.
16732
16733 * src/complain.h, src/complain.c (warn, complain): New.
16734 * src/conflicts.c (conflicts_print): Use them.
16735 (conflict_report_yacc): New, extracted from...
16736 (conflicts_print): here.
16737 * tests/conflicts.at, tests/existing.at: Adjust.
16738
16739 2002-07-30 Akim Demaille <akim@epita.fr>
16740
16741 Report rules which are never reduced by the parser: those hidden
16742 by conflicts.
16743
16744 * src/LR0.c (save_reductions): Don't make the final state too
16745 different: save its reduction (accept) instead of having a state
16746 without any action (no shift or goto, no reduce).
16747 Note: the final state is now a ``regular'' state, i.e., the
16748 parsers now contain `reduce 0' as default reduction.
16749 Nevertheless, since they decide to `accept' when yystate =
16750 final_state, they still will not reduce rule 0.
16751 * src/print.c (print_actions, print_reduction): Adjust.
16752 * src/output.c (action_row): Track reduced rules.
16753 (token_actions): Report rules never reduced.
16754 * tests/conflicts.at, tests/regression.at: Adjust.
16755
16756 2002-07-30 Akim Demaille <akim@epita.fr>
16757
16758 `stage' was accidently included in a previous patch.
16759 Initiate its autoconfiscation.
16760
16761 * configure.in: Look for malloc.h and sys/times.h.
16762 * src/main.c (stage): Adjust.
16763 Report only when trace_flag.
16764
16765 2002-07-29 Akim Demaille <akim@epita.fr>
16766
16767 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
16768 state_number_t.
16769 (errs_t): symbol_t*, not symbol_number_t.
16770 (reductions_t): rule_t*, not rule_number_t.
16771 (FOR_EACH_SHIFT): New.
16772 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
16773 * src/print.c, src/print_graph.c: Adjust.
16774
16775 2002-07-29 Akim Demaille <akim@epita.fr>
16776
16777 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
16778
16779 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
16780 (endtoken, accept): these.
16781 * src/reader.c (reader): Set endtoken's default tag to "$end".
16782 Set undeftoken's tag to "$undefined" instead of "$undefined.".
16783 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
16784 Adjust.
16785
16786 2002-07-29 Akim Demaille <akim@epita.fr>
16787
16788 * src/reduce.c (reduce_grammar): When the language is empty,
16789 complain about the start symbol, not the axiom.
16790 Use its location.
16791 * tests/reduce.at (Empty Language): New.
16792
16793 2002-07-26 Akim Demaille <akim@epita.fr>
16794
16795 * src/reader.h, src/reader.c (gram_error): ... can't get
16796 yycontrol without making too strong assumptions on the parser
16797 itself.
16798 * src/output.c (prepare_tokens): Use the real 0th value of
16799 token_translations instead of `0'.
16800 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
16801 visible here.
16802 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
16803 for the time being: %locations ought to provide it to yyerror.
16804
16805 2002-07-25 Akim Demaille <akim@epita.fr>
16806
16807 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
16808 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
16809 * tests/regression.at (Web2c Actions): Adjust.
16810
16811 2002-07-25 Akim Demaille <akim@epita.fr>
16812
16813 Stop storing rules from 1 to nrules + 1.
16814
16815 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
16816 * src/nullable.c, src/output.c, src/print.c, src/reader.c
16817 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
16818 Iterate from 0 to nrules.
16819 Use rule_number_as_item_number and item_number_as_rule_number.
16820 Adjust to `derive' now containing possibly 0.
16821 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
16822 Handle the `- 1' part in rule numbers from/to item numbers.
16823 * src/conflicts.c (log_resolution): Fix the message which reversed
16824 shift and reduce.
16825 * src/output.c (action_row): Initialize default_rule to -1.
16826 (token_actions): Adjust.
16827 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
16828 expected output.
16829 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
16830
16831 2002-07-25 Akim Demaille <akim@epita.fr>
16832
16833 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
16834 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
16835 (b4_c_knr_arg_decl): New.
16836 * data/yacc.c: Use it to define yysymprint, yydestruct, and
16837 yyreport_parse_error.
16838
16839 2002-07-25 Akim Demaille <akim@epita.fr>
16840
16841 * data/yacc.c (yyreport_parse_error): New, extracted from...
16842 (yyparse): here.
16843 (yydestruct, yysymprint): Move above yyparse.
16844 Be K&R compliant.
16845
16846 2002-07-25 Akim Demaille <akim@epita.fr>
16847
16848 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
16849 replace...
16850 (b4_sint_type, b4_uint_type): these.
16851 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
16852 * tests/regression.at (Web2c Actions): Adjust.
16853
16854 2002-07-25 Akim Demaille <akim@epita.fr>
16855
16856 * src/gram.h (TIEM_NUMBER_MAX): New.
16857 (item_number_of_rule_number, rule_number_of_item_number): Rename
16858 as...
16859 (rule_number_as_item_number, item_number_as_rule_number): these.
16860 Adjust dependencies.
16861 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
16862 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
16863 (symbol_number_to_vector_number): New.
16864 (order): Of vector_number_t* type.
16865 (base_t, BASE_MAX, BASE_MIN): New.
16866 (froms, tos, width, pos, check): Of base_t type.
16867 (action_number_t, ACTION_MIN, ACTION_MAX): New.
16868 (actrow): Of action_number_t type.
16869 (conflrow): Of unsigned int type.
16870 (table_ninf, base_ninf): New.
16871 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
16872 (muscle_insert_int_table, muscle_insert_base_table)
16873 (muscle_insert_rule_number_table): New.
16874 (prepare_tokens): Output `toknum' as int_table.
16875 (action_row): Returns a rule_number_t.
16876 Use ACTION_MIN, not SHRT_MIN.
16877 (token_actions): yydefact is rule_number_t*.
16878 (table_ninf_remap): New.
16879 (pack_table): Use it for `base' and `table'.
16880 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
16881 replaced with...
16882 (YYPACT_NINF, YYTABLE_NINF): these.
16883 (yypact, yytable): Compute their types instead of hard-coded
16884 `short'.
16885 * tests/regression.at (Web2c Actions): Adjust.
16886
16887 2002-07-19 Akim Demaille <akim@epita.fr>
16888
16889 * src/scan-gram.l (id): Can start with an underscore.
16890
16891 2002-07-16 Akim Demaille <akim@epita.fr>
16892
16893 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
16894 Adjust all former `associativity' dependencies.
16895 * src/symtab.c (symbol_new): Default associativity is `undef', not
16896 `right'.
16897 (symbol_check_alias_consistence): Adjust.
16898
16899 2002-07-09 Akim Demaille <akim@epita.fr>
16900
16901 * doc/bison.texinfo: Properly set the ``header'' part.
16902 Use @dircategory ``GNU programming tools'' as per Texinfo's
16903 documentation.
16904 Use @copying.
16905
16906 2002-07-09 Akim Demaille <akim@epita.fr>
16907
16908 * lib/quotearg.h: Protect against multiple inclusions.
16909 * src/location.h (location_t): Add a `file' member.
16910 (LOCATION_RESET, LOCATION_PRINT): Adjust.
16911 * src/complain.c (warn_at, complain_at, fatal_at): Drop
16912 `error_one_per_line' support.
16913
16914 2002-07-09 Akim Demaille <akim@epita.fr>
16915
16916 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
16917 * src/reader.c (lineno): Remove.
16918 Adjust all dependencies.
16919 (get_merge_function): Take a location and use complain_at.
16920 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
16921 * tests/regression.at (Invalid inputs, Mixing %token styles):
16922 Adjust.
16923
16924 2002-07-09 Akim Demaille <akim@epita.fr>
16925
16926 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
16927 recovery rule, and forbid extensions when --yacc.
16928 (gram_error): Use complain_at.
16929 * src/reader.c (reader): Exit if there were parse errors.
16930
16931 2002-07-09 Akim Demaille <akim@epita.fr>
16932
16933 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
16934 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
16935 Reported by R Blake <blakers@mac.com>.
16936
16937 2002-07-09 Akim Demaille <akim@epita.fr>
16938
16939 * data/yacc.c: Output the copyright notive in the header.
16940
16941 2002-07-03 Akim Demaille <akim@epita.fr>
16942
16943 * src/output.c (froms, tos): Are state_number_t.
16944 (save_column): sp, sp1, and sp2 are state_number_t.
16945 (prepare): Rename `final' as `final_state_number', `nnts' as
16946 `nterms_number', `nrules' as `rules_number', `nstates' as
16947 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
16948 unused.
16949 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
16950 * data/lalr1.cc (nsym_): Remove, unused.
16951
16952 2002-07-03 Akim Demaille <akim@epita.fr>
16953
16954 * src/lalr.h, src/lalr.c (goto_number_t): New.
16955 * src/lalr.c (goto_list_t): New.
16956 Propagate them.
16957 * src/nullable.c (rule_list_t): New.
16958 Propagate.
16959 * src/types.h: Remove.
16960
16961 2002-07-03 Akim Demaille <akim@epita.fr>
16962
16963 * src/closure.c (print_fderives): Use rule_rhs_print.
16964 * src/derives.c (print_derives): Use rule_rhs_print.
16965 (rule_list_t): New, replaces `shorts'.
16966 (set_derives): Add comments.
16967 * tests/sets.at (Nullable, Firsts): Adjust.
16968
16969 2002-07-03 Akim Demaille <akim@epita.fr>
16970
16971 * src/output.c (prepare_actions): Free `tally' and `width'.
16972 (prepare_actions): Allocate and free `order'.
16973 * src/symtab.c (symbols_free): Free `symbols'.
16974 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
16975 * src/output.c (m4_invoke): Move to...
16976 * src/scan-skel.l: here.
16977 (<<EOF>>): Close yyout, and free its name.
16978
16979 2002-07-03 Akim Demaille <akim@epita.fr>
16980
16981 Fix some memory leaks, and fix a bug: state 0 was examined twice.
16982
16983 * src/LR0.c (new_state): Merge into...
16984 (state_list_append): this.
16985 (new_states): Merge into...
16986 (generate_states): here.
16987 (set_states): Don't ensure a proper `errs' state member here, do it...
16988 * src/conflicts.c (conflicts_solve): here.
16989 * src/state.h, src/state.c: Comment changes.
16990 (state_t): Rename member `shifts' as `transitions'.
16991 Adjust all dependencies.
16992 (errs_new): For consistency, also take the values as argument.
16993 (errs_dup): Remove.
16994 (state_errs_set): New.
16995 (state_reductions_set, state_transitions_set): Assert that no
16996 previous value was assigned.
16997 (state_free): New.
16998 (states_free): Use it.
16999 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
17000 temporary storage: use `errs' and `nerrs' as elsewhere.
17001 (set_conflicts): Allocate and free this `errs'.
17002
17003 2002-07-02 Akim Demaille <akim@epita.fr>
17004
17005 * lib/libiberty.h: New.
17006 * lib: Update the bitset implementation from upstream.
17007 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
17008 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
17009 * src/main.c: Adjust bitset stats calls.
17010
17011 2002-07-01 Paul Eggert <eggert@twinsun.com>
17012
17013 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
17014 char, so that negative chars don't collide with $.
17015
17016 2002-06-30 Akim Demaille <akim@epita.fr>
17017
17018 Have the GLR tests be `warning' checked, and fix the warnings.
17019
17020 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
17021 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
17022 (yyremoveDeletes): `yyi' and `yyj' are size_t.
17023 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
17024 (yyaddDeferredAction): static.
17025 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
17026 (yyreportParseError): yyprefix is const.
17027 yytokenp is used only when verbose.
17028 (yy__GNUC__): Replace with __GNUC__.
17029 (yypdumpstack): yyi is size_t.
17030 (yypreference): Un-yy local variables and arguments, to avoid
17031 clashes with `yyr1'. Anyway, we are not in the user name space.
17032 (yytname_size): be an int, as is compared with ints.
17033 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
17034 Use them.
17035 * tests/cxx-gram.at: Use quotation to protect $1.
17036 Use AT_COMPILE to enable warnings hunts.
17037 Prototype yylex and yyerror.
17038 `Use' argc.
17039 Include `string.h', not `strings.h'.
17040 Produce and prototype stmtMerge only when used.
17041 yylex takes a location.
17042
17043 2002-06-30 Akim Demaille <akim@epita.fr>
17044
17045 We spend a lot of time in quotearg, in particular when --verbose.
17046
17047 * src/symtab.c (symbol_get): Store a quoted version of the key.
17048 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
17049 Adjust all callers.
17050
17051 2002-06-30 Akim Demaille <akim@epita.fr>
17052
17053 * src/state.h (reductions_t): Rename member `nreds' as num.
17054 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
17055 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
17056
17057 2002-06-30 Akim Demaille <akim@epita.fr>
17058
17059 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
17060 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
17061 (shifts_to): Rename as...
17062 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
17063 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
17064 (TRANSITION_IS_DISABLED, transitions_to): these.
17065
17066 2002-06-30 Akim Demaille <akim@epita.fr>
17067
17068 * src/print.c (print_shifts, print_gotos): Merge into...
17069 (print_transitions): this.
17070 (print_transitions, print_errs, print_reductions): Align the
17071 lookaheads columns.
17072 (print_core, print_transitions, print_errs, print_state,
17073 print_grammar): Output empty lines separator before, not after.
17074 (state_default_rule_compute): Rename as...
17075 (state_default_rule): this.
17076 * tests/conflicts.at (Defaulted Conflicted Reduction),
17077 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
17078 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
17079
17080 2002-06-30 Akim Demaille <akim@epita.fr>
17081
17082 Display items as we display rules.
17083
17084 * src/gram.h, src/gram.c (rule_lhs_print): New.
17085 * src/gram.c (grammar_rules_partial_print): Use it.
17086 * src/print.c (print_core): Likewise.
17087 * tests/conflicts.at (Defaulted Conflicted Reduction),
17088 (Unresolved SR Conflicts): Adjust.
17089 (Unresolved SR Conflicts): Adjust and rename as...
17090 (Resolved SR Conflicts): this, as was meant.
17091 * tests/regression.at (Web2c Report): Adjust.
17092
17093 2002-06-30 Akim Demaille <akim@epita.fr>
17094
17095 * src/print.c (state_default_rule_compute): New, extracted from...
17096 (print_reductions): here.
17097 Pessimize, but clarify the code.
17098 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
17099
17100 2002-06-30 Akim Demaille <akim@epita.fr>
17101
17102 * src/output.c (action_row): Let default_rule be always a rule
17103 number.
17104
17105 2002-06-30 Akim Demaille <akim@epita.fr>
17106
17107 * src/closure.c (print_firsts, print_fderives, closure):
17108 Use BITSET_EXECUTE.
17109 * src/lalr.c (lookaheads_print): Likewise.
17110 * src/state.c (state_rule_lookaheads_print): Likewise.
17111 * src/print_graph.c (print_core): Likewise.
17112 * src/print.c (print_reductions): Likewise.
17113 * src/output.c (action_row): Likewise.
17114 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
17115
17116 2002-06-30 Akim Demaille <akim@epita.fr>
17117
17118 * src/print_graph.c: Use report_flag.
17119
17120 2002-06-30 Akim Demaille <akim@epita.fr>
17121
17122 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
17123 to...
17124 * src/relation.h, src/relation.c (traverse, relation_digraph)
17125 (relation_print, relation_transpose): New.
17126
17127 2002-06-30 Akim Demaille <akim@epita.fr>
17128
17129 * src/state.h, src/state.c (shifts_to): New.
17130 * src/lalr.c (build_relations): Use it.
17131
17132 2002-06-30 Akim Demaille <akim@epita.fr>
17133
17134 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
17135 (item_number_of_rule_number, rule_number_of_item_number): New.
17136 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
17137 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17138 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
17139 Propagate their use.
17140 Much remains to be done, in particular wrt `shorts' from types.h.
17141
17142 2002-06-30 Akim Demaille <akim@epita.fr>
17143
17144 * src/symtab.c (symbol_new): Initialize the `printer' member.
17145
17146 2002-06-30 Akim Demaille <akim@epita.fr>
17147
17148 * src/LR0.c (save_reductions): Remove, replaced by...
17149 * src/state.h, src/state.c (state_reductions_set): New.
17150 (reductions, errs): Rename as...
17151 (reductions_t, errs_t): these.
17152 Adjust all dependencies.
17153
17154 2002-06-30 Akim Demaille <akim@epita.fr>
17155
17156 * src/LR0.c (state_list_t, state_list_append): New.
17157 (first_state, last_state): Now symbol_list_t.
17158 (this_state): Remove.
17159 (new_itemsets, append_states, save_reductions): Take a state_t as
17160 argument.
17161 (set_states, generate_states): Adjust.
17162 (save_shifts): Remove, replaced by...
17163 * src/state.h, src/state.c (state_shifts_set): New.
17164 (shifts): Rename as...
17165 (shifts_t): this.
17166 Adjust all dependencies.
17167 * src/state.h (state_t): Remove the `next' member.
17168
17169 2002-06-30 Akim Demaille <akim@epita.fr>
17170
17171 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
17172 escaped in slot 0.
17173
17174 2002-06-30 Akim Demaille <akim@epita.fr>
17175
17176 Use hash.h for the state hash table.
17177
17178 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
17179 (allocate_storage): Use state_hash_new.
17180 (free_storage): Use state_hash_free.
17181 (new_state, get_state): Adjust.
17182 * src/lalr.h, src/lalr.c (states): Move to...
17183 * src/states.h (state_t): Remove the `link' member, no longer
17184 used.
17185 * src/states.h, src/states.c: here.
17186 (state_hash_new, state_hash_free, state_hash_lookup)
17187 (state_hash_insert, states_free): New.
17188 * src/states.c (state_table, state_compare, state_hash): New.
17189 * src/output.c (output_actions): Do not free states now, since we
17190 still need to know the final_state number in `prepare', called
17191 afterwards. Do it...
17192 * src/main.c (main): here: call states_free after `output'.
17193
17194 2002-06-30 Akim Demaille <akim@epita.fr>
17195
17196 * src/state.h, src/state.c (state_new): New, extracted from...
17197 * src/LR0.c (new_state): here.
17198 * src/state.h (STATE_ALLOC): Move to...
17199 * src/state.c: here.
17200 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
17201 * src/state.h, src/state.c: here.
17202
17203 2002-06-30 Akim Demaille <akim@epita.fr>
17204
17205 * src/reader.c (gensym): Rename as...
17206 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
17207 (getsym): Rename as...
17208 (symbol_get): this.
17209
17210 2002-06-30 Akim Demaille <akim@epita.fr>
17211
17212 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
17213 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
17214 * src/output.c, src/print.c, src/print_graph.c: Propagate.
17215 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
17216
17217 2002-06-30 Akim Demaille <akim@epita.fr>
17218
17219 Make the test suite pass with warnings checked.
17220
17221 * tests/actions.at (Printers and Destructors): Improve.
17222 Avoid unsigned vs. signed issues.
17223 * tests/calc.at: Don't exercise the scanner here, do it...
17224 * tests/input.at (Torturing the Scanner): here.
17225
17226 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17227
17228 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
17229 reorganize first lines parallel to yacc.c.
17230
17231 2002-06-28 Akim Demaille <akim@epita.fr>
17232
17233 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
17234 (b4_token_enum, b4_token_defines): New, factored from...
17235 * data/lalr1.cc, data/yacc.c, glr.c: here.
17236
17237 2002-06-28 Akim Demaille <akim@epita.fr>
17238
17239 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
17240 unused variables.
17241 * src/output.c (merger_output): static.
17242
17243 2002-06-28 Akim Demaille <akim@epita.fr>
17244
17245 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
17246 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
17247 pacify GCC.
17248 * src/output.c (save_row): Initialize all the variables to pacify GCC.
17249
17250 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17251
17252 Accumulated changelog for new GLR parsing features.
17253
17254 * src/conflicts.c (count_total_conflicts): Change name to
17255 conflicts_total_count.
17256 * src/conflicts.h: Ditto.
17257 * src/output.c (token_actions): Use the new name.
17258 (output_conflicts): Change conflp => conflict_list_heads, and
17259 confl => conflict_list for better readability.
17260 * data/glr.c: Use the new names.
17261 * NEWS: Add self to GLR announcement.
17262
17263 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
17264
17265 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17266 Akim Demaille.
17267
17268 * data/bison.glr: Change name to glr.c
17269 * data/glr.c: Renamed from bison.glr.
17270 * data/Makefile.am: Add glr.c
17271
17272 * src/getargs.c:
17273
17274 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
17275 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
17276
17277 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17278
17279 * data/bison.glr: Be sure to restore the
17280 current #line when returning to the skeleton contents after having
17281 exposed the input file's #line.
17282
17283 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17284
17285 * data/bison.glr: Bring up to date with changes to bison.simple.
17286
17287 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17288
17289 * data/bison.glr: Correct definitions that use b4_prefix.
17290 Various reformatting.
17291 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
17292 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
17293 yytokenp argument; now part of stack.
17294 (yychar): Define to behave as documented.
17295 (yyclearin): Ditto.
17296
17297 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
17298
17299 * src/reader.h: Add declaration for free_merger_functions.
17300
17301 * src/reader.c (merge_functions): New variable.
17302 (get_merge_function): New function.
17303 (free_merger_functions): New function.
17304 (readgram): Check for %prec that is not followed by a symbol.
17305 Handle %dprec and %merge declarations.
17306 (packgram): Initialize dprec and merger fields in rules array.
17307
17308 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
17309 conflict_list_cnt, conflict_list_free): New variables.
17310 (table_grow): Also grow conflict_table.
17311 (prepare_rules): Output dprec and merger tables.
17312 (conflict_row): New function.
17313 (action_row): Output conflict lists for GLR parser. Don't use
17314 default reduction in conflicted states for GLR parser so that there
17315 are spaces for the conflict lists.
17316 (save_row): Also save conflict information.
17317 (token_actions): Allocate conflict list.
17318 (merger_output): New function.
17319 (pack_vector): Pack conflict table, too.
17320 (output_conflicts): New function to output yyconflp and yyconfl.
17321 (output_check): Allocate conflict_tos.
17322 (output_actions): Output conflict tables, also.
17323 (output_skeleton): Output b4_mergers definition.
17324 (prepare): Output b4_max_rhs_length definition.
17325 Use 'bison.glr' as default skeleton for GLR parsers.
17326
17327 * src/gram.c (glr_parser): New flag.
17328 (grammar_free): Call free_merger_functions.
17329
17330 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
17331 all pairs of conflicting reductions, rather than just all tokens
17332 causing conflicts. Needed to size conflict tables.
17333 (conflicts_output): Modify call to count_rr_conflicts for new
17334 interface.
17335 (conflicts_print): Ditto.
17336 (count_total_conflicts): New function.
17337
17338 * src/reader.h (merger_list): New type.
17339 (merge_functions): New variable.
17340
17341 * src/lex.h (tok_dprec, tok_merge): New token types.
17342
17343 * src/gram.h (rule_s): Add dprec and merger fields.
17344 (glr_parser): New flag.
17345
17346 * src/conflicts.h (count_total_conflicts): New function.
17347
17348 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
17349
17350 * doc/bison.texinfo (Generalized LR Parsing): New section.
17351 (GLR Parsers): New section.
17352 (Language and Grammar): Mention GLR parsing.
17353 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
17354 Correct typo ("tge" -> "the").
17355
17356 * data/bison.glr: New skeleton for GLR parsing.
17357
17358 * tests/cxx-gram.at: New tests for GLR parsing.
17359
17360 * tests/testsuite.at: Include cxx-gram.at.
17361
17362 * tests/Makefile.am: Add cxx-gram.at.
17363
17364 * src/parse-gram.y:
17365
17366 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
17367
17368 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
17369
17370 2002-06-27 Akim Demaille <akim@epita.fr>
17371
17372 * src/options.h, src/options.c: Remove.
17373 * src/getargs.c (short_options, long_options): New.
17374
17375 2002-06-27 Akim Demaille <akim@epita.fr>
17376
17377 * data/bison.simple, data/bison.c++: Rename as...
17378 * data/yacc.c, data/lalr1.cc: these.
17379 * doc/bison.texinfo (Environment Variables): Remove.
17380
17381 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
17382
17383 * src/getargs.c (report_argmatch): Initialize strtok().
17384
17385 2002-06-20 Akim Demaille <akim@epita.fr>
17386
17387 * data/bison.simple (b4_symbol_actions): New, replaces...
17388 (b4_symbol_destructor, b4_symbol_printer): these.
17389 (yysymprint): Be sure to call YYPRINT only for tokens, and using
17390 user token numbers.
17391
17392 2002-06-20 Akim Demaille <akim@epita.fr>
17393
17394 * data/bison.simple (yydestructor): Rename as...
17395 (yydestruct): this.
17396
17397 2002-06-20 Akim Demaille <akim@epita.fr>
17398
17399 * src/symtab.h, src/symtab.c (symbol_type_set)
17400 (symbol_destructor_set, symbol_precedence_set): The location is
17401 the last argument.
17402 Adjust all callers.
17403
17404 2002-06-20 Akim Demaille <akim@epita.fr>
17405
17406 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
17407 internals.
17408 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
17409 Takes a location.
17410 * src/symtab.h, src/symtab.c (symbol_class_set)
17411 (symbol_user_token_number_set): Likewise.
17412 Adjust all callers.
17413 Promote complain_at.
17414 * tests/input.at (Type Clashes): Adjust.
17415
17416 2002-06-20 Akim Demaille <akim@epita.fr>
17417
17418 * data/bison.simple (YYLEX): Fix the declaration when
17419 %pure-parser.
17420
17421 2002-06-20 Akim Demaille <akim@epita.fr>
17422
17423 * data/bison.simple (yysymprint): Don't print the token number,
17424 just its name.
17425 * tests/actions.at (Destructors): Rename as...
17426 (Printers and Destructors): this.
17427 Also exercise %printer.
17428
17429 2002-06-20 Akim Demaille <akim@epita.fr>
17430
17431 * data/bison.simple (YYDSYMPRINT): New.
17432 Use it to remove many of the #if YYDEBUG/if (yydebug).
17433
17434 2002-06-20 Akim Demaille <akim@epita.fr>
17435
17436 * src/symtab.h, src/symtab.c (symbol_t): printer and
17437 printer_location are new members.
17438 (symbol_printer_set): New.
17439 * src/parse-gram.y (PERCENT_PRINTER): New token.
17440 Handle its associated rule.
17441 * src/scan-gram.l: Adjust.
17442 (handle_destructor_at, handle_destructor_dollar): Rename as...
17443 (handle_symbol_code_at, handle_symbol_code_dollar): these.
17444 * src/output.c (symbol_printers_output): New.
17445 (output_skeleton): Call it.
17446 * data/bison.simple (yysymprint): New. Cannot be named yyprint
17447 since there are already many grammar files with a user `yyprint'.
17448 Replace the calls to YYPRINT to calls to yysymprint.
17449 * tests/calc.at: Adjust.
17450 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
17451 taking advantage of parser very internal details (stack size!).
17452
17453 2002-06-20 Akim Demaille <akim@epita.fr>
17454
17455 * src/scan-gram.l: Complete the scanner with the missing patterns
17456 to pacify Flex.
17457 Use `quote' and `symbol_tag_get' where appropriate.
17458
17459 2002-06-19 Akim Demaille <akim@epita.fr>
17460
17461 * tests/actions.at (Destructors): Augment to test locations.
17462 * data/bison.simple (yydestructor): Pass it the current location
17463 if locations are enabled.
17464 Prototype only when __STDC__ or C++.
17465 Change the argument names to move into the yy name space: there is
17466 user code here.
17467
17468 2002-06-19 Akim Demaille <akim@epita.fr>
17469
17470 * data/bison.simple (b4_pure_if): New.
17471 Use it instead of #ifdef YYPURE.
17472
17473 2002-06-19 Akim Demaille <akim@epita.fr>
17474
17475 * data/bison.simple (b4_location_if): New.
17476 Use it instead of #ifdef YYLSP_NEEDED.
17477
17478 2002-06-19 Akim Demaille <akim@epita.fr>
17479
17480 Prepare @$ in %destructor, but currently don't bind it in the
17481 skeleton, as %location use is not cleaned up yet.
17482
17483 * src/scan-gram.l (handle_dollar, handle_destructor_at)
17484 (handle_action_at): New.
17485 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
17486 a braced_code_t and a location as additional arguments.
17487 (handle_destructor_dollar): Instead of requiring `b4_eval', just
17488 unquote one when outputting `b4_dollar_dollar'.
17489 Adjust callers.
17490 * data/bison.simple (b4_eval): Remove.
17491 (b4_symbol_destructor): Adjust.
17492 * tests/input.at (Invalid @n): Adjust.
17493
17494 2002-06-19 Zack Weinberg <zack@codesourcery.com>
17495
17496 * doc/bison.texinfo: Document ability to have multiple
17497 prologue sections.
17498
17499 2002-06-18 Akim Demaille <akim@epita.fr>
17500
17501 * src/files.c (compute_base_names): When computing the output file
17502 names from the input file name, strip the directory part.
17503
17504 2002-06-18 Akim Demaille <akim@epita.fr>
17505
17506 * data/bison.simple.new: Comment changes.
17507 Reported by Andreas Schwab.
17508
17509 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
17510
17511 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
17512 there are no `label `yyoverflowlab' defined but not used' warnings
17513 when yyoverflow is defined.
17514
17515 2002-06-18 Akim Demaille <akim@epita.fr>
17516
17517 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
17518 new member.
17519 (symbol_destructor_set): Adjust.
17520 * src/output.c (symbol_destructors_output): Output the destructor
17521 locations.
17522 Output the symbol name.
17523 * data/bison.simple (b4_symbol_destructor): Adjust.
17524
17525 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
17526 and Akim Demaille <akim@epita.fr>
17527
17528 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
17529 what's left on the stack when the error recovery hits EOF.
17530 * tests/actions.at (Destructors): Complete to exercise this case.
17531
17532 2002-06-17 Akim Demaille <akim@epita.fr>
17533
17534 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
17535 arguments is really empty, not only equal to `[]'.
17536 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
17537 member.
17538 (symbol_destructor_set): New.
17539 * src/output.c (symbol_destructors_output): New.
17540 * src/reader.h (brace_code_t, current_braced_code): New.
17541 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
17542 (handle_dollar): Rename as...
17543 (handle_action_dollar): this.
17544 (handle_destructor_dollar): New.
17545 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
17546 (grammar_declaration): Use it.
17547 * data/bison.simple (yystos): Is always defined.
17548 (yydestructor): New.
17549 * tests/actions.at (Destructors): New.
17550 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
17551
17552 2002-06-17 Akim Demaille <akim@epita.fr>
17553
17554 * src/symlist.h, src/symlist.c (symbol_list_length): New.
17555 * src/scan-gram.l (handle_dollar, handle_at): Compute the
17556 rule_length only when needed.
17557 * src/output.c (actions_output, token_definitions_output): Output
17558 the full M4 block.
17559 * src/symtab.c: Don't access directly to the symbol tag, use
17560 symbol_tag_get.
17561 * src/parse-gram.y: Use symbol_list_free.
17562
17563 2002-06-17 Akim Demaille <akim@epita.fr>
17564
17565 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
17566 (symbol_list_prepend, get_type_name): Move to...
17567 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
17568 (symbol_list_prepend, symbol_list_n_type_name_get): here.
17569 Adjust all callers.
17570 (symbol_list_free): New.
17571 * src/scan-gram.l (handle_dollar): Takes a location.
17572 * tests/input.at (Invalid $n): Adjust.
17573
17574 2002-06-17 Akim Demaille <akim@epita.fr>
17575
17576 * src/reader.h, src/reader.c (symbol_list_new): Export it.
17577 (symbol_list_prepend): New.
17578 * src/parse-gram.y (%union): `list' is a new member.
17579 (symbols.1): New, replaces...
17580 (terms_to_prec.1, nterms_to_type.1): these.
17581 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
17582 Take a location as additional argument.
17583 Adjust all callers.
17584
17585 2002-06-15 Akim Demaille <akim@epita.fr>
17586
17587 * src/parse-gram.y: Move %token in the declaration section so that
17588 we don't depend upon CVS Bison.
17589
17590 2002-06-15 Akim Demaille <akim@epita.fr>
17591
17592 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
17593 * src/print.c (print_core): Use it.
17594
17595 2002-06-15 Akim Demaille <akim@epita.fr>
17596
17597 * src/conflicts.c (log_resolution): Accept the rule involved in
17598 the sr conflicts instead of the lookahead number that points to
17599 that rule.
17600 (flush_reduce): Accept the current lookahead vector as argument,
17601 instead of the index in LA.
17602 (resolve_sr_conflict): Accept the current number of lookahead
17603 bitset to consider for the STATE, instead of the index in LA.
17604 (set_conflicts): Adjust.
17605 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
17606
17607 2002-06-15 Akim Demaille <akim@epita.fr>
17608
17609 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17610 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
17611 Adjust all dependencies.
17612 * src/lalr.c (initialize_lookaheads): Split into...
17613 (states_lookaheads_count, states_lookaheads_initialize): these.
17614 (lalr): Adjust.
17615
17616 2002-06-15 Akim Demaille <akim@epita.fr>
17617
17618 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
17619 out of...
17620 (grammar_rules_print): here.
17621 * src/reduce.c (reduce_output): Use it.
17622 * tests/reduce.at (Useless Rules, Reduced Automaton)
17623 (Underivable Rules): Adjust.
17624
17625 2002-06-15 Akim Demaille <akim@epita.fr>
17626
17627 Copy BYacc's nice way to report the grammar.
17628
17629 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
17630 New.
17631 Don't print the rules' location, it is confusing and useless.
17632 (rule_print): Use grammar_rhs_print.
17633 * src/print.c (print_grammar): Use grammar_rules_print.
17634
17635 2002-06-15 Akim Demaille <akim@epita.fr>
17636
17637 Complete and rationalize `useless thing' warnings.
17638
17639 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
17640 (symbol_tag_print): New.
17641 Use them everywhere in place of accessing directly the tag member.
17642 * src/gram.h, src/gram.c (rule_print): New.
17643 Use it where a rule used to be printed `by hand'.
17644 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
17645 (reduce_grammar_tables): Report the useless rules.
17646 (reduce_print): Useless things are a warning, not an error.
17647 Report it as such.
17648 * tests/reduce.at (Useless Nonterminals, Useless Rules):
17649 (Reduced Automaton, Underivable Rules): Adjust.
17650 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
17651 * tests/conflicts.at (Unresolved SR Conflicts)
17652 (Solved SR Conflicts): Adjust.
17653
17654 2002-06-15 Akim Demaille <akim@epita.fr>
17655
17656 Let symbols have a location.
17657
17658 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
17659 (getsym): Adjust.
17660 Adjust all callers.
17661 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
17662 Use location_t, not int.
17663 * src/symtab.c (symbol_check_defined): Take advantage of the
17664 location.
17665 * tests/regression.at (Invalid inputs): Adjust.
17666
17667 2002-06-15 Akim Demaille <akim@epita.fr>
17668
17669 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
17670 (input): Don't try to initialize yylloc here, do it in the
17671 scanner.
17672 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
17673 * src/gram.h (rule_t): Change line and action_line into location
17674 and action_location, of location_t type.
17675 Adjust all dependencies.
17676 * src/location.h, src/location.c (empty_location): New.
17677 * src/reader.h, src/reader.c (grammar_start_symbol_set)
17678 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
17679 (grammar_current_rule_symbol_append)
17680 (grammar_current_rule_action_append): Expect a location as argument.
17681 * src/reader.c (grammar_midrule_action): Adjust to attach an
17682 action's location as dummy symbol location.
17683 * src/symtab.h, src/symtab.c (startsymbol_location): New.
17684 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
17685 the line numbers.
17686
17687 2002-06-14 Akim Demaille <akim@epita.fr>
17688
17689 Grammar declarations may be found in the grammar section.
17690
17691 * src/parse-gram.y (rules_or_grammar_declaration): New.
17692 (declarations): Each declaration may end with a semicolon, not
17693 just...
17694 (grammar_declaration): `"%union"'.
17695 (grammar): Branch to rules_or_grammar_declaration.
17696
17697 2002-06-14 Akim Demaille <akim@epita.fr>
17698
17699 * src/main.c (main): Invoke scanner_free.
17700
17701 2002-06-14 Akim Demaille <akim@epita.fr>
17702
17703 * src/output.c (m4_invoke): Extracted from...
17704 (output_skeleton): here.
17705 Free tempfile.
17706
17707 2002-06-14 Akim Demaille <akim@epita.fr>
17708
17709 * src/parse-gram.y (directives, directive, gram)
17710 (grammar_directives, precedence_directives, precedence_directive):
17711 Rename as...
17712 (declarations, declaration, grammar, grammar_declaration)
17713 (precedence_declaration, precedence_declarator): these.
17714 (symbol_declaration): New.
17715
17716 2002-06-14 Akim Demaille <akim@epita.fr>
17717
17718 * src/files.c (action_obstack): Remove, unused.
17719 (output_obstack): Remove it, and all its dependencies, as it is no
17720 longer needed.
17721 * src/reader.c (epilogue_set): Build the epilogue in the
17722 muscle_obstack.
17723 * src/output.h, src/output.c (muscle_obstack): Move to...
17724 * src/muscle_tab.h, src/muscle_tab.h: here.
17725 (muscle_init): Initialize muscle_obstack.
17726 (muscle_free): New.
17727 * src/main.c (main): Call it.
17728
17729 2002-06-14 Akim Demaille <akim@epita.fr>
17730
17731 * src/location.h: New, extracted from...
17732 * src/reader.h: here.
17733 * src/Makefile.am (noinst_HEADERS): Merge into
17734 (bison_SOURCES): this.
17735 Add location.h.
17736 * src/parse-gram.y: Use location_t instead of Bison's.
17737 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
17738 Use location_t instead of ints.
17739
17740 2002-06-14 Akim Demaille <akim@epita.fr>
17741
17742 * data/bison.simple, data/bison.c++: Be sure to restore the
17743 current #line when returning to the skeleton contents after having
17744 exposed the input file's #line.
17745
17746 2002-06-12 Akim Demaille <akim@epita.fr>
17747
17748 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
17749 eager.
17750 * tests/actions.at (Exotic Dollars): New.
17751
17752 2002-06-12 Akim Demaille <akim@epita.fr>
17753
17754 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
17755 ['"/] too eagerly.
17756 * tests/input.at (Torturing the Scanner): New.
17757
17758 2002-06-11 Akim Demaille <akim@epita.fr>
17759
17760 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
17761 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
17762 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
17763 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
17764 * src/reader.c (reader): Use it.
17765
17766 2002-06-11 Akim Demaille <akim@epita.fr>
17767
17768 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
17769 Adjust all callers.
17770 (scanner_last_string_free): New.
17771
17772 2002-06-11 Akim Demaille <akim@epita.fr>
17773
17774 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
17775 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
17776 (last_string, YY_OBS_FREE): New.
17777 Use them when returning an ID.
17778
17779 2002-06-11 Akim Demaille <akim@epita.fr>
17780
17781 Have Bison grammars parsed by a Bison grammar.
17782
17783 * src/reader.c, src/reader.h (prologue_augment): New.
17784 * src/reader.c (copy_definition): Remove.
17785
17786 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
17787 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
17788 (grammar_current_rule_prec_set, grammar_current_rule_check)
17789 (grammar_current_rule_symbol_append)
17790 (grammar_current_rule_action_append): Export.
17791 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
17792 (symbol_list_action_append): Remove.
17793 Hook the routines from reader.
17794 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17795 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
17796
17797 * src/reader.c (read_declarations): Remove, unused.
17798
17799 * src/parse-gram.y: Handle the epilogue.
17800 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
17801 (grammar_start_symbol_set): this.
17802 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
17803 * src/reader.c (readgram): Remove, unused.
17804 (reader): Adjust to insert eoftoken and axiom where appropriate.
17805
17806 * src/reader.c (copy_dollar): Replace with...
17807 * src/scan-gram.h (handle_dollar): this.
17808 * src/parse-gram.y: Remove `%thong'.
17809
17810 * src/reader.c (copy_at): Replace with...
17811 * src/scan-gram.h (handle_at): this.
17812
17813 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
17814 New.
17815
17816 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
17817 time being.
17818
17819 * src/reader.h, src/reader.c (grammar_rule_end): New.
17820
17821 * src/parse.y (current_type, current_class): New.
17822 Implement `%nterm', `%token' support.
17823 Merge `%term' into `%token'.
17824 (string_as_id): New.
17825 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
17826 type name.
17827
17828 * src/parse-gram.y: Be sure to handle properly the beginning of
17829 rules.
17830
17831 * src/parse-gram.y: Handle %type.
17832 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
17833
17834 * src/parse-gram.y: More directives support.
17835 * src/options.c: No longer handle source directives.
17836
17837 * src/parse-gram.y: Fix %output.
17838
17839 * src/parse-gram.y: Handle %union.
17840 Use the prologue locations.
17841 * src/reader.c (parse_union_decl): Remove.
17842
17843 * src/reader.h, src/reader.c (epilogue_set): New.
17844 * src/parse-gram.y: Use it.
17845
17846 * data/bison.simple, data/bison.c++: b4_stype is now either not
17847 defined, then default to int, or to the contents of %union,
17848 without `union' itself.
17849 Adjust.
17850 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
17851
17852 * src/output.c (actions_output): Don't output braces, as they are
17853 already handled by the scanner.
17854
17855 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
17856 characters to themselves.
17857
17858 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
17859 that the epilogue has a proper #line.
17860
17861 * src/parse-gram.y: Handle precedence/associativity.
17862
17863 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
17864 a terminal.
17865 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
17866 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
17867 at all to define terminals that cannot be emitted.
17868
17869 * src/scan-gram.l: Escape M4 characters.
17870
17871 * src/scan-gram.l: Working properly with escapes in user
17872 strings/characters.
17873
17874 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
17875 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
17876 grammar.
17877 Use more modest sizes, as for the time being the parser does not
17878 release memory, and therefore the process swallows a huge amount
17879 of memory.
17880
17881 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
17882 stricter %token grammar.
17883
17884 * src/symtab.h (associativity): Add `undef_assoc'.
17885 (symbol_precedence_set): Do nothing when passed an undef_assoc.
17886 * src/symtab.c (symbol_check_alias_consistence): Adjust.
17887
17888 * tests/regression.at (Invalid %directive): Remove, as it is now
17889 meaningless.
17890 (Invalid inputs): Adjust to the new error messages.
17891 (Token definitions): The new grammar doesn't allow too many
17892 eccentricities.
17893
17894 * src/lex.h, src/lex.c: Remove.
17895 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
17896 (copy_character, copy_string2, copy_string, copy_identifier)
17897 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
17898 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
17899 (parse_action): Remove.
17900 * po/POTFILES.in: Adjust.
17901
17902 2002-06-11 Akim Demaille <akim@epita.fr>
17903
17904 * src/reader.c (parse_action): Don't store directly into the
17905 rule's action member: return the action as a string.
17906 Don't require `rule_length' as an argument: compute it.
17907 (grammar_current_rule_symbol_append)
17908 (grammar_current_rule_action_append): New, eved out from
17909 (readgram): here.
17910 Remove `action_flag', `rulelength', unused now.
17911
17912 2002-06-11 Akim Demaille <akim@epita.fr>
17913
17914 * src/reader.c (grammar_current_rule_prec_set).
17915 (grammar_current_rule_check): New, eved out from...
17916 (readgram): here.
17917 Remove `xaction', `first_rhs': useless.
17918 * tests/input.at (Type clashes): New.
17919 * tests/existing.at (GNU Cim Grammar): Adjust.
17920
17921 2002-06-11 Akim Demaille <akim@epita.fr>
17922
17923 * src/reader.c (grammar_midrule_action): New, Eved out from
17924 (readgram): here.
17925
17926 2002-06-11 Akim Demaille <akim@epita.fr>
17927
17928 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
17929 New.
17930 (readgram): Use them as replacement of inlined code, crule and
17931 crule1.
17932
17933 2002-06-11 Akim Demaille <akim@epita.fr>
17934
17935 * src/reader.c (grammar_end, grammar_symbol_append): New.
17936 (readgram): Use them.
17937 Make the use of `p' as local as possible.
17938
17939 2002-06-10 Akim Demaille <akim@epita.fr>
17940
17941 GCJ's parser requires the tokens to be defined before the prologue.
17942
17943 * data/bison.simple: Output the token definition before the user's
17944 prologue.
17945 * tests/regression.at (Braces parsing, Duplicate string)
17946 (Mixing %token styles): Check the output from bison.
17947 (Early token definitions): New.
17948
17949 2002-06-10 Akim Demaille <akim@epita.fr>
17950
17951 * src/symtab.c (symbol_user_token_number_set): Don't complain when
17952 assigning twice the same user number to a token, so that we can
17953 use it in...
17954 * src/lex.c (lex): here.
17955 Also use `symbol_class_set' instead of hand written code.
17956 * src/reader.c (parse_assoc_decl): Likewise.
17957
17958 2002-06-10 Akim Demaille <akim@epita.fr>
17959
17960 * src/symtab.c, src/symtab.c (symbol_class_set)
17961 (symbol_user_token_number_set): New.
17962 * src/reader.c (parse_token_decl): Use them.
17963 Use a switch instead of ifs.
17964 Use a single argument.
17965
17966 2002-06-10 Akim Demaille <akim@epita.fr>
17967
17968 Remove `%thong' support as it is undocumented, unused, duplicates
17969 `%token's job, and creates useless e-mail traffic with people who
17970 want to know what it is, why it is undocumented, unused, and
17971 duplicates `%token's job.
17972
17973 * src/reader.c (parse_thong_decl): Remove.
17974 * src/options.c (option_table): Remove "thong".
17975 * src/lex.h (tok_thong): Remove.
17976
17977 2002-06-10 Akim Demaille <akim@epita.fr>
17978
17979 * src/symtab.c, src/symtab.c (symbol_type_set)
17980 (symbol_precedence_set): New.
17981 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17982 (value_components_used): Remove, unused.
17983
17984 2002-06-09 Akim Demaille <akim@epita.fr>
17985
17986 Move symbols handling code out of the reader.
17987
17988 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
17989 (axiom): Move to...
17990 * src/symtab.h, src/symtab.c: here.
17991
17992 * src/gram.c (start_symbol): Remove: use startsymbol->number.
17993 * src/reader.c (startval): Rename as...
17994 * src/symtab.h, src/symtab.c (startsymbol): this.
17995 * src/reader.c: Adjust.
17996
17997 * src/reader.c (symbol_check_defined, symbol_make_alias)
17998 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
17999 (token_translations_init)
18000 Move to...
18001 * src/symtab.c: here.
18002 * src/reader.c (packsymbols): Move to...
18003 * src/symtab.h, src/symtab.c (symbols_pack): here.
18004 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
18005 argument.
18006
18007 2002-06-03 Akim Demaille <akim@epita.fr>
18008
18009 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
18010 then statements.
18011
18012 2002-06-03 Akim Demaille <akim@epita.fr>
18013
18014 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
18015 structs with non literals.
18016 * src/scan-skel.l: never-interactive.
18017 * src/conflicts.c (enum conflict_resolution_e): No trailing
18018 comma.
18019 * src/getargs.c (usage): Split long literal strings.
18020 Reported by Hans Aberg.
18021
18022 2002-05-28 Akim Demaille <akim@epita.fr>
18023
18024 * data/bison.c++: Use C++ ostreams.
18025 (cdebug_): New member.
18026
18027 2002-05-28 Akim Demaille <akim@epita.fr>
18028
18029 * src/output.c (output_skeleton): Be sure to allocate enough room
18030 for `/' _and_ for `\0' in full_skeleton.
18031
18032 2002-05-28 Akim Demaille <akim@epita.fr>
18033
18034 * data/bison.c++: Catch up with bison.simple:
18035 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18036 and Paul Eggert <eggert@twinsun.com>: `error' handing.
18037 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
18038 and popping traces.
18039
18040 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18041
18042 * src/output.c (output_skeleton): Put an explicit path in front of
18043 the skeleton file name, rather than relying on the -I directory,
18044 to partially alleviate effects of having a skeleton file lying around
18045 in the current directory.
18046
18047 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18048
18049 * src/conflicts.c (log_resolution): Correct typo:
18050 obstack_printf should be obstack_fgrow1.
18051
18052 2002-05-26 Akim Demaille <akim@epita.fr>
18053
18054 * src/state.h (state_t): `solved_conflicts' is a new member.
18055 * src/LR0.c (new_state): Set it to 0.
18056 * src/conflicts.h, src/conflicts.c (print_conflicts)
18057 (free_conflicts, solve_conflicts): Rename as...
18058 (conflicts_print, conflicts_free, conflicts_solve): these.
18059 Adjust callers.
18060 * src/conflicts.c (enum conflict_resolution_e)
18061 (solved_conflicts_obstack): New, used by...
18062 (log_resolution): this.
18063 Adjust to attach the conflict resolution to each state.
18064 Complete the description with the precedence/associativity
18065 information.
18066 (resolve_sr_conflict): Adjust.
18067 * src/print.c (print_state): Output its solved_conflicts.
18068 * tests/conflicts.at (Unresolved SR Conflicts)
18069 (Solved SR Conflicts): Exercise --report=all.
18070
18071 2002-05-26 Akim Demaille <akim@epita.fr>
18072
18073 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18074 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18075 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
18076 (token_number_t, item_number_as_token_number)
18077 (token_number_as_item_number, muscle_insert_token_number_table):
18078 Rename as...
18079 (symbol_number_t, item_number_as_symbol_number)
18080 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
18081 these, since it is more appropriate.
18082
18083 2002-05-26 Akim Demaille <akim@epita.fr>
18084
18085 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
18086 `Error:' lines.
18087 * data/bison.simple (yystos) [YYDEBUG]: New.
18088 (yyparse) [YYDEBUG]: Display the symbols which are popped during
18089 error recovery.
18090 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
18091
18092 2002-05-25 Akim Demaille <akim@epita.fr>
18093
18094 * doc/bison.texinfo (Debugging): Split into...
18095 (Tracing): this new section, its former contents, and...
18096 (Understanding): this new section.
18097 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
18098 by...
18099 (report_flag): this.
18100 Adjust all dependencies.
18101 (report_args, report_types, report_argmatch): New.
18102 (usage, getargs): Report/support -r, --report.
18103 * src/options.h
18104 (struct option_table_struct): Rename as..,
18105 (struct option_table_s): this.
18106 Rename the `set_flag' member to `flag' to match with getopt_long's
18107 struct.
18108 * src/options.c (option_table): Split verbose into an entry for
18109 %verbose, and another for --verbose.
18110 Support --report/-r, so remove -r from the obsolete --raw.
18111 * src/print.c: Attach full item sets and lookaheads reports to
18112 report_flag instead of trace_flag.
18113 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
18114
18115 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18116 and Paul Eggert <eggert@twinsun.com>
18117
18118 * data/bison.simple (yyparse): Correct error handling to conform to
18119 POSIX and yacc. Specifically, after syntax error is discovered,
18120 do not reduce further before shifting the error token.
18121 Clean up the code a bit by removing the labels yyerrdefault,
18122 yyerrhandle, yyerrpop.
18123 * NEWS: Document the above.
18124
18125 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18126
18127 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
18128 type; it isn't always big enough, since it doesn't necessarily
18129 include non-terminals.
18130 (yytranslate): Expand definition of yy_token_number_type, so that
18131 the latter can be removed.
18132 (yy_token_number_type): Remove, only one use.
18133 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
18134 don't use TokenNumberType as element type.
18135
18136 * tests/regression.at: Modify expected output to agree with change
18137 to yyr1 and yytranslate.
18138
18139 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
18140
18141 * src/reader.c (parse_action): Use copy_character instead of
18142 obstack_1grow.
18143
18144 2002-05-13 Akim Demaille <akim@epita.fr>
18145
18146 * tests/regression.at (Token definitions): Prototype yylex and
18147 yyerror.
18148
18149 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
18150
18151 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
18152 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
18153 32-bit arithmetic.
18154 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
18155
18156 2002-05-07 Akim Demaille <akim@epita.fr>
18157
18158 * tests/synclines.at: Be sure to prototype yylex and yyerror to
18159 avoid GCC warnings.
18160
18161 2002-05-07 Akim Demaille <akim@epita.fr>
18162
18163 Kill GCC warnings.
18164
18165 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
18166 over the RHS of each rule.
18167 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
18168 * src/state.h (state_t): Member `nitems' is unsigned short.
18169 * src/LR0.c (get_state): Adjust.
18170 * src/reader.c (packgram): Likewise.
18171 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
18172 `Type'.
18173 (muscle_insert_int_table): Remove, unused.
18174 (prepare_rules): Remove `max'.
18175
18176 2002-05-06 Akim Demaille <akim@epita.fr>
18177
18178 * src/closure.c (print_firsts): Display of the symbol tags.
18179 (bitmatrix_print): Move to...
18180 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
18181 here.
18182 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
18183
18184 2002-05-06 Akim Demaille <akim@epita.fr>
18185
18186 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
18187 hash_do_for_each.
18188
18189 2002-05-06 Akim Demaille <akim@epita.fr>
18190
18191 * src/LR0.c (new_state, get_state): Instead of using the global
18192 `kernel_size' and `kernel_base', have two new arguments:
18193 `core_size' and `core'.
18194 Adjust callers.
18195
18196 2002-05-06 Akim Demaille <akim@epita.fr>
18197
18198 * src/reader.c (packgram): No longer end `ritem' with a 0
18199 sentinel: it is not used.
18200
18201 2002-05-05 Akim Demaille <akim@epita.fr>
18202
18203 New experimental feature: display the lookaheads in the report and
18204 graph.
18205
18206 * src/print (print_core): When --trace-flag, display the rules
18207 lookaheads.
18208 * src/print_graph.c (print_core): Likewise.
18209 Swap the arguments.
18210 Adjust caller.
18211
18212 2002-05-05 Akim Demaille <akim@epita.fr>
18213
18214 * tests/torture.at (Many lookaheads): New test.
18215
18216 2002-05-05 Akim Demaille <akim@epita.fr>
18217
18218 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
18219 (GENERATE_MUSCLE_INSERT_TABLE): this.
18220 (output_int_table, output_unsigned_int_table, output_short_table)
18221 (output_token_number_table, output_item_number_table): Replace with...
18222 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
18223 (muscle_insert_short_table, muscle_insert_token_number_table)
18224 (muscle_insert_item_number_table): these.
18225 Adjust all callers.
18226 (prepare_tokens): Don't free `translations', since...
18227 * src/reader.h, src/reader.c (grammar_free): do it.
18228 Move to...
18229 * src/gram.h, src/gram.c (grammar_free): here.
18230 * data/bison.simple, data/bison.c++: b4_token_number_max is now
18231 b4_translate_max.
18232
18233 2002-05-05 Akim Demaille <akim@epita.fr>
18234
18235 * src/output.c (output_unsigned_int_table): New.
18236 (prepare_rules): `i' is unsigned.
18237 `prhs', `rline', `r2' are unsigned int.
18238 Rename muscle `rhs_number_max' as `rhs_max'.
18239 Output muscles `prhs_max', `rline_max', and `r2_max'.
18240 Free rline and r1.
18241 * data/bison.simple, data/bison.c++: Adjust to use these muscles
18242 to compute types instead of constant types.
18243 * tests/regression.at (Web2c Actions): Adjust.
18244
18245 2002-05-04 Akim Demaille <akim@epita.fr>
18246
18247 * src/symtab.h (SALIAS, SUNDEF): Rename as...
18248 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
18249 Adjust dependencies.
18250 * src/output.c (token_definitions_output): Be sure not to output a
18251 `#define 'a'' when fed with `%token 'a' "a"'.
18252 * tests/regression.at (Token definitions): New.
18253
18254 2002-05-03 Paul Eggert <eggert@twinsun.com>
18255
18256 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
18257 for K&R C.
18258
18259 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
18260
18261 * Makefile.am (SUBDIRS): Remove intl.
18262 (EXTRA_DIST): Add config/config.rpath.
18263
18264 2002-05-03 Akim Demaille <akim@epita.fr>
18265
18266 * data/bison.simple (m4_if): Don't output empty enums.
18267 And actually, output valid enum definitions :(.
18268
18269 2002-05-03 Akim Demaille <akim@epita.fr>
18270
18271 * configure.bat: Remove, completely obsolete.
18272 * Makefile.am (EXTRA_DIST): Adjust.
18273 Don't distribute config.rpath...
18274 * config/Makefile.am (EXTRA_DIST): Do it.
18275
18276 2002-05-03 Akim Demaille <akim@epita.fr>
18277
18278 * configure.in (GETTEXT_VERSION): New.
18279 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
18280
18281 2002-05-03 Akim Demaille <akim@epita.fr>
18282
18283 * data/bison.simple (b4_token_enum): New.
18284 (b4_token_defines): Use it to output tokens both as #define and
18285 enums.
18286 Suggested by Paul Eggert.
18287 * src/output.c (token_definitions_output): Don't output spurious
18288 white spaces.
18289
18290 2002-05-03 Akim Demaille <akim@epita.fr>
18291
18292 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18293
18294 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
18295
18296 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
18297 Update the stack class, give a try to deque as the default container.
18298
18299 2002-05-02 Akim Demaille <akim@epita.fr>
18300
18301 * data/bison.simple (yyparse): Do not implement @$ = @1.
18302 (YYLLOC_DEFAULT): Adjust to do it.
18303 * doc/bison.texinfo (Location Default Action): Fix.
18304
18305 2002-05-02 Akim Demaille <akim@epita.fr>
18306
18307 * src/reader.c (parse_braces): Merge into...
18308 (parse_action): this.
18309
18310 2002-05-02 Akim Demaille <akim@epita.fr>
18311
18312 * configure.in (ALL_LINGUAS): Remove.
18313 * po/LINGUAS, hr.po: New.
18314
18315 2002-05-02 Akim Demaille <akim@epita.fr>
18316
18317 Remove the so called hairy (semantic) parsers.
18318
18319 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
18320 * src/gram.h, src/gram.c (semantic_parser): Remove.
18321 (rule_t): Remove the guard and guard_line members.
18322 * src/lex.h (token_t): remove tok_guard.
18323 * src/options.c (option_table): Remove %guard and %semantic_parser
18324 support.
18325 * src/output.c, src/output.h (guards_output): Remove.
18326 (prepare): Adjust.
18327 (token_definitions_output): Don't output the `T'
18328 tokens (???).
18329 (output_skeleton): Don't output the guards.
18330 * src/files.c, src/files.c (attrsfile): Remove.
18331 * src/reader.c (symbol_list): Remove the guard and guard_line
18332 members.
18333 Adjust dependencies.
18334 (parse_guard): Remove.
18335 * data/bison.hairy: Remove.
18336 * doc/bison.texinfo (Environment Variables): Remove occurrences of
18337 BISON_HAIRY.
18338
18339 2002-05-02 Akim Demaille <akim@epita.fr>
18340
18341 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
18342 (parse_guard): Rename the formal argument `stack_offset' as
18343 `rule_length', which is more readable.
18344 Adjust callers.
18345 (copy_at, copy_dollar): Instead of outputting the hard coded
18346 values of $$, $n and so forth, output invocation to b4_lhs_value,
18347 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
18348 Note: this patch partially drops `semantic-parser' support: it
18349 always does `rule_length - n', where semantic parsers ought to
18350 always use `-n'.
18351 * data/bison.simple, data/bison.c++ (b4_lhs_value)
18352 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
18353
18354 2002-05-02 Akim Demaille <akim@epita.fr>
18355
18356 * configure.in (AC_INIT): Bump to 1.49b.
18357 (AM_INIT_AUTOMAKE): Short invocation.
18358
18359 2002-05-02 Akim Demaille <akim@epita.fr>
18360
18361 Version 1.49a.
18362
18363 2002-05-01 Akim Demaille <akim@epita.fr>
18364
18365 * src/skeleton.h: Remove.
18366
18367 2002-05-01 Akim Demaille <akim@epita.fr>
18368
18369 * src/skeleton.h: Fix the #endif.
18370 Reported by Magnus Fromreide.
18371
18372 2002-04-26 Paul Eggert <eggert@twinsun.com>
18373
18374 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
18375 Define if we define YYSTYPE and YYLTYPE, respectively.
18376 (YYCOPY): Fix [] quoting problem in the non-GCC case.
18377
18378 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
18379
18380 * src/scan-skel.l: Postprocess quadrigraphs.
18381
18382 * src/reader.c (copy_character): New function, used to output
18383 single characters while replacing `[' and `]' with quadrigraphs, to
18384 avoid troubles with M4 quotes.
18385 (copy_comment): Output characters with copy_character.
18386 (read_additionnal_code): Likewise.
18387 (copy_string2): Likewise.
18388 (copy_definition): Likewise.
18389
18390 * tests/calc.at: Exercise M4 quoting.
18391
18392 2002-04-25 Akim Demaille <akim@epita.fr>
18393
18394 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
18395 between `!' and the command.
18396 Reported by Paul Eggert.
18397
18398 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
18399
18400 * tests/calc.at: Exercise prologue splitting.
18401
18402 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
18403 `b4_post_prologue' instead of `b4_prologue'.
18404
18405 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
18406 muscles.
18407 (output): Free pre_prologue_obstack and post_prologue_obstack.
18408 * src/files.h, src/files.c (attrs_obstack): Remove.
18409 (pre_prologue_obstack, post_prologue_obstack): New.
18410 * src/reader.c (copy_definition): Add a parameter to specify the
18411 obstack to fill, instead of using attrs_obstack unconditionally.
18412 (read_declarations): Pass pre_prologue_obstack to copy_definition if
18413 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
18414
18415 2002-04-23 Paul Eggert <eggert@twinsun.com>
18416
18417 * data/bison.simple: Remove unnecessary commentary and white
18418 space differences from 1_29-branch.
18419 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
18420
18421 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
18422 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
18423 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
18424 constructors or destructors.
18425
18426 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
18427
18428 2002-04-23 Akim Demaille <akim@epita.fr>
18429
18430 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
18431 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
18432 location with columns.
18433 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
18434 All reported by Paul Eggert.
18435
18436 2002-04-22 Akim Demaille <akim@epita.fr>
18437
18438 * src/reduce.c (dump_grammar): Move to...
18439 * src/gram.h, src/gram.c (grammar_dump): here.
18440 Be sure to separate long item numbers.
18441 Don't read the members of a rule's prec if its nil.
18442
18443 2002-04-22 Akim Demaille <akim@epita.fr>
18444
18445 * src/output.c (table_size, table_grow): New.
18446 (MAXTABLE): Remove, replace uses with table_size.
18447 (pack_vector): Instead of dying when the table is too big, grow it.
18448
18449 2002-04-22 Akim Demaille <akim@epita.fr>
18450
18451 * data/bison.simple (yyr1): Its type is that of a token number.
18452 * data/bison.c++ (r1_): Likewise.
18453 * tests/regression.at (Web2c Actions): Adjust.
18454
18455 2002-04-22 Akim Demaille <akim@epita.fr>
18456
18457 * src/reader.c (token_translations_init): 256 is now the default
18458 value for the error token, i.e., it will be assigned another
18459 number if the user assigned 256 to one of her tokens.
18460 (reader): Don't force 256 to error.
18461 * doc/bison.texinfo (Symbols): Adjust.
18462 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
18463 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
18464 etc. instead of 10, 20, 30 (which was used to `jump' over error
18465 (256) and undefined (2)).
18466
18467 2002-04-22 Akim Demaille <akim@epita.fr>
18468
18469 Propagate more token_number_t.
18470
18471 * src/gram.h (token_number_as_item_number)
18472 (item_number_as_token_number): New.
18473 * src/output.c (GENERATE_OUTPUT_TABLE): New.
18474 Use it to create output_item_number_table and
18475 output_token_number_table.
18476 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
18477 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
18478 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
18479 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
18480
18481 2002-04-22 Akim Demaille <akim@epita.fr>
18482
18483 * src/output.h, src/output.c (get_lines_number): Remove.
18484
18485 2002-04-19 Akim Demaille <akim@epita.fr>
18486
18487 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
18488 as Lex/Flex'.
18489 (Debugging): More details about enabling the debugging features.
18490 (Table of Symbols): Describe $$, $n, @$, and @n.
18491 Suggested by Tim Josling.
18492
18493 2002-04-19 Akim Demaille <akim@epita.fr>
18494
18495 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
18496
18497 2002-04-10 Akim Demaille <akim@epita.fr>
18498
18499 * src/system.h: Rely on HAVE_LIMITS_H.
18500 Suggested by Paul Eggert.
18501
18502 2002-04-09 Akim Demaille <akim@epita.fr>
18503
18504 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
18505 full stderr, and strip it according to the bison options, instead
18506 of composing the error message from different bits.
18507 This makes it easier to check for several error messages.
18508 Adjust all the invocations.
18509 Add an invocation exercising the error token.
18510 Add an invocation demonstrating a stupid error message.
18511 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
18512 Adjust the tests.
18513 Error message are for stderr, not stdout.
18514
18515 2002-04-09 Akim Demaille <akim@epita.fr>
18516
18517 * src/gram.h, src/gram.c (error_token_number): Remove, use
18518 errtoken->number.
18519 * src/reader.c (reader): Don't specify the user token number (2)
18520 for $undefined, as it uselessly prevents using it.
18521 * src/gram.h (token_number_t): Move to...
18522 * src/symtab.h: here.
18523 (state_t.number): Is a token_number_t.
18524 * src/print.c, src/reader.c: Use undeftoken->number instead of
18525 hard coded 2.
18526 (Even though this 2 is not the same as above: the number of the
18527 undeftoken remains being 2, it is its user token number which
18528 might not be 2).
18529 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
18530 `user_token_number_max'.
18531 Output `undef_token_number'.
18532 * data/bison.simple, data/bison.c++: Use them.
18533 Be sure to map invalid yylex return values to
18534 `undef_token_number'. This saves us from gratuitous SEGV.
18535
18536 * tests/conflicts.at (Solved SR Conflicts)
18537 (Unresolved SR Conflicts): Adjust.
18538 * tests/regression.at (Web2c Actions): Adjust.
18539
18540 2002-04-08 Akim Demaille <akim@epita.fr>
18541
18542 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
18543 Adding #line.
18544 Remove the duplicate `typedefs'.
18545 (RhsNumberType): Fix the declaration and various other typos.
18546 Use __ofile__.
18547 * data/bison.simple: Use __ofile__.
18548 * src/scan-skel.l: Handle __ofile__.
18549
18550 2002-04-08 Akim Demaille <akim@epita.fr>
18551
18552 * src/gram.h (item_number_t): New, the type of item numbers in
18553 RITEM. Note that it must be able to code symbol numbers as
18554 positive number, and the negation of rule numbers as negative
18555 numbers.
18556 Adjust all dependencies (pretty many).
18557 * src/reduce.c (rule): Remove this `short *' pointer: use
18558 item_number_t.
18559 * src/system.h (MINSHORT, MAXSHORT): Remove.
18560 Include `limits.h'.
18561 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
18562 (shortcpy): Remove.
18563 (MAXTABLE): Move to...
18564 * src/output.c (MAXTABLE): here.
18565 (prepare_rules): Use output_int_table to output rhs.
18566 * data/bison.simple, data/bison.c++: Adjust.
18567 * tests/torture.at (Big triangle): Move the limit from 254 to
18568 500.
18569 * tests/regression.at (Web2c Actions): Ajust.
18570
18571 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
18572 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
18573 passes, but produces negative #line number, once fixed, GCC is
18574 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
18575 C), it passes.
18576 * src/state.h (state_h): Code input lines on ints, not shorts.
18577
18578 2002-04-08 Akim Demaille <akim@epita.fr>
18579
18580 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
18581 and then the grammar.
18582
18583 2002-04-08 Akim Demaille <akim@epita.fr>
18584
18585 * src/system.h: No longer using strndup.
18586
18587 2002-04-07 Akim Demaille <akim@epita.fr>
18588
18589 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
18590 * src/output.c (output_table_data): Return the longest number.
18591 (prepare_tokens): Output `token_number_max').
18592 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
18593 New.
18594 Use them to define yy_token_number_type/TokenNumberType.
18595 Use this type for yytranslate.
18596 * tests/torture.at (Big triangle): Push the limit from 124 to
18597 253.
18598 * tests/regression.at (Web2c Actions): Adjust.
18599
18600 2002-04-07 Akim Demaille <akim@epita.fr>
18601
18602 * tests/torture.at (Big triangle): New.
18603 (GNU AWK Grammar, GNU Cim Grammar): Move to...
18604 * tests/existing.at: here.
18605
18606 2002-04-07 Akim Demaille <akim@epita.fr>
18607
18608 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
18609 nritems.
18610 Adjust dependencies.
18611
18612 2002-04-07 Akim Demaille <akim@epita.fr>
18613
18614 * src/reader.c: Normalize increments to prefix form.
18615
18616 2002-04-07 Akim Demaille <akim@epita.fr>
18617
18618 * src/reader.c, symtab.c: Remove debugging code.
18619
18620 2002-04-07 Akim Demaille <akim@epita.fr>
18621
18622 Rename all the `bucket's as `symbol_t'.
18623
18624 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
18625 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
18626 * src/symtab.c, src/symtab.h (bucket): Rename as...
18627 (symbol_t): this.
18628 (symbol_list_new, bucket_check_defined, bucket_make_alias)
18629 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
18630 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18631 (buckets_new, buckets_free, buckets_do): Rename as...
18632 (symbol_list_new, symbol_check_defined, symbol_make_alias)
18633 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
18634 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
18635 (symbols_new, symbols_free, symbols_do): these.
18636
18637 2002-04-07 Akim Demaille <akim@epita.fr>
18638
18639 Use lib/hash for the symbol table.
18640
18641 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
18642 EOF.
18643 * src/lex.c (lex): Set the `number' member of new terminals.
18644 * src/reader.c (bucket_check_defined, bucket_make_alias)
18645 (bucket_check_alias_consistence, bucket_translation): New.
18646 (reader, grammar_free, readgram, token_translations_init)
18647 (packsymbols): Adjust.
18648 (reader): Number the predefined tokens.
18649 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
18650 for predefined tokens.
18651 * src/symtab.h (bucket): Remove all the hash table related
18652 members.
18653 * src/symtab.c (symtab): Replace by...
18654 (bucket_table): this.
18655 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
18656 (buckets_new, buckets_do): New.
18657
18658 2002-04-07 Akim Demaille <akim@epita.fr>
18659
18660 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
18661 (start_symbol, max_user_token_number, semantic_parser)
18662 (error_token_number): Initialize.
18663 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
18664 Initialize.
18665 (reader): Don't.
18666 (errtoken, eoftoken, undeftoken, axiom): Extern.
18667
18668 2002-04-07 Akim Demaille <akim@epita.fr>
18669
18670 * src/gram.h (rule_s): prec and precsym are now pointers
18671 to the bucket giving the priority/associativity.
18672 Member `associativity' removed: useless.
18673 * src/reduce.c, src/conflicts.c: Adjust.
18674
18675 2002-04-07 Akim Demaille <akim@epita.fr>
18676
18677 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
18678 Properly escape the symbols' TAG when outputting them.
18679
18680 2002-04-07 Akim Demaille <akim@epita.fr>
18681
18682 * src/lalr.h (LA): Is a bitsetv, not bitset*.
18683
18684 2002-04-07 Akim Demaille <akim@epita.fr>
18685
18686 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
18687 (LArule): this, which is an array to rule_t*.
18688 * src/print.c, src/conflicts.c: Adjust.
18689
18690 2002-04-07 Akim Demaille <akim@epita.fr>
18691
18692 * src/gram.h (rule_t): Rename `number' as `user_number'.
18693 `number' is a new member.
18694 Adjust dependencies.
18695 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
18696
18697 2002-04-07 Akim Demaille <akim@epita.fr>
18698
18699 As a result of the previous patch, it is no longer needed
18700 to reorder ritem itself.
18701
18702 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
18703
18704 2002-04-07 Akim Demaille <akim@epita.fr>
18705
18706 Be sure never to walk through RITEMS, but use only data related to
18707 the rules themselves. RITEMS should be banished.
18708
18709 * src/output.c (output_token_translations): Rename as...
18710 (prepare_tokens): this.
18711 In addition to `translate', prepare the muscles `tname' and
18712 `toknum', which were handled by...
18713 (output_rule_data): this.
18714 Remove, and move the remainder of its outputs into...
18715 (prepare_rules): this new routines, which also merges content from
18716 (output_gram): this.
18717 (prepare_rules): Be sure never to walk through RITEMS.
18718 (output_stos): Rename as...
18719 (prepare_stos): this.
18720 (output): Always invoke prepare_states, after all, just don't use it
18721 in the output if you don't need it.
18722
18723 2002-04-07 Akim Demaille <akim@epita.fr>
18724
18725 * src/LR0.c (new_state): Display `nstates' as the name of the
18726 newly created state.
18727 Adjust to initialize first_state and last_state if needed.
18728 Be sure to distinguish the initial from the final state.
18729 (new_states): Create the itemset of the initial state, and use
18730 new_state.
18731 * src/closure.c (closure): Now that the initial state has its
18732 items properly set, there is no need for a special case when
18733 creating `ruleset'.
18734
18735 As a result, now the rule 0, reducing to $axiom, is visible in the
18736 outputs. Adjust the test suite.
18737
18738 * tests/conflicts.at (Solved SR Conflicts)
18739 (Unresolved SR Conflicts): Adjust.
18740 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
18741 * tests/conflicts.at (S/R in initial): New.
18742
18743 2002-04-07 Akim Demaille <akim@epita.fr>
18744
18745 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
18746 the RHS of the rules.
18747 * src/output.c (output_gram): Likewise.
18748
18749 2002-04-07 Akim Demaille <akim@epita.fr>
18750
18751 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
18752 bucket.
18753 Adjust all dependencies.
18754 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
18755 `number' of the buckets too.
18756 * src/gram.h: Include `symtab.h'.
18757 (associativity): Move to...
18758 * src/symtab.h: here.
18759 No longer include `gram.h'.
18760
18761 2002-04-07 Akim Demaille <akim@epita.fr>
18762
18763 * src/gram.h, src/gram.c (rules_rhs_length): New.
18764 (ritem_longest_rhs): Use it.
18765 * src/gram.h (rule_t): `number' is a new member.
18766 * src/reader.c (packgram): Set it.
18767 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
18768 the end of `rules', and count them out of `nrules'.
18769 (reduce_output, dump_grammar): Adjust.
18770 * src/print.c (print_grammar): It is no longer needed to check for
18771 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
18772 * tests/reduce.at (Reduced Automaton): New test.
18773
18774 2002-04-07 Akim Demaille <akim@epita.fr>
18775
18776 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
18777 lacking `+ 1' to nrules, Bison reported as useless a token if it
18778 was used solely to set the precedence of the last rule...
18779
18780 2002-04-07 Akim Demaille <akim@epita.fr>
18781
18782 * data/bison.c++, data/bison.simple: Don't output the current file
18783 name in #line, to avoid useless diffs between two identical
18784 outputs under different names.
18785
18786 2002-04-07 Akim Demaille <akim@epita.fr>
18787
18788 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
18789 Normalize loops to using `< nrules + 1', not `<= nrules'.
18790
18791 2002-04-07 Akim Demaille <akim@epita.fr>
18792
18793 * TODO: Update.
18794
18795 2002-04-07 Akim Demaille <akim@epita.fr>
18796
18797 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
18798 bucket.value as bucket.number.
18799
18800 2002-04-07 Akim Demaille <akim@epita.fr>
18801
18802 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
18803 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
18804 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
18805 RHS, instead of being an index in RITEMS.
18806
18807 2002-04-04 Paul Eggert <eggert@twinsun.com>
18808
18809 * doc/bison.texinfo: Update copyright date.
18810 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
18811 (Symbols): Warn about running Bison in one character set,
18812 but compiling and/or running in an incompatible one.
18813 Warn about character code 256, too.
18814
18815 2002-04-03 Paul Eggert <eggert@twinsun.com>
18816
18817 * src/bison.data (YYSTACK_ALLOC): Depend on whether
18818 YYERROR_VERBOSE is nonzero, not whether it is defined.
18819
18820 Merge changes from bison-1_29-branch.
18821
18822 2002-03-20 Paul Eggert <eggert@twinsun.com>
18823
18824 Merge fixes from Debian bison_1.34-1.diff.
18825
18826 * configure.in (AC_PREREQ): 2.53.
18827
18828 2002-03-20 Akim Demaille <akim@epita.fr>
18829
18830 * src/conflicts.c (log_resolution): Argument `resolution' is const.
18831
18832 2002-03-19 Paul Eggert <eggert@twinsun.com>
18833
18834 * src/bison.simple (YYCOPY): New macro.
18835 (YYSTACK_RELOCATE): Use it.
18836 Remove Type arg; no longer needed. All callers changed.
18837 (yymemcpy): Remove; no longer needed.
18838
18839 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
18840 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
18841
18842 2002-03-19 Akim Demaille <akim@epita.fr>
18843
18844 Test and fix the #line outputs.
18845
18846 * tests/atlocal.at (GCC): New.
18847 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
18848 (Prologue synch line, %union synch line, Postprologue synch line)
18849 (Action synch line, Epilogue synch line): New tests.
18850 * src/reader.c (parse_union_decl): Define the muscle stype_line.
18851 * data/bison.simple, data/bison.c++: Use it.
18852
18853 2002-03-19 Akim Demaille <akim@epita.fr>
18854
18855 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
18856 (Solved SR Conflicts, %expect not enough, %expect right)
18857 (%expect too much): Move to...
18858 * tests/conflicts.at: this new file.
18859
18860 2002-03-19 Akim Demaille <akim@epita.fr>
18861
18862 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
18863 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
18864 that we can move to enums for instance.
18865 * src/output.c (token_definitions_output): Output a list of
18866 `token-name, token-number' instead of the #define.
18867 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
18868
18869 2002-03-14 Akim Demaille <akim@epita.fr>
18870
18871 Use Gettext 0.11.1.
18872
18873 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
18874
18875 * data/bison.c++: Make the user able to add members to the generated
18876 parser by subclassing.
18877
18878 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
18879
18880 * src/reader.c (read_additionnal_code): `c' should be an integer, not
18881 a character.
18882 Reported by Nicolas Tisserand and Nicolas Burrus.
18883
18884 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18885
18886 * src/reader.c: Warn about lacking semi-colons, do not complain.
18887
18888 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18889
18890 * data/bison.c++: Remove a debug line.
18891
18892 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
18893
18894 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
18895 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
18896 provide a default implementation.
18897
18898 2002-03-04 Akim Demaille <akim@epita.fr>
18899
18900 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
18901 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
18902 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
18903 * tests/semantic.at (Parsing Guards): Similarly.
18904 * src/reader.at (readgram): Complain if the last rule is not ended
18905 with a semi-colon.
18906
18907 2002-03-04 Akim Demaille <akim@epita.fr>
18908
18909 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
18910 * src/closure.c: here.
18911 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
18912 RTC.
18913 * src/warshall.h, src/warshall.c: Remove.
18914 * tests/sets.at (Broken Closure): Adjust.
18915
18916 2002-03-04 Akim Demaille <akim@epita.fr>
18917
18918 * src/output.c (output_skeleton): tempdir is const.
18919 bytes_read is unused.
18920
18921 2002-03-04 Akim Demaille <akim@epita.fr>
18922
18923 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
18924 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
18925 Update.
18926 From Michael Hayes.
18927
18928 2002-03-04 Akim Demaille <akim@epita.fr>
18929
18930 * src/closure.c (closure): `r' is unused.
18931
18932 2002-03-04 Akim Demaille <akim@epita.fr>
18933
18934 * tests/sets.at (Broken Closure): Add the ending `;'.
18935 * src/reader.at (readgram): Complain if a rule is not ended with a
18936 semi-colon.
18937
18938 2002-03-04 Akim Demaille <akim@epita.fr>
18939
18940 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
18941 (count_sr_conflicts): Use bitset_count.
18942 * src/reduce.c (inaccessable_symbols): Ditto.
18943 (bits_size): Remove.
18944 * src/warshall.h, src/warshall.c: Convert to bitsetv.
18945
18946 2002-03-04 Akim Demaille <akim@epita.fr>
18947
18948 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
18949 * src/reduce.c: Remove the `bitset_zero's following the
18950 `bitset_create's, as now it is performed by the latter.
18951
18952 2002-03-04 Akim Demaille <akim@epita.fr>
18953
18954 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
18955 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
18956 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
18957 latest sources from Michael.
18958
18959 2002-03-04 Akim Demaille <akim@epita.fr>
18960
18961 * src/output.c (output): Don't free the grammar.
18962 * src/reader.c (grammar_free): New.
18963 * src/main.c (main): Call it and don't free symtab here.
18964
18965 2002-03-04 Akim Demaille <akim@epita.fr>
18966
18967 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
18968 before returning.
18969 Reported by Benoit Perrot.
18970
18971 2002-03-04 Akim Demaille <akim@epita.fr>
18972
18973 Use bitset operations when possible, not loops over bits.
18974
18975 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
18976 bitset_or.
18977 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
18978 * src/reduce.c (useless_nonterminals): Formatting changes.
18979 * src/warshall.c (TC): Use bitset_or.
18980
18981 2002-03-04 Akim Demaille <akim@epita.fr>
18982
18983 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
18984 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
18985 Ditto.
18986
18987 2002-03-04 Akim Demaille <akim@epita.fr>
18988
18989 * src/lalr.c (F): Now a bitset*.
18990 Adjust all dependencies.
18991
18992 2002-03-04 Akim Demaille <akim@epita.fr>
18993
18994 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
18995 Adjust all dependencies.
18996
18997 2002-03-04 Akim Demaille <akim@epita.fr>
18998
18999 * src/L0.c, src/LR0.h (nstates): Be size_t.
19000 Adjust comparisons (signed vs unsigned).
19001 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
19002 bitset*.
19003 Adjust all dependencies.
19004
19005 2002-03-04 Akim Demaille <akim@epita.fr>
19006
19007 * src/closure.c (firsts): Now, also a bitset.
19008 Adjust all dependencies.
19009 (varsetsize): Remove, now unused.
19010 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
19011
19012 2002-03-04 Akim Demaille <akim@epita.fr>
19013
19014 * src/print.c: Convert to use bitset.h, not hand coded iterations
19015 over ints.
19016
19017 2002-03-04 Akim Demaille <akim@epita.fr>
19018
19019 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
19020
19021 2002-03-04 Akim Demaille <akim@epita.fr>
19022
19023 * src/closure.c (ruleset): Be a bitset.
19024 (rulesetsize): Remove.
19025
19026 2002-03-04 Akim Demaille <akim@epita.fr>
19027
19028 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
19029 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
19030 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
19031 * src/closure.c (fderives): Be an array of bitsets.
19032
19033 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
19034
19035 * data/bison.c++: Merge the two generated headers. Insert a copyright
19036 notice in each output file.
19037
19038 2002-02-28 Akim Demaille <akim@epita.fr>
19039
19040 * data/bison.c++: Copy the prologue of bison.simple to fetch
19041 useful M4 definitions, such as b4_header_guard.
19042
19043 2002-02-25 Akim Demaille <akim@epita.fr>
19044
19045 * src/getargs.c (version): Give the name of the authors, and use a
19046 translator friendly scheme for the bgr
19047 copyright notice.
19048
19049 2002-02-25 Akim Demaille <akim@epita.fr>
19050
19051 * src/output.c (header_output): Remove, now handled completely via
19052 M4.
19053
19054 2002-02-25 Akim Demaille <akim@epita.fr>
19055
19056 * m4/m4.m4: New, from CVS Autoconf.
19057 * configure.in: Invoke it.
19058 * src/output.c (output_skeleton): Use its result instead of the
19059 hard coded name.
19060
19061 2002-02-25 Akim Demaille <akim@epita.fr>
19062
19063 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
19064 Fileutils 4.1.5.
19065 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
19066 * src/output.c (output_skeleton): Use mkstemp to create a real
19067 temporary file.
19068 Move the filling of `skeleton' and its muscle to...
19069 (prepare): here.
19070 (output): Move the definition of the prologue muscle to...
19071 (prepare): here.
19072 * src/system.h (DEFAULT_TMPDIR): New.
19073
19074 2002-02-14 Paul Eggert <eggert@twinsun.com>
19075
19076 Remove the support for C++ namespace cleanliness; it was
19077 causing more problems than it was curing, since it didn't work
19078 properly on some nonstandard C++ compilers. This can wait
19079 for a proper C++ parser.
19080
19081 * NEWS: Document this.
19082 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
19083 of C++, as it's treated like C now.
19084 * src/bison.simple (YYSTD): Remove.
19085 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
19086 Treat C++ just like Standard C instead of trying to support
19087 namespace cleanliness.
19088
19089 2002-02-14 Akim Demaille <akim@epita.fr>
19090
19091 * tests/regression.at (else): Adjust to Andreas' change.
19092
19093 2002-02-14 Akim Demaille <akim@epita.fr>
19094
19095 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
19096
19097 2002-02-13 Andreas Schwab <schwab@suse.de>
19098
19099 * src/output.c (output_rule_data): Don't output NULL, it might
19100 not be defined yet.
19101
19102 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
19103
19104 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
19105 (Copyright notice): Update.
19106
19107 2002-02-11 Akim Demaille <akim@epita.fr>
19108
19109 * tests/regression.at (%nonassoc and eof): Don't include
19110 nonportable headers.
19111
19112 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
19113
19114 * data/bison.c++: Correct error recovery. Make the user able to
19115 initialize the starting location.
19116
19117 2002-02-07 Akim Demaille <akim@epita.fr>
19118
19119 * tests/input.at: New.
19120
19121 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19122
19123 * data/bison.c++: Replace some direct m4 expansions by constants. Be
19124 more consistent when naming methods and variables. Put preprocessor
19125 directives around tables only needed for debugging.
19126
19127 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19128
19129 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
19130 C++ parsers.
19131 (yy::b4_name::parse): Use print_.
19132
19133 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19134
19135 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
19136
19137 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
19138
19139 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
19140 C++ parsers.
19141 (yy::b4_name::parse): Build verbose error messages, and use error_.
19142
19143 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
19144
19145 * data/bison.c++: Fix m4 quoting in comments.
19146
19147 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
19148
19149 * data/bison.c++: Adjust the parser code. Fix some muscles that were
19150 not expanded by m4.
19151
19152 2002-02-05 Akim Demaille <akim@epita.fr>
19153
19154 * data/bison.c++: Adjust to the M4 back end.
19155 More is certainly needed.
19156
19157 2002-02-05 Akim Demaille <akim@epita.fr>
19158
19159 Give a try to M4 as a back end.
19160
19161 * lib/readpipe.c: New, from wdiff.
19162 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
19163 BISON_HAIRY.
19164 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
19165 specific values. Now it is m4 that performs the lookup.
19166 * src/parse-skel.y: Remove.
19167 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
19168 * src/output.c (actions_output, guards_output)
19169 (token_definitions_output): No longer keeps track of the output
19170 line number, hence remove the second argument.
19171 (guards_output): Check against the guard member of a rule, not the
19172 action member.
19173 Adjust callers.
19174 (output_skeleton): Don't look for the skeleton location, let m4 do
19175 that.
19176 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
19177 file will be used.
19178 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
19179 (prepare): Given that for the time being changesyntax is not
19180 usable in M4, rename the muscles using `-' to `_'.
19181 Define `defines_flag', `output_parser_name' and `output_header_name'.
19182 * src/output.h (actions_output, guards_output)
19183 (token_definitions_output): Adjust prototypes.
19184 * src/scan-skel.l: Instead of scanning the skeletons, it now
19185 processes the output of m4: `__oline__' and `#output'.
19186 * data/bison.simple: Adjust to be used by M4(sugar).
19187 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
19188 to date.
19189 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
19190 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
19191 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
19192 shamelessly stolen from CVS Autoconf.
19193
19194 2002-02-05 Akim Demaille <akim@epita.fr>
19195
19196 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
19197 * configure.in: Check for the declarations of free and malloc.
19198 * src/muscle_tab.c: Adjust.
19199
19200 2002-02-05 Akim Demaille <akim@epita.fr>
19201
19202 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
19203 which have no values.
19204
19205 2002-02-05 Akim Demaille <akim@epita.fr>
19206
19207 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
19208 * data/: here.
19209
19210 2002-01-29 Paul Eggert <eggert@twinsun.com>
19211
19212 * src/bison.simple (YYSIZE_T): Do not define merely because
19213 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
19214 On some platforms, <alloca.h> does not declare YYSTD (size_t).
19215
19216 2002-01-27 Akim Demaille <akim@epita.fr>
19217
19218 Fix `%nonassoc and eof'.
19219
19220 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
19221 which were not properly copied! Replace
19222 memcpy (res->errs, src->errs, src->nerrs);
19223 with
19224 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
19225 !!!
19226 * tests/regression.at (%nonassoc and eof): Adjust to newest
19227 Autotest: `.' is not in the PATH.
19228
19229 2002-01-27 Akim Demaille <akim@epita.fr>
19230
19231 * tests/sets.at (AT_EXTRACT_SETS): New.
19232 (Nullable): Use it.
19233 (Firsts): New.
19234
19235 2002-01-26 Akim Demaille <akim@epita.fr>
19236
19237 * tests/actions.at, tests/calc.at, tests/headers.at,
19238 * tests/torture.at: Adjust to the newest Autotest which no longer
19239 forces `.' in the PATH.
19240
19241 2002-01-25 Akim Demaille <akim@epita.fr>
19242
19243 * tests/regression.at (%nonassoc and eof): New.
19244 Suggested by Robert Anisko.
19245
19246 2002-01-24 Akim Demaille <akim@epita.fr>
19247
19248 Bison dumps core when trying to complain about broken input files.
19249 Reported by Cris van Pelt.
19250
19251 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
19252 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
19253 into...
19254 (Invalid inputs): Strengthen: exercise parse_percent_token.
19255
19256 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
19257
19258 * src/Makefile.am: Add bison.c++.
19259 * src/bison.c++: New skeleton.
19260
19261 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
19262
19263 * po/it.po: New.
19264
19265 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
19266
19267 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
19268
19269 2002-01-20 Marc Autret <marc@gnu.org>
19270
19271 * src/files.c (compute_output_file_names): Fix
19272
19273 2002-01-20 Marc Autret <marc@gnu.org>
19274
19275 * tests/output.at: New test.
19276 * src/files.c (compute_base_names): Don't map extensions when
19277 the YACC flag is set, use defaults.
19278 Reported by Evgeny Stambulchik.
19279
19280 2002-01-20 Marc Autret <marc@gnu.org>
19281
19282 * src/system.h: Need to define __attribute__ away for non-GCC
19283 compilers as well (i.e., the vendor C compiler).
19284 Suggested by Albert Chin-A-Young.
19285
19286 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
19287
19288 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
19289 canonical definition.
19290 * src/system.h: Use the canonical definition for PARAMS (avoids
19291 a conflict with the macro from lib/hash.h).
19292
19293 2002-01-11 Akim Demaille <akim@epita.fr>
19294
19295 * configure.in: Use AC_FUNC_STRNLEN.
19296 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
19297
19298 2002-01-09 Akim Demaille <akim@epita.fr>
19299
19300 * src/files.c, src/files.h (output_infix): New.
19301 (tab_extension): Remove.
19302 (compute_base_names): Compute the former, drop the latter.
19303 * src/output.c (prepare): Insert the muscles `output-infix', and
19304 `output-suffix'.
19305 * src/parse-skel.y (string, string.1): New.
19306 (section.header): Use it.
19307 (section.yacc): Remove.
19308 (prefix): Remove too.
19309 * src/scan-skel.l: Adjust.
19310 * src/bison.simple, src/bison.hairy: Adjust.
19311
19312 2002-01-09 Akim Demaille <akim@epita.fr>
19313
19314 * configure.in (WERROR_CFLAGS): Compute it.
19315 * src/Makefile.am (CFLAGS): Pass it.
19316 * tests/atlocal.in (CFLAGS): Idem.
19317 * src/files.c: Fix a few warnings.
19318 (get_extension_index): Remove, unused.
19319
19320 2002-01-08 Akim Demaille <akim@epita.fr>
19321
19322 * src/getargs.c (AS_FILE_NAME): New.
19323 (getargs): Use it to convert DOSish file names.
19324 * src/files.c (base_name): Rename as full_base_name to avoid
19325 clashes with `base_name ()'.
19326 (filename_split): New.
19327 (compute_base_names): N-th rewrite, using filename_split.
19328
19329 2002-01-08 Akim Demaille <akim@epita.fr>
19330
19331 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
19332 New, stolen from the Fileutils 4.1.
19333 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
19334 * configure.in: Check for the presence of memrchr, and of its
19335 prototype.
19336
19337 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
19338
19339 * lib/hash.h (__P): Added definition for this macro.
19340 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
19341 BUILT_SOURCES, to ensure they are generated first.
19342 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
19343 %error-verbose to allow bootstrapping with bison 1.30x.
19344
19345 2002-01-06 Akim Demaille <akim@epita.fr>
19346
19347 * src/reader.c (parse_braces): Don't fetch the next char, the
19348 convention is to fetch on entry.
19349 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
19350 'switch' without a following semicolon.
19351 * tests/regression.at (braces parsing): New.
19352
19353 2002-01-06 Akim Demaille <akim@epita.fr>
19354
19355 Bison is dead wrong in its RR conflict reports.
19356
19357 * tests/torture.at (GNU Cim Grammar): New.
19358 * src/conflicts.c (count_rr_conflicts): Fix.
19359
19360 2002-01-06 Akim Demaille <akim@epita.fr>
19361
19362 Creating package.m4 from configure.ac causes too many problems.
19363
19364 * tests/Makefile.am (package.m4): Create it by hand,
19365 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
19366
19367 2002-01-06 Akim Demaille <akim@epita.fr>
19368
19369 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
19370 skeleton.h.
19371
19372 2002-01-04 Paul Eggert <eggert@twinsun.com>
19373
19374 * doc/bison.texinfo (Debugging):
19375 Remove YYSTDERR; it's no longer defined or used.
19376 Also, s/cstdio.h/cstdio/.
19377
19378 2002-01-03 Akim Demaille <akim@epita.fr>
19379
19380 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
19381
19382 2002-01-03 Akim Demaille <akim@epita.fr>
19383
19384 * src/parse-skel.y (process_skeleton): Don't bind the parser's
19385 tracing code to --trace, wait for a better --trace option, with
19386 args.
19387
19388 2002-01-03 Akim Demaille <akim@epita.fr>
19389
19390 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
19391 The ISO C++ standard is extremely clear about it: stderr is
19392 considered a macro, not a regular symbol (see table 94 `Header
19393 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
19394 Therefore std:: does not apply to it. It still does with fprintf.
19395 Also, s/cstdio.h/cstdio/.
19396
19397 2002-01-03 Akim Demaille <akim@epita.fr>
19398
19399 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
19400 for non system headers.
19401
19402 2002-01-02 Akim Demaille <akim@epita.fr>
19403
19404 Equip the skeleton chain with location tracking, runtime trace,
19405 pure parser and scanner.
19406
19407 * src/parse-skel.y: Request a pure parser, locations, and prefix
19408 renaming.
19409 (%union): Having several members with the same type does not help
19410 type mismatches, simplify.
19411 (YYPRINT, yyprint): New.
19412 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
19413 (skel_error): this.
19414 Handle locations.
19415 * src/scan-skel.l: Adjust to these changes.
19416 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
19417 (LOCATION_PRINT, skel_control_t): New.
19418
19419 2001-12-30 Akim Demaille <akim@epita.fr>
19420
19421 * src/parse-skel.y: Get rid of the shift/reduce conflict:
19422 replace `gb' with BLANKS.
19423 * src/scan-skel.l: Adjust.
19424
19425 2001-12-30 Akim Demaille <akim@epita.fr>
19426
19427 * src/system.h: We don't need nor want bcopy.
19428 Throw away MS-DOS crap: we don't need getpid.
19429 * configure.in: We don't need strndup. It was even causing
19430 problems: because Flex includes the headers *before* us,
19431 _GNU_SOURCE is not defined by config.h, and therefore strndup was
19432 not visible.
19433 * lib/xstrndup.c: New.
19434 * src/scan-skel.l: Use it.
19435 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
19436 * src/parse-skel.y: Use %directives instead of #defines.
19437
19438 2001-12-30 Akim Demaille <akim@epita.fr>
19439
19440 * src/skeleton.h: New.
19441 * src/output.c (output_parser, output_master_parser): Remove, dead
19442 code.
19443 * src/output.h (get_lines_number, actions_output, guards_output)
19444 (token_definitions_output): Prototype them.
19445 * src/parse-skel.y: Add the license notice.
19446 Include output.h and skeleton.h.
19447 (process_skeleton): Returns void, and takes a single parameter.
19448 * src/scan-skel.l: Add the license notice.
19449 Include skeleton.h.
19450 Don't use %option yylineno: it seems that then Flex imagines
19451 REJECT has been used, and therefore it won't reallocate its
19452 buffers (which makes no other sense to me than a bug). It results
19453 in warnings for `unused: yy_flex_realloc'.
19454
19455 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
19456
19457 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19458 (MUSCLE_INSERT_PREFIX): ...to there.
19459 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
19460 (MUSCLE_INSERT_PREFIX): Move from here...
19461
19462 * src/bison.hairy: Add a section directive. Put braces around muscle
19463 names. This parser skeleton is still broken, but Bison should not
19464 choke on a bad muscle 'syntax'.
19465 * src/bison.simple: Add a section directive. Put braces around muscle
19466 names.
19467
19468 * src/files.h (strsuffix, stringappend): Add declarations.
19469 (tab_extension): Add declaration.
19470 (short_base_name): Add declaration.
19471
19472 * src/files.c (strsuffix, stringappend): No longer static. These
19473 functions are used in the skeleton parser.
19474 (tab_extension): New.
19475 (compute_base_names): Use the computations done in this function
19476 to guess if the generated parsers should have '.tab' in their
19477 names.
19478 (short_base_name): No longer static.
19479
19480 * src/output.c (output_skeleton): New.
19481 (output): Disable call to output_master_parser, and give a try to
19482 a new skeleton handling system.
19483 (guards_output, actions_output): No longer static.
19484 (token_definitions_output, get_lines_number): No longer static.
19485
19486 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
19487
19488 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
19489 parse-skel.y.
19490
19491 * src/parse-skel.y: New file.
19492 * src/scan-skel.l: New file.
19493
19494 2001-12-29 Akim Demaille <akim@epita.fr>
19495
19496 %name-prefix is broken.
19497
19498 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
19499 Adjust all dependencies.
19500 * tests/headers.at (export YYLTYPE): Strengthen this test: use
19501 %name-prefix.
19502
19503 Renaming yylval but not yylloc is not consistent. Now we do.
19504
19505 * src/bison.simple: Prefix yylloc if used.
19506 * doc/bison.texinfo (Decl Summary): Document that.
19507
19508 2001-12-29 Akim Demaille <akim@epita.fr>
19509
19510 * doc/bison.texinfo: Promote `%long-directive' over
19511 `%long_directive'.
19512 Remove all references to fixed-output-files, yacc is enough.
19513
19514 2001-12-29 Akim Demaille <akim@epita.fr>
19515
19516 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
19517 user prologue. These are defaults.
19518 * tests/actions.at (Mid-rule actions): Make sure the user can
19519 define YYDEBUG and YYERROR_VERBOSE.
19520
19521 2001-12-29 Akim Demaille <akim@epita.fr>
19522
19523 * src/output.c (header_output): Don't forget to export YYLTYPE and
19524 yylloc.
19525 * tests/headers.at (export YYLTYPE): New, make sure it does.
19526 * tests/regression.at (%union and --defines, Invalid CPP headers):
19527 Move to...
19528 * tests/headers.at: here.
19529
19530 2001-12-29 Akim Demaille <akim@epita.fr>
19531
19532 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
19533
19534 2001-12-29 Akim Demaille <akim@epita.fr>
19535
19536 * tests/actions.at (Mid-rule actions): Output on a single line
19537 instead of several.
19538
19539 2001-12-29 Akim Demaille <akim@epita.fr>
19540
19541 * doc/bison.texinfo: Formatting changes.
19542
19543 2001-12-29 Akim Demaille <akim@epita.fr>
19544
19545 Don't store the token defs in a muscle, just be ready to output it
19546 on command. Now possible via `symbols'. Fixes a memory leak.
19547
19548 * src/output.c (token_definitions_output): New.
19549 (output_parser, header_output): Use it.
19550 * src/reader.c (symbols_save): Remove.
19551
19552 2001-12-29 Akim Demaille <akim@epita.fr>
19553
19554 * src/bison.simple: Do not provide a default for YYSTYPE and
19555 YYLTYPE before the user's prologue. Otherwise it's hardly... a
19556 default.
19557
19558 2001-12-29 Akim Demaille <akim@epita.fr>
19559
19560 Mid-rule actions are simply... ignored!
19561
19562 * src/reader.c (readgram): Be sure to attach mid-rule actions to
19563 the empty-rule associated to the dummy symbol, not to the host
19564 rule.
19565 * tests/actions.at (Mid-rule actions): New.
19566
19567 2001-12-29 Akim Demaille <akim@epita.fr>
19568
19569 Memory leak.
19570
19571 * src/reader.c (reader): Free grammar.
19572
19573 2001-12-29 Akim Demaille <akim@epita.fr>
19574
19575 Memory leak.
19576
19577 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
19578 since it allocates it for each state, although only one is needed.
19579 (allocate_storage): Do it here.
19580
19581 2001-12-29 Akim Demaille <akim@epita.fr>
19582
19583 * src/options.h, src/options.c (create_long_option_table): Rename
19584 as...
19585 (long_option_table_new): this, with a clearer prototype.
19586 (percent_table): Remove, unused,
19587 * src/getargs.c (getargs): Adjust.
19588
19589 2001-12-29 Akim Demaille <akim@epita.fr>
19590
19591 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
19592 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
19593 as states.
19594
19595 2001-12-29 Akim Demaille <akim@epita.fr>
19596
19597 * src/lalr.c (build_relations): Rename `states' as `states1'.
19598 Sorry, I don't understand exactly what it is, no better name...
19599
19600 2001-12-29 Akim Demaille <akim@epita.fr>
19601
19602 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
19603 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
19604 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
19605 as rules.
19606
19607 2001-12-29 Akim Demaille <akim@epita.fr>
19608
19609 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
19610 ago.
19611
19612 2001-12-29 Akim Demaille <akim@epita.fr>
19613
19614 * src/reader.c, src/reader.h (user_toknums): Remove.
19615 Adjust all users to use symbols[i]->user_token_number.
19616
19617 2001-12-29 Akim Demaille <akim@epita.fr>
19618
19619 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
19620 Adjust all users to use symbols[i]->prec or ->assoc.
19621
19622 2001-12-29 Akim Demaille <akim@epita.fr>
19623
19624 * src/reader.c, src/reader.h (tags): Remove.
19625 Adjust all users to use symbols[i]->tag.
19626
19627 2001-12-29 Akim Demaille <akim@epita.fr>
19628
19629 * src/gram.h, src/gram.c (symbols): New, similar to state_table
19630 and rule_table.
19631 * src/reader.c (packsymbols): Fill this table.
19632 Drop sprec.
19633 * src/conflicts.c (resolve_sr_conflict): Adjust.
19634 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
19635 single table.
19636 Use symbols[i]->tag instead of tags[i].
19637
19638 2001-12-29 Akim Demaille <akim@epita.fr>
19639
19640 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
19641 In addition, put a comment in there, to replace...
19642 * tests/regression.at (%union and C comments): Remove.
19643
19644 2001-12-29 Akim Demaille <akim@epita.fr>
19645
19646 * tests/regression.at (Web2c Actions): Blindly move the actual
19647 output as expected output. The contents *seem* right to me, but I
19648 can't pretend reading perfectly parser tables... Nonetheless, all
19649 the other tests pass correctly, the table look OK, even though the
19650 presence of `$axiom' is to be noted: AFAICS it is useless (but
19651 harmless).
19652
19653 2001-12-29 Akim Demaille <akim@epita.fr>
19654
19655 * src/reader.c (readgram): Don't add the rule 0 if there were no
19656 rules read. In other words, add it _after_ having performed
19657 grammar sanity checks.
19658 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
19659
19660 2001-12-29 Akim Demaille <akim@epita.fr>
19661
19662 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
19663 visible, and some states have now a different number.
19664
19665 2001-12-29 Akim Demaille <akim@epita.fr>
19666
19667 * src/reader.c (readgram): Bind the initial rule's lineno to that
19668 of the first rule.
19669 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
19670 (Solved SR Conflicts): Adjust rule 0's line number.
19671
19672 2001-12-29 Akim Demaille <akim@epita.fr>
19673
19674 Fix the `GAWK Grammar' failure.
19675
19676 * src/LR0.c (final_state): Initialize to -1 so that we do compute
19677 the reductions of the first state which was mistakenly confused
19678 with the final state because precisely final_state was initialized
19679 to 0.
19680 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
19681 now noticed by Bison.
19682 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
19683 have a reduction on $default.
19684
19685 2001-12-29 Akim Demaille <akim@epita.fr>
19686
19687 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
19688 rule line numbers.
19689 * src/closure.c (print_closure): Likewise.
19690 * src/derives.c (print_derives): Likewise.
19691 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
19692 now.
19693
19694 2001-12-29 Akim Demaille <akim@epita.fr>
19695
19696 * src/lalr.c (lookaheads_print): New.
19697 (lalr): Call it when --trace-flag.
19698 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
19699 are dumped.
19700
19701 2001-12-29 Akim Demaille <akim@epita.fr>
19702
19703 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
19704 when walking through ritem, even via rule->rhs.
19705 * src/reduce.c (dump_grammar, useful_production, reduce_output)
19706 (useful_production, useless_nonterminals): Likewise.
19707 (reduce_grammar_tables): Likewise, plus update nritems.
19708 * src/nullable.c (set_nullable): Likewise.
19709 * src/lalr.c (build_relations): Likewise.
19710 * tests/sets.at (Nullable): Adjust.
19711 Fortunately, now, the $axiom is no longer nullable.
19712
19713 2001-12-29 Akim Demaille <akim@epita.fr>
19714
19715 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
19716 the 0-sentinel.
19717 * src/gram.c (ritem_longest_rhs): Likewise.
19718 * src/reduce.c (nonterminals_reduce): Likewise.
19719 * src/print_graph.c (print_graph): Likewise.
19720 * src/output.c (output_rule_data): Likewise.
19721 * src/nullable.c (set_nullable): Likewise.
19722
19723 2001-12-29 Akim Demaille <akim@epita.fr>
19724
19725 * src/output.c: Comment changes.
19726
19727 2001-12-27 Paul Eggert <eggert@twinsun.com>
19728
19729 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
19730 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
19731 Sparc, as they were causing more porting problems than the
19732 (minor) performance improvement was worth.
19733
19734 Also, catch up with 1.31's YYSTD.
19735
19736 2001-12-27 Akim Demaille <akim@epita.fr>
19737
19738 * src/output.c (output_gram): Rely on nritems, not the
19739 0-sentinel. See below.
19740 Use -1 as separator, not 0.
19741 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
19742 Rely on -1 as separator in yyrhs, instead of 0.
19743 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
19744 twice `Now at end of input', therefore there are two lines less to
19745 expect.
19746
19747 2001-12-27 Akim Demaille <akim@epita.fr>
19748
19749 * tests/regression.at (Unresolved SR Conflicts):
19750 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
19751 below.
19752
19753 2001-12-27 Akim Demaille <akim@epita.fr>
19754
19755 * src/LR0.c (new_state): Recognize the final state by the fact it
19756 is reached by eoftoken.
19757 (insert_start_shifting_state, insert_eof_shifting_state)
19758 (insert_accepting_state, augment_automaton): Remove, since now
19759 these states are automatically computed from the initial state.
19760 (generate_states): Adjust.
19761 * src/print.c: When reporting a rule number to the user, substract
19762 1, so that the axiom rule is rule 0, and the first user rule is 1.
19763 * src/reduce.c: Likewise.
19764 * src/print_graph.c (print_core): For the time being, just as for
19765 the report, depend upon --trace-flags to dump the full set of
19766 items.
19767 * src/reader.c (readgram): Once the grammar read, insert the rule
19768 0: `$axiom: START-SYMBOL $'.
19769 * tests/set.at: Adjust: rule 0 is now displayed, and since the
19770 number of the states has changed (the final state is no longer
19771 necessarily the last), catch up.
19772
19773 2001-12-27 Akim Demaille <akim@epita.fr>
19774
19775 Try to make the use of the eoftoken valid. Given that its value
19776 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
19777 is used instead of > 0 where appropriate, (ii), depend upon nritems
19778 instead of the 0-sentinel.
19779
19780 * src/gram.h, src/gram.c (nritems): New.
19781 Expected to be duplication of nitems, but for the time being...
19782 * src/reader.c (packgram): Assert nritems and nitems are equal.
19783 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
19784 * src/closure.c (print_closure, print_fderives): Likewise.
19785 * src/gram.c (ritem_print): Likewise.
19786 * src/print.c (print_core, print_grammar): Likewise.
19787 * src/print_graph.c: Likewise.
19788
19789 2001-12-27 Akim Demaille <akim@epita.fr>
19790
19791 * src/main.c (main): If there are complains after grammar
19792 reductions, then output the report anyway if requested, then die.
19793 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
19794 * src/reader.c (eoftoken): New.
19795 (parse_token_decl): If the token being defined has value `0', it
19796 is the eoftoken.
19797 (packsymbols): No longer hack `tags' to insert `$' by hand.
19798 Be sure to preserve the value of the eoftoken.
19799 (reader): Make sure eoftoken is defined.
19800 Initialize nsyms to 0: now eoftoken is created just like the others.
19801 * src/print.c (print_grammar): Don't special case the eof token.
19802 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
19803 lie anyway, albeit pleasant.
19804 * tests/calc.at: Exercise error messages with eoftoken.
19805 Change the grammar so that empty input is invalid.
19806 Adjust expectations.
19807 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
19808
19809 2001-12-27 Akim Demaille <akim@epita.fr>
19810
19811 * configure.in: Check the protos of strchr ans strspn.
19812 Replace strchr if needed.
19813 * src/system.h: Provide the protos of strchr, strspn and memchr if
19814 missing.
19815 * lib/strchr.c: New.
19816 * src/reader.c (symbols_save): Use strchr.
19817
19818 2001-12-27 Akim Demaille <akim@epita.fr>
19819
19820 * src/print.c, src/print_graph.c (escape): New.
19821 Use it to quote the TAGS outputs.
19822 * src/print_graph.c (print_state): Now errors are in red, and
19823 reductions in green.
19824 Prefer high to wide: output the state number on a line of its own.
19825
19826 2001-12-27 Akim Demaille <akim@epita.fr>
19827
19828 * src/state.h, src/state.c (reductions_new): New.
19829 * src/LR0.c (set_state_table): Let all the states have a
19830 `reductions', even if reduced to 0.
19831 (save_reductions): Adjust.
19832 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
19833 * src/print.c (print_reductions, print_actions): Adjust.
19834 * src/output.c (action_row): Adjust.
19835
19836 2001-12-27 Akim Demaille <akim@epita.fr>
19837
19838 * src/state.h, src/state.c (errs_new, errs_dup): New.
19839 * src/LR0.c (set_state_table): Let all the states have an errs,
19840 even if reduced to 0.
19841 * src/print.c (print_errs, print_reductions): Adjust.
19842 * src/output.c (output_actions, action_row): Adjust.
19843 * src/conflicts.c (resolve_sr_conflict): Adjust.
19844
19845 2001-12-27 Akim Demaille <akim@epita.fr>
19846
19847 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
19848
19849 2001-12-27 Akim Demaille <akim@epita.fr>
19850
19851 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
19852 * src/print.c: here.
19853 (lookaheadset, shiftset): New, used as additional storage by
19854 print_reductions.
19855 (print_results): Adjust.
19856 (print_shifts, print_gotos, print_errs): New, extracted from...
19857 (print_actions): here.
19858 * src/print_graph.c (print_actions): Remove dead code.
19859
19860 2001-12-27 Akim Demaille <akim@epita.fr>
19861
19862 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
19863 `$n' and `@n'.
19864
19865 2001-12-27 Akim Demaille <akim@epita.fr>
19866
19867 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
19868 (build_relations): Adjust.
19869
19870 2001-12-27 Akim Demaille <akim@epita.fr>
19871
19872 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
19873 duplication.
19874
19875 2001-12-27 Akim Demaille <akim@epita.fr>
19876
19877 * src/reader.c (packgram): Catch nitems overflows.
19878
19879 2001-12-27 Akim Demaille <akim@epita.fr>
19880
19881 * src/files.c, src/files.h (guard_obstack): Remove.
19882 * src/output.c (output): Adjust.
19883 * src/reader.c (parse_braces): New, factoring...
19884 (copy_action, copy_guard): these two which are renamed as...
19885 (parse_action, parse_guard): these.
19886 As a voluntary consequence, using braces around guards is now
19887 mandatory.
19888
19889 2001-12-27 Akim Demaille <akim@epita.fr>
19890
19891 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
19892 * src/reader.c (symbol_list): `guard' and `guard_line' are new
19893 members.
19894 (symbol_list_new): Adjust.
19895 (copy_action): action_line is the first line, not the last.
19896 (copy_guard): Just as for actions, store the `action' only, not
19897 the switch/case/break flesh.
19898 Don't parse the user action that might follow the guard, let...
19899 (readgram): do it, i.e., now, there can be an action after a
19900 guard.
19901 In other words the guard is just explicitly optional.
19902 (packgram): Adjust.
19903 * src/output.c (guards_output): New.
19904 (output_parser): Call it when needed.
19905 (output): Also free the guard and attrs obstacks.
19906 * src/files.c, src/files.h (obstack_save): Remove.
19907 (output_files): Remove.
19908 As a result, if one needs the former `.act' file, using an
19909 appropriate skeleton which requires actions and guards is now
19910 required.
19911 * src/main.c (main): Adjust.
19912 * tests/semantic.at: New.
19913 * tests/regression.at: Use `input.y' as input file name.
19914 Avoid 8+3 problems by requiring input.c when the test needs the
19915 parser.
19916
19917 2001-12-27 Akim Demaille <akim@epita.fr>
19918
19919 * src/reader.c (symbol_list_new): Be sure to initialize all the
19920 fields.
19921
19922 2001-12-27 Akim Demaille <akim@epita.fr>
19923
19924 All the hacks using a final pseudo state are now useless.
19925
19926 * src/LR0.c (set_state_table): state_table holds exactly nstates.
19927 * src/lalr.c (nLA): New.
19928 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
19929 instead of lookaheadsp from the pseudo state (nstate + 1).
19930
19931 2001-12-27 Akim Demaille <akim@epita.fr>
19932
19933 * src/output.c (action_row, token_actions): Use a state_t instead
19934 of a integer, and nlookaheads instead of the following state's
19935 lookaheadsp.
19936
19937 2001-12-27 Akim Demaille <akim@epita.fr>
19938
19939 * src/conflicts.c (log_resolution, flush_shift)
19940 (resolve_sr_conflict, set_conflicts, solve_conflicts)
19941 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
19942 (conflicts_print, print_reductions): Use a state_t instead of an
19943 integer when referring to a state.
19944 As much as possible, depend upon nlookaheads, instead of the
19945 `lookaheadsp' member of the following state (since lookaheads of
19946 successive states are successive, the difference between state n + 1
19947 and n served as the number of lookaheads for state n).
19948 * src/lalr.c (add_lookback_edge): Likewise.
19949 * src/print.c (print_core, print_actions, print_state)
19950 (print_results): Likewise.
19951 * src/print_graph.c (print_core, print_actions, print_state)
19952 (print_graph): Likewise.
19953 * src/conflicts.h: Adjust.
19954
19955 2001-12-27 Akim Demaille <akim@epita.fr>
19956
19957 * src/bison.hairy: Formatting/comment changes.
19958 ANSIfy.
19959 Remove `register' indications.
19960 Add plenty of `static'.
19961
19962 2001-12-27 Akim Demaille <akim@epita.fr>
19963
19964 * src/output.c (prepare): Drop the muscle `ntbase' which
19965 duplicates ntokens.
19966 * src/bison.simple: Formatting/comment changes.
19967 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
19968 is an undocumented synonym.
19969
19970 2001-12-22 Akim Demaille <akim@epita.fr>
19971
19972 * src/output.c (output_table_data): Change the prototype to use
19973 `int' for array ranges: some invocations do pass an int, not a
19974 short.
19975 Reported by Wayne Green.
19976
19977 2001-12-22 Akim Demaille <akim@epita.fr>
19978
19979 Some actions of web2c.y are improperly triggered.
19980 Reported by Mike Castle.
19981
19982 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
19983 * tests/regression.at (Web2c): Rename as...
19984 (Web2c Report): this.
19985 (Web2c Actions): New.
19986
19987 2001-12-22 Akim Demaille <akim@epita.fr>
19988
19989 Reductions in web2c.y are improperly reported.
19990 Reported by Mike Castle.
19991
19992 * src/conflicts.c (print_reductions): Fix.
19993 * tests/regression.at (Web2c): New.
19994
19995 2001-12-18 Akim Demaille <akim@epita.fr>
19996
19997 Some host fail on `assert (!"foo")', which expands to
19998 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
19999 Reported by Nelson Beebee.
20000
20001 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
20002 `#define it_succeeded 0' and `assert (it_succeeded)'.
20003
20004 2001-12-17 Marc Autret <autret_m@epita.fr>
20005
20006 * src/bison.simple: Don't hard code the skeleton line and filename.
20007 * src/output.c (output_parser): Rename 'line' as 'output_line'.
20008 New line counter 'skeleton_line' (skeleton-line muscle).
20009
20010 2001-12-17 Paul Eggert <eggert@twinsun.com>
20011
20012 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
20013 YYDEBUG must be defined to a nonzero value.
20014
20015 * src/bison.simple (yytname): Do not assume that the user defines
20016 YYDEBUG to a properly parenthesized expression.
20017
20018 2001-12-17 Akim Demaille <akim@epita.fr>
20019
20020 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
20021 nlookaheads is a new member.
20022 Adjust all users.
20023 * src/lalr.h (nlookaheads): Remove this orphan declaration.
20024 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
20025 state.
20026
20027 2001-12-17 Akim Demaille <akim@epita.fr>
20028
20029 * src/files.h, src/files.c (open_files, close_files): Remove.
20030 * src/main.c (main): Don't open/close files, nor invoke lex_free,
20031 let...
20032 * src/reader.c (reader): Do it.
20033
20034 2001-12-17 Akim Demaille <akim@epita.fr>
20035
20036 * src/conflicts.c (print_reductions): Formatting changes.
20037
20038 2001-12-17 Akim Demaille <akim@epita.fr>
20039
20040 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
20041 (flush_reduce): New.
20042 (resolve_sr_conflict): Adjust.
20043
20044 2001-12-17 Akim Demaille <akim@epita.fr>
20045
20046 * src/output.c (output_obstack): Be static and rename as...
20047 (format_obstack): this, to avoid any confusion with files.c's
20048 output_obstack.
20049 * src/reader.h (muscle_obstack): Move to...
20050 * src/output.h: here, since it's defined in output.c.
20051
20052 2001-12-17 Akim Demaille <akim@epita.fr>
20053
20054 * src/output.c (action_row, save_column, default_goto)
20055 (sort_actions, matching_state, pack_vector): Better variable
20056 locality.
20057
20058 2001-12-17 Akim Demaille <akim@epita.fr>
20059
20060 * src/output.c: Various formatting changes.
20061
20062 2001-12-17 Akim Demaille <akim@epita.fr>
20063
20064 * src/files.c (output_files): Free the output_obstack.
20065 * src/main.c (main): Call print and print_graph conditionally.
20066 * src/print.c (print): Work unconditionally.
20067 * src/print_graph.c (print_graph): Work unconditionally.
20068 * src/conflicts.c (log_resolution): Output only if verbose_flag.
20069
20070 2001-12-16 Marc Autret <autret_m@epita.fr>
20071
20072 * src/output.c (actions_output): Fix. When we use %no-lines,
20073 there is one less line per action.
20074
20075 2001-12-16 Marc Autret <autret_m@epita.fr>
20076
20077 * src/bison.simple: Remove a useless #line directive.
20078 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
20079 * src/output.c (get_lines_number): New.
20080 (output_parser): Adjust, now takes care about the lines of a
20081 output muscles.
20082 Fix line numbering.
20083 (actions_output): Computes the number of lines taken by actions.
20084 (output_master_parser): Insert new skeleton which is the name of
20085 the output parser file name.
20086
20087 2001-12-15 Marc Autret <autret_m@epita.fr>
20088
20089 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
20090
20091 2001-12-15 Marc Autret <autret_m@epita.fr>
20092
20093 * src/output.c (output_gram): Keep track of the hairy one.
20094
20095 2001-12-15 Akim Demaille <akim@epita.fr>
20096
20097 Make `make distcheck' work.
20098
20099 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
20100 system.h which uses libgettext.h.
20101
20102 2001-12-15 Akim Demaille <akim@epita.fr>
20103
20104 * src/nullable.c (set_nullable): Useless rules must be skipped,
20105 otherwise, since we range over their symbols, we might look at a
20106 nonterminal which no longer ``exists'', i.e., it is not counted in
20107 `nvars', hence we overflow our arrays.
20108
20109 2001-12-15 Akim Demaille <akim@epita.fr>
20110
20111 The header can also be produced directly, without any obstack!
20112 Yahoo!
20113
20114 * src/files.c, src/files.h (defines_obstack): Remove.
20115 (compute_header_macro): Global.
20116 (defines_obstack_save): Remove.
20117 * src/reader.c (parse_union_decl): No longer output to
20118 defines_obstack: its content can be found in the `stype' muscle
20119 anyway.
20120 (output_token_translations): Merge into...
20121 (symbols_output): this.
20122 Rename as...
20123 (symbols_save): this.
20124 (reader): Adjust.
20125 * src/output.c (header_output): New.
20126 (output): Call it.
20127
20128 2001-12-15 Akim Demaille <akim@epita.fr>
20129
20130 * src/reader.c (parse_union_decl): Instead of handling two obstack
20131 simultaneously, use one to define the `stype' muscle, and use the
20132 value of the latter to fill defines_obstack.
20133 (copy_comment): Remove.
20134 (copy_comment2): Work for a single obstack.
20135 Rename as...
20136 (copy_comment): this.
20137
20138 2001-12-15 Akim Demaille <akim@epita.fr>
20139
20140 * src/lex.c, src/lex.h (xgetc): No longer static.
20141 * src/reader.c (parse_union_decl): Revamp.
20142
20143 2001-12-15 Akim Demaille <akim@epita.fr>
20144
20145 Still making progress in separating Bison into (i) input, (ii)
20146 process, (iii) output: now we can directly output the parser file
20147 without using table_obstack at all.
20148
20149 * src/files.c, src/files.h (table_obstack): Bye bye.
20150 (parser_file_name): New.
20151 * src/files.c (compute_output_file_names): Compute it.
20152 * src/output.c (actions_output, output_parser)
20153 (output_master_parser): To a file instead of an obstack.
20154
20155 2001-12-15 Akim Demaille <akim@epita.fr>
20156
20157 Attach actions to rules, instead of pre-outputting them to
20158 actions_obstack.
20159
20160 * src/gram.h (rule_t): action and action_line are new members.
20161 * src/reader.c (symbol_list): Likewise.
20162 (copy_action): Save the actions within the rule.
20163 (packgram): Save them in rule_table.
20164 * src/output.c (actions_output): New.
20165 (output_parser): Use it on `%%actions'.
20166 (output_rule_data): Don't free rule_table.
20167 (output): Do it.
20168 (prepare): Don't save the `action' muscle.
20169 * src/bison.simple: s/%%action/%%actions/.
20170
20171 2001-12-15 Akim Demaille <akim@epita.fr>
20172
20173 * src/reader.c (copy_action): When --yacc, don't append a `;'
20174 to the user action: let it fail if lacking.
20175 Suggested by Arnold Robbins and Tom Tromey.
20176
20177 2001-12-14 Akim Demaille <akim@epita.fr>
20178
20179 * src/lex.c (literalchar): Simply return the char you decoded, non
20180 longer mess around with obstacks and int pointers.
20181 Adjust all callers.
20182
20183 2001-12-14 Akim Demaille <akim@epita.fr>
20184
20185 * src/lex.c (literalchar): Don't escape the special characters,
20186 just decode them, and keep them as char (before, eol was output as
20187 the 2 char string `\n' etc.).
20188 * src/output.c (output_rule_data): Use quotearg to output the
20189 token strings.
20190
20191 2001-12-13 Paul Eggert <eggert@twinsun.com>
20192
20193 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
20194 Do not infringe on the global user namespace when using C++.
20195 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
20196 All uses of `fprintf' and `stderr' changed.
20197
20198 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
20199
20200 2001-12-13 Akim Demaille <akim@epita.fr>
20201
20202 The computation of nullable is broken: it doesn't handle empty
20203 RHS's properly.
20204
20205 * tests/torture.at (GNU AWK Grammar): New.
20206 * tests/sets.at (Nullable): New.
20207 * src/nullable.c (set_nullable): Instead of blindly looping over
20208 `ritems', loop over the rules, and then over their rhs's.
20209
20210 Work around Autotest bugs.
20211
20212 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
20213 frame, because Autotest understand lines starting with a `+' as
20214 traces from the shell. Then, they are not processed properly.
20215 Admittedly an Autotest bug, but we don't have time to wait for
20216 Autotest to catch up.
20217 * tests/regression.at (Broken Closure): Adjust to the new table
20218 frames.
20219 Move to...
20220 * tests/sets.at: here.
20221
20222 2001-12-13 Akim Demaille <akim@epita.fr>
20223
20224 * src/closure.c (closure): Use nrules instead of playing tricks
20225 with BITS_PER_WORD.
20226
20227 2001-12-13 Akim Demaille <akim@epita.fr>
20228
20229 * src/print.c (print_actions): Output the handling of `$' as the
20230 traces do: shifting the token EOF. Before EOF was treated as a
20231 nonterminal.
20232 * tests/regression.at: Adjust some tests.
20233 * src/print_graph.c (print_core): Complete the set of items via
20234 closure. The next-to-final and final states are still unsatisfying,
20235 but that's to be addressed elsewhere.
20236 No longer output the rule numbers, but do output the state number.
20237 A single loop for the shifts + gotos is enough, but picked a
20238 distinct color for each.
20239 (print_graph): Initialize and finalize closure.
20240
20241 2001-12-13 Akim Demaille <akim@epita.fr>
20242
20243 * src/reader.c (readgram): Remove dead code, an strip useless
20244 braces.
20245 (get_type): Remove, unused.
20246
20247 2001-12-12 Akim Demaille <akim@epita.fr>
20248
20249 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
20250 on that of lib/error.c.
20251
20252 2001-12-12 Akim Demaille <akim@epita.fr>
20253
20254 Some hosts don't like `/' in includes.
20255
20256 * src/system.h: Include libgettext.h without qualifying the path.
20257 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
20258 $(top_srcdir).
20259
20260 2001-12-11 Marc Autret <autret_m@epita.fr>
20261
20262 * src/output.c (output_parser): Remove useless muscle.
20263
20264 2001-12-11 Marc Autret <autret_m@epita.fr>
20265
20266 * src/bison.simple: Remove #line just before %%epilogue. It
20267 is now handled in ...
20268 * src/reader.c (read_additionnal_code): Add the output of a
20269 #line for the epilogue.
20270
20271 2001-12-10 Marc Autret <autret_m@epita.fr>
20272
20273 * src/reader.c (copy_definition): Re-use CPP-outed code which
20274 replace precedent remove.
20275 * src/bison.simple: Remove #line before %%prologue because
20276 %%input-line is wrong at this time.
20277
20278 2001-12-10 Marc Autret <autret_m@epita.fr>
20279
20280 * src/reader.c (symbols_output): Clean up.
20281 * src/output.c (output_gram, output): Clean up.
20282
20283 2001-12-10 Akim Demaille <akim@epita.fr>
20284
20285 * src/lalr.c (initialize_lookaheads): New. Extracted from...
20286 * src/LR0.c (set_state_table): here.
20287 * src/lalr.c (lalr): Call it.
20288
20289 2001-12-10 Akim Demaille <akim@epita.fr>
20290
20291 * src/state.h (shifts): Remove the `number' member: shifts are
20292 attached to state, hence no longer need to be labelled with a
20293 state number.
20294
20295 2001-12-10 Akim Demaille <akim@epita.fr>
20296
20297 Now that states have a complete set of members, the linked list of
20298 shifts is useless: just fill directly the state's shifts member.
20299
20300 * src/state.h (shifts): Remove the `next' member.
20301 * src/LR0.c (first_state, last_state): Remove.
20302 Adjust the callers.
20303 (augment_automaton): Don't look for the shifts that must be added
20304 a shift on EOF: it is those of the state we looked for! But now,
20305 since shifts are attached, it is no longer needed to looking
20306 merely by its id: its number.
20307
20308 2001-12-10 Akim Demaille <akim@epita.fr>
20309
20310 * src/LR0.c (augment_automaton): Better variable locality.
20311 Remove an impossible branch: if there is a state corresponding to
20312 the start symbol being shifted, then there is shift for the start
20313 symbol from the initial state.
20314
20315 2001-12-10 Akim Demaille <akim@epita.fr>
20316
20317 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
20318 only when appropriate: when insert_start_shifting_state' is not
20319 invoked.
20320 * tests/regression.at (Rule Line Numbers): Adjust.
20321
20322 2001-12-10 Akim Demaille <akim@epita.fr>
20323
20324 * src/LR0.c (augment_automaton): Now that all states have shifts,
20325 merge the two cases addition shifts to the initial state.
20326
20327 2001-12-10 Akim Demaille <akim@epita.fr>
20328
20329 * src/lalr.c (set_state_table): Move to...
20330 * src/LR0.c: here.
20331 * src/lalr.c (lalr): Don't call it...
20332 * src/LR0.c (generate_states): do it.
20333 * src/LR0.h (first_state): Remove, only the table is used.
20334
20335 2001-12-10 Akim Demaille <akim@epita.fr>
20336
20337 * src/LR0.h (first_shift, first_reduction): Remove.
20338 * src/lalr.c: Don't use first_shift: find shifts through the
20339 states.
20340
20341 2001-12-10 Akim Demaille <akim@epita.fr>
20342
20343 * src/LR0.c: Attach shifts to states as soon as they are
20344 computed.
20345 * src/lalr.c (set_state_table): Instead of assigning shifts to
20346 state, just assert that the mapping was properly done.
20347
20348 2001-12-10 Akim Demaille <akim@epita.fr>
20349
20350 * src/LR0.c (insert_start_shift): Rename as...
20351 (insert_start_shifting_state): this.
20352 (insert_eof_shifting_state, insert_accepting_state): New.
20353 (augment_automaton): Adjust.
20354 Better locality of the variables.
20355 When looking if the start_symbol is shifted from the initial
20356 state, using `while (... symbol != start_symbol ...)' sounds
20357 better than `while (... symbol < start_symbol ...)': If fail
20358 to see how the order between symbols could be relevant!
20359
20360 2001-12-10 Akim Demaille <akim@epita.fr>
20361
20362 * src/getargs.h: Don't declare `spec_name_prefix' and
20363 `spec_file_prefix', declared by src/files.h.
20364 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
20365 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
20366 * src/output.c (prepare): Adjust.
20367 * src/reader.c (symbols_output): Likewise.
20368 * src/vmsgetargs.c: Vaguely adjust, but who cares?
20369
20370 2001-12-10 Akim Demaille <akim@epita.fr>
20371
20372 * src/muscle_tab.c (muscle_init): NULL is a better default than
20373 `"0"'.
20374
20375 2001-12-10 Akim Demaille <akim@epita.fr>
20376
20377 * src/reader.c (reader): Calling symbols_output once is enough.
20378
20379 2001-12-10 Akim Demaille <akim@epita.fr>
20380
20381 Now that states have a complete set of members, the linked list of
20382 reductions is useless: just fill directly the state's reductions
20383 member.
20384
20385 * src/state.h (struct reductions): Remove member `number' and
20386 `next'.
20387 * src/LR0.c (first_reduction, last_reduction): Remove.
20388 (save_reductions): Don't link the new reductions, store them in
20389 this_state.
20390 * src/lalr.c (set_state_table): No need to attach reductions to
20391 states, it's already done.
20392 * src/output.c (output_actions): No longer free the shifts, then
20393 the reductions, then the states: free all the states and their
20394 members.
20395
20396 2001-12-10 Akim Demaille <akim@epita.fr>
20397
20398 * src/options.c (OPTN, DRTV, BOTH): New.
20399 (option_table): Use them.
20400
20401 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
20402 the job of system.h.
20403 * src/options.c: Don't include stdio.h and xalloc.h for the same
20404 reasons.
20405
20406 2001-12-10 Akim Demaille <akim@epita.fr>
20407
20408 * src/output.c (output, prepare): Make sure the values of the
20409 muscles `action' and `prologue' are 0-terminated.
20410
20411 2001-12-10 Akim Demaille <akim@epita.fr>
20412
20413 Clean up GCC warnings.
20414
20415 * src/reader.c (copy_action): `buf' is not used.
20416 (parse_skel_decl): Be static.
20417 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
20418 * src/options.h (create_long_option_table): Have a real prototype.
20419 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
20420 (hash_delete_at): Return const void *.
20421 Adjust casts to preserve the const.
20422
20423 2001-12-10 Akim Demaille <akim@epita.fr>
20424
20425 * configure.in: Require 2.52g.
20426 M4 is not needed, but AUTOM4TE is.
20427 * m4/m4.m4: Remove.
20428 * tests/Makefile.am: Adjust.
20429
20430 2001-12-10 Akim Demaille <akim@epita.fr>
20431
20432 One structure for states is enough, even though theoretically
20433 there are LR(0) states and LALR(1) states.
20434
20435 * src/lalr.h (state_t): Remove.
20436 (state_table): Be state_t **, not state_t *.
20437 * src/state.h (core, CORE_ALLOC): Rename as...
20438 (state_t, STATE_ALLOC): this.
20439 Add the LALR(1) members: shifts, reductions, errs.
20440 * src/LR0.c (state_table): Rename as...
20441 (state_hash): this, to avoid name clashes with the global
20442 `state_table'.
20443 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
20444 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
20445
20446 2001-12-10 Akim Demaille <akim@epita.fr>
20447
20448 Bison dumps core on bash.y.
20449 Reported by Pascal Bart.
20450
20451 * src/warshall.c (bitmatrix_print): New.
20452 (TC): Use it.
20453 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
20454 j must be the outer loop.
20455 * tests/regression.at (Broken Closure): New.
20456
20457 2001-12-05 Akim Demaille <akim@epita.fr>
20458
20459 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
20460 its argument.
20461 Reported by Peter Hamorsky.
20462
20463 2001-12-05 Akim Demaille <akim@epita.fr>
20464
20465 * src/conflicts.c (err_table): Remove.
20466 (resolve_sr_conflict): Adjust.
20467 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
20468 Rename as...
20469 (state_t.reductions, state_t.shifts): this.
20470
20471 2001-12-05 Akim Demaille <akim@epita.fr>
20472
20473 * src/reduce.c (reduce_grammar_tables): No longer disable the
20474 removal of useless rules via CPP but via `if (0)', so that the
20475 compiler still check the code is valid.
20476 For instance, it should have noticed `rline' no longer exists: use
20477 the `line' member of rule_t.
20478 * src/gram.c (dummy, rline): Remove, unused.
20479
20480 2001-12-05 Akim Demaille <akim@epita.fr>
20481
20482 * src/output.c (pack_vector): Use assert, not berror.
20483 * src/main.c (berror): Remove, unused.
20484
20485 2001-12-05 Akim Demaille <akim@epita.fr>
20486
20487 New experimental feature: if --verbose --trace output all the
20488 items of a state, not only its kernel.
20489
20490 * src/print.c (print_core): If `trace_flag', then invoke closure
20491 before outputting the items of the state (print_core is no longer
20492 a correct name them).
20493 (print_results): Invoke new_closure/free_closure if needed.
20494
20495 2001-12-05 Akim Demaille <akim@epita.fr>
20496
20497 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
20498 * src/closure.c, src/closure.h (itemsetsize): Rename as...
20499 (nitemset): for consistency with the rest of the project.
20500
20501 2001-12-05 Akim Demaille <akim@epita.fr>
20502
20503 * src/closure.c (print_closure): Improve.
20504 (closure): Use it for printing input and output.
20505
20506 2001-12-05 Akim Demaille <akim@epita.fr>
20507
20508 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
20509 indexed by nonterminals.
20510
20511 2001-12-05 Akim Demaille <akim@epita.fr>
20512
20513 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
20514 what it was!).
20515 * src/warshall.h: Remove accidental duplication of the content.
20516
20517 2001-12-05 Akim Demaille <akim@epita.fr>
20518
20519 * src/closure.c (set_fderives): De-obfuscate.
20520
20521 2001-12-05 Akim Demaille <akim@epita.fr>
20522
20523 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
20524
20525 2001-12-05 Akim Demaille <akim@epita.fr>
20526
20527 * src/closure.c (set_firsts): De-obfuscate.
20528
20529 2001-12-05 Akim Demaille <akim@epita.fr>
20530
20531 * src/output.c (action_row): De-obfuscate
20532 using the good o' techniques: arrays not pointers, variable
20533 locality, BITISSET, RESETBIT etc.
20534
20535 2001-12-05 Akim Demaille <akim@epita.fr>
20536
20537 Pessimize the code to simplify it: from now on, all the states
20538 have a valid SHIFTS, which NSHIFTS is possibly 0.
20539
20540 * src/LR0.c (shifts_new): Be global and move to..
20541 * src/state.c, src/state.h: here.
20542 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
20543 * src/print_graph: Adjust.
20544
20545 2001-12-05 Akim Demaille <akim@epita.fr>
20546
20547 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
20548 * src/conflicts.c: Use it.
20549 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
20550 incorrectly ``simplified''.
20551
20552 2001-12-05 Akim Demaille <akim@epita.fr>
20553
20554 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
20555 using the good o' techniques: arrays not pointers, variable
20556 locality, BITISSET, RESETBIT etc.
20557
20558 2001-12-05 Akim Demaille <akim@epita.fr>
20559
20560 * src/state.h (SHIFT_SYMBOL): New.
20561 * src/conflicts.c: Use it to deobfuscate.
20562
20563 2001-12-05 Akim Demaille <akim@epita.fr>
20564
20565 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
20566 (print_reductions): De-obfuscate using the good o' techniques:
20567 arrays not pointers, variable locality, BITISSET.
20568
20569 2001-12-05 Akim Demaille <akim@epita.fr>
20570
20571 * src/conflicts.c (print_reductions): Arrays, not pointers.
20572 Use BITISSET.
20573
20574 2001-12-05 Akim Demaille <akim@epita.fr>
20575
20576 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20577
20578 2001-12-05 Akim Demaille <akim@epita.fr>
20579
20580 * src/conflicts.c (print_reductions): Improve variable locality.
20581
20582 2001-12-05 Akim Demaille <akim@epita.fr>
20583
20584 * src/conflicts.c (print_reductions): Pessimize, but clarify.
20585
20586 2001-12-05 Akim Demaille <akim@epita.fr>
20587
20588 * src/conflicts.c (print_reductions): Improve variable locality.
20589
20590 2001-12-05 Akim Demaille <akim@epita.fr>
20591
20592 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
20593 * src/lalr.c: Use them.
20594
20595 2001-12-05 Akim Demaille <akim@epita.fr>
20596
20597 * src/LR0.c (augment_automaton): Formatting changes.
20598 Better variable locality.
20599
20600 2001-12-05 Akim Demaille <akim@epita.fr>
20601
20602 * src/lalr.c (matrix_print): New.
20603 (transpose): Use it.
20604 Use arrays instead of pointers.
20605
20606 2001-12-05 Akim Demaille <akim@epita.fr>
20607
20608 * src/lalr.c (maxrhs): Move to...
20609 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
20610 * src/lalr.c (build_relations): Adjust.
20611
20612 2001-12-05 Akim Demaille <akim@epita.fr>
20613
20614 * src/lalr.c (transpose): Free the memory allocated to the
20615 argument, as it is replaced by the results by the unique caller.
20616 (build_relations): Merely invoke transpose: it handles the memory
20617 deallocation.
20618 Improve variable locality.
20619 Avoid variables used as mere abbreviations.
20620 (compute_lookaheads): Use arrays instead of pointers.
20621
20622 2001-12-05 Akim Demaille <akim@epita.fr>
20623
20624 * src/lalr.c (initialize_F): Improve variable locality.
20625 Avoid variables used as mere abbreviations.
20626
20627 2001-12-05 Akim Demaille <akim@epita.fr>
20628
20629 * src/derives.c (print_derives): Display the ruleno.
20630 * src/lalr.c (initialize_F, transpose): Better variable locality
20631 to improve readability.
20632 Avoid variables used as mere abbreviations.
20633
20634 2001-12-05 Akim Demaille <akim@epita.fr>
20635
20636 * src/lalr.c (traverse): Use arrays instead of pointers.
20637
20638 2001-12-05 Akim Demaille <akim@epita.fr>
20639
20640 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
20641 the handling of squeue.
20642 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20643
20644 2001-12-05 Akim Demaille <akim@epita.fr>
20645
20646 Because useless nonterminals are now kept alive (instead of being
20647 `destroyed'), we now sometimes examine them, and store information
20648 related to them. Hence we need to know their number, and adjust
20649 memory allocations.
20650
20651 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
20652 static.
20653 * src/LR0.c (allocate_itemsets): The memory allocated to
20654 `symbol_count' was used for two different purpose: once to count
20655 the number of occurrences of each symbol, and later reassigned to
20656 `shift_symbol', containing the symbol that can be shifted from a
20657 given state.
20658 Deobfuscate, i.e., allocate, use and free `symbol_count' here
20659 only, and...
20660 (new_itemsets): Allocate `shift_symbol' here.
20661 (allocate_itemsets): symbol_count includes useless nonterminals.
20662 Make room for them.
20663 (free_storage): Use `free', not `XFREE', for pointers that cannot
20664 be null.
20665
20666 2001-12-05 Akim Demaille <akim@epita.fr>
20667
20668 * src/nullable.c (set_nullable): Deobfuscate the handling of
20669 ritem.
20670 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
20671
20672 2001-12-05 Akim Demaille <akim@epita.fr>
20673
20674 * src/gram.c, src/gram.h (ritem_print): New.
20675 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
20676 (This useless function was defined only to work around VMS linkers
20677 that can't handle compilation units with variables only).
20678 * src/reduce.c (dump_grammar): Use it to trace the construction of
20679 ritem.
20680
20681 2001-12-04 Paul Eggert <eggert@twinsun.com>
20682
20683 * src/bison.simple (union yyalloc): Change member names
20684 to be the same as the stack names.
20685 (yyparse): yyptr is now union yyalloc *, not char *.
20686 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
20687 and may generate better code on some machines.
20688 (yystpcpy): Use prototype if __STDC__ is defined, not just
20689 if __cplusplus is defined.
20690
20691 2001-11-30 Akim Demaille <akim@epita.fr>
20692
20693 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
20694 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
20695 Gettext doesn't compile cleanly, and dies with -Werror.
20696 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
20697 Include WARNING_CFLAGS here.
20698 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
20699 before being defined.
20700
20701 2001-11-27 Paul Eggert <eggert@twinsun.com>
20702
20703 * lib/quotearg.h (quotearg_n, quotearg_n_style):
20704 First arg is int, not unsigned.
20705 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
20706 (SIZE_MAX, UINT_MAX): New macros.
20707 (quotearg_n_options): Abort if N is negative.
20708 Avoid overflow check on hosts where size_t is 64 bits and int
20709 is 32 bits, as overflow is impossible there.
20710 Fix off-by-one typo that caused unnecessary reallocation.
20711
20712 2001-11-29 Paul Eggert <eggert@twinsun.com>
20713
20714 Name space cleanup in generated parser.
20715
20716 * doc/bison.texinfo (Bison Parser): Discuss system headers
20717 and their effect on the user name space.
20718
20719 * src/bison.simple:
20720 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
20721 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
20722 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
20723
20724 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
20725 on user names when possible.
20726
20727 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
20728 Simplify test for whather <alloca.h> exists.
20729
20730 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
20731
20732 (<stdio.h>): Include if YYDEBUG.
20733
20734 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
20735 ! defined (yyoverflow) && ! defined (yymemcpy).
20736
20737 (yymemcpy, yyparse): Rename local variables as needed so that
20738 they all begin with 'yy'.
20739
20740 (yystrlen, yystpcpy): New functions.
20741
20742 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
20743 All uses changed.
20744
20745 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
20746 instead of relying on string.h functions. Use YYSTACK_ALLOC
20747 and YYSTACK_FREE instead of malloc and free.
20748
20749 2001-11-30 Akim Demaille <akim@epita.fr>
20750
20751 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
20752 before their first uses.
20753 (YYBISON, YYPURE): Move to the top of the output.
20754
20755 2001-11-30 Akim Demaille <akim@epita.fr>
20756
20757 * tests/reduce.at (Useless Nonterminals): Fix.
20758
20759 2001-11-30 Akim Demaille <akim@epita.fr>
20760
20761 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
20762 if body instead of `;' to pacify GCC's warnings.
20763
20764 2001-11-30 Akim Demaille <akim@epita.fr>
20765
20766 Instead of mapping the LHS of unused rules to -1, keep the LHS
20767 valid, but flag the rules as invalid.
20768
20769 * src/gram.h (rule_t): `useful' is a new member.
20770 * src/print.c (print_grammar): Adjust.
20771 * src/derives.c (set_derives): Likewise.
20772 * src/reader.c (packgram, reduce_output): Likewise.
20773 * src/reduce.c (reduce_grammar_tables): Likewise.
20774 * tests/reduce.at (Underivable Rules, Useless Rules): New.
20775
20776 2001-11-30 Akim Demaille <akim@epita.fr>
20777
20778 * src/reduce.c (reduce_output): Formatting changes.
20779 * src/print.c (print_results, print_grammar): Likewise.
20780 * tests/regression.at (Rule Line Numbers)
20781 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
20782
20783 2001-11-30 Akim Demaille <akim@epita.fr>
20784
20785 * src/reduce.c (nonterminals_reduce): Instead of throwing away
20786 useless nonterminals, move them at the end of the symbol arrays.
20787 (reduce_output): Adjust.
20788 * tests/reduce.at (Useless Nonterminals): Adjust.
20789
20790 2001-11-30 Akim Demaille <akim@epita.fr>
20791
20792 * src/reduce.c: Various comment/formatting changes.
20793 (nonterminals_reduce): New, extracted from...
20794 (reduce_grammar_tables): here.
20795 (reduce_grammar): Call nonterminals_reduce.
20796
20797 2001-11-29 Paul Eggert <eggert@twinsun.com>
20798
20799 * src/bison.simple (YYSTACK_REALLOC): Remove.
20800 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
20801 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
20802 New macros.
20803 (union yyalloc): New type.
20804 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
20805 an arbitrary restriction on hosts where size_t is wider than int.
20806
20807 (yyparse): Don't dump core if alloca or malloc fails; instead, report
20808 a parser stack overflow. Allocate just one block of memory for all
20809 three stacks, instead of allocating three blocks; this typically is
20810 faster and reduces fragmentation.
20811
20812 Do not limit the number of items in the stack to a value that fits
20813 in 'int', as this is an arbitrary limit on hosts with 64-bit
20814 size_t and 32-bit int.
20815
20816 2001-11-29 Marc Autret <autret_m@epita.fr>
20817
20818 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
20819 of defining YYERROR_VERBOSE.
20820 [AT_DATA]: $4 is now out of C declarations in the prologue.
20821
20822 2001-11-28 Marc Autret <autret_m@epita.fr>
20823
20824 * src/reader.c (parse_dquoted_param): New.
20825 (parse_skel_decl): Use it.
20826 * src/lex.h: Add its prototype.
20827 * src/lex.c (literalchar): Become not static.
20828
20829 2001-11-28 Marc Autret <autret_m@epita.fr>
20830
20831 * src/output.h: And put its extern declaration here.
20832 * src/output.c (error_verbose): Define here.
20833 (prepare): Echo name modification.
20834 * src/getargs.h: Clean its extern declaration.
20835 * src/getargs.c (error_verbose_flag): Remove.
20836 (getargs): Remove case 'e'.
20837 * src/options.c (option_table): 'error-verbose' is now seen as simple
20838 percent option.
20839 Include output.h.
20840
20841 * src/reader.c (read_declarations): Remove case tok_include.
20842 (parse_include_decl): Remove.
20843 * src/lex.h (token_t): Remove tok_include.
20844 * src/options.c (option_table): 'include' is now a simple command line
20845 option.
20846
20847 2001-11-28 Marc Autret <autret_m@epita.fr>
20848
20849 * src/bison.simple: Adjust muscle names.
20850 * src/muscle_tab.c (muscle_init): Also rename the muscles.
20851 * src/output.c (prepare): s/_/-/ for the muscles names.
20852 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
20853
20854 2001-11-28 Marc Autret <autret_m@epita.fr>
20855
20856 * src/bison.simple: Fix debug.
20857 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
20858
20859 2001-11-28 Akim Demaille <akim@epita.fr>
20860
20861 * src/LR0.c (shifts_new): New.
20862 (save_shifts, insert_start_shift, augment_automaton): Use it.
20863
20864 2001-11-28 Akim Demaille <akim@epita.fr>
20865
20866 * src/closure.c (closure): `b' and `ruleno' denote the same value:
20867 keep ruleno only.
20868
20869 2001-11-28 Akim Demaille <akim@epita.fr>
20870
20871 * src/closure.c (closure): Instead of looping over word in array
20872 then bits in words, loop over bits in array.
20873
20874 2001-11-28 Akim Demaille <akim@epita.fr>
20875
20876 * src/closure.c (closure): No longer optimize the special case
20877 where all the bits of `ruleset[r]' are set to 0, to make the code
20878 clearer.
20879
20880 2001-11-28 Akim Demaille <akim@epita.fr>
20881
20882 * src/closure.c (closure): `r' and `c' are new variables, used to
20883 de-obfuscate accesses to RULESET and CORE.
20884
20885 2001-11-28 Akim Demaille <akim@epita.fr>
20886
20887 * src/reduce.c (reduce_print): Use ngettext.
20888 (dump_grammar): Improve the trace accuracy.
20889
20890 2001-11-28 Akim Demaille <akim@epita.fr>
20891
20892 * src/reduce.c (dump_grammar): Don't translate trace messages.
20893
20894 2001-11-28 Akim Demaille <akim@epita.fr>
20895
20896 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
20897 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
20898 as all tags are free'ed afterwards.
20899 From Enrico Scholz.
20900
20901 2001-11-27 Paul Eggert <eggert@twinsun.com>
20902
20903 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
20904 use alloca when we didn't want to, and vice versa.
20905
20906 2001-11-27 Marc Autret <autret_m@epita.fr>
20907
20908 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
20909 initialization.
20910 * src/output.c (prepare): Remove its update.
20911
20912 2001-11-27 Marc Autret <autret_m@epita.fr>
20913
20914 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
20915 Use %error-verbose.
20916
20917 2001-11-27 Marc Autret <autret_m@epita.fr>
20918
20919 * src/bison.simple: Remove YYERROR_VERBOSE using.
20920 Use %%error_verbose.
20921 (yyparse): Likewise.
20922 * src/output.c (prepare): Give its final value.
20923 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
20924 * src/getargs.h: Add its extern declaration.
20925 * src/getargs.c (error_verbose_flag): New int.
20926 (getargs): Update to catch new case.
20927 * src/options.c (option_table): 'error-verbose' is a new option.
20928 (shortopts): Update.
20929
20930 2001-11-27 Akim Demaille <akim@epita.fr>
20931
20932 * src/system.h: Use intl/libgettext.h.
20933 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
20934
20935 2001-11-27 Akim Demaille <akim@epita.fr>
20936
20937 * tests/torture.at (Exploding the Stack Size with Malloc):
20938 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
20939
20940 2001-11-27 Akim Demaille <akim@epita.fr>
20941
20942 * src/files.c: Include error.h.
20943 Reported by Hans Aberg.
20944
20945 2001-11-26 Marc Autret <autret_m@epita.fr>
20946
20947 * src/reader.c (parse_include_decl): New, not yet implemented.
20948 (read_declarations): Add case tok_include.
20949 * src/getargs.h (include): Add its extern definition.
20950 * src/getargs.c (include): New const char *.
20951 (getargs): Add case '-I'.
20952 * src/options.c (option_table): Add include as command line and
20953 percent option.
20954 * src/lex.h (token_t): Add tok_include.
20955
20956 2001-11-26 Akim Demaille <akim@epita.fr>
20957
20958 * src/reader.c (readgram): Make sure rules for mid-rule actions
20959 have a lineno equal to that of their host rule.
20960 Reported by Hans Aberg.
20961 * tests/regression.at (Rule Line Numbers): New.
20962
20963 2001-11-26 Akim Demaille <akim@epita.fr>
20964
20965 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
20966 size_ts.
20967
20968 2001-11-26 Akim Demaille <akim@epita.fr>
20969
20970 * src/complain.c, src/complain.h (error): Remove, provided by
20971 lib/error.[ch].
20972
20973 2001-11-26 Akim Demaille <akim@epita.fr>
20974
20975 * src/reader.c (read_declarations): Don't abort on tok_illegal,
20976 issue an error message.
20977 * tests/regression.at (Invalid %directive): New.
20978 Reported by Hans Aberg.
20979
20980 2001-11-26 Akim Demaille <akim@epita.fr>
20981
20982 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
20983 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
20984
20985 2001-11-26 Akim Demaille <akim@epita.fr>
20986
20987 * src/conflicts.c (conflicts_print): Don't complain at all when
20988 there are no reduce/reduce conflicts, and as many shift/reduce
20989 conflicts as expected.
20990 * tests/regression.at (%expect right): Adjust.
20991
20992 2001-11-23 Akim Demaille <akim@epita.fr>
20993
20994 * lib/alloca.c: Update, from fileutils.
20995
20996 2001-11-23 Akim Demaille <akim@epita.fr>
20997
20998 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
20999
21000 2001-11-23 Akim Demaille <akim@epita.fr>
21001
21002 * src/system.h: Include alloca.h.
21003 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
21004
21005 2001-11-23 Akim Demaille <akim@epita.fr>
21006
21007 * src/print_graph.c (print_actions): Remove `rule', unused.
21008 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
21009 pacify GCC's signed < unsigned warnings.
21010 * src/closure.c (itemsetsize): Likewise.
21011 * src/reader.c (symbol_list_new): Static.
21012
21013 2001-11-23 Akim Demaille <akim@epita.fr>
21014
21015 Attaching lineno to buckets is stupid, since only one copy of each
21016 symbol is kept, only the line of the first occurrence is kept too.
21017
21018 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
21019 * src/reader.c (rline_allocated): Remove, unused.
21020 (symbol_list): Have a `line' member.
21021 (symbol_list_new): New.
21022 (readgram): Use it.
21023 * src/print.c (print_grammar): Output the rule line numbers.
21024 * tests/regression.at (Solved SR Conflicts)
21025 (Unresolved SR Conflicts): Adjust.
21026 Reported by Hans Aberg.
21027
21028 2001-11-22 Marc Autret <autret_m@epita.fr>
21029
21030 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
21031
21032 2001-11-22 Marc Autret <autret_m@epita.fr>
21033
21034 * src/muscle_tab.c (muscle_init): Remove initialization of
21035 skeleton muscle.
21036 * src/output.c (output_master_parser): Do it here.
21037
21038 2001-11-20 Akim Demaille <akim@epita.fr>
21039
21040 * po/sv.po: New.
21041 * configure.in (ALL_LINGUAS): Adjust.
21042 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
21043 longer contains strings to translate.
21044
21045 2001-11-19 Akim Demaille <akim@epita.fr>
21046
21047 * src/conflicts.c (conflicts_print): Add a missing \n.
21048
21049 2001-11-19 Akim Demaille <akim@epita.fr>
21050
21051 * src/nullable.c (nullable_print): New.
21052 (set_nullable): Call it when tracing.
21053 Better locality of variables.
21054
21055 2001-11-19 Akim Demaille <akim@epita.fr>
21056
21057 * src/print.c (print_actions): Better locality of variables.
21058
21059 2001-11-19 Akim Demaille <akim@epita.fr>
21060
21061 * src/derives.c (print_derives): Fix and enrich.
21062 * src/closure.c (print_fderives): Likewise.
21063
21064 2001-11-19 Akim Demaille <akim@epita.fr>
21065
21066 * src/closure.c (itemsetend): Remove, replaced with...
21067 (itemsetsize): new.
21068
21069 2001-11-19 Akim Demaille <akim@epita.fr>
21070
21071 * src/LR0.c (kernel_end): Remove, replaced with...
21072 (kernel_size): new.
21073
21074 2001-11-19 Akim Demaille <akim@epita.fr>
21075
21076 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
21077 to clarify.
21078
21079 2001-11-19 Akim Demaille <akim@epita.fr>
21080
21081 * src/closure.c (closure): Use arrays instead of pointers to clarify.
21082
21083 2001-11-19 Akim Demaille <akim@epita.fr>
21084
21085 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
21086 trace messages.
21087 * src/LR0.c: Likewise.
21088 (allocate_itemsets): Use arrays instead of pointers to clarify.
21089
21090 2001-11-19 Akim Demaille <akim@epita.fr>
21091
21092 * src/getargs.c (statistics_flag): Replace with...
21093 (trace_flag): New.
21094 (longopts): Accept --trace instead of --statistics.
21095 * src/getargs.h, src/options.c: Adjust.
21096 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
21097 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
21098
21099 2001-11-19 Akim Demaille <akim@epita.fr>
21100
21101 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
21102 pointers to clarify the code.
21103 (save_reductions, save_shifts): Factor common parts of alternatives.
21104
21105 2001-11-19 Akim Demaille <akim@epita.fr>
21106
21107 * src/LR0.c (new_state, get_state): Complete TRACE code.
21108 * src/closure.c: Include `reader.h' to get `tags', needed by the
21109 trace code.
21110 Rename the conditional DEBUG as TRACE.
21111 Output consistently TRACEs to stderr, not stdout.
21112 * src/derives.c: Likewise.
21113 * src/reduce.c: (inaccessable_symbols): Using if is better style
21114 than goto.
21115 Use `#if TRACE' instead of `#if 0' for tracing code.
21116
21117 2001-11-19 Akim Demaille <akim@epita.fr>
21118
21119 * src/system.h (LIST_FREE, shortcpy): New.
21120 * src/LR0.c: Use them.
21121 * src/output.c (free_itemsets, free_reductions, free_shifts):
21122 Remove, replaced by LIST_FREE.
21123
21124 2001-11-19 Akim Demaille <akim@epita.fr>
21125
21126 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
21127 (REDUCTIONS_ALLOC): New.
21128 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
21129 allocation.
21130
21131 2001-11-19 Akim Demaille <akim@epita.fr>
21132
21133 * src/LR0.c (new_state): Complete trace code.
21134 * src/nullable.c (set_nullable): Don't translate traces.
21135
21136 2001-11-19 Akim Demaille <akim@epita.fr>
21137
21138 * src/print_graph.c (print_core): Better locality of variables.
21139 * src/print.c (print_core): Likewise.
21140
21141 2001-11-19 Akim Demaille <akim@epita.fr>
21142
21143 * src/vcg.c: You do the output, so you are responsible of the
21144 handling of VCG syntax, in particular: use quotearg.
21145 * src/print_graph.c: Don't.
21146 (print_actions): Don't output the actions as part of the nodes,
21147 since that's the job of the edges.
21148 (print_state): Don't output by hand: fill the node description,
21149 and ask for its output.
21150
21151 2001-11-19 Akim Demaille <akim@epita.fr>
21152
21153 * src/bison.simple (yyparse): When verbosely reporting an error,
21154 no longer put additional quotes around token names.
21155 * tests/calc.at: Adjust.
21156
21157 2001-11-19 Akim Demaille <akim@epita.fr>
21158
21159 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
21160 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
21161 * src/output.c: Adjust.
21162
21163 2001-11-19 Akim Demaille <akim@epita.fr>
21164
21165 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
21166 (rule_t): this.
21167 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
21168
21169 2001-11-19 Akim Demaille <akim@epita.fr>
21170
21171 * src/gram.h (rule_t): New.
21172 (rule_table): New.
21173 (rrhs, rlhs): Remove, part of state_t.
21174 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
21175 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
21176 * src/reader.c, src/reduce.c: Adjust.
21177
21178 2001-11-19 Akim Demaille <akim@epita.fr>
21179
21180 * src/reader.c (symbols_output): New, extracted from...
21181 (packsymbols): Here.
21182 (reader): Call it.
21183
21184 2001-11-19 Akim Demaille <akim@epita.fr>
21185
21186 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
21187 (maxrhs): this new function.
21188
21189 2001-11-19 Akim Demaille <akim@epita.fr>
21190
21191 * src/lalr.c (F): New macro to access the variable F.
21192 Adjust.
21193
21194 2001-11-19 Akim Demaille <akim@epita.fr>
21195
21196 * src/lalr.h (LA): New macro to access the variable LA.
21197 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21198 * src/lalr.c: Adjust.
21199
21200 2001-11-19 Akim Demaille <akim@epita.fr>
21201
21202 * src/lalr.c (initialize_LA): Only initialize LA. Let...
21203 (set_state_table): handle the `lookaheads' members.
21204
21205 2001-11-19 Akim Demaille <akim@epita.fr>
21206
21207 * src/lalr.h (lookaheads): Removed array, whose contents is now
21208 a member of...
21209 (state_t): this structure.
21210 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21211 Adjust.
21212
21213 2001-11-19 Akim Demaille <akim@epita.fr>
21214
21215 * src/lalr.h (consistent): Removed array, whose contents is now
21216 a member of...
21217 (state_t): this structure.
21218 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21219 Adjust.
21220
21221 2001-11-19 Akim Demaille <akim@epita.fr>
21222
21223 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
21224 contents are now members of...
21225 (state_t): this structure.
21226 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
21227 Adjust.
21228
21229 2001-11-19 Akim Demaille <akim@epita.fr>
21230
21231 * src/lalr.h (state_t): New.
21232 (state_table): Be a state_t * instead of a core **.
21233 (accessing_symbol): Remove, part of state_t.
21234 * src/lalr.c: Adjust.
21235 (set_accessing_symbol): Merge into...
21236 (set_state_table): this.
21237 * src/print_graph.c, src/conflicts.c: Adjust.
21238
21239 2001-11-14 Akim Demaille <akim@epita.fr>
21240
21241 * tests/calc.at, tests/output.at, tests/regression.at,
21242 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
21243 now the tests are run in private dirs, therefore AC_CLEANUP and
21244 family can be simplified to 0-ary.
21245 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
21246 use abs. path to find config.h.
21247 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
21248 stderr, there can be way too much random noise.
21249 Instead pass -Werror to GCC and rely on the exit status.
21250 Reported by Wolfram Wagner.
21251
21252 2001-11-14 Akim Demaille <akim@epita.fr>
21253
21254 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
21255 defined only if yyoverflow is defined, to avoid `warning: unused
21256 variable `yyvs1''.
21257 Reported by The Test Suite.
21258
21259 2001-11-14 Akim Demaille <akim@epita.fr>
21260
21261 * src/print.c: Include reduce.h.
21262 Reported by Hans Aberg.
21263
21264 2001-11-14 Akim Demaille <akim@epita.fr>
21265
21266 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
21267 Revert a previous patch: these are really const.
21268 * src/conflicts.c (conflict_report): Additional useless pair of
21269 braces to pacify GCC's warnings for `if () if () {} else {}'.
21270 * src/lex.c (parse_percent_token): Replace equal_offset with
21271 arg_offset.
21272 arg is const.
21273 Be sure to strdup `arg' when used, since there is no reason for
21274 token_buffer not to change.
21275
21276 2001-11-14 Akim Demaille <akim@epita.fr>
21277
21278 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
21279 definition.
21280 * src/main.c (main): Use them.
21281 Suggested by Hans Aberg.
21282
21283 2001-11-12 Akim Demaille <akim@epita.fr>
21284
21285 * src/system.h (ngettext): Now that we use ngettext, be sure to
21286 provide a default definition when NLS are not used.
21287
21288 2001-11-12 Akim Demaille <akim@epita.fr>
21289
21290 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
21291 Use @kbd to denote user input.
21292 (Language and Grammar): ANSIfy the example.
21293 Adjust its layout for info/notinfo.
21294 (Location Tracking Calc): Output error messages to stderr.
21295 Output locations in a more GNUtically correct way.
21296 Fix a couple of Englishos.
21297 Adjust @group/@end group pairs.
21298
21299 2001-11-12 Akim Demaille <akim@epita.fr>
21300
21301 %expect was not functioning at all.
21302
21303 * src/conflicts.c (expected_conflicts): Set to -1.
21304 (conflict_report): Use ngettext.
21305 (conflicts_print): Check %expect and make its violation an error.
21306 * doc/bison.texinfo (Expect Decl): Adjust.
21307 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
21308 * tests/regression.at (%expect not enough, %expect right)
21309 (%expect too much): New.
21310
21311 2001-11-12 Akim Demaille <akim@epita.fr>
21312
21313 * tests/regression.at (Conflicts): Rename as...
21314 (Unresolved SR Conflicts): this.
21315 (Solved SR Conflicts): New.
21316
21317 2001-11-12 Akim Demaille <akim@epita.fr>
21318
21319 * src/reduce.c (print_results): Rename as...
21320 (reduce_output): This.
21321 Output to OUT, passed as argument, instead of output_obstack.
21322 (dump_grammar): Likewise.
21323 (reduce_free): New.
21324 Also free V1.
21325 (reduce_grammar): No longer call reduce_output, since...
21326 * src/print.c (print_results): do it.
21327 * src/main.c (main): Call reduce_free;
21328
21329 2001-11-12 Akim Demaille <akim@epita.fr>
21330
21331 * src/conflicts.c (print_reductions): Accept OUT as argument.
21332 Output to it, not to output_obstack.
21333 * src/print.c (print_actions): Adjust.
21334
21335 2001-11-12 Akim Demaille <akim@epita.fr>
21336
21337 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
21338 the result instead of using...
21339 (src_total, rrc_total, src_count, rrc_count): Remove.
21340 (any_conflicts): Remove.
21341 (print_conflicts): Split into...
21342 (conflicts_print, conflicts_output): New.
21343 * src/conflicts.h: Adjust.
21344 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
21345 * src/print.c (print_grammar): Issue `\n' between two rules.
21346 * tests/regression.at (Conflicts): New.
21347 Reported by Tom Lane.
21348
21349 2001-11-12 Akim Demaille <akim@epita.fr>
21350
21351 * tests/regression.at (Invalid input): Remove, duplicate with
21352 ``Invalid input: 1''.
21353
21354 2001-11-12 Akim Demaille <akim@epita.fr>
21355
21356 * tests/torture.at (AT_DATA_STACK_TORTURE)
21357 (Exploding the Stack Size with Alloca)
21358 (Exploding the Stack Size with Malloc): New.
21359
21360 2001-11-12 Akim Demaille <akim@epita.fr>
21361
21362 * src/bison.simple (YYSTACK_REALLOC): New.
21363 (yyparse) [!yyoverflow]: Use it and free the old stack.
21364 Reported by Per Allansson.
21365
21366 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
21367
21368 * src/bison.simple: Define type yystype instead of YYSTYPE, and
21369 define CPP macro, which substitute YYSTYPE by yystype.
21370 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
21371 with yyltype/YYLTYPE. This allows inclusion of the generated
21372 header within the parser if the compiler, such as GGC, accepts
21373 multiple equivalent #defines.
21374 From Akim.
21375
21376 2001-11-05 Akim Demaille <akim@epita.fr>
21377
21378 * src/reader.c (symbols_output): New, extracted from...
21379 (packsymbols): here.
21380 (reader): Adjust.
21381
21382 2001-11-05 Akim Demaille <akim@epita.fr>
21383
21384 * src/lex.c (parse_percent_token): s/quotearg/quote/.
21385
21386 2001-11-05 Akim Demaille <akim@epita.fr>
21387
21388 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
21389 pattern.
21390
21391 2001-11-05 Akim Demaille <akim@epita.fr>
21392
21393 * src/options.h (struct option_table_struct): set_flags is void*.
21394 * src/options.c (longopts): Support `--output' and `%output'.
21395 (usage): Adjust.
21396 * src/lex.h (tok_setopt): Remove, replaced with...
21397 (tok_intopt, tok_stropt): these new guys.
21398 * src/lex.c (getopt.h): Not needed.
21399 (token_buffer, unlexed_token_buffer): Not const.
21400 (percent_table): Promote `-' over `_' in directive names.
21401 Active `%name-prefix', `file-prefix', and `output'.
21402 (parse_percent_token): Accept possible arguments to directives.
21403 Promote `-' over `_' in directive names.
21404
21405 2001-11-04 Akim Demaille <akim@epita.fr>
21406
21407 * doc/bison.texinfo (Decl Summary): Split the list into
21408 `directives for grammars' and `directives for bison'.
21409 Sort'em.
21410 Add description of `%name-prefix', `file-prefix', and `output'.
21411 Promote `-' over `_' in directive names.
21412 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
21413 Simplify the description of `--name-prefix'.
21414 Promote `-' over `_' in directive names.
21415 Promote `--output' over `--output-file'.
21416 Fix the description of `--defines'.
21417 * tests/output.at: Exercise %file-prefix and %output.
21418
21419 2001-11-02 Akim Demaille <akim@epita.fr>
21420
21421 * doc/refcard.tex: Update.
21422
21423 2001-11-02 Akim Demaille <akim@epita.fr>
21424
21425 * src/symtab.h (SUNDEF): New.
21426 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
21427 stand for `uninitialized', instead of 0.
21428 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
21429 * src/lex.c (lex): Adjust.
21430
21431 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
21432 Number it 0.
21433 Let yylex return it instead of a plain 0.
21434 Reported by Dick Streefland.
21435
21436 2001-11-02 Akim Demaille <akim@epita.fr>
21437
21438 * tests/regression.at (Mixing %token styles): New test.
21439
21440 2001-11-02 Akim Demaille <akim@epita.fr>
21441
21442 * src/reader.c (parse_thong_decl): Formatting changes.
21443 (token_translations_init): New, extracted from...
21444 (packsymbols): Here.
21445 Adjust.
21446
21447 2001-11-01 Akim Demaille <akim@epita.fr>
21448
21449 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
21450 Check that `9foo.y' produces correct cpp guards.
21451 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
21452 guards.
21453 Reported by Wwp.
21454
21455 2001-11-01 Akim Demaille <akim@epita.fr>
21456
21457 * tests/regression.at (Invalid input: 2): New.
21458 * src/lex.c (unlexed_token_buffer): New.
21459 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
21460 too.
21461 Reported by Wwp.
21462
21463 2001-11-01 Akim Demaille <akim@epita.fr>
21464
21465 * tests/calc.at: Catch up with 1.30.
21466 * configure.in: Bump to 1.49a.
21467 Adjust to newer Autotest.
21468
21469 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
21470
21471 * src/conflicts.c: Move global variables rrc_total and src_total ...
21472 (print_conflicts): here.
21473 * src/output.c (output): Free global variable user_toknums.
21474 * src/lex.c (token_obstack): Become static.
21475
21476 2001-10-18 Akim Demaille <akim@epita.fr>
21477
21478 * tests/atlocal.in (GCC): Add.
21479 * tests/calc.at: s/m4_match/m4_bmatch/.
21480 s/m4_patsubst/m4_bpatsubst/.
21481 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
21482 * configure.in: AC_SUBST(GCC).
21483
21484 2001-10-14 Marc Autret <autret_m@epita.fr>
21485
21486 * src/options.c (create_long_option_table): Fix.
21487
21488 2001-10-10 Akim Demaille <akim@epita.fr>
21489
21490 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
21491
21492 2001-10-04 Akim Demaille <akim@epita.fr>
21493
21494 * src/reader.c (parse_union_decl): Push the caracters in
21495 union_obstack, not attrs_obstack.
21496
21497 2001-10-04 Akim Demaille <akim@epita.fr>
21498
21499 Merge in the branch 1.29.
21500
21501 * src/reader.c (packsymbols): Use a temporary obstack for
21502 `%%tokendef', since output_stack is already used elsewhere.
21503
21504 2001-10-02 Akim Demaille <akim@epita.fr>
21505
21506 Bump 1.29d.
21507
21508 2001-10-02 Akim Demaille <akim@epita.fr>
21509
21510 Version 1.29c.
21511
21512 2001-10-02 Akim Demaille <akim@epita.fr>
21513
21514 * tests/regression.at (Invalid CPP headers): New.
21515 From Alexander Belopolsky.
21516 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
21517
21518 2001-10-02 Akim Demaille <akim@epita.fr>
21519
21520 * tests/regression.at (Invalid input): New.
21521 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
21522 Reported by Shura.
21523
21524 2001-10-02 Akim Demaille <akim@epita.fr>
21525
21526 * tests/calc.at: Now that --debug works, the tests must be adjusted.
21527
21528 2001-10-02 Akim Demaille <akim@epita.fr>
21529
21530 * src/output.c (output_parser): Assert `skeleton'.
21531 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
21532 systems.
21533 From Shura.
21534
21535 2001-10-01 Marc Autret <autret_m@epita.fr>
21536
21537 * src/lex.h: Echo modifications.
21538 * src/lex.c (unlex): Parameter is now token_t.
21539 From Hans Aberg.
21540
21541 2001-10-01 Marc Autret <autret_m@epita.fr>
21542
21543 * src/main.c: Include lex.h.
21544 From Hans Aberg.
21545
21546 2001-09-29 Akim Demaille <akim@epita.fr>
21547
21548 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
21549
21550 2001-09-28 Akim Demaille <akim@epita.fr>
21551
21552 * tests/testsuite.at: Update to newer Autotest.
21553 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
21554
21555 2001-09-27 Akim Demaille <akim@epita.fr>
21556
21557 Position independent wrapper.
21558
21559 * tests/bison: Remove.
21560 * tests/bison.in: New.
21561 * configure.in: Adjust.
21562
21563 2001-09-27 Paul Eggert <eggert@twinsun.com>
21564
21565 Port quotearg fixes from tar 1.13.24.
21566
21567 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
21568 tm to be declared.
21569 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
21570 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
21571
21572 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
21573 * m4/mbrtowc.m4: New file.
21574 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
21575 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
21576
21577 2001-09-27 Akim Demaille <akim@epita.fr>
21578
21579 Bump to 1.29c.
21580
21581 2001-09-27 Akim Demaille <akim@epita.fr>
21582
21583 Version 1.29b.
21584
21585 2001-09-25 Akim Demaille <akim@epita.fr>
21586
21587 * src/system.h: Include `xalloc.h'.
21588 Remove it from the C files.
21589 * src/files.c (output_files): Free the obstacks.
21590 * src/lex.c (init_lex): Rename as...
21591 (lex_init): this.
21592 (lex_free): New.
21593 * src/main.c (main): Use it.
21594
21595 2001-09-24 Marc Autret <autret_m@epita.fr>
21596
21597 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
21598 to output informations in fout (FILE*).
21599 (open_graph, close_graph): Likewise.
21600 (output_graph, output_edge, output_node): Likewise.
21601 * src/vcg.h: Update function prototypes.
21602 * src/print_graph.c (print_graph): Open output graph file.
21603 (print_actions): Adjust.
21604 * src/files.h: Remove extern declaration.
21605 * src/files.c: Remove graph_obstack declaration.
21606 (open_files): Remove graph_obstack initialization.
21607 (output_files): Remove graph_obstack saving.
21608
21609 2001-09-24 Marc Autret <autret_m@epita.fr>
21610
21611 * src/files.c (compute_output_file_names): Fix.
21612
21613 2001-09-24 Marc Autret <autret_m@epita.fr>,
21614 Akim Demaille <akim@epita.fr>
21615
21616 * src/reader.c (reader): Remove call to free_symtab ().
21617 * src/main.c (main): Call it here.
21618 Include symtab.h.
21619 * src/conflicts.c (initialize_conflicts): Rename as...
21620 (solve_conflicts): this.
21621 * src/print.c (print_core, print_actions, print_state)
21622 (print_grammar): Dump to a file instead a `output_obstack'.
21623 (print_results): Dump `output_obstack', and then proceed with the
21624 FILE *.
21625 * src/files.c (compute_output_file_names, close_files): New.
21626 (output_files): Adjust.
21627 * src/main.c (main): Adjust.
21628
21629 2001-09-23 Marc Autret <autret_m@epita.fr>
21630
21631 * src/files.c (compute_header_macro): Computes header macro name
21632 from spec_defines_file when given.
21633
21634 2001-09-23 Marc Autret <autret_m@epita.fr>
21635
21636 * src/files.c (output_files): Add default extensions.
21637
21638 2001-09-22 Akim Demaille <akim@epita.fr>
21639
21640 * src/conflicts.c (finalize_conflicts): Rename as...
21641 (free_conflicts): this.
21642
21643 2001-09-22 Akim Demaille <akim@epita.fr>
21644
21645 * src/gram.c (gram_free): Rename back as...
21646 (dummy): this.
21647 (output_token_translations): Free `token_translations'.
21648 * src/symtab.c (free_symtab): Free the tag field.
21649
21650 2001-09-22 Akim Demaille <akim@epita.fr>
21651
21652 Remove `translations' as it is always set to true.
21653
21654 * src/gram.h: Adjust.
21655 * src/reader.c (packsymbols, parse_token_decl): Adjust
21656 * src/print.c (print_grammar): Adjust.
21657 * src/output.c (output_token_translations): Adjust.
21658 * src/lex.c (lex): Adjust.
21659 * src/gram.c: Be sure the set pointers to NULL.
21660 (dummy): Rename as...
21661 (gram_free): this.
21662
21663 2001-09-22 Akim Demaille <akim@epita.fr>
21664
21665 * configure.in: Invoke AM_LIB_DMALLOC.
21666 * src/system.h: Use dmalloc.
21667 * src/LR0.c: Be sure to have pointers initialized to NULL.
21668 (allocate_itemsets): Allocate kernel_items only if needed.
21669
21670 2001-09-22 Akim Demaille <akim@epita.fr>
21671
21672 * configure.in: Bump to 1.29b.
21673 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
21674 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
21675 need xmalloc.c in calc.y.
21676 From Pascal Bart.
21677
21678 2001-09-21 Akim Demaille <akim@epita.fr>
21679
21680 Version 1.29a.
21681 * Makefile.maint, config/config.guess, config/config.sub,
21682 * config/missing: Update from masters.
21683 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
21684 upon package.m4.
21685 * configure.in (ALL_LINGUAS): Add `tr'.
21686
21687 2001-09-21 Akim Demaille <akim@epita.fr>
21688
21689 * tests/Makefile.am (package.m4): Move to...
21690 ($(srcdir)/$(TESTSUITE)): here.
21691
21692 2001-09-20 Akim Demaille <akim@epita.fr>
21693
21694 * src/complain.c: No longer try to be standalone: use system.h.
21695 Don't assume __STDC__ is defined to 1. Just test if it is defined.
21696 * src/complain.h: Likewise.
21697 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
21698 Remove the unused variable `n'.
21699 From Albert Chin-A-Young.
21700
21701 2001-09-18 Marc Autret <autret_m@epita.fr>
21702
21703 * doc/bison.1: Update.
21704 * doc/bison.texinfo (Bison Options): Update --defines and --graph
21705 descriptions.
21706 (Option Cross Key): Update.
21707 Add --graph.
21708
21709 2001-09-18 Marc Autret <autret_m@epita.fr>
21710
21711 * tests/regression.at: New test (comment in %union).
21712
21713 2001-09-18 Marc Autret <autret_m@epita.fr>
21714
21715 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
21716 do that.
21717 Reported by Keith Browne.
21718
21719 2001-09-18 Marc Autret <autret_m@epita.fr>
21720
21721 * tests/output.at: Add tests for --defines and --graph.
21722
21723 2001-09-18 Marc Autret <autret_m@epita.fr>
21724
21725 * tests/output.at: Removes tests of %{header,src}_extension features.
21726
21727 2001-09-18 Akim Demaille <akim@epita.fr>
21728
21729 * tests/Makefile.am (package.m4): New.
21730 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
21731 (_AT_CHECK_CALC_ERROR): Likewise.
21732 Factor the `, ' part of verbose error messages.
21733
21734 2001-09-18 Marc Autret <autret_m@epita.fr>
21735
21736 * src/getargs.c (longopts): Declare --defines and --graph as options
21737 with optional arguments.
21738 * src/files.h: Add extern declarations.
21739 * src/files.c (spec_graph_file, spec_defines_file): New.
21740 (output_files): Update.
21741 Remove CPP-outed code.
21742
21743 2001-09-18 Marc Autret <autret_m@epita.fr>
21744
21745 Turn off %{source,header}_extension feature.
21746
21747 * src/files.c (compute_exts_from_gf): Update.
21748 (compute_exts_from_src): Update.
21749 (output_files): CPP-out useless code.
21750 * src/files.h: Remove {header,source}_extension extern declarations.
21751 * src/reader.c (parse_dquoted_param): CPP-out.
21752 (parse_header_extension_decl): Remove.
21753 (parse_source_extension_decl): Remove.
21754 (read_declarations): Remove cases tok_{hdrext,srcext}.
21755 * src/lex.c (percent_table): Remove {header,source}_extension entries.
21756 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
21757
21758 2001-09-10 Akim Demaille <akim@epita.fr>
21759
21760 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
21761 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
21762 (AT_CHECK_OUTPUT): this.
21763 Merely check ls' exit status, its output is useless.
21764
21765 2001-09-10 Akim Demaille <akim@epita.fr>
21766
21767 * tests/calc.at: Use m4_match.
21768 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
21769
21770 2001-09-10 Marc Autret <autret_m@epita.fr>,
21771 Akim Demaille <akim@epita.fr>
21772
21773 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
21774 enum color_e.
21775 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
21776 to `normal'.
21777 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
21778 * src/lex.h: Adjust prototype.
21779 (token_t): Add `tok_undef'.
21780 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
21781 (parse_percent_token): Now returns token_t.
21782 Add default statement in switch.
21783 (lex): Separate `c' as an input variable, from the token_t result
21784 part.
21785 (unlexed): Is a token_t.
21786
21787 2001-09-10 Akim Demaille <akim@epita.fr>
21788
21789 * configure.in: Bump to 1.29a.
21790
21791 2001-09-07 Akim Demaille <akim@epita.fr>
21792
21793 Version 1.29.
21794
21795 2001-08-30 Akim Demaille <akim@epita.fr>
21796
21797 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
21798 * m4/atconfig.m4: Remove.
21799 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
21800 * tests/bison: New.
21801 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
21802 m4_if, m4_patsubst, and m4_regexp.
21803 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
21804 `input' file instead of echo.
21805
21806 2001-08-29 Akim Demaille <akim@epita.fr>
21807
21808 Bump to 1.28e.
21809
21810 2001-08-29 Akim Demaille <akim@epita.fr>
21811
21812 Version 1.28d.
21813
21814 2001-08-29 Paul Eggert <eggert@twinsun.com>
21815
21816 * src/bison.simple (yyparse): Don't take the address of an
21817 item before the start of an array, as that doesn't conform to
21818 the C Standard.
21819
21820 2001-08-29 Robert Anisko <anisko_r@epita.fr>
21821
21822 * doc/bison.texinfo (Location Tracking Calc): New node.
21823
21824 2001-08-29 Paul Eggert <eggert@twinsun.com>
21825
21826 * src/output.c (output): Do not define const, as this now
21827 causes more problems than it cures.
21828
21829 2001-08-29 Akim Demaille <akim@epita.fr>
21830
21831 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
21832 the nodes.
21833 Be sure to tag the `detailmenu'.
21834
21835 2001-08-29 Akim Demaille <akim@epita.fr>
21836
21837 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
21838 download in a tmp dir.
21839
21840 2001-08-28 Marc Autret <autret_m@epita.fr>
21841
21842 * config/depcomp: New file.
21843
21844 2001-08-28 Marc Autret <autret_m@epita.fr>
21845
21846 * doc/bison.1 (mandoc): Adjust.
21847 From Juan Manuel Guerrero.
21848
21849 2001-08-28 Marc Autret <autret_m@epita.fr>
21850
21851 * src/print_graph.c (print_state): Fix.
21852
21853 2001-08-27 Marc Autret <autret_m@epita.fr>
21854
21855 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
21856 char * members.
21857 Echo modifications to the functions prototypes.
21858 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
21859
21860 2001-08-27 Marc Autret <autret_m@epita.fr>
21861
21862 * src/vcg.c: Include `xalloc.h'.
21863 (add_colorentry): New.
21864 (add_classname): New.
21865 (add_infoname): New.
21866 * src/vcg.h: Add new prototypes.
21867
21868 2001-08-27 Akim Demaille <akim@epita.fr>
21869
21870 * Makefile.maint: Sync. again with CVS Autoconf.
21871
21872 2001-08-27 Akim Demaille <akim@epita.fr>
21873
21874 * Makefile.maint: Formatting changes.
21875 (po-update, cvs-update, update): New targets.
21876 (AMTAR): Remove.
21877
21878 2001-08-27 Akim Demaille <akim@epita.fr>
21879
21880 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
21881 * Makefile.maint: Sync. with CVS Autoconf.
21882
21883 2001-08-27 Marc Autret <autret_m@epita.fr>
21884
21885 * src/vcg.h (struct infoname_s): New.
21886 (struct colorentry_s): New.
21887 (graph_s): New fields {vertical,horizontal}_order in structure.
21888 Add `infoname' field.
21889 Add `colorentry' field;
21890 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
21891 (G_HORIZONTAL_ORDER): New.
21892 (G_INFONAME): New.
21893 (G_COLORENTRY): New.
21894 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
21895 Add output of `infoname'.
21896 Add output of `colorentry'.
21897
21898 2001-08-27 Marc Autret <autret_m@epita.fr>
21899
21900 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
21901 This one shadowed a global parameter.
21902
21903 2001-08-24 Marc Autret <autret_m@epita.fr>
21904
21905 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
21906 instead of `unsigned'.
21907 (print_state): Do not call obstack_object_size () in obstack_grow ()
21908 to avoid macro variables shadowing.
21909
21910 2001-08-23 Marc Autret <autret_m@epita.fr>
21911
21912 * src/lex.c (percent_table): Typo: s/naem/name/.
21913 Add graph option.
21914 Normalize new options declarations.
21915
21916 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
21917
21918 * tests/suite.at: Exercise %header_extension and %source_extension.
21919
21920 2001-08-16 Marc Autret <autret_m@epita.fr>
21921
21922 * src/reader.c (parse_dquoted_param): New.
21923 (parse_header_extension_decl): Use it.
21924 (parse_source_extension_decl): Likewise.
21925
21926 2001-08-16 Marc Autret <autret_m@epita.fr>
21927
21928 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
21929 (get_xxxx_str): Use assert () instead of complain ().
21930 Remove return invokations in default cases.
21931 (get_decision_str): Modify default behaviour. Remove second argument.
21932 Echo modifications on calls.
21933 (output_graph): Fix.
21934
21935 2001-08-16 Marc Autret <autret_m@epita.fr>
21936
21937 * src/getargs.c (usage): Update with ``-g, --graph''.
21938
21939 2001-08-16 Marc Autret <autret_m@epita.fr>
21940
21941 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
21942 (Option Cross Key): Likewise.
21943 * doc/bison.1: Update.
21944
21945 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
21946
21947 * src/output.c (output_master_parser): Don't finish action_obstack.
21948 (output_parser): Don't care about the muscle action, here.
21949 (prepare): Copy the action_obstack in the action muscle.
21950 (output): Free action_obstack.
21951
21952 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
21953
21954 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
21955 will contain `%union' declaration.
21956 (parse_union_decl): Delete #line directive output.
21957 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
21958 informations about %union.
21959 (parse_union_decl): Copy the union_obstack in the muscle stype.
21960 * src/bison.simple: Add new #line directive.
21961 Add typdef %%stype YYSTYPE.
21962
21963 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
21964
21965 * src/bison.simple: Add new `#line' directive.
21966
21967 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
21968
21969 * src/bison.simple: New `#line' directive.
21970 * src/output.c (output_parser): Support new dynamic muscle input_line.
21971
21972 2001-09-22 Marc Autret <autret_m@epita.fr>
21973
21974 * src/output.c (output_master_parser): New.
21975 (output_parser): Be more re-entrant.
21976
21977 2001-09-21 Marc Autret <autret_m@epita.fr>
21978
21979 * src/reader.c (copy_definition, parse_union_decl): Update and use
21980 `linef' muscle.
21981 (copy_action): Likewise.
21982 Use obstack_1grow ().
21983 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
21984
21985 2001-09-21 Marc Autret <autret_m@epita.fr>
21986
21987 * src/options.c (option_table): Adjust.
21988 * src/lex.c (parse_percent_token): Fix.
21989
21990 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
21991
21992 * src/options.c (symtab.h): Include it, need by lex.h.
21993
21994 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
21995
21996 * src/lex.c (parse_percent_token): Change type of variable `tx', which
21997 is now an option_table_struct*.
21998 (option_strcmp): New function option_strcmp.
21999 (parse_percent_token): Call option_strcmp.
22000 * src/getargs.c (xalloc.h, options.h): Include it.
22001 (getargs): Call create_long_option_table.
22002 (getargs): Free longopts at the end of the function.
22003 (shortopts): Move in options.c.
22004 * src/options.c (create_long_option_table): New function. Convert
22005 information from option_table to option structure.
22006 * src/reader.c (options.h): Include it.
22007
22008 * src/Makefile.am: Adjust.
22009 * src/options.c (option_table): Create from longopts and percent_table.
22010 * src/getargs.c (longopts): Delete.
22011 * src/lex.c (struct percent_table_struct): Delete.
22012 (percent_table): Delete.
22013 (options.h): Include it.
22014 * src/options.c: Create.
22015 * src/options.h: Create.
22016 Declare enum opt_access_e.
22017 Define struct option_table_struct.
22018
22019 2001-09-20 Marc Autret <autret_m@epita.fr>
22020
22021 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
22022 sections of Bison.
22023
22024 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
22025
22026 * src/bison.simple: s/%%filename/%%skeleton.
22027 * src/muscle_tab.c (getargs.h): Include it.
22028 (muscle_init): Insert new muscle skeleton.
22029
22030 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
22031
22032 * src/output.c (output_parser): Delete unused variable actions_dumped.
22033
22034 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
22035
22036 * src/output.c (output): Delete call to reader_output_yylsp.
22037 * src/reader.c (reader): Likewise.
22038 * src/reader.h: Delete declaration of reader_output_yylsp.
22039
22040 2001-09-02 Marc Autret <autret_m@epita.fr>
22041
22042 * src/reader.c: Include muscle_tab.h.
22043 (parse_union_decl): Update.
22044 (parse_macro_decl): Rename parse_muscle_decl.
22045 Update to use renamed functions and variable.
22046 (read_declarations, copy_action, read_additionnal_code, : Updated
22047 with correct variables and functions names.
22048 (packsymbols, reader): Likewise.
22049
22050 * src/reader.h (muscle_obstack): Extern declaration update.
22051
22052 * src/output.c: Include muscle_tab.h
22053 In all functions using macro_insert, change by using muscle_insert ().
22054 (macro_obstack): Rename muscle_obstack.
22055 Echo modifications in the whole file.
22056 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
22057 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
22058 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
22059
22060 * src/muscle_tab.h: Update double inclusion macros.
22061 (macro_entry_s): Rename muscle_entry_s.
22062 Update prototypes.
22063
22064 * src/muscle_tab.c: Include muscle_tab.h.
22065 Rename macro_tabble to muscle_table.
22066 (mhash1, mhash2, mcmp): Use muscle_entry.
22067 (macro_init): Rename muscle_init. Update.
22068 (macro_insert): Rename muscle_insert. Update.
22069 (macro_find): Rename muscle_find. Update.
22070
22071 * src/main.c: Include muscle_tab.h.
22072 (main): Call muscle_init ().
22073 * src/Makefile.am (bison_SOURCES): Echo modifications.
22074
22075 2001-09-02 Marc Autret <autret_m@epita.fr>
22076
22077 Now the files macro_tab.[ch] are named muscle_tab.[ch].
22078
22079 * src/muscle_tab.c, src/muscle_tab.h: Add files.
22080
22081 2001-09-02 Marc Autret <autret_m@epita.fr>
22082
22083 * src/macrotab.c, src/macrotab.h: Remove.
22084
22085 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
22086
22087 * src/reader.c (copy_guard): Use muscle to specify the `#line'
22088 filename.
22089
22090 2001-09-01 Marc Autret <autret_m@epita.fr>
22091
22092 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
22093 to an explicit value to activate the feature. We do it here.
22094
22095 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22096
22097 * src/output.c (prepare): Delete the `filename' muscule insertion.
22098 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
22099 (parse_union_decl): Likewise.
22100 * src/macrotab.c (macro_init): Initialize filename by infile.
22101
22102 2001-08-31 Marc Autret <autret_m@epita.fr>
22103
22104 * src/bison.simple (YYLSP_NEEDED): New definition.
22105 * src/output.c (prepare): Add macro insertion of `locations_flag'
22106
22107 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22108
22109 * src/output.c (prepare): Delete insertion of previous muscles,
22110 and insert the `prefix' muscles.
22111 * src/macrotab.c (macro_init): Likewise.
22112 (macro_init): Initialization prefix directive by `yy'.
22113 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
22114 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
22115 yylval, yydebug, yyerror, yynerrs and yyparse.
22116 New directive `#define' to substitute yydebug, ... with option
22117 name_prefix.
22118
22119 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22120
22121 * src/main.c (main): Standardize.
22122 * src/output.c (output_table_data, output_parser): Likewise.
22123 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
22124
22125 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
22126
22127 * src/reader.c (read_additionnal_code): Rename %%user_code to
22128 %%epilogue.
22129 * src/output.c (output): Rename %%declarations to %%prologue.
22130 * src/bison.simple: Echo modifications.
22131
22132 2001-08-31 Marc Autret <autret_m@epita.fr>
22133
22134 * src/reader.c (readgram): CleanUp.
22135 (output_token_defines): Likewise.
22136 (packsymbols): Likewise.
22137 (reader): Likewise.
22138 * src/output.c (output): CPP-out useless code.
22139
22140 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
22141
22142 * src/reader.c (reader): Delete obsolete call to function
22143 output_trailers and output_headers.
22144 * src/output.h: Remove obsolete functions prototypes of output_headers
22145 and output_trailers.
22146
22147 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
22148
22149 * src/main.c: Include macrotab.h.
22150 * src/macrotab.h (macro_entry_s): Constify fields.
22151 Adjust functions prototypes.
22152 * src/macrotab.c (macro_insert): Constify key and value.
22153 (macro_find): Constify key.
22154 (macro_insert): Include 'xalloc.h'
22155 (macro_insert): Use XMALLOC.
22156 (macro_find): Constify return value.
22157 * src/output.c (output_table_data): Rename table to table_data.
22158 (output_parser): Constify macro_key, macro_value.
22159
22160 2001-08-30 Marc Autret <autret_m@epita.fr>
22161
22162 * src/reader.c (parse_skel_decl): New.
22163 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
22164 * src/lex.h (token_t): New token `tok_skel'.
22165 * src/lex.c (percent_table): Add skeleton option entry.
22166 Standardize.
22167
22168 2001-08-29 Marc Autret <autret_m@epita.fr>
22169
22170 * src/bison.simple: Add %%user_code directive at the end.
22171 * src/reader.c (read_additionnal_code): New.
22172 (reader): Use it.
22173 * src/output.c (output_program): Remove.
22174 (output): Update.
22175
22176 2001-08-28 Marc Autret <autret_m@epita.fr>
22177
22178 * src/output.c (output_actions): Clean up.
22179 (output_gram): CPP-out useless code.
22180 * src/reader.c (reader): Clean up, CPP-out useless code.
22181
22182 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
22183
22184 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
22185 directive.
22186 * src/bison.simple: Add `%%definitions'.
22187
22188 2001-08-28 Marc Autret <autret_m@epita.fr>
22189
22190 * config/depcomp: New file.
22191
22192 2001-08-27 Paul Eggert <eggert@twinsun.com>
22193
22194 * src/bison.simple (yyparse): Don't take the address of an
22195 item before the start of an array, as that doesn't conform to
22196 the C Standard.
22197
22198 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
22199
22200 * src/output.c (output): Remove the initialization of the macro
22201 obstack. It was done too late here.
22202
22203 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
22204 completely wrong.
22205 (reader): Initialize the macro obstack here, since we need it to grow
22206 '%define' directives.
22207
22208 * src/reader.h: Declare the macro obstack as extern.
22209
22210 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
22211
22212 * src/output.c (output_parser): Fix. Store single '%' characters in
22213 the output obstack instead of throwing them away.
22214
22215 2001-08-27 Akim Demaille <akim@epita.fr>
22216
22217 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
22218
22219 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22220
22221 * lib/Makefile.am: Adjust.
22222
22223 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22224
22225 * src/bison.simple: Update and add '%%' directives.
22226
22227 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22228
22229 * src/reader.c (reader): Remove calls to 'output_headers' and
22230 'output_trailers'. Remove some C output.
22231 (readgram): Disable a piece of code that was writing a default
22232 definition for 'YYSTYPE'.
22233 (reader_output_yylsp): Remove.
22234 (packsymbols): Output token defintions to a macro.
22235 (copy_definition): Disable C output.
22236
22237 * src/reader.c (parse_macro_decl): New function used to parse macro
22238 declarations.
22239 (copy_string2): Put the body of copy_string into this new function.
22240 Add a parameter to let the caller choose whether he wants to copy the
22241 string delimiters or not.
22242 (copy_string): Be a simple call to copy_string2 with the last argument
22243 bound to true.
22244 (read_declarations): Add case for macro definition.
22245 (copy_identifier): New.
22246 (parse_macro_decl): Read macro identifiers using copy_identifier
22247 rather than lex.
22248
22249 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22250
22251 * src/output.c (prepare): Add prefixed names.
22252 (output_parser): Output semantic actions.
22253 (output_parser): Fix bug on '%%line' directives.
22254
22255 * src/output.c (output_headers): Remove. The C code printed by this
22256 function should now be in the skeletons.
22257 (output_trailers): Remove.
22258 (output): Disable call to 'reader_output_yylsp'.
22259 (output_rule_data): Do not output tables to the table obstack.
22260
22261 * src/output.c: Remove some C dedicated output.
22262 Improve the use of macro and output obstacks.
22263 (output_defines): Remove.
22264
22265 * src/output.c (output_token_translations): Associate 'translate'
22266 table with a macro. No output to the table obstack.
22267 (output_gram): Same for 'rhs' and 'prhs'.
22268 (output_stos): Same for 'stos'.
22269 (output_rule_data): Same for 'r1' and 'r2'.
22270 (token_actions): Same for 'defact'.
22271 (goto_actions): Same for 'defgoto'.
22272 (output_base): Same for 'pact' and 'pgoto'.
22273 (output_table): Same for 'table'.
22274 (output_check): Same for 'check'.
22275
22276 * src/output.c (output_table_data): New function.
22277 (output_short_table): Remove.
22278 (output_short_or_char_table): Remove.
22279
22280 * src/output.c (output_parser): Replace most of the skeleton copy code
22281 with something new. Skeletons are now processed character by character
22282 rather than line by line, and Bison looks for '%%' macros. This is the
22283 first step in making Bison's output process (a lot) more flexible.
22284 (output_parser): Use the macro table.
22285
22286 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22287
22288 * src/main.c (main): Initialize the macro table.
22289
22290 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22291
22292 * src/lex.c (percent_table): Add tok_define.
22293 * src/lex.h: Add tok_define.
22294
22295 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22296
22297 * src/macrotab.c: New file.
22298 * src/macrotab.h: New file.
22299 * src/Makefile.am: Update.
22300
22301 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
22302
22303 * lib/hash.c: New file.
22304 * lib/hash.h: New file.
22305 * lib/Makefile.am: Update.
22306
22307 2001-08-15 Akim Demaille <akim@epita.fr>
22308
22309 Version 1.28c.
22310
22311 2001-08-15 Marc Autret <autret_m@epita.fr>
22312
22313 * src/reader.c (readgram): Indent output macro YYSTYPE.
22314 (packsymbols): Likewise.
22315 (output_token_defines): Likewise.
22316 * src/files.c: Standardize.
22317 (compute_header_macro): New.
22318 (defines_obstack_save): New. Use compute_header_macro.
22319 (output_files): Update. Use defines_obstack_save.
22320
22321 2001-08-15 Akim Demaille <akim@epita.fr>
22322
22323 * doc/bison.texinfo (Table of Symbols): Document
22324 YYSTACK_USE_ALLOCA.
22325
22326 2001-08-15 Akim Demaille <akim@epita.fr>
22327
22328 * missing: Update from CVS Automake.
22329 * config/config.guess, config/config.sub, config/texinfo.tex:
22330 Update from gnu.org.
22331
22332 2001-08-15 Akim Demaille <akim@epita.fr>
22333
22334 * Makefile.maint: Sync with CVS Autoconf.
22335
22336 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
22337
22338 * doc/bison.texinfo: Include GNU Free Documentation License from
22339 `fdl.texi'.
22340 * doc/fdl.texi: Add to package.
22341
22342 2001-08-14 Marc Autret <autret_m@epita.fr>
22343
22344 Turn on %{source,header}_extension features.
22345
22346 * src/lex.c (percent_table): Un-CPP out header_extension and
22347 source_extension.
22348 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
22349 (compute_exts_from_src): Remove conditions. It restores priorities
22350 between options.
22351
22352 2001-08-14 Marc Autret <autret_m@epita.fr>
22353
22354 * src/files.c (compute_base_names): Add extensions computing when
22355 `--file-prefix' used.
22356 Standardize function calls.
22357
22358 2001-08-13 Marc Autret <autret_m@epita.fr>
22359
22360 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
22361 defining it (defined but null disables alloca).
22362
22363 2001-08-13 Marc Autret <autret_m@epita.fr>
22364
22365 * src/bison.simple (_yy_memcpy): CPP reformat.
22366
22367 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
22368
22369 * tests/atconfig.in (CPPFLAGS): Fix.
22370
22371 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
22372
22373 * doc/bison.texinfo: Include GNU General Public License from
22374 `gpl.texi'.
22375 * doc/gpl.texi: Add to package.
22376
22377 2001-08-10 Marc Autret <autret_m@epita.fr>
22378
22379 * src/print_graph.h: Fix.
22380 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
22381
22382 2001-08-10 Akim Demaille <akim@epita.fr>
22383
22384 * src/system.h: Provide default declarations for stpcpy, strndup,
22385 and strnlen.
22386
22387 2001-08-10 Robert Anisko <anisko_r@epita.fr>
22388
22389 * doc/bison.texinfo (Locations): Update @$ stuff.
22390
22391 2001-08-09 Robert Anisko <anisko_r@epita.fr>
22392
22393 * src/bison.simple (YYLLOC_DEFAULT): Update.
22394 (yyparse): Adjust.
22395
22396 2001-08-08 Marc Autret <autret_m@epita.fr>
22397
22398 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
22399 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
22400 Reported by Fabrice Bauzac.
22401
22402 2001-08-08 Marc Autret <autret_m@epita.fr>
22403
22404 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
22405 * src/vcg.c (output_node): Fix.
22406 * src/vcg.h: Cleanup.
22407 * src/print_graph.c: Add comments.
22408 (node_output_size): New global variable. Simplify the formatting of
22409 the VCG graph output.
22410 (print_actions): Unused code is now used. It notifies the final state
22411 and no action states in the VCG graph. It also give the reduce actions.
22412 The `shift and goto' edges are red and the `go to state' edges are
22413 blue.
22414 Get the current node name and node_obstack by argument.
22415 (node_obstack): New variable.
22416 (print_state): Manage node_obstack.
22417 (print_core): Use node_obstack given by argument.
22418 A node is not only computed here but in print_actions also.
22419 (print_graph): CPP out useless code instead of commenting it.
22420
22421 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
22422
22423 * tests/atconfig.in (CPPFLAGS): Fix.
22424
22425 2001-08-07 Akim Demaille <akim@epita.fr>
22426
22427 * src/print_graph.c (quote): New.
22428 (print_core): Use it.
22429
22430 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
22431
22432 * src/vcg.c (complain.h): Include it.
22433 Unepitaize `return' invocations.
22434 [NDEBUG] (main): Remove.
22435 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
22436 * src/files.c (open_files): Initialize graph_obstack.
22437 * src/print_graph.c (print_actions): CPP out useless code.
22438 (print_core): Don't output the last `\n' in labels.
22439 Use `quote'.
22440 * src/files.c (output_files): Output the VCG file.
22441 * src/main.c (main): Invoke print_graph ();
22442
22443 2001-08-06 Marc Autret <autret_m@epita.fr>
22444
22445 Automaton VCG graph output.
22446 Using option ``-g'' or long option ``--graph'', you can generate
22447 a gram_filename.vcg file containing a VCG description of the LALR (1)
22448 automaton of your grammar.
22449
22450 * src/main.c: Call to print_graph() function.
22451 * src/getargs.h: Update.
22452 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
22453 (graph_flag): New flag.
22454 (longopts): Update.
22455 (getargs): Add case `g'.
22456 * src/files.c (graph_obstack): New obstack struct.
22457 (open_files): Initialize new obstack.
22458 (output_files): Saves graph_obstack if required.
22459 * src/files.h (graph_obstack): New extern declaration.
22460 * src/Makefile.am: Add new source files.
22461
22462 2001-08-06 Marc Autret <autret_m@epita.fr>
22463
22464 * src/print_graph.c, src/print_graph.h (graph): New.
22465 * src/vcg.h: New file.
22466 * src/vcg.c: New file, VCG graph handling.
22467
22468 2001-08-06 Marc Autret <autret_m@epita.fr>
22469
22470 Add of %source_extension and %header_extension which specify
22471 the source or/and the header output file extension.
22472
22473 * src/files.c (compute_base_names): Remove initialisation of
22474 src_extension and header_extension.
22475 (compute_exts_from_gf): Update.
22476 (compute_exts_from_src): Update.
22477 (output_files): Update.
22478 * src/reader.c (parse_header_extension_decl): New.
22479 (parse_source_extension_decl): New.
22480 (read_declarations): New case statements for the new tokens.
22481 * src/lex.c (percent_table): Add entries for %source_extension
22482 and %header_extension.
22483 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
22484
22485 2001-08-06 Marc Autret <autret_m@epita.fr>
22486
22487 * configure.in: Bump to 1.28c.
22488 * doc/bison.texinfo: Texinfo thingies.
22489
22490 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
22491
22492 * tests/atconfig.in (CPPFLAGS): Add.
22493 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
22494
22495 2001-08-03 Akim Demaille <akim@epita.fr>
22496
22497 Version 1.28b.
22498
22499 2001-08-03 Akim Demaille <akim@epita.fr>
22500
22501 * tests/Makefile.am (check-local): Ship testsuite.
22502 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
22503 Include `string.h'.
22504
22505 2001-08-03 Akim Demaille <akim@epita.fr>
22506
22507 * configure.in: Try using -Wformat when compiling.
22508
22509 2001-08-03 Akim Demaille <akim@epita.fr>
22510
22511 * configure.in: Bump to 1.28b.
22512
22513 2001-08-03 Akim Demaille <akim@epita.fr>
22514
22515 * src/complain.c: Adjust strerror_r portability issues.
22516
22517 2001-08-03 Akim Demaille <akim@epita.fr>
22518
22519 Version 1.28a.
22520
22521 2001-08-03 Akim Demaille <akim@epita.fr>
22522
22523 * src/getargs.c, src/getarg.h (skeleton)): Constify.
22524 * src/lex.c (literalchar): Avoid name clashes on `buf'.
22525 * src/getargs.c: Include complain.h.
22526 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
22527 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
22528
22529 2001-08-03 Akim Demaille <akim@epita.fr>
22530
22531 * src/reader.c (readgram): Display hidden chars in error messages.
22532
22533 2001-08-03 Akim Demaille <akim@epita.fr>
22534
22535 Update to gettext 0.10.39.
22536
22537 2001-08-03 Akim Demaille <akim@epita.fr>
22538
22539 * lib/strspn.c: New.
22540
22541 2001-08-01 Marc Autret <autret_m@epita.fr>
22542
22543 * doc/bison.texinfo: Update.
22544 * doc/bison.1 (mandoc): Update.
22545 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
22546 * src/files.c: Support output files extensions computing.
22547 (src_extension): New static variable.
22548 (header_extension): New static variable.
22549 (tr): New function.
22550 (get_extension_index): New function, gets the index of an extension
22551 filename in a string.
22552 (compute_exts_from_gf): New function, computes extensions from the
22553 grammar file extension.
22554 (compute_exts_from_src): New functions, computes extensions from the
22555 C source file extension, file given by ``-o'' option.
22556 (compute_base_names): Update.
22557 (output_files): Update.
22558
22559 2001-08-01 Robert Anisko <anisko_r@epita.fr>
22560
22561 * doc/bison.texi: Document @$.
22562 (Locations): New section.
22563
22564 2001-07-18 Akim Demaille <akim@epita.fr>
22565
22566 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
22567 * config/prev-version.txt, config/move-if-change: New.
22568 * Makefile.am: Adjust.
22569
22570 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
22571
22572 * src/bison.simple (yyparse): Suppress warning `comparaison
22573 between signed and unsigned'.
22574
22575 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
22576
22577 * src/getargs.h (raw_flag): Remove.
22578 * src/getargs.c: Die on `-r'/`--raw'.
22579 * src/lex.c (parse_percent_token): Die on `%raw'.
22580 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
22581 * tests/calc.at: Suppress test with option `--raw'.
22582
22583 2001-07-14 Akim Demaille <akim@epita.fr>
22584
22585 * config/: New.
22586 * configure.in: Require Autoconf 2.50.
22587 Update to gettext 0.10.38.
22588
22589 2001-03-16 Akim Demaille <akim@epita.fr>
22590
22591 * doc/bison.texinfo: ANSIfy the examples.
22592
22593 2001-03-16 Akim Demaille <akim@epita.fr>
22594
22595 * getargs.c (skeleton): New variable.
22596 (longopts): --skeleton is a new option.
22597 (shortopts, getargs): -S is a new option.
22598 * getargs.h: Declare skeleton.
22599 * output.c (output_parser): Use it.
22600
22601 2001-03-16 Akim Demaille <akim@epita.fr>
22602
22603 * m4/strerror_r.m4: New.
22604 * m4/error.m4: Run AC_FUNC_STRERROR_R.
22605 * lib/error.h, lib/error.c: Update.
22606
22607 2001-03-16 Akim Demaille <akim@epita.fr>
22608
22609 * src/getargs.c (longopts): Clean up.
22610
22611 2001-02-21 Akim Demaille <akim@epita.fr>
22612
22613 * src/reader.c (gensym): `gensym_count' is your own.
22614 Use a static buf to create the symbol name, as token_buffer is no
22615 longer a buffer.
22616
22617 2001-02-08 Akim Demaille <akim@epita.fr>
22618
22619 * src/conflicts.c (conflict_report): Be sure not to append to res
22620 between two calls, which could happen if both first sprintf were
22621 skipped, but not the first cp += strlen.
22622
22623 2001-02-08 Akim Demaille <akim@epita.fr>
22624
22625 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
22626 New, from fileutils 4.0.37.
22627 * configure.in: Require Autoconf 2.49c. I took some time before
22628 making this decision. This is the only way out for portability
22629 issues in Bison, it would mean way too much duplicate effort to
22630 import in Bison features implemented in 2.49c since 2.13.
22631 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
22632
22633 2001-02-02 Akim Demaille <akim@epita.fr>
22634
22635 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
22636 * lib/xalloc.h, lib/xmalloc.c: Update.
22637
22638 2001-01-19 Akim Demaille <akim@epita.fr>
22639
22640 Get rid of the ad hoc handling of token_buffer in the scanner: use
22641 the obstacks.
22642
22643 * src/lex.c (token_obstack): New.
22644 (init_lex): Initialize it. No longer call...
22645 (grow_token_buffer): this. Remove it.
22646 Adjust all the places which used it to use the obstack.
22647
22648 2001-01-19 Akim Demaille <akim@epita.fr>
22649
22650 * src/lex.h: Rename all the tokens:
22651 s/\bENDFILE\b/tok_eof/g;
22652 s/\bIDENTIFIER\b/tok_identifier/g;
22653 etc.
22654 Let them be enums, not #define, to ease debugging.
22655 Adjust all the code.
22656
22657 2001-01-18 Akim Demaille <akim@epita.fr>
22658
22659 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
22660 * src/lex.c (maxtoken, grow_token_buffer): Static.
22661
22662 2001-01-18 Akim Demaille <akim@epita.fr>
22663
22664 Since we now use obstacks, more % directives can be enabled.
22665
22666 * src/lex.c (percent_table): Also accept `%yacc',
22667 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
22668 `%debug'.
22669 Handle the actions for `%semantic_parser' and `%pure_parser' here,
22670 instead of returning a token.
22671 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
22672 * src/reader.c (read_declarations): Adjust.
22673 * src/files.c (open_files): Don't call `compute_base_names', don't
22674 compute `attrsfile' since they depend upon data which might be
22675 *in* the input file now.
22676 (output_files): Do it here.
22677 * src/output.c (output_headers): Document the fact that this patch
22678 introduces a guaranteed SEGV for semantic parsers.
22679 * doc/bison.texinfo: Document them.
22680 * tests/suite.at: Exercise these %options.
22681
22682 2000-12-20 Akim Demaille <akim@epita.fr>
22683
22684 Also handle the output file (--verbose) with obstacks.
22685
22686 * files.c (foutput): Remove.
22687 (output_obstack): New.
22688 Adjust all dependencies.
22689 * src/conflicts.c: Return a string.
22690 * src/system.h (obstack_grow_string): Rename as...
22691 (obstack_sgrow): this. Be ready to work with non literals.
22692 (obstack_fgrow4): New.
22693
22694 2000-12-20 Akim Demaille <akim@epita.fr>
22695
22696 * src/files.c (open_files): Fix the computation of short_base_name
22697 in the case of `-o foo.tab.c'.
22698
22699 2000-12-20 Akim Demaille <akim@epita.fr>
22700
22701 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
22702 (copy_dollar): Now that everything uses obstacks, get rid of the
22703 FILE * parameters.
22704
22705 2000-12-20 Akim Demaille <akim@epita.fr>
22706
22707 * src/files.c (open_files): Actually the `.output' file is based
22708 on the short_base_name, not base_name.
22709 * tests/suite.at (Checking output file names): Adjust.
22710
22711 2000-12-20 Akim Demaille <akim@epita.fr>
22712
22713 * src/bison.s1: Remove, we now use directly...
22714 * src/bison.simple: this.
22715 * src/Makefile.am: Use pkgdata instead of data.
22716
22717 2000-12-20 Akim Demaille <akim@epita.fr>
22718
22719 * src/files.c (guard_obstack): New.
22720 (open_files): Initialize it.
22721 (output_files): Dump it...
22722 * src/files.h: Export it.
22723 * src/reader.c (copy_guard): Use it.
22724
22725 2000-12-19 Akim Demaille <akim@epita.fr>
22726
22727 * src/files.c (outfile, defsfile, actfile): Removed as global
22728 vars.
22729 (open_files): Don't compute them.
22730 (output_files): Adjust.
22731 (base_name, short_base_name): Be global.
22732 Adjust dependencies.
22733
22734 2000-12-19 Akim Demaille <akim@epita.fr>
22735
22736 * src/files.c (strsuffix): New.
22737 (stringappend): Be just like strcat but allocate.
22738 (base_names): Eve out from open_files.
22739 Try to simplify the rather hairy computation of base_name and
22740 short_base_name.
22741 (open_files): Use it.
22742 * tests/suite.at (Checking output file names): New test.
22743
22744 2000-12-19 Akim Demaille <akim@epita.fr>
22745
22746 * src/system.h (obstack_grow_literal_string): Rename as...
22747 (obstack_grow_string): this.
22748 * src/output.c (output_parser): Recognize `%% actions' instead of
22749 `$'.
22750 * src/bison.s1: s/$/%% actions/.
22751 * src/bison.hairy: Likewise.
22752
22753 2000-12-19 Akim Demaille <akim@epita.fr>
22754
22755 * src/output.c (output_parser): Compute the `#line' lines when
22756 there are.
22757 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
22758 Suggested by Hans Aberg.
22759
22760 2000-12-19 Akim Demaille <akim@epita.fr>
22761
22762 Let the handling of the skeleton files be local to the procedures
22763 that use it.
22764
22765 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
22766 longer static.
22767 (fparser, open_extra_files): Remove.
22768 (open_files, output_files): Don't take care of fparser.
22769 * src/files.h: Adjust.
22770 * src/output.c (output_parser): Open and close the file to the
22771 skeleton.
22772 * src/reader.c (read_declarations): When %semantic_parser, open
22773 fguard.
22774
22775 2000-12-19 Akim Demaille <akim@epita.fr>
22776
22777 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
22778 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
22779
22780 2000-12-19 Akim Demaille <akim@epita.fr>
22781
22782 * src/files.c (open_files): Yipee! We no longer need all the code
22783 looking for `/tmp' since we have no tmp file.
22784
22785 2000-12-19 Akim Demaille <akim@epita.fr>
22786
22787 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
22788 New macros.
22789 * src/files.c (open_files): Less dependency on MSDOS etc.
22790
22791 2000-12-14 Akim Demaille <akim@epita.fr>
22792
22793 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
22794 Provide a default definition.
22795 Use it when executing the default @ action.
22796 * src/reader.c (reader_output_yylsp): No longer include
22797 `timestamp' and `text' in the default YYLTYPE.
22798
22799 2000-12-12 Akim Demaille <akim@epita.fr>
22800
22801 * src/reader.c (copy_definition, parse_union_decl, copy_action)
22802 (copy_guard): Quote the file names.
22803 Reported by Laurent Mascherpa.
22804
22805 2000-12-12 Akim Demaille <akim@epita.fr>
22806
22807 * src/output.c (output_headers, output_program, output): Be sure
22808 to escape special characters when outputting filenames.
22809 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
22810 (output_headers): Don't depend on them, Use ACTSTR.
22811
22812 2000-11-17 Akim Demaille <akim@epita.fr>
22813
22814 * lib/obstack.h: Formatting changes.
22815 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
22816 prevents type checking.
22817 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
22818 cast the value to (void *): assigning a `foo *' to a `void *'
22819 variable is valid.
22820 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
22821 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
22822 append characters.
22823
22824 2000-11-17 Akim Demaille <akim@epita.fr>
22825
22826 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
22827 as...
22828 (suite.m4, regression.m4, calc.m4): these.
22829 * tests/atgeneral.m4: Update from CVS Autoconf.
22830
22831 2000-11-17 Akim Demaille <akim@epita.fr>
22832
22833 * tests/regression.m4 (%union and --defines): New test,
22834 demonstrating a current bug in the obstack implementation.
22835
22836 2000-11-17 Akim Demaille <akim@epita.fr>
22837
22838 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
22839 macros.
22840 Use them to declare the variables which are global or local to
22841 `yyparse'.
22842
22843 2000-11-17 Akim Demaille <akim@epita.fr>
22844
22845 * acconfig.h: Remove, no longer used.
22846
22847 2000-11-07 Akim Demaille <akim@epita.fr>
22848
22849 * src: s/Copyright (C)/Copyright/g.
22850
22851 2000-11-07 Akim Demaille <akim@epita.fr>
22852
22853 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
22854 defining.
22855 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
22856
22857 2000-11-07 Akim Demaille <akim@epita.fr>
22858
22859 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
22860 Merge in a single CPP if/else.
22861
22862 2000-11-07 Akim Demaille <akim@epita.fr>
22863
22864 * src/output.c (output): Remove useless variables.
22865 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
22866 argument `data' for consistency with the prototypes.
22867 Qualify it `const'.
22868 (obstack_copy, obstack_copy0): Rename the second argument as
22869 `address' for consistency. Qualify it `const'.
22870 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
22871 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
22872 `const' their input argument (`data' or `address').
22873 Adjust the corresponding macros to include `const' in casts.
22874
22875 2000-11-03 Akim Demaille <akim@epita.fr>
22876
22877 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
22878 s/PFILE1/BISON_HAIRY/.
22879 Adjust dependencies.
22880
22881 2000-11-03 Akim Demaille <akim@epita.fr>
22882
22883 For some reason, this was not applied.
22884
22885 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22886 `unlink': it's no longer used.
22887
22888 2000-11-03 Akim Demaille <akim@epita.fr>
22889
22890 * src/files.c (skeleton_find): New function, eved out of...
22891 (open_files, open_extra_files): here.
22892
22893 2000-11-03 Akim Demaille <akim@epita.fr>
22894
22895 Don't use `atexit'.
22896
22897 * src/files.c (obstack_save): New function.
22898 (done): Rename as...
22899 (output_files): this.
22900 Use `obstack_save'.
22901 * src/main.c (main): Don't use `atexit' to register `done', since
22902 it no longer has to remove tmp files, just call `output_files'
22903 when there are no errors.
22904
22905 2000-11-02 Akim Demaille <akim@epita.fr>
22906
22907 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
22908 `unlink': it's no longer used.
22909 * src/files.h: Formatting changes.
22910
22911 2000-11-02 Akim Demaille <akim@epita.fr>
22912
22913 Remove the last uses of mktemp and unlink/delete.
22914
22915 * src/files.c (fdefines, ftable): Removed.
22916 (defines_ostack, table_obstack): New.
22917 Adjust dependencies of the former into uses of the latter.
22918 * src/output.c (output_short_or_char_table, output_short_table):
22919 Convert to using obstacks.
22920 * src/reader.c (copy_comment2): Accept one FILE * and two
22921 obstacks.
22922 (output_token_defines, reader_output_yylsp): Use obstacks.
22923 * src/system.h (obstack_fgrow3): New.
22924 * po/POTFILES.in: Adjust.
22925
22926 2000-11-01 Akim Demaille <akim@epita.fr>
22927
22928 Change each use of `fattrs' into a use of `attrs_obstack'.
22929
22930 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
22931 * src/files.c (fattrs): Remove.
22932 (attrs_obstack): New.
22933 Adjust all dependencies.
22934 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
22935
22936 2000-11-01 Akim Demaille <akim@epita.fr>
22937
22938 Introduce obstacks.
22939 Change each use of `faction' into a use of `action_obstack'.
22940
22941 * lib/obstack.h, lib/obstack.c: New files.
22942 * src/files.c (faction): Remove.
22943 (action_obstack): New.
22944 Adjust all dependencies.
22945
22946 2000-10-20 Akim Demaille <akim@epita.fr>
22947
22948 * lib/quote.h (PARAMS): New macro. Use it.
22949
22950 2000-10-16 Akim Demaille <akim@epita.fr>
22951
22952 * src/output.c (output_short_or_char_table): New function.
22953 (output_short_table, output_token_translations): Use it.
22954 (goto_actions): Use output_short_table.
22955
22956 2000-10-16 Akim Demaille <akim@epita.fr>
22957
22958 * src/symtab.c (bucket_new): New function.
22959 (getsym): Use it.
22960
22961 * src/output.c (output_short_table): New argument to display the
22962 comment associated with the table.
22963 Adjust dependencies.
22964 (output_gram): Use it.
22965 (output_rule_data): Nicer output layout for YYTNAME.
22966
22967 2000-10-16 Akim Demaille <akim@epita.fr>
22968
22969 * src/lex.c (read_typename): New function.
22970 (lex): Use it.
22971 * src/reader.c (copy_dollar): Likewise.
22972
22973 2000-10-16 Akim Demaille <akim@epita.fr>
22974
22975 * src/reader.c (copy_comment2): Expect the input stream to be on
22976 the `/' which is suspected to open a comment, instead of being
22977 called after `//' or `/*' was read.
22978 (copy_comment, copy_definition, parse_union_decl, copy_action)
22979 (copy_guard): Adjust.
22980
22981 2000-10-16 Akim Demaille <akim@epita.fr>
22982
22983 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
22984 `read_signed_integer'.
22985
22986 2000-10-16 Akim Demaille <akim@epita.fr>
22987
22988 * src/reader.c (copy_dollar): New function.
22989 (copy_guard, copy_action): Use it.
22990
22991 2000-10-16 Akim Demaille <akim@epita.fr>
22992
22993 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
22994 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
22995 New files, from Fileutils 4.0.27.
22996 * src/main.c (printable_version): Remove.
22997 * src/lex.c, src/reader.c: Use `quote'.
22998
22999 2000-10-04 Akim Demaille <akim@epita.fr>
23000
23001 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
23002
23003 2000-10-04 Akim Demaille <akim@epita.fr>
23004
23005 * doc/bison.texinfo: Various typos spotted by Neil Booth.
23006
23007 2000-10-04 Akim Demaille <akim@epita.fr>
23008
23009 When a literal string is used to define two different tokens,
23010 `bison -v' segfaults.
23011 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
23012
23013 * tests/regression.m4: New file.
23014 Include the core of the sample provided by Piotr Gackiewicz.
23015 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
23016 properly.
23017
23018 2000-10-04 Akim Demaille <akim@epita.fr>
23019
23020 * src/reader.c (parse_expect_decl): Keep `count' within the size
23021 of `buffer'.
23022 From Neil Booth.
23023
23024 2000-10-02 Paul Eggert <eggert@twinsun.com>
23025
23026 * bison.s1 (yyparse): Assign the default value
23027 unconditionally, to avoid a GCC warning and make the parser a
23028 tad smaller.
23029
23030 2000-10-02 Akim Demaille <akim@epita.fr>
23031
23032 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
23033 options.
23034
23035 2000-10-02 Akim Demaille <akim@epita.fr>
23036
23037 * src/derives.c, src/print.c, src/reduce.c: To ease the
23038 translation, move some `\n' out of the translated strings.
23039
23040 2000-10-02 Akim Demaille <akim@epita.fr>
23041
23042 The location tracking mechanism is precious for parse error
23043 messages. Nevertheless, it is enabled only when `@n' is used in
23044 the grammar, which is a different issue (you can use it in error
23045 message, but not in the grammar per se). Therefore, there should
23046 be another means to enable it.
23047
23048 * src/getargs.c (getargs): Support `--locations'.
23049 (usage): Report it.
23050 * src/getargs.h (locationsflag): Export it.
23051 * src/lex.c (percent_table): Support `%locations'.
23052 * src/reader.c (yylsp_needed): Remove this variable, now replaced
23053 with `locationsflag'.
23054 * doc/bison.texinfo: Document `--locations' and `%locations'.
23055 Sort the options.
23056 * tests/calc.m4: Test it.
23057
23058 For regularity of the names, replace each
23059 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
23060 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
23061 In addition replace each `flag' with `_flag'.
23062
23063 2000-10-02 Akim Demaille <akim@epita.fr>
23064
23065 Also test parse error messages, including with YYERROR_VERBOSE.
23066
23067 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
23068 associative).
23069 Use it to check the computations.
23070 Use it to check `nonassoc' is honored.
23071 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
23072 `--yyerror-verbose'.
23073 (_AT_CHECK_CALC): Adjust to this option.
23074 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
23075
23076 2000-10-02 Akim Demaille <akim@epita.fr>
23077
23078 Test also `--verbose', `--defines' and `--name-prefix'. Testing
23079 the latter demonstrates a flaw in the handling of non debugging
23080 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
23081 was used in order to simplify:
23082
23083 #if YYDEBUG
23084 if (yydebug)
23085 {
23086 ...
23087 }
23088 #endif
23089
23090 into
23091
23092 if (yydebug)
23093 {
23094 ...
23095 }
23096
23097 unfortunately this leads to a CPP conflict when
23098 `--name-prefix=foo' is used since it produces `#define yydebug
23099 foodebug'.
23100
23101 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
23102 (YYDPRINTF): New macro.
23103 Spread its use.
23104 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
23105 the bison options.
23106 Also test `--verbose', `--defines' and `--name-prefix'.
23107
23108 2000-10-02 Akim Demaille <akim@epita.fr>
23109
23110 Improve the readability of the produced parsers.
23111
23112 * src/bison.s1: Formatting changes.
23113 Improve the comment related to the `$' mark.
23114 (yydefault): Don't fall through to `yyresume': `goto' there.
23115 * src/output.c (output_parser): When the `$' is met, skip the end
23116 of its line.
23117 New variable, `number_of_dollar_signs', to check there's exactly
23118 one `$' in the parser skeleton.
23119
23120 2000-10-02 Akim Demaille <akim@epita.fr>
23121
23122 * lib/xstrdup.c: New file, from the fileutils.
23123 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
23124 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
23125 instead of strlen + xmalloc + strcpy.
23126 * src/symtab.c (copys): Remove, use xstrdup instead.
23127
23128 2000-10-02 Akim Demaille <akim@epita.fr>
23129
23130 * src/gram.h (associativity): New enum type which replaces the
23131 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
23132 `right_assoc', `left_assoc' and `non_assoc'.
23133 Adjust all dependencies.
23134 * src/reader.c: Formatting changes.
23135 (LTYPESTR): Don't define it, use it as a literal in
23136 `reader_output_yylsp'.
23137 * src/symtab.h (symbol_class): New enum type which replaces the
23138 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
23139 `sunknown', `stoken and `snterm'.
23140
23141 2000-10-02 Akim Demaille <akim@epita.fr>
23142
23143 * src/getargs.c (fixed_outfiles): Rename as...
23144 (yaccflag): for consistency and accuracy.
23145 Adjust dependencies.
23146
23147 2000-10-02 Akim Demaille <akim@epita.fr>
23148
23149 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
23150 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
23151 difficult and introduced a lot of core dump. It turns out that
23152 Bison used an implementation of `xmalloc' based on `calloc', and
23153 at various places it does depend upon the initialization to 0. I
23154 have not tried to isolate the pertinent places, and all the former
23155 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
23156 someone should address this issue.
23157
23158 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
23159 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
23160 files.
23161 Adjust dependencies.
23162 * src/warshall.h: New file.
23163 Propagate.
23164
23165 2000-10-02 Akim Demaille <akim@epita.fr>
23166
23167 Various anti-`extern in *.c' changes.
23168
23169 * src/system.h: Include `assert.h'.
23170
23171 2000-10-02 Akim Demaille <akim@epita.fr>
23172
23173 * src/state.h (nstates, final_state, first_state, first_shift)
23174 (first_reduction): Move their exportation from here...
23175 * src/LR0.h: to here.
23176 Adjust dependencies.
23177 * src/getargs.c (statisticsflag): New variable.
23178 Add support for `--statistics'.
23179 Adjust dependencies.
23180
23181 Remove a lot of now useless `extern' statements in most files.
23182
23183 2000-10-02 Akim Demaille <akim@epita.fr>
23184
23185 * src/LR0.h: New file.
23186 Propagate its use.
23187
23188 2000-10-02 Akim Demaille <akim@epita.fr>
23189
23190 * src/print.h: New file.
23191 Propagate its use.
23192 * src/print.c: Formatting and ordering changes.
23193 (verbose, terse): Replace with...
23194 (print_results): this new function.
23195 Adjust dependencies.
23196
23197 2000-10-02 Akim Demaille <akim@epita.fr>
23198
23199 * src/conflicts.c (conflict_report): New function.
23200 (conflict_log, verbose_conflict_log): Replace with...
23201 (print_conflicts): this function.
23202 Adjust dependencies.
23203 * src/conflicts.h: New file.
23204 Propagate its inclusion.
23205
23206 2000-10-02 Akim Demaille <akim@epita.fr>
23207
23208 * src/nullable.h: New file.
23209 Propagate its inclusion.
23210 * src/nullable.c: Formatting changes.
23211
23212 2000-10-02 Akim Demaille <akim@epita.fr>
23213
23214 * src/reduce.h: New file.
23215 Propagate its inclusion.
23216 * src/reduce.c: Topological sort and other formatting changes.
23217 (bool, TRUE, FALSE): Move their definition to...
23218 * src/system.h: here.
23219
23220 2000-10-02 Akim Demaille <akim@epita.fr>
23221
23222 * src/files.c: Formatting changes.
23223 (tryopen, tryclose, openfiles): Rename as...
23224 (xfopen, xfclose, open_files): this.
23225 (stringappend): static.
23226 * src/files.h: Complete the list of exported symbols.
23227 Propagate its use.
23228
23229 2000-10-02 Akim Demaille <akim@epita.fr>
23230
23231 * src/reader.h: New file.
23232 Propagate its use instead of tedious list of `extern' and
23233 prototypes.
23234 * src/reader.c: Formatting changes, topological sort,
23235 s/register//.
23236
23237 2000-10-02 Akim Demaille <akim@epita.fr>
23238
23239 * src/lex.h: Prototype `lex.c' exported functions.
23240 * src/reader.c: Adjust.
23241 * src/lex.c: Formatting changes.
23242 (safegetc): Rename as...
23243 (xgetc): this.
23244
23245 2000-10-02 Akim Demaille <akim@epita.fr>
23246
23247 * src/lalr.h: New file.
23248 Propagate its inclusion instead of prototypes and `extern'.
23249 * src/lalr.c: Formatting changes, topological sorting etc.
23250
23251 2000-10-02 Akim Demaille <akim@epita.fr>
23252
23253 * src/output.c (token_actions): Introduce a temporary array,
23254 YYDEFACT, that makes it possible for this function to use
23255 output_short_table.
23256
23257 2000-10-02 Akim Demaille <akim@epita.fr>
23258
23259 `user_toknums' is output as a `short[]' in `output.c', while it is
23260 defined as a `int[]' in `reader.c'. For consistency with the
23261 other output tables, `user_toknums' is now defined as a table of
23262 shorts.
23263
23264 * src/reader.c (user_toknums): Be a short table instead of an int
23265 table.
23266 Adjust dependencies.
23267
23268 Factor the short table outputs.
23269
23270 * src/output.c (output_short_table): New function.
23271 * src/output.c (output_gram, output_stos, output_rule_data)
23272 (output_base, output_table, output_check): Use it.
23273
23274 2000-10-02 Akim Demaille <akim@epita.fr>
23275
23276 * src/output.c (output): Topological sort of the functions, in
23277 order to get rid of the `static' prototypes.
23278 No longer use `register'.
23279 * src/output.h: New file.
23280 Propagate its inclusion in files explicitly prototyping functions
23281 from output.c.
23282
23283 2000-09-21 Akim Demaille <akim@epita.fr>
23284
23285 * src/atgeneral.m4: Update from Autoconf.
23286
23287 2000-09-21 Akim Demaille <akim@epita.fr>
23288
23289 * src/closure.h: New file.
23290 * src/closure.c: Formatting changes, topological sort over the
23291 functions, use of closure.h.
23292 (initialize_closure, finalize_closure): Rename as...
23293 (new_closure, free_closure): these. Adjust dependencies.
23294 * src/LR0.c: Formatting changes, topological sort, use of
23295 cloture.h.
23296 (initialize_states): Rename as...
23297 (new_states): this.
23298 * src/Makefile.am (noinst_HEADERS): Adjust.
23299
23300 2000-09-20 Akim Demaille <akim@epita.fr>
23301
23302 * src/acconfig.h: Don't protect config.h against multiple
23303 inclusion.
23304 Don't define PARAMS.
23305 * src/system.h: Define PARAMS.
23306 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
23307 purpose of config.h. system.h must not try to fix wrong
23308 definitions in config.h.
23309
23310 2000-09-20 Akim Demaille <akim@epita.fr>
23311
23312 * src/derives.h: New file.
23313 * src/main.c, src/derives.h: Use it.
23314 Formatting changes.
23315 * src/Makefile.am (noinst_HEADERS): Adjust.
23316
23317 2000-09-20 Akim Demaille <akim@epita.fr>
23318
23319 * tests/atgeneral.m4: Update from Autoconf.
23320 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
23321 (AT_CHECK_CALC): New macros.
23322 Use these macros to test bison with options `', `--raw',
23323 `--debug', `--yacc', `--yacc --debug'.
23324
23325 2000-09-19 Akim Demaille <akim@epita.fr>
23326
23327 * src/output.c: Formatting changes.
23328 * src/machine.h: Remove, leaving its contents in...
23329 * src/system.h: here.
23330 Include stdio.h.
23331 Adjust all dependencies on stdio.h and machine.h.
23332 * src/getargs.h: New file.
23333 Let all `extern' declarations about getargs.c be replaced with
23334 inclusion of `getargs.h'.
23335 * src/Makefile.am (noinst_HEADERS): Adjust.
23336
23337 * tests/calc.m4 (yyin): Be initialized in main, not on the global
23338 scope.
23339 (yyerror): Returns void, not int.
23340 * doc/bison.texinfo: Formatting changes.
23341
23342 2000-09-19 Akim Demaille <akim@epita.fr>
23343
23344 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
23345 portable.
23346
23347 2000-09-18 Akim Demaille <akim@epita.fr>
23348
23349 * configure.in: Append WARNING_CFLAGS to CFLAGS.
23350 * src/Makefile.am (INCLUDES): Don't.
23351 Be ready to fetch headers in lib/.
23352
23353 2000-09-18 Akim Demaille <akim@epita.fr>
23354
23355 * doc/bison.texinfo: Update the copyright.
23356 ANSIfy and GNUify the examples.
23357 Remove the old menu.
23358
23359 2000-09-18 Akim Demaille <akim@epita.fr>
23360
23361 First set of tests: use the `calc' example from the documentation.
23362
23363 * src/bison.s1 (yyparse): Condition the code using `yytname' which
23364 is defined only when YYDEBUG is.
23365 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
23366 * src/files.c (tryopen, tryclose): Formatting changes.
23367 Move to the top and be static.
23368 * src/reader.c (read_signed_integer): Likewise.
23369 * tests/calc.m4: New file.
23370 * Makefile.am, suite.m4: Adjust.
23371 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
23372
23373 2000-09-18 Akim Demaille <akim@epita.fr>
23374
23375 Add support for an Autotest test suite for Bison.
23376
23377 * m4/m4.m4, m4/atconfig.m4: New files.
23378 * m4/Makefile.am (EXTRA_DIST): Adjust.
23379 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
23380 files.
23381 * src/getargs.c: Display a more standard --version message.
23382 * src/reader.c (reader): Formatting changes.
23383 No longer depend upon VERSION_STRING.
23384 * configure.in: No longer use `dnl'.
23385 Set up the test suite and the new directory `tests/.
23386 (VERSION_STRING): Remove.
23387
23388 2000-04-14 Akim Demaille <akim@epita.fr>
23389
23390 * src/reader.c (copy_comment2): New function, same as former
23391 `copy_comment', but outputs into two FILE *.
23392 (copy_comment): Use it.
23393 (parse_union_decl): Use it.
23394 (get_type, parse_start_decl): Use the same `invalid' message.
23395 (parse_start_decl, parse_union_decl): Use the same `multiple'
23396 message.
23397 (parse_union_decl, copy_guard, copy_action): Use the same
23398 `unmatched' message.
23399 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
23400
23401 2000-03-31 Akim Demaille <akim@epita.fr>
23402
23403 * src/files.c (tryopen, tryclose): Move to the top.
23404 Be static.
23405
23406 2000-03-31 Akim Demaille <akim@epita.fr>
23407
23408 * src/main.c (main): Don't call `done', exit does it.
23409
23410 2000-03-31 Akim Demaille <akim@epita.fr>
23411
23412 * allocate.c: s/return (foo)/return foo/.
23413 * lalr.c: Likewise.
23414 * LR0.c: Likewise.
23415 * output.c: Likewise.
23416 * reader.c: Likewise.
23417 * symtab.c: Likewise.
23418 * vmsgetargs.c: Likewise.
23419
23420 2000-03-31 Akim Demaille <akim@epita.fr>
23421
23422 Clean up the error reporting functions.
23423
23424 * src/report.c: New file.
23425 * src/report.h: Likewise.
23426 * src/Makefile.am: Adjust.
23427 * m4/error.m4: New file.
23428 * m4/Makefile.am: Adjust.
23429 * configure.in (jm_PREREQ_ERROR): Call it.
23430 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
23431 Remove.
23432 (fatal, fatals): Remove. All callers use complain.c::fatal.
23433 (warn, warni, warns, warnss, warnss): Remove. All callers use
23434 complain.c::complain.
23435 (toomany): Remove, use fatal instead.
23436 * src/files.c (done): No argument, use complain_message_count.
23437 * src/main.c (main): Register `done' to `atexit'.
23438
23439 * src/getargs.c (usage): More `fputs', less `fprintf'.
23440
23441 2000-03-28 Akim Demaille <akim@epita.fr>
23442
23443 * lib/: New directory.
23444 * Makefile.am (SUBDIRS): Adjust.
23445 * configure.in: Adjust.
23446 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
23447 useless.
23448 * src/alloca.c: Moved to lib/.
23449 * src/getopt.c: Likewise.
23450 * src/getopt1.c: Likewise.
23451 * src/getopt.h: Likewise.
23452 * src/ansi2knr.c: Likewise.
23453 * src/ansi2knr.1: Likewise.
23454 * src/Makefile.am: Adjust.
23455 * lib/Makefile.am: New file.
23456
23457 2000-03-28 Akim Demaille <akim@epita.fr>
23458
23459 * src/getargs.c (usage): Refresh the help message.
23460
23461 2000-03-17 Akim Demaille <akim@epita.fr>
23462
23463 * src/getopt1.c: Updated from textutils 2.0e
23464 * src/getopt.c: Likewise.
23465 * src/getopt.h: Likewise.
23466
23467 2000-03-17 Akim Demaille <akim@epita.fr>
23468
23469 * src/Makefile.am (bison.simple): Fix the awk program: quote only
23470 the file name, not the whole `#line LINE FILE'.
23471
23472 2000-03-17 Akim Demaille <akim@epita.fr>
23473
23474 On syntax errors, report the token on which we choked.
23475
23476 * src/bison.s1 (yyparse): In the label yyerrlab, when
23477 YYERROR_VERBOSE, add yychar in msg.
23478
23479 2000-03-17 Akim Demaille <akim@epita.fr>
23480
23481 * src/reader.c (copy_at): New function.
23482 (copy_guard): Use it.
23483 (copy_action): Use it.
23484
23485 2000-03-17 Akim Demaille <akim@epita.fr>
23486
23487 Be kind to translators, save some useless translations.
23488
23489 * src/main.c (banner): New function.
23490 (fatal_banner): Use it.
23491 (warn_banner): Use it.
23492
23493 2000-03-17 Akim Demaille <akim@epita.fr>
23494
23495 * src/reader.c (copy_definition): Use copy_string and
23496 copy_comment. Removed now unused `match', `ended',
23497 `cplus_comment'.
23498 (copy_comment, copy_string): Moved, to be visible from
23499 copy_definition.
23500
23501 2000-03-17 Akim Demaille <akim@epita.fr>
23502
23503 * src/reader.c (copy_string): Declare `static inline'. No
23504 problems with inline, since it is checked by configure.
23505 (copy_comment): Likewise.
23506
23507 2000-03-17 Akim Demaille <akim@epita.fr>
23508
23509 * src/reader.c (packsymbols): Formatting changes.
23510
23511 2000-03-17 Akim Demaille <akim@epita.fr>
23512
23513 * src/reader.c (copy_comment): New function, factored out from:
23514 (copy_action): Use it. Removed now unused `match', `ended',
23515 `cplus_comment'.
23516 (copy_guard): Likewise.
23517
23518 2000-03-17 Akim Demaille <akim@epita.fr>
23519
23520 * src/reader.c (copy_string): New function, factored out from:
23521 (copy_action): Use it.
23522 (copy_guard): Likewise.
23523
23524 2000-03-17 Akim Demaille <akim@epita.fr>
23525
23526 Change the handling of @s so that they behave exactly like $s.
23527 There is now a pseudo variable @$ (readble and writable), location
23528 of the lhs of the rule (by default ranging from the location of
23529 the first symbol of the rhs, to the location of the last symbol,
23530 or, if the rhs is empty, YYLLOC).
23531
23532 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
23533 yyval.
23534 (yyparse): When providing a default semantic action, provide a
23535 default location action.
23536 (after the $): No longer change `*YYLSP', just stack YYLOC the
23537 same way you stack YYVAL.
23538 * src/reader.c (read_declarations): Use warns.
23539 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
23540 (copy_action, case '@'): Likewise.
23541 Use a standard error message, to save useless work from
23542 translators.
23543
23544 2000-03-17 Akim Demaille <akim@epita.fr>
23545
23546 * src/bison.s1: Formatting and cosmetics changes.
23547 * src/reader.c: Likewise.
23548 Update the Copyright notice.
23549
23550 2000-03-17 Akim Demaille <akim@epita.fr>
23551
23552 * src/bison.s1 (#line): All set to `#line' only, since the
23553 Makefile now handles them.
23554
23555 2000-03-16 Akim Demaille <akim@epita.fr>
23556
23557 * src/output.c (output_rule_data): Output the documentation of
23558 some of the tables.
23559 (Copyright notice): Update.
23560 Formatting changes.
23561
23562 2000-03-16 Akim Demaille <akim@epita.fr>
23563
23564 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
23565 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
23566 One `#if YYDEBUG' remains, since it uses variables which are
23567 defined only if `YYDEBUG != 0'.
23568
23569 2000-03-16 Akim Demaille <akim@epita.fr>
23570
23571 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
23572 and related variables so that the similarities are highlighted.
23573
23574 2000-03-16 Akim Demaille <akim@epita.fr>
23575
23576 * src/bison.s1: Properly indent CPP directives.
23577
23578 2000-03-16 Akim Demaille <akim@epita.fr>
23579
23580 * src/bison.s1: Properly indent the `alloca' CPP section.
23581
23582 2000-03-16 Akim Demaille <akim@epita.fr>
23583
23584 Do not hard code values of directories in `configure.in'.
23585 Update the `configure' tool chain.
23586
23587 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
23588 src/makefile.am.
23589 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
23590 (AC_OUTPUT): Add m4/Makefile.
23591 Bump to bison 1.28a, 1.29 has never been released.
23592 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
23593 handled via src/Makefile.am.
23594 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
23595 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
23596 autoheader.
23597 * Makefile.am (SUBDIRS): Add m4.
23598 (ACLOCAL_AM_FLAGS): New variable.
23599 (AUTOMAKE_OPTIONS): Add check-news.
23600 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
23601 the proper line number and file name.
23602 (DEFS): Propagate the location of bison library files and of the
23603 locale files.
23604 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
23605 builddir.
23606 * acinclude.m4: Remove, replaced by the directory m4.
23607 * m4/Makefile.am (EXTRA_DIST): New variable.
23608 * m4/gettext.m4: New file, from the fileutils.
23609 * m4/lcmessage.m4: Likewise
23610 * m4/progtest.m4: Likewise.
23611 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
23612
23613 2000-03-10 Akim Demaille <akim@epita.fr>
23614
23615 * src/closure.c:
23616 Formatting changes of various comments.
23617 Respect the GNU coding standards at various places.
23618 Don't use `_()' when no translation is needed.
23619
23620 1999-12-13 Jesse Thilo <jthilo@gnu.org>
23621
23622 * src/files.c:
23623 OS/2 honors TMPDIR environment variable.
23624
23625 1999-12-13 Jesse Thilo <jthilo@gnu.org>
23626
23627 * doc/bison.texinfo: Tweaked spelling and grammar.
23628 Updated ISBN.
23629 Removed reference to price of printed copy.
23630 Mention BISON_SIMPLE and BISON_HAIRY.
23631
23632 1999-12-13 Jesse Thilo <jthilo@gnu.org>
23633
23634 * configure.in, NEWS:
23635 Bison 1.29 released.
23636
23637 1999-10-27 Jesse Thilo <jthilo@gnu.org>
23638
23639 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
23640 Added reference card.
23641
23642 1999-07-26 Jesse Thilo <jthilo@gnu.org>
23643
23644 * po/ru.po: Added Russian translation.
23645
23646 1999-07-26 Jesse Thilo <jthilo@gnu.org>
23647
23648 * configure.in: Added Russian translation.
23649
23650 1999-07-06 Jesse Thilo <jthilo@gnu.org>
23651
23652 * configure.in, NEWS, README:
23653 Released version 1.28.
23654
23655 1999-06-14 Jesse Thilo <jthilo@gnu.org>
23656
23657 * src/system.h:
23658 Squashed redefinition warning on some systems.
23659
23660 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
23661 Have configure build version string instead of relying on ANSI string
23662 concatentation.
23663
23664 1999-06-14 Jesse Thilo <jthilo@gnu.org>
23665
23666 * po/POTFILES.in: Got rid of version.c.
23667
23668 1999-06-14 Jesse Thilo <jthilo@gnu.org>
23669
23670 * acconfig.h, configure.in:
23671 Have configure build version string instead of relying on ANSI string
23672 concatentation.
23673
23674 1999-06-08 Jesse Thilo <jthilo@gnu.org>
23675
23676 * doc/bison.1:
23677 Dropped mention of `+' for long-named options.
23678
23679 1999-05-30 Jesse Thilo <jthilo@gnu.org>
23680
23681 * src/files.c: Added <unistd.h> for unlink().
23682
23683 * src/Makefile.am, src/system.h:
23684 I18n fixes.
23685
23686 1999-05-30 Jesse Thilo <jthilo@gnu.org>
23687
23688 * README: Added a FAQ list.
23689
23690 * configure.in, acconfig.h:
23691 I18n fixes.
23692
23693 1999-05-30 Jesse Thilo <jthilo@gnu.org>
23694
23695 * doc/FAQ, doc/Makefile.am:
23696 Added a FAQ list.
23697
23698 1999-05-19 Jesse Thilo <jthilo@gnu.org>
23699
23700 * src/alloc.h, src/symtab.h, src/version.c:
23701 Protected inclusion of "config.h" with HAVE_CONFIG_H.
23702
23703 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23704
23705 * src/.cvsignore, src/Makefile.am:
23706 Reorganized: sources in `src', documentation in `doc'.
23707
23708 * src/lex.c (literalchar):
23709 fixed the code for escaping double quotes (thanks
23710 Jonathan Czisny.)
23711
23712 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23713
23714 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
23715 Adjusted paths to reflect directory reorganization.
23716
23717 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23718
23719 * doc/.cvsignore, doc/Makefile.am:
23720 Reorganized: sources in `src', documentation in `doc'.
23721
23722 1999-04-18 Jesse Thilo <jthilo@gnu.org>
23723
23724 * configure.in:
23725 Updated AC_INIT file to reflect directory reorganization.
23726
23727 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
23728 Reorganized: sources in `src', documentation in `doc'.
23729
23730 1999-04-13 Jesse Thilo <jthilo@gnu.org>
23731
23732 * src/allocate.c:
23733 Don't declare calloc() and realloc() if not necessary.
23734
23735 1999-04-13 Jesse Thilo <jthilo@gnu.org>
23736
23737 * configure.in, acconfig.h, acinclude.m4:
23738 Don't declare calloc() and realloc() if not necessary.
23739
23740 1999-03-23 Jesse Thilo <jthilo@gnu.org>
23741
23742 * po/.cvsignore: Added i18n support.
23743
23744 1999-03-23 Jesse Thilo <jthilo@gnu.org>
23745
23746 * acconfig.h, configure.in, Makefile.am:
23747 Added i18n support.
23748
23749 1999-03-22 Jesse Thilo <jthilo@gnu.org>
23750
23751 * src/bison.s1: Fixed #line numbers.
23752
23753 1999-03-15 Jesse Thilo <jthilo@gnu.org>
23754
23755 * po/es.po, po/fr.po, po/nl.po, po/de.po:
23756 Added PO files from Translation Project.
23757
23758 1999-03-03 Jesse Thilo <jthilo@gnu.org>
23759
23760 * Makefile.am:
23761 Added support for non-ANSI compilers (ansi2knr).
23762
23763 1999-02-16 Jesse Thilo <jthilo@gnu.org>
23764
23765 * configure.in: Bumped version number to 1.27.
23766
23767 * Makefile.am:
23768 Added `bison.simple' to list of files removed by `make distclean'.
23769
23770 1999-02-12 Jesse Thilo <jthilo@gnu.org>
23771
23772 * src/files.c, src/files.h:
23773 Defined locations of parser files in config.h instead of Makefile.
23774
23775 1999-02-12 Jesse Thilo <jthilo@gnu.org>
23776
23777 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
23778 Defined locations of parser files in config.h instead of Makefile.
23779
23780 1999-02-09 Jesse Thilo <jthilo@gnu.org>
23781
23782 * Makefile.am:
23783 Removed inappropriate use of $< macro.
23784
23785 1999-02-05 Jesse Thilo <jthilo@gnu.org>
23786
23787 * po/Makefile.in.in, po/POTFILES.in:
23788 Add `po' directory skeleton.
23789
23790 1999-01-27 Jesse Thilo <jthilo@gnu.org>
23791
23792 * README: Document help-bison list.
23793
23794 * configure.in: Add check for mkstemp().
23795
23796 1999-01-20 Jesse Thilo <jthilo@gnu.org>
23797
23798 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
23799 Hush a few compiler warnings.
23800
23801 * src/files.c:
23802 Add tryclose(), which verifies that fclose was successful.
23803 Hush a couple of compiler warnings.
23804
23805 1999-01-20 Jesse Thilo <jthilo@gnu.org>
23806
23807 * Makefile.am, OChangeLog:
23808 ChangeLog is now automatically generated. Include the old version as
23809 OChangeLog.
23810
23811 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23812
23813 * 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:
23814 Update FSF address.
23815
23816 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23817
23818 * doc/bison.texinfo: Fix formatting glitch.
23819
23820 * doc/bison.texinfo: Update FSF address.
23821
23822 1999-01-14 Jesse Thilo <jthilo@gnu.org>
23823
23824 * acconfig.h: Update FSF address.
23825
23826 1999-01-08 Jesse Thilo <jthilo@gnu.org>
23827
23828 * src/system.h:
23829 Don't define PACKAGE here, since config.h defines it.
23830
23831 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23832
23833 * src/reader.c: Update copyright date.
23834
23835 * src/main.c:
23836 Ditch sprintf to statically-sized buffers in fatal/warn functions in
23837 favor of output directly to stderr (avoids buffer overruns).
23838
23839 * src/reader.c: Some checks for premature EOF.
23840
23841 * 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:
23842 Use prototypes if the compiler understands them.
23843
23844 * src/files.c: Honor TMPDIR on Unix hosts.
23845 Use prototypes if the compiler understands them.
23846
23847 * src/reader.c:
23848 Fix a couple of buffer overrun bugs.
23849 Use prototypes if the compiler understands them.
23850
23851 * src/system.h: Include unistd.h and ctype.h.
23852 Use #ifdef instead of #if for NLS symbols.
23853
23854 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23855
23856 * doc/bison.texinfo:
23857 Delete comment "consider using @set for edition number, etc..." since
23858 we now are doing so.
23859
23860 1998-12-30 Jesse Thilo <jthilo@gnu.org>
23861
23862 * configure.in:
23863 Use prototypes if the compiler understands them.
23864
23865 * NEWS: Document 1.26 highlights.
23866
23867 * Makefile.am: Require Automake 1.3 or later.
23868
23869 * acconfig.h:
23870 Use prototypes if the compiler understands them.
23871
23872 1998-12-29 Jesse Thilo <jthilo@gnu.org>
23873
23874 * src/version.c:
23875 Use VERSION symbol from automake for version number.
23876
23877 1998-12-29 Jesse Thilo <jthilo@gnu.org>
23878
23879 * acconfig.h, configure.in, version.cin:
23880 Use VERSION symbol from automake for version number.
23881
23882 1998-11-28 Jesse Thilo <jthilo@gnu.org>
23883
23884 * Makefile.am:
23885 Distribute original version of simple parser (bison.s1), not built
23886 version (bison.simple).
23887
23888 1998-11-28 Jesse Thilo <jthilo@gnu.org>
23889
23890 * doc/bison.texinfo: Add info dir entry.
23891
23892 * doc/bison.texinfo:
23893 Let automake put version number into documentation.
23894
23895 1998-11-26 Jesse Thilo <jthilo@gnu.org>
23896
23897 * src/bison.cld, src/build.com, src/vmshlp.mar:
23898 Add non-RCS files from /gd/gnu/bison.
23899
23900 1998-11-26 Jesse Thilo <jthilo@gnu.org>
23901
23902 * doc/bison.1:
23903 Document the BISON_HAIRY and BISON_SIMPLE variables.
23904
23905 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23906
23907 * src/version.c: Build version.c automatically.
23908
23909 * src/reader.c:
23910 Fix token numbering (used to start at 258, not 257).
23911
23912 * src/system.h: Include config.h.
23913
23914 * src/getargs.c: Update bug report address.
23915
23916 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
23917 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
23918
23919 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23920
23921 * Makefile.am:
23922 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23923
23924 * configure.in, version.cin:
23925 Build version.c automatically.
23926
23927 * AUTHORS: Add AUTHORS file.
23928
23929 * README: Update bug report address.
23930
23931 * bison.simple:
23932 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
23933
23934 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
23935 Add automake stuff.
23936
23937 1998-11-25 Jesse Thilo <jthilo@gnu.org>
23938
23939 * doc/bison.texinfo: Clean up some formatting.
23940
23941 1998-05-05 Richard Stallman <rms@gnu.org>
23942
23943 * doc/bison.texinfo:
23944 Explain better why to make a pure parser.
23945
23946 1998-01-05 Richard Stallman <rms@gnu.org>
23947
23948 * src/files.c (openfiles):
23949 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
23950 find a temporary directory, if possible. Do not unlink files while
23951 they are open.
23952
23953 1997-08-25 Richard Stallman <rms@gnu.org>
23954
23955 * src/reader.c (stack_offset;):
23956 Change some warni to warns.
23957
23958 * src/lex.c (literalchar): Use warns, not warni.
23959
23960 1997-06-28 Richard Stallman <rms@gnu.org>
23961
23962 * src/bison.s1: Add a Bison version comment.
23963
23964 * src/main.c (fatal, warn, berror):
23965 Use program_name.
23966
23967 1997-06-28 Richard Stallman <rms@gnu.org>
23968
23969 * Makefile.in (bison_version): New variable.
23970 (dist): Use that variable.
23971 (bison.s1): Substitute the Bison version into bison.simple.
23972
23973 * bison.simple: Add a Bison version comment.
23974
23975 1997-06-18 Richard Stallman <rms@gnu.org>
23976
23977 * src/main.c (fatal, warn, berror):
23978 Make error messages standard.
23979 (toomany): Improve error message text.
23980
23981 * 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:
23982 new.h renamed to alloc.h.
23983
23984 1997-06-18 Richard Stallman <rms@gnu.org>
23985
23986 * Makefile.in: new.h renamed to alloc.h.
23987
23988 1997-05-24 Richard Stallman <rms@gnu.org>
23989
23990 * src/lex.c (literalchar):
23991 Fix the code for escaping \, " and '.
23992
23993 (lex): Avoid trouble when there are many chars
23994 to discard in a char literal with just several chars in it.
23995
23996 1997-05-17 Richard Stallman <rms@gnu.org>
23997
23998 * src/bison.s1:
23999 Use malloc, if using alloca is troublesome.
24000 (YYSTACK_USE_ALLOCA): New flag macro.
24001 Define it for some systems and compilers.
24002 (YYSTACK_ALLOC): New macro.
24003 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24004 If it was malloc'd, free it.
24005
24006 1997-05-17 Richard Stallman <rms@gnu.org>
24007
24008 * bison.simple:
24009 Use malloc, if using alloca is troublesome.
24010 (YYSTACK_USE_ALLOCA): New flag macro.
24011 Define it for some systems and compilers.
24012 (YYSTACK_ALLOC): New macro.
24013 (yyparse): Use YYSTACK_ALLOC to allocate stack.
24014 If it was malloc'd, free it.
24015
24016 1997-04-23 Richard Stallman <rms@gnu.org>
24017
24018 * src/bison.s1:
24019 (alloca) [__hpux]: Always define as __builtin_alloca.
24020
24021 1997-04-23 Richard Stallman <rms@gnu.org>
24022
24023 * bison.simple:
24024 (alloca) [__hpux]: Always define as __builtin_alloca.
24025
24026 1997-04-22 Richard Stallman <rms@gnu.org>
24027
24028 * src/bison.s1:
24029 [__hpux]: Include alloca.h (right for HPUX 10)
24030 instead of declaring alloca (right for HPUX 9).
24031
24032 * src/bison.s1 (__yy_memcpy):
24033 Declare arg `count' as unsigned int.
24034 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24035
24036 1997-04-22 Richard Stallman <rms@gnu.org>
24037
24038 * bison.simple:
24039 [__hpux]: Include alloca.h (right for HPUX 10)
24040 instead of declaring alloca (right for HPUX 9).
24041
24042 * bison.simple (__yy_memcpy):
24043 Declare arg `count' as unsigned int.
24044 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
24045
24046 1997-01-03 Richard Stallman <rms@gnu.org>
24047
24048 * src/allocate.c: [__STDC__ or _MSC_VER]:
24049 Declare calloc and realloc to return void *.
24050
24051 1997-01-02 Richard Stallman <rms@gnu.org>
24052
24053 * src/system.h:
24054 [_MSC_VER]: Include stdlib.h and process.h.
24055 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
24056
24057 * src/main.c (main): Return FAILURE as a value.
24058 (printable_version): Declare arg as int, not char.
24059
24060 1997-01-02 Richard Stallman <rms@gnu.org>
24061
24062 * Makefile.in (dist):
24063 Explicitly check for symlinks, and copy them.
24064
24065 1996-12-19 Richard Stallman <rms@gnu.org>
24066
24067 * src/files.c:
24068 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
24069
24070 1996-12-18 Paul Eggert <eggert@gnu.org>
24071
24072 * src/bison.s1 (yyparse):
24073 If __GNUC__ and YYPARSE_PARAM are both defined,
24074 declare yyparse to have a void * argument.
24075
24076 1996-12-18 Paul Eggert <eggert@gnu.org>
24077
24078 * bison.simple (yyparse):
24079 If __GNUC__ and YYPARSE_PARAM are both defined,
24080 declare yyparse to have a void * argument.
24081
24082 1996-12-17 Richard Stallman <rms@gnu.org>
24083
24084 * src/reduce.c (nbits): Add some casts.
24085
24086 1996-08-12 Richard Stallman <rms@gnu.org>
24087
24088 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
24089
24090 1996-08-12 Richard Stallman <rms@gnu.org>
24091
24092 * bison.simple: Test _MSDOS as well as _MSDOS_.
24093
24094 1996-07-31 Richard Stallman <rms@gnu.org>
24095
24096 * src/bison.s1:
24097 [__sun && __i386]: Include alloca.h.
24098
24099 1996-07-31 Richard Stallman <rms@gnu.org>
24100
24101 * bison.simple:
24102 [__sun && __i386]: Include alloca.h.
24103
24104 1996-07-30 Richard Stallman <rms@gnu.org>
24105
24106 * src/bison.s1: Comment change.
24107
24108 * src/bison.s1: Test _MSDOS_, not MSDOS.
24109
24110 1996-07-30 Richard Stallman <rms@gnu.org>
24111
24112 * bison.simple: Comment change.
24113
24114 * bison.simple: Test _MSDOS_, not MSDOS.
24115
24116 1996-06-01 Richard Stallman <rms@gnu.org>
24117
24118 * 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:
24119 Insert `_' macro around many string constants.
24120
24121 * src/main.c:
24122 Insert `_' macro around many string constants.
24123
24124 (main): Call setlocale, bindtextdomain and textdomain.
24125
24126 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
24127 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
24128 [ENABLE_NLS]: Include libintl.h.
24129 [ENABLE_NLS] (gettext): Define.
24130 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
24131 (N_, PACKAGE, LOCALEDIR): New macros.
24132
24133 1996-06-01 Richard Stallman <rms@gnu.org>
24134
24135 * POTFILES.in: New file.
24136
24137 * Makefile.in (allocate.o):
24138 Define target explicitly.
24139
24140 * Makefile.in (CFLAGS): Set to @CFLAGS@.
24141 (LDFLAGS): Set to @LDFLAGS@.
24142 (configure): Run autoconf only if preceding `cd' succeeds.
24143 (bison.s1): Redirect output to temporary file then move the
24144 temporary to the target, rather than redirecting directly to bison.s1.
24145 (clean): Remove config.status and config.log.
24146 (distclean): Don't remove config.status here.
24147
24148 1996-05-12 Richard Stallman <rms@gnu.org>
24149
24150 * src/bison.s1:
24151 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24152
24153 1996-05-12 Richard Stallman <rms@gnu.org>
24154
24155 * bison.simple:
24156 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
24157
24158 1996-05-11 Richard Stallman <rms@gnu.org>
24159
24160 * src/bison.s1 (__yy_memcpy):
24161 Really reorder the args, as was supposedly done on Feb 14 1995.
24162 (yyparse): Calls changed accordingly.
24163
24164 1996-05-11 Richard Stallman <rms@gnu.org>
24165
24166 * Makefile.in (dist): Don't use $(srcdir).
24167
24168 * bison.simple (__yy_memcpy):
24169 Really reorder the args, as was supposedly done on Feb 14 1995.
24170 (yyparse): Calls changed accordingly.
24171
24172 1996-01-27 Richard Stallman <rms@gnu.org>
24173
24174 * src/output.c (output_rule_data):
24175 Test YYERROR_VERBOSE in the conditional
24176 around the definition of ttyname.
24177
24178 1995-12-29 Richard Stallman <rms@gnu.org>
24179
24180 * src/bison.s1:
24181 Fix line numbers in #line commands.
24182
24183 1995-12-29 Richard Stallman <rms@gnu.org>
24184
24185 * bison.simple:
24186 Fix line numbers in #line commands.
24187
24188 1995-12-27 Richard Stallman <rms@gnu.org>
24189
24190 * src/bison.s1 (YYPARSE_PARAM_DECL):
24191 In C++, make it always null.
24192 (YYPARSE_PARAM_ARG): New macro.
24193 (yyparse): Use YYPARSE_PARAM_ARG.
24194
24195 1995-12-27 Richard Stallman <rms@gnu.org>
24196
24197 * bison.simple (YYPARSE_PARAM_DECL):
24198 In C++, make it always null.
24199 (YYPARSE_PARAM_ARG): New macro.
24200 (yyparse): Use YYPARSE_PARAM_ARG.
24201
24202 1995-11-29 Richard Stallman <rms@gnu.org>
24203
24204 * doc/bison.texinfo:
24205 Describe literal string tokens, %raw, %no_lines, %token_table.
24206
24207 1995-11-29 Daniel Hagerty <hag@gnu.org>
24208
24209 * doc/bison.texinfo: Fixed update date
24210
24211 1995-10-16 Richard Stallman <rms@gnu.org>
24212
24213 * src/version.c: Version 1.25.
24214
24215 1995-10-16 Richard Stallman <rms@gnu.org>
24216
24217 * NEWS: *** empty log message ***
24218
24219 1995-10-16 Richard Stallman <rms@gnu.org>
24220
24221 * doc/bison.1, doc/bison.rnh:
24222 Add new options.
24223
24224 1995-10-15 Richard Stallman <rms@gnu.org>
24225
24226 * src/vmsgetargs.c, src/getargs.c:
24227 Added -n, -k, and -raw switches.
24228 (noparserflag, toknumflag, rawtoknumflag): New variables.
24229
24230 * src/symtab.h (SALIAS):
24231 New #define for adding aliases to %token.
24232 (struct bucket): Added `alias' field.
24233
24234 * src/reduce.c (reduce_grammar):
24235 Revise error message.
24236 (print_notices): Remove final `.' from error message.
24237
24238 * src/reader.c (reader_output_yylsp):
24239 New function.
24240 (readgram): Use `#if 0' around code that accepted %command
24241 inside grammar rules: The documentation doesn't allow it,
24242 and it will fail since the %command processors scan for the next %.
24243 (parse_token_decl): Extended the %token
24244 declaration to allow a multi-character symbol as an alias.
24245 (parse_thong_decl): New function.
24246 (read_declarations): Added %thong declarations.
24247 (read_declarations): Handle NOOP to deal with allowing
24248 % declarations as another means to specify the flags.
24249 (readgram): Allow %prec prior to semantics embedded in a rule.
24250 (skip_to_char, read_declarations, copy_definition)
24251 (parse_token_decl, parse_start_decl, parse_type_decl)
24252 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
24253 (get_type_name, copy_guard, copy_action, readgram)
24254 (get_type, packsymbols): Revised most error messages.
24255 Changed `fatal' to `warnxxx' to avoid aborting for error.
24256 Revised and use multiple warnxxx functions to avoid using VARARGS1.
24257 (read_declarations): Improve the error message for
24258 an invalid character. Do not abort.
24259 (read_declarations, copy_guard, copy_action): Use
24260 printable_version to avoid unprintable characters in printed output.
24261 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
24262 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
24263 Allow the type of a non-terminal can be given
24264 more than once, as long as all specifications give the same type.
24265
24266 * src/output.c:
24267 (output_headers, output_trailers, output, output_gram)
24268 (output_rule_data): Implement noparserflag variable.
24269 Implement toknumflag variable.
24270 (output): Call reader_output_yylsp to output LTYPESTR.
24271
24272 * src/main.c (main):
24273 If reader sees an error, don't process the grammar.
24274 (fatals): Updated to not use VARARGS1.
24275 (printable_version, int_to_string, warn, warni, warns, warnss)
24276 (warnsss): New error reporting functions. Avoid abort for error.
24277
24278 * src/lex.h:
24279 Added THONG and NOOP for alias processing.
24280 Added SETOPT for the new code that allows setting options with %flags.
24281
24282 * src/lex.c:
24283 Include getopt.h. Add some extern decls.
24284 (safegetc): New function to deal with EOF gracefully.
24285 (literalchar); new function to deal with reading \ escapes.
24286 (lex): Use literalchar.
24287 (lex): Implemented "..." tokens.
24288 (literalchar, lex, parse_percent_token): Made tokenbuffer
24289 always contain the token. This includes growing the token
24290 buffer while reading an integer.
24291 (parse_percent_token): Replaced if-else statement with percent_table.
24292 (parse_percent_token): Added % declarations as another
24293 way to specify the flags -n, -l, and -r. Also added hooks for
24294 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
24295 major changes to files.c.
24296 (lex) Retain in the incoming stream a character following
24297 an incorrect '/'.
24298 (skip_white_space, lex): Revised most error messages
24299 and changed fatal to warn to avoid aborting.
24300 (percent_table): Added %thong declarations.
24301
24302 * src/gram.h: Comment changes.
24303
24304 * src/files.c (openfiles, open_extra_files, done):
24305 Add faction flag
24306 and actfile file. Handle noparserflag. Both for -n switch.
24307
24308 * src/conflicts.c (resolve_sr_conflict):
24309 Remove use of alloca.
24310
24311 1995-06-01 Jim Meyering <meyering@gnu.org>
24312
24313 * doc/bison.texinfo: *** empty log message ***
24314
24315 1995-05-06 Richard Stallman <rms@gnu.org>
24316
24317 * src/bison.s1: Comment change.
24318
24319 1995-05-06 Richard Stallman <rms@gnu.org>
24320
24321 * bison.simple: Comment change.
24322
24323 1995-05-03 Richard Stallman <rms@gnu.org>
24324
24325 * src/version.c: Version now 1.24.
24326
24327 * src/bison.s1: Change distribution terms.
24328
24329 * src/version.c: Version now 1.23.
24330
24331 1995-05-03 Richard Stallman <rms@gnu.org>
24332
24333 * doc/bison.texinfo:
24334 Rewrite "Conditions for Using Bison".
24335 Update version to 1.24.
24336
24337 1995-05-03 Richard Stallman <rms@gnu.org>
24338
24339 * bison.simple: Change distribution terms.
24340
24341 1995-02-23 Richard Stallman <rms@gnu.org>
24342
24343 * src/files.c: Test __VMS_POSIX as well as VMS.
24344
24345 1995-02-14 Jim Meyering <meyering@gnu.org>
24346
24347 * src/bison.s1 (__yy_memcpy):
24348 Renamed from __yy_bcopy to avoid
24349 confusion. Reverse FROM and TO arguments to be consistent with
24350 those of memcpy.
24351
24352 1995-02-14 Jim Meyering <meyering@gnu.org>
24353
24354 * bison.simple (__yy_memcpy):
24355 Renamed from __yy_bcopy to avoid
24356 confusion. Reverse FROM and TO arguments to be consistent with
24357 those of memcpy.
24358
24359 1994-11-10 David J. MacKenzie <djm@gnu.org>
24360
24361 * NEWS: reformat
24362
24363 * NEWS: New file.
24364
24365 * Makefile.in (DISTFILES): Include NEWS.
24366
24367 * Makefile.in (DISTFILES):
24368 Include install-sh, not install.sh.
24369
24370 * configure.in: Update to Autoconf v2 macro names.
24371
24372 1994-10-05 David J. MacKenzie <djm@gnu.org>
24373
24374 * Makefile.in: fix typo
24375
24376 * Makefile.in (prefix, exec_prefix):
24377 Let configure set them.
24378
24379 1994-09-28 David J. MacKenzie <djm@gnu.org>
24380
24381 * Makefile.in: Set datadir to $(prefix)/share.
24382
24383 1994-09-15 Richard Stallman <rms@gnu.org>
24384
24385 * src/bison.s1:
24386 Update copyright notice and GPL version.
24387
24388 1994-09-15 Richard Stallman <rms@gnu.org>
24389
24390 * bison.simple:
24391 Update copyright notice and GPL version.
24392
24393 1994-07-12 Richard Stallman <rms@gnu.org>
24394
24395 * src/reduce.c, src/reader.c:
24396 entered into RCS
24397
24398 1994-05-05 David J. MacKenzie <djm@gnu.org>
24399
24400 * Makefile.in: entered into RCS
24401
24402 1994-03-26 Richard Stallman <rms@gnu.org>
24403
24404 * src/bison.s1: entered into RCS
24405
24406 1994-03-26 Richard Stallman <rms@gnu.org>
24407
24408 * bison.simple: entered into RCS
24409
24410 1994-03-25 Richard Stallman <rms@gnu.org>
24411
24412 * src/main.c: entered into RCS
24413
24414 1994-03-24 Richard Stallman <rms@gnu.org>
24415
24416 * src/conflicts.c: entered into RCS
24417
24418 1994-01-02 Richard Stallman <rms@gnu.org>
24419
24420 * Makefile.in: *** empty log message ***
24421
24422 1993-11-21 Richard Stallman <rms@gnu.org>
24423
24424 * src/bison.s1: *** empty log message ***
24425
24426 1993-11-21 Richard Stallman <rms@gnu.org>
24427
24428 * doc/bison.texinfo: entered into RCS
24429
24430 * doc/bison.texinfo: *** empty log message ***
24431
24432 1993-11-21 Richard Stallman <rms@gnu.org>
24433
24434 * bison.simple: *** empty log message ***
24435
24436 1993-10-25 David J. MacKenzie <djm@gnu.org>
24437
24438 * doc/bison.texinfo: *** empty log message ***
24439
24440 1993-10-19 Richard Stallman <rms@gnu.org>
24441
24442 * src/bison.s1: *** empty log message ***
24443
24444 1993-10-19 Richard Stallman <rms@gnu.org>
24445
24446 * bison.simple: *** empty log message ***
24447
24448 1993-10-14 Richard Stallman <rms@gnu.org>
24449
24450 * src/bison.s1: *** empty log message ***
24451
24452 1993-10-14 Richard Stallman <rms@gnu.org>
24453
24454 * bison.simple: *** empty log message ***
24455
24456 1993-09-14 David J. MacKenzie <djm@gnu.org>
24457
24458 * doc/bison.texinfo: *** empty log message ***
24459
24460 1993-09-13 Noah Friedman <friedman@gnu.org>
24461
24462 * Makefile.in: *** empty log message ***
24463
24464 1993-09-10 Richard Stallman <rms@gnu.org>
24465
24466 * src/conflicts.c: *** empty log message ***
24467
24468 * src/system.h: entered into RCS
24469
24470 1993-09-10 Richard Stallman <rms@gnu.org>
24471
24472 * doc/bison.1: entered into RCS
24473
24474 1993-09-06 Noah Friedman <friedman@gnu.org>
24475
24476 * src/version.c: entered into RCS
24477
24478 1993-09-06 Noah Friedman <friedman@gnu.org>
24479
24480 * Makefile.in: *** empty log message ***
24481
24482 1993-07-30 David J. MacKenzie <djm@gnu.org>
24483
24484 * Makefile.in: *** empty log message ***
24485
24486 1993-07-24 Richard Stallman <rms@gnu.org>
24487
24488 * src/bison.s1: *** empty log message ***
24489
24490 1993-07-24 Richard Stallman <rms@gnu.org>
24491
24492 * bison.simple: *** empty log message ***
24493
24494 1993-07-08 David J. MacKenzie <djm@gnu.org>
24495
24496 * Makefile.in: *** empty log message ***
24497
24498 1993-07-04 Richard Stallman <rms@gnu.org>
24499
24500 * src/bison.s1: *** empty log message ***
24501
24502 1993-07-04 Richard Stallman <rms@gnu.org>
24503
24504 * bison.simple: *** empty log message ***
24505
24506 1993-06-26 David J. MacKenzie <djm@gnu.org>
24507
24508 * src/getargs.c: entered into RCS
24509
24510 1993-06-26 David J. MacKenzie <djm@gnu.org>
24511
24512 * doc/bison.texinfo: *** empty log message ***
24513
24514 * doc/bison.1: New file.
24515
24516 1993-06-25 Richard Stallman <rms@gnu.org>
24517
24518 * src/getargs.c: New file.
24519
24520 1993-06-16 Richard Stallman <rms@gnu.org>
24521
24522 * src/bison.s1: *** empty log message ***
24523
24524 1993-06-16 Richard Stallman <rms@gnu.org>
24525
24526 * bison.simple: *** empty log message ***
24527
24528 1993-06-03 Richard Stallman <rms@gnu.org>
24529
24530 * src/bison.s1: New file.
24531
24532 1993-06-03 Richard Stallman <rms@gnu.org>
24533
24534 * doc/bison.texinfo: *** empty log message ***
24535
24536 1993-06-03 Richard Stallman <rms@gnu.org>
24537
24538 * bison.simple: New file.
24539
24540 1993-05-19 Richard Stallman <rms@gnu.org>
24541
24542 * doc/bison.texinfo: New file.
24543
24544 1993-05-07 Noah Friedman <friedman@gnu.org>
24545
24546 * Makefile.in: *** empty log message ***
24547
24548 1993-04-28 Noah Friedman <friedman@gnu.org>
24549
24550 * src/reader.c: *** empty log message ***
24551
24552 1993-04-23 Noah Friedman <friedman@gnu.org>
24553
24554 * src/alloc.h: entered into RCS
24555
24556 1993-04-20 David J. MacKenzie <djm@gnu.org>
24557
24558 * src/version.c: *** empty log message ***
24559
24560 * src/files.c, src/allocate.c:
24561 entered into RCS
24562
24563 * src/reader.c: *** empty log message ***
24564
24565 * src/lex.c: entered into RCS
24566
24567 * src/conflicts.c: New file.
24568
24569 * src/symtab.c: entered into RCS
24570
24571 * src/alloc.h: New file.
24572
24573 * src/LR0.c: entered into RCS
24574
24575 1993-04-18 Noah Friedman <friedman@gnu.org>
24576
24577 * src/reader.c: New file.
24578
24579 * src/version.c: *** empty log message ***
24580
24581 1993-04-18 Noah Friedman <friedman@gnu.org>
24582
24583 * Makefile.in: *** empty log message ***
24584
24585 1993-04-17 Noah Friedman <friedman@gnu.org>
24586
24587 * Makefile.in: *** empty log message ***
24588
24589 1993-04-15 Richard Stallman <rms@gnu.org>
24590
24591 * src/main.c, src/files.c:
24592 New file.
24593
24594 1993-04-15 Noah Friedman <friedman@gnu.org>
24595
24596 * configure.in: entered into RCS
24597
24598 * configure.in: *** empty log message ***
24599
24600 * configure.in: New file.
24601
24602 1993-04-14 Richard Stallman <rms@gnu.org>
24603
24604 * Makefile.in: New file.
24605
24606 1993-04-13 Richard Stallman <rms@gnu.org>
24607
24608 * src/version.c: New file.
24609
24610 1993-03-25 Richard Stallman <rms@gnu.org>
24611
24612 * src/output.c: entered into RCS
24613
24614 1992-09-25 Richard Stallman <rms@gnu.org>
24615
24616 * configure.bat: entered into RCS
24617
24618 1992-06-22 Richard Stallman <rms@gnu.org>
24619
24620 * src/vmsgetargs.c: entered into RCS
24621
24622 1992-06-22 Richard Stallman <rms@gnu.org>
24623
24624 * doc/bison.rnh: entered into RCS
24625
24626 1992-04-20 David J. MacKenzie <djm@gnu.org>
24627
24628 * README: entered into RCS
24629
24630 1992-01-22 Richard Stallman <rms@gnu.org>
24631
24632 * src/machine.h: entered into RCS
24633
24634 1991-12-21 Richard Stallman <rms@gnu.org>
24635
24636 * src/lalr.c, src/closure.c:
24637 entered into RCS
24638
24639 1991-12-20 Richard Stallman <rms@gnu.org>
24640
24641 * src/state.h: entered into RCS
24642
24643 1991-12-18 Richard Stallman <rms@gnu.org>
24644
24645 * src/print.c, src/nullable.c, src/derives.c:
24646 entered into RCS
24647
24648 1991-11-03 David J. MacKenzie <djm@gnu.org>
24649
24650 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
24651 entered into RCS
24652
24653 1988-09-09 Richard Stallman <rms@gnu.org>
24654
24655 * src/bison.hairy: entered into RCS
24656
24657 1987-12-16 Richard Stallman <rms@gnu.org>
24658
24659 * REFERENCES: entered into RCS
24660
24661
24662 -----
24663
24664 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
24665 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
24666 2008, 2009 Free Software Foundation, Inc.
24667
24668 Copying and distribution of this file, with or without
24669 modification, are permitted provided the copyright notice and this
24670 notice are preserved.